Files
kotlin-fork/compiler/fir/analysis-tests/testData/resolve/kt41984.kt
T
pyos 5fec9f34b1 FIR: revert a hack that allows overriding T!! with T
1. this should've been only done if the language feature for validating
    that is disabled;

 2. that feature probably won't matter by the time FIR is stable;

 3. it only worked because type enhancement of type arguments is broken
    anyway - a more correct hack would be to provide a custom
    ConeTypePreparator.
2021-09-06 13:11:01 +03:00

32 lines
675 B
Kotlin
Vendored

// ISSUE: KT-41984
// FILE: A.java
import org.jetbrains.annotations.NotNull;
public abstract class A<T, V> {
@NotNull
public abstract String take(@NotNull V value);
@NotNull
public abstract String takeInv(@NotNull Inv<@NotNull V> value);
}
// FILE: main.kt
class Inv<T>
open <!ABSTRACT_CLASS_MEMBER_NOT_IMPLEMENTED!>class B<!><V> : A<Any, V>() {
<!NOTHING_TO_OVERRIDE!>override<!> fun take(value: V): String {
return ""
}
override fun takeInv(value: Inv<V>): String = ""
}
fun test_1(b: B<Int>, x: Int, inv: Inv<Int>) {
b.<!OVERLOAD_RESOLUTION_AMBIGUITY!>take<!>(x)
b.<!NONE_APPLICABLE!>take<!>(null)
b.takeInv(inv)
}