Call object's constructor in <clinit> and ignore the result, but in the first
line of <init> save the current "this" to INSTANCE$
#KT-4516 Fixed
#KT-4543 Fixed
#KT-5291 Fixed
#KT-5523 Fixed
#KT-5582 Fixed
#KT-5402 Fixed
#KT-4838 Fixed
Resolve type of object inside local object as special, not supertype('Any').
Changed visibility of constructor of anonymous object to 'internal' to be able to resolve the following:
fun box(): String {
var foo = object {
val bar = object {
val baz = "ok"
}
}
return foo.bar.baz
}
The containing declaration of property initializers is constructor, so 'baz' was invisible inside private constructor.