Files
kotlin-fork/compiler/fir/analysis-tests/testData/resolveWithStdlib/problems/immutableName.kt
T
Mikhail Glukhikh 05d65275bf FIR u/s scope: choose most specific intersection member for override check
Before this commit we took just first intersection member for this check.
However it's quite bad, because we were dependent on supertype order.
Choosing the most specific member looks more consistent here.

#KT-50969 Fixed
2022-01-31 21:59:18 +03:00

37 lines
733 B
Kotlin
Vendored

// SCOPE_DUMP: ImplDerived:foo, DerivedImpl:foo
// FILE: Base.java
import org.jetbrains.annotations.NotNull;
public interface Base {
Base foo(@NotNull String name);
}
// FILE: Derived.java
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public interface Derived extends Base {
@Override
@NotNull Derived foo(@Nullable String name);
}
// FILE: Impl.kt
abstract class Impl : Base {
override fun foo(name: String): Base {
return this
}
}
// FILE: test.kt
abstract class ImplDerived : Impl(), Derived {
abstract override fun foo(name: String?): Derived
}
abstract class DerivedImpl : Derived, Impl() {
abstract override fun foo(name: String?): Derived
}