Instantly share code, notes, and snippets.

@niv /test.nim Secret
Created Apr 16, 2018

Embed
What would you like to do?
nwmaster.nim → master • cat test.nim
proc whatever[T](cb: proc(): T): T =
cb()
discard whatever() do -> int: discard
whatever() do -> void: discard
nwmaster.nim → master • nim c -r test
Hint: used config file '/Users/niv/.choosenim/toolchains/nim-0.18.0/config/nim.cfg' [Conf]
Hint: used config file '/Users/niv/code/nwmaster.nim/nim.cfg' [Conf]
Hint: system [Processing]
Hint: test [Processing]
test.nim(5, 9) Error: type mismatch: got <proc (){.noSideEffect, gcsafe, locks: 0.}>
but expected one of:
proc whatever[T](cb: proc (): T): T
expression: whatever(do -> void:
discard )
[1] 45689 exit 1 nim c -r test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment