Files
kotlin-fork/compiler/testData/codegen/box/properties/kt2892.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

17 lines
326 B
Kotlin

open class A
class B : A() {
fun foo() = 1
}
class Test {
val a : A = B()
private val b : B get() = a as B //'private' is important here
fun outer() : Int {
fun inner() : Int = b.foo() //'no such field error' here
return inner()
}
}
fun box() = if (Test().outer() == 1) "OK" else "fail"