Skip to content

Instantly share code, notes, and snippets.

@hisui
Created June 28, 2016 03:13
Show Gist options
  • Save hisui/1bb2dc58bd58b0a69c971ad05d2d69a7 to your computer and use it in GitHub Desktop.
Save hisui/1bb2dc58bd58b0a69c971ad05d2d69a7 to your computer and use it in GitHub Desktop.
val Int.incr: Int get() = this + 1
val Int.decr: Int get() = this - 1
fun main(b: Boolean) {
println(if (b) Int::incr else Int::decr)
}
@hisui
Copy link
Author

hisui commented Jun 28, 2016

This code snippet causes the Kotlin compiler (version 1.0.2) to crash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment