Skip to content

Instantly share code, notes, and snippets.

@niv

niv/test.nim Secret

Created April 16, 2018 12:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save niv/d6807322d4296ccc4cde3d9758771280 to your computer and use it in GitHub Desktop.
Save niv/d6807322d4296ccc4cde3d9758771280 to your computer and use it in GitHub Desktop.
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