Files
kotlin-fork/compiler/testData/diagnostics/tests/regressions/kt201.jet
T
2012-03-12 22:54:24 +04:00

9 lines
209 B
Plaintext

// KT-201 Allow to call extension with nullable receiver with a '.'
fun <T : Any> T?.npe() : T = if (this == null) throw NullPointerException() else this
fun foo() {
val i : Int? = 1
i.npe() // error!
}