Revert "fix #15836 proc arg return type auto unexpectly match proc with concr… (#21044)"
This reverts commit 0cd9bdcf9f.
This commit is contained in:
parent
da3274d1b3
commit
db56fc3bcb
9 changed files with 12 additions and 23 deletions
|
|
@ -1,11 +0,0 @@
|
|||
discard """
|
||||
errormsg: "type mismatch: got <string> but expected 'int'"
|
||||
line: 11
|
||||
"""
|
||||
|
||||
proc takesProc[T](x: T, f: proc(x: T): int) =
|
||||
echo f(x) + 2
|
||||
|
||||
takesProc(1, proc (a: int): int = 2) # ok, prints 4
|
||||
takesProc(1, proc (a: auto): auto = 2) # ok, prints 4
|
||||
takesProc(1, proc (a: auto): auto = "uh uh") # prints garbage
|
||||
Loading…
Add table
Add a link
Reference in a new issue