[FIR] Fully expand the bounds of type parameters for canBeNull check
This is required because a not-null bound `Foo` can resolve to a `typealias Foo = Bar?` in which case we must return true. #KT-64645 Fixed
This commit is contained in:
committed by
Space Team
parent
438b2dd164
commit
1018ff280e
+1
-1
@@ -35,7 +35,7 @@ internal class KtFirTypeInfoProvider(
|
||||
return (type as KtFirType).coneType.functionTypeKind(analysisSession.useSiteSession)
|
||||
}
|
||||
|
||||
override fun canBeNull(type: KtType): Boolean = (type as KtFirType).coneType.canBeNull
|
||||
override fun canBeNull(type: KtType): Boolean = (type as KtFirType).coneType.canBeNull(analysisSession.useSiteSession)
|
||||
|
||||
override fun isDenotable(type: KtType): Boolean {
|
||||
val coneType = (type as KtFirType).coneType
|
||||
|
||||
+6
@@ -35179,6 +35179,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia
|
||||
runTest("compiler/testData/diagnostics/tests/smartCasts/castchecks/insideCall.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt64645.kt")
|
||||
public void testKt64645() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/smartCasts/castchecks/kt64645.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("smartCastOfNullableExpressionWithExpectedType.kt")
|
||||
public void testSmartCastOfNullableExpressionWithExpectedType() throws Exception {
|
||||
|
||||
+6
@@ -35179,6 +35179,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated
|
||||
runTest("compiler/testData/diagnostics/tests/smartCasts/castchecks/insideCall.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt64645.kt")
|
||||
public void testKt64645() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/smartCasts/castchecks/kt64645.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("smartCastOfNullableExpressionWithExpectedType.kt")
|
||||
public void testSmartCastOfNullableExpressionWithExpectedType() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user