Files
kotlin-fork/compiler/testData/codegen/box/extensionFunctions/kt1290.kt
T
2019-11-19 11:00:09 +03:00

16 lines
316 B
Kotlin
Vendored

// IGNORE_BACKEND_FIR: JVM_IR
//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"
}