[FIR] Fix Definitely Not Null type substitution
This commit is contained in:
+1
-1
@@ -87,7 +87,7 @@ abstract class AbstractConeSubstitutor : ConeSubstitutor() {
|
||||
}
|
||||
|
||||
private fun ConeDefinitelyNotNullType.substituteOriginal(): ConeDefinitelyNotNullType? {
|
||||
return ConeDefinitelyNotNullType.create(substituteType(original)?.withNullability(ConeNullability.NOT_NULL) ?: original)
|
||||
return ConeDefinitelyNotNullType.create(substituteOrNull(original)?.withNullability(ConeNullability.NOT_NULL) ?: original)
|
||||
}
|
||||
|
||||
private fun ConeFlexibleType.substituteBounds(): ConeFlexibleType? {
|
||||
|
||||
@@ -32,8 +32,7 @@ public class DiagnosticFactory<D extends EmptyDiagnostic> {
|
||||
}
|
||||
|
||||
// FILE: DiagnosticFactory0.java
|
||||
|
||||
public class DiagnosticFactory0<E extends Element> extends DiagnosticFactory<Diagnostic> {}
|
||||
public class DiagnosticFactory0<E extends Element> extends DiagnosticFactory<Diagnostic<E>> {}
|
||||
|
||||
// FILE: test.kt
|
||||
|
||||
@@ -54,5 +53,5 @@ private val DERIVED_FACTORY = DiagnosticFactory0<DerivedElement>()
|
||||
fun createViaFactory(d: EmptyDiagnostic) {
|
||||
val casted = DERIVED_FACTORY.cast(d)
|
||||
val element = casted.element
|
||||
<!INAPPLICABLE_CANDIDATE!>Fix<!>(element)
|
||||
Fix(element)
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ FILE: test.kt
|
||||
private final val DERIVED_FACTORY: R|DiagnosticFactory0<DerivedElement>| = R|/DiagnosticFactory0.DiagnosticFactory0|<R|DerivedElement|>()
|
||||
private get(): R|DiagnosticFactory0<DerivedElement>|
|
||||
public final fun createViaFactory(d: R|EmptyDiagnostic|): R|kotlin/Unit| {
|
||||
lval casted: R|Diagnostic<*>!| = R|/DERIVED_FACTORY|.R|FakeOverride</DiagnosticFactory.cast: R|Diagnostic<*>!|>|(R|<local>/d|)
|
||||
lval element: R|Element!| = R|<local>/casted|.R|/Diagnostic.element|
|
||||
<Inapplicable(INAPPLICABLE): [/Fix.Fix]>#(R|<local>/element|)
|
||||
lval casted: R|Diagnostic<DerivedElement>!| = R|/DERIVED_FACTORY|.R|FakeOverride</DiagnosticFactory.cast: R|Diagnostic<DerivedElement>!|>|(R|<local>/d|)
|
||||
lval element: R|DerivedElement!| = R|<local>/casted|.R|/Diagnostic.element|
|
||||
R|/Fix.Fix|(R|<local>/element|)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user