mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-09 15:53:37 +00:00
#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.
19 lines
281 B
Kotlin
19 lines
281 B
Kotlin
class A {
|
|
var a: String = "Fail"
|
|
|
|
{
|
|
open class B() {
|
|
open fun s() : String = "O"
|
|
}
|
|
|
|
val o = object : B() {
|
|
override fun s(): String = "K"
|
|
}
|
|
|
|
a = B().s() + o.s()
|
|
}
|
|
}
|
|
|
|
fun box() : String {
|
|
return A().a
|
|
} |