Fix header scope for secondary constructors

Add companion object's scope and nested classes

 #KT-6996 fixed
This commit is contained in:
Denis Zharkov
2015-03-17 19:34:47 +03:00
parent 977b743f3d
commit bd5dbb665e
6 changed files with 93 additions and 4 deletions
@@ -0,0 +1,21 @@
class A(val result: Int) {
companion object {
fun foo(): Int = 1
val prop = 2
val C = 3
}
object B {
fun bar(): Int = 4
val prop = 5
}
object C {
}
constructor() : this(foo() + prop + B.bar() + B.prop + C) {}
}
fun box(): String {
val result = A().result
if (result != 15) return "fail: $result"
return "OK"
}