8ff4af034a
```
open class Base<T> {
fun foo(): T = ...
}
class Derived<T> : Base<T> {
override fun foo(): T = ...
}
```
In intersection scope of type `Base<T> & Other<R>` we should create
intersection override based on `Base.foo(): T` and `Derived.foo(): R`
at the same time, despite the fact that `Derived.foo` actually directly
overrides `Base.foo`
^KT-56722 Fixed
20 lines
998 B
Plaintext
Vendored
20 lines
998 B
Plaintext
Vendored
FILE: test.kt
|
|
public final fun test_1(option: R|Option<kotlin/Pair<kotlin/String, kotlin/String>>?|): R|kotlin/Unit| {
|
|
when () {
|
|
(R|<local>/option| is R|Option.Some<*>|) -> {
|
|
lval x: R|kotlin/String| = R|<local>/option|.R|/Option.Some.get|().R|SubstitutionOverride<kotlin/Pair.first: R|kotlin/String|>|
|
|
R|<local>/x|.R|kotlin/String.length|
|
|
}
|
|
}
|
|
|
|
}
|
|
public final fun test_2(option: R|Option<kotlin/Pair<kotlin/String, kotlin/String>>?|): R|kotlin/Unit| {
|
|
when () {
|
|
(R|<local>/option| is R|Option.Some<kotlin/Pair<kotlin/String, kotlin/String>>|) -> {
|
|
lval x: R|kotlin/String| = R|<local>/option|.R|SubstitutionOverride</Option.Some.get: R|ft<kotlin/Pair<kotlin/String, kotlin/String>, kotlin/Pair<kotlin/String, kotlin/String>?>|>|().R|SubstitutionOverride<kotlin/Pair.first: R|kotlin/String|>|
|
|
R|<local>/x|.R|kotlin/String.length|
|
|
}
|
|
}
|
|
|
|
}
|