* fix #18886 crash on ambiguous proc cast * follow suggestion
This commit is contained in:
parent
0f2775aacf
commit
db3d2971cf
3 changed files with 29 additions and 2 deletions
18
tests/errmsgs/t18886.nim
Normal file
18
tests/errmsgs/t18886.nim
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
discard """
|
||||
cmd: "nim check --hints:off $file"
|
||||
errormsg: ""
|
||||
nimout: '''
|
||||
t18886.nim(18, 24) Error: ambiguous identifier: 'bar' -- you need a helper proc to disambiguate the following:
|
||||
t18886.bar: proc (i: ptr int){.noSideEffect, gcsafe, locks: 0.}
|
||||
t18886.bar: proc (i: ptr char){.noSideEffect, gcsafe, locks: 0.}
|
||||
'''
|
||||
"""
|
||||
|
||||
type Foo = (proc(_: pointer): void)
|
||||
|
||||
|
||||
proc bar(i: ptr[int]) = discard
|
||||
proc bar(i: ptr[char]) = discard
|
||||
|
||||
|
||||
let fooBar = cast[Foo](bar)
|
||||
Loading…
Add table
Add a link
Reference in a new issue