JS backend: fix access to class object members from containing class with implicit receiver.

#KT-4130 Fixed
This commit is contained in:
Zalim Bashorov
2014-03-17 21:59:00 +04:00
parent 1ba0b01456
commit 71bfa51ab2
7 changed files with 105 additions and 2 deletions
@@ -0,0 +1,31 @@
package foo
open class A {
val a = 3
fun foo(): Int {
return 5
}
class object: A() {
val c = a
}
}
class B {
class object: A() {
}
}
fun box(): String {
if (A.a != 3) return "A.a != 3, it: ${A.a}"
if (A.foo() != 5) return "A.foo() != 5, it: ${A.foo()}"
val a = A
if (a.c != 3) return "a = A; a.c != 3, it: ${a.c}"
if (A().a != 3) return "A().a != 3, it: ${A().a}"
if (B.a != 3) return "B.a != 3, it: ${B.a}"
val b = B
if (b.foo() != 5) return "b = B; b.foo() != 5, it: ${b.foo()}"
return "OK"
}