[FIR] Fix exception in Java scope caused by inherited member with implicit return type

It's caused by checking the return type of an inherited property.
toConeKotlinTypeProbablyFlexible() returns an error type when the
type ref is unresolved instead of throwing.
This "breaks" some override checks and in the added test, it leads
to an additional candidate being created for a synthetic property.
However, the candidate has applicability K2_SYNTHETIC_RESOLVED
and gets filtered out because the real property has a higher
applicability.

#KT-66392 Fixed
This commit is contained in:
Kirill Rakhman
2024-03-14 15:23:19 +01:00
committed by Space Team
parent 8f420eb3e1
commit 2095f90e69
9 changed files with 69 additions and 6 deletions
@@ -21984,6 +21984,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia
runTest("compiler/testData/diagnostics/tests/j+k/kjkRawTypeWithKotlinUpperBound.kt");
}
@Test
@TestMetadata("kjkimplicitTypesCrash.kt")
public void testKjkimplicitTypesCrash() {
runTest("compiler/testData/diagnostics/tests/j+k/kjkimplicitTypesCrash.kt");
}
@Test
@TestMetadata("kt1402.kt")
public void testKt1402() {
@@ -21984,6 +21984,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated
runTest("compiler/testData/diagnostics/tests/j+k/kjkRawTypeWithKotlinUpperBound.kt");
}
@Test
@TestMetadata("kjkimplicitTypesCrash.kt")
public void testKjkimplicitTypesCrash() {
runTest("compiler/testData/diagnostics/tests/j+k/kjkimplicitTypesCrash.kt");
}
@Test
@TestMetadata("kt1402.kt")
public void testKt1402() {