t18886.nim 443 B

123456789101112131415161718
  1. discard """
  2. cmd: "nim check --hints:off $file"
  3. errormsg: ""
  4. nimout: '''
  5. t18886.nim(18, 24) Error: ambiguous identifier: 'bar' -- you need a helper proc to disambiguate the following:
  6. t18886.bar: proc (i: ptr int){.noSideEffect, gcsafe.}
  7. t18886.bar: proc (i: ptr char){.noSideEffect, gcsafe.}
  8. '''
  9. """
  10. type Foo = (proc(_: pointer): void)
  11. proc bar(i: ptr[int]) = discard
  12. proc bar(i: ptr[char]) = discard
  13. let fooBar = cast[Foo](bar)