K2: Fix generic inference case with !! synthetic call
Result of the `checkNotNull` calls should always be a non-nullable values. The simplest idea how to acheive it is adding not-nullable Any bound to the type parameter declaration. Existing comment stating about impossibility of such bound seems to be not 100% correct because it doesn't take into account presence of definitely-non-nullable X & Any types that allow described case with nullable generic. ^KT-55804 Fixed
This commit is contained in:
committed by
Space Team
parent
352316ba9f
commit
56557fb8ff
+6
@@ -14366,6 +14366,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia
|
||||
runTest("compiler/testData/diagnostics/tests/inference/errorsOnImplicitInvokeInSimpleCall.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("exclExclInference.kt")
|
||||
public void testExclExclInference() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/inference/exclExclInference.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("expectedTypeAdditionalTest.kt")
|
||||
public void testExpectedTypeAdditionalTest() throws Exception {
|
||||
|
||||
+6
@@ -14366,6 +14366,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated
|
||||
runTest("compiler/testData/diagnostics/tests/inference/errorsOnImplicitInvokeInSimpleCall.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("exclExclInference.kt")
|
||||
public void testExclExclInference() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/inference/exclExclInference.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("expectedTypeAdditionalTest.kt")
|
||||
public void testExpectedTypeAdditionalTest() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user