9d366cb896
#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.
20 lines
556 B
Kotlin
20 lines
556 B
Kotlin
package test
|
|
|
|
open class A
|
|
|
|
class MyClass() {
|
|
{
|
|
val a = object: A() {
|
|
|
|
}
|
|
}
|
|
}
|
|
|
|
//package test
|
|
//internal open class A defined in test
|
|
//public constructor A() defined in test.A
|
|
//internal final class MyClass defined in test
|
|
//public constructor MyClass() defined in test.MyClass
|
|
//val a: test.MyClass.<init>.<no name provided> defined in test.MyClass.<init>
|
|
//internal final class <no name provided> : test.A defined in test.MyClass.<init>
|
|
//internal constructor <no name provided>() defined in test.MyClass.<init>.<no name provided> |