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
29 lines
796 B
Kotlin
Vendored
29 lines
796 B
Kotlin
Vendored
// WITH_STDLIB
|
|
// ISSUE: KT-56722
|
|
// FILE: Option.java
|
|
public interface Option<T> {
|
|
T get();
|
|
|
|
public final class Some<T> implements Option<T> {
|
|
@Override
|
|
public T get() {
|
|
return null;
|
|
}
|
|
}
|
|
}
|
|
|
|
// FILE: test.kt
|
|
fun test_1(option: Option<Pair<String, String>>?) {
|
|
if (option is Option.Some<*>) {
|
|
val x = <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Pair<kotlin.String, kotlin.String>..kotlin.Pair<kotlin.String, kotlin.String>?!")!>option.get()<!>.first
|
|
x.length
|
|
}
|
|
}
|
|
|
|
fun test_2(option: Option<Pair<String, String>>?) {
|
|
if (option is Option.Some) {
|
|
val x = <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Pair<kotlin.String, kotlin.String>..kotlin.Pair<kotlin.String, kotlin.String>?!")!>option.get()<!>.first
|
|
x.length
|
|
}
|
|
}
|