Created
June 16, 2018 14:58
-
-
Save captainbland/bbdca077f95fcf85c63bcb5e3bd5a561 to your computer and use it in GitHub Desktop.
when compiles
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
proc myIntProc(x: int, y: int): int = x*2 | |
proc myIntProc(x: int): string = $x | |
template typeTest(myCall:untyped): untyped = | |
let something: int = myCall | |
when(compiles(typeTest(myIntProc(5, 5)))): | |
let a = myIntProc(5, 5) | |
else: | |
let a = -1 | |
echo a | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment