Created
August 1, 2010 02:06
-
-
Save ajhager/502854 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
test: func (f: Func()) { | |
f() | |
} | |
main: func { | |
i := 0 | |
test(|| | |
// Uncomment the next line and all issues disappear. | |
//i toString() println() | |
i = -1 | |
// This works but warns of comparison between pointer and int. | |
if (i == -1) { | |
printf("i == -1\n") | |
} | |
// This does not work and warns of comparison between pointer and int. | |
if (i < 0) { | |
printf("i < 0\n") | |
} | |
// This works perfectly with no warning. | |
if (i as Int < 0) { | |
printf("i as Int < 0\n") | |
} | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment