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.
22 lines
278 B
Kotlin
Vendored
22 lines
278 B
Kotlin
Vendored
object A {
|
|
val x : Int = 0
|
|
}
|
|
|
|
open class Foo {
|
|
fun foo() : Int = 1
|
|
}
|
|
|
|
fun test() {
|
|
A.x
|
|
val b = object : Foo() {
|
|
}
|
|
b.foo()
|
|
|
|
<error>object B</error> {
|
|
fun foo() {}
|
|
}
|
|
B.foo()
|
|
}
|
|
|
|
val bb = <error>B</error>.<error>foo</error>()
|