Minor: split test to access to companion and to nested object

This commit is contained in:
Zalim Bashorov
2015-05-25 19:45:24 +03:00
parent dc1b91eacd
commit 3fe363e72b
4 changed files with 33 additions and 6 deletions
@@ -0,0 +1,19 @@
// TODO enable for JS backend too when KT-6203 will be fixed
// TARGET_BACKEND: JVM
class A(val result: Int) {
object B {
fun bar(): Int = 4
val prop = 5
}
object C {
}
constructor() : this(B.bar() + B.prop)
}
fun box(): String {
val result = A().result
if (result != 9) return "fail: $result"
return "OK"
}