9807c67ae4
If some java class has multiple supertypes then we need to collect overriddens from all those types directly, even if superTypeScope (which is FirTypeIntersectionScope in this case) returns only one symbol from one of this types (not intersection one) This is needed to proper enhancement in cases when some type occurs multiple times in supertypes graph with different nullability of arguments: class ConcurrentHashMap<K, V> : AbstractMap<K!, V!>, MutableMap<K, V> If we try to find method `get(key: K): V` supertype scope returns `AbstractMap.get(key: K!): V!` (because it actually overrides `MutableMap(key: K): V?`), but we need to get both symbols to properly enhance types for `ConcurrentHashMap.remove`
50 lines
1.2 KiB
Kotlin
Vendored
50 lines
1.2 KiB
Kotlin
Vendored
val test1: Int /* by */
|
|
field = lazy<Int>(initializer = local fun <anonymous>(): Int {
|
|
return 42
|
|
}
|
|
)
|
|
get(): Int {
|
|
return #test1$delegate.getValue<Int>(thisRef = null, property = ::test1)
|
|
}
|
|
|
|
class C {
|
|
constructor(map: MutableMap<String, Any>) /* primary */ {
|
|
super/*Any*/()
|
|
/* <init>() */
|
|
|
|
}
|
|
|
|
val map: MutableMap<String, Any>
|
|
field = map
|
|
get
|
|
|
|
val test2: Int /* by */
|
|
field = lazy<Int>(initializer = local fun <anonymous>(): Int {
|
|
return 42
|
|
}
|
|
)
|
|
get(): Int {
|
|
return <this>.#test2$delegate.getValue<Int>(thisRef = <this>, property = C::test2)
|
|
}
|
|
|
|
var test3: Any /* by */
|
|
field = <this>.<get-map>()
|
|
get(): Any {
|
|
return <this>.#test3$delegate.getValue<Any, Any>(thisRef = <this>, property = C::test3)
|
|
}
|
|
set(<set-?>: Any) {
|
|
<this>.#test3$delegate.setValue<Any>(thisRef = <this>, property = C::test3, value = <set-?>)
|
|
}
|
|
|
|
}
|
|
|
|
var test4: Any /* by */
|
|
field = hashMapOf<String, Any>()
|
|
get(): Any {
|
|
return #test4$delegate.getValue<Any, Any>(thisRef = null, property = ::test4)
|
|
}
|
|
set(<set-?>: Any) {
|
|
#test4$delegate.setValue<Any>(thisRef = null, property = ::test4, value = <set-?>)
|
|
}
|
|
|