pass outer instance when calling base inner class constructor in inner class

This commit is contained in:
Dmitry Jemerov
2011-05-30 19:55:44 +04:00
parent 8adaf297ef
commit e616c38a9f
4 changed files with 36 additions and 9 deletions
@@ -0,0 +1,14 @@
class Outer() {
class InnerBase() {
}
class InnerDerived(): InnerBase() {
}
public val foo: InnerBase? = new InnerDerived()
}
fun box() {
val o = new Outer()
return if (o.foo === null) "fail" else "OK"
}