[FIR] fix subtyping for definitely notnull types.
The current implementation doesn't consider Foo a subtype of Captured<in Foo>!!, since AbstractTypeCheckerContext::checkSubtypeForSpecialCases does not handle DefinitelyNotNullType cases. This PR adds handling of DefinitelyNotNullType by looking at its original type. ^KT-42824 Fixed
This commit is contained in:
committed by
Mikhail Glukhikh
parent
eb804709da
commit
9486f58fb1
@@ -0,0 +1,21 @@
|
||||
// FILE: DiagnosticFactory0.java
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class DiagnosticFactory0<E> {
|
||||
@NotNull
|
||||
public SimpleDiagnostic<E> on(@NotNull E element) {
|
||||
return new SimpleDiagnostic<>(element);
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: test.kt
|
||||
|
||||
class SimpleDiagnostic<E>(val element: E)
|
||||
interface KtAnnotationEntry
|
||||
|
||||
fun foo(error: DiagnosticFactory0<in KtAnnotationEntry>, entry: KtAnnotationEntry) {
|
||||
error.on(entry) // used to be INAPPLICABLE_CANDIDATE
|
||||
}
|
||||
|
||||
fun box() = "OK"
|
||||
Reference in New Issue
Block a user