Files
kotlin-fork/compiler/testData/codegen/regressions/kt1290.kt
T
Svetlana Isakova 22e9e7de10 more small tests
2012-05-04 20:47:26 +04:00

15 lines
288 B
Kotlin

//KT-1290 Method property in constructor causes NPE
class Foo<T>(val filter: (T) -> Boolean) {
public fun bar(tee: T) : Boolean {
return filter(tee);
}
}
fun foo() = Foo({ (i: Int) -> i < 5 }).bar(2)
fun box() : String {
if (!foo()) return "fail"
return "OK"
}