forked from nim-lang/Nim
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
iterate overloads when resolving symchoice based on type
fixes nim-lang#20240
- Loading branch information
Showing
2 changed files
with
62 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
discard """ | ||
output: ''' | ||
int: 100 | ||
''' | ||
""" | ||
|
||
# issue #20240 | ||
|
||
type Action[T] = proc (x: T): void {.nimcall.} | ||
|
||
proc doThing(x : float) = echo "float: ", x | ||
|
||
proc getDoThing[T]: Action[T] = | ||
mixin doThing | ||
assert compiles(doThing(default(T))) # still works | ||
result = doThing # but this doesn't -- type mismatch: got 'None' for 'doThing' but expected 'Action[system.int]' | ||
|
||
proc doThing(x : int) = echo "int: ", x | ||
let intDoThing = getDoThing[int]() | ||
intDoThing(100) |