diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/substitution/ConeSubstitutor.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/substitution/ConeSubstitutor.kt index b6aa79c5e8b..83f3d8bddd2 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/substitution/ConeSubstitutor.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/substitution/ConeSubstitutor.kt @@ -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? { diff --git a/compiler/fir/resolve/testData/resolve/expresssions/genericDiagnostic.kt b/compiler/fir/resolve/testData/resolve/expresssions/genericDiagnostic.kt index f7540c3e987..4a982f1cc1d 100644 --- a/compiler/fir/resolve/testData/resolve/expresssions/genericDiagnostic.kt +++ b/compiler/fir/resolve/testData/resolve/expresssions/genericDiagnostic.kt @@ -32,8 +32,7 @@ public class DiagnosticFactory { } // FILE: DiagnosticFactory0.java - -public class DiagnosticFactory0 extends DiagnosticFactory {} +public class DiagnosticFactory0 extends DiagnosticFactory> {} // FILE: test.kt @@ -54,5 +53,5 @@ private val DERIVED_FACTORY = DiagnosticFactory0() fun createViaFactory(d: EmptyDiagnostic) { val casted = DERIVED_FACTORY.cast(d) val element = casted.element - Fix(element) + Fix(element) } diff --git a/compiler/fir/resolve/testData/resolve/expresssions/genericDiagnostic.txt b/compiler/fir/resolve/testData/resolve/expresssions/genericDiagnostic.txt index 2691596ff7e..a46da2826fb 100644 --- a/compiler/fir/resolve/testData/resolve/expresssions/genericDiagnostic.txt +++ b/compiler/fir/resolve/testData/resolve/expresssions/genericDiagnostic.txt @@ -16,7 +16,7 @@ FILE: test.kt private final val DERIVED_FACTORY: R|DiagnosticFactory0| = R|/DiagnosticFactory0.DiagnosticFactory0|() private get(): R|DiagnosticFactory0| public final fun createViaFactory(d: R|EmptyDiagnostic|): R|kotlin/Unit| { - lval casted: R|Diagnostic<*>!| = R|/DERIVED_FACTORY|.R|FakeOverride!|>|(R|/d|) - lval element: R|Element!| = R|/casted|.R|/Diagnostic.element| - #(R|/element|) + lval casted: R|Diagnostic!| = R|/DERIVED_FACTORY|.R|FakeOverride!|>|(R|/d|) + lval element: R|DerivedElement!| = R|/casted|.R|/Diagnostic.element| + R|/Fix.Fix|(R|/element|) }