Files
kotlin-fork/compiler/testData/codegen/box/extensionFunctions/kt1290.kt
T
Alexander Udalov 41a416da60 Move blackBoxFile() testData to box/ directory
Delete all test methods (and empty test classes), since they'll be
auto-generated
2013-01-28 18:20:17 +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"
}