fix KT-2892

This commit is contained in:
Peter Kofler
2012-10-29 22:10:00 +01:00
parent 81de3cd46a
commit 28160ecb11
3 changed files with 24 additions and 1 deletions
@@ -0,0 +1,16 @@
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"