Skip to content

Instantly share code, notes, and snippets.

@ajhager
Created August 1, 2010 02:06
Show Gist options
  • Save ajhager/502854 to your computer and use it in GitHub Desktop.
Save ajhager/502854 to your computer and use it in GitHub Desktop.
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