2/2 FirUnsupportedSyntheticCallableReferenceChecker: don't report error on FirJavaOverriddenSyntheticPropertySymbol

Meta issue: KT-8575
^KT-58061 Fixed
Review: https://jetbrains.team/p/kt/reviews/9677

This commit fixes an inconsistency between
FirUnsupportedSyntheticCallableReferenceChecker and
UnsupportedSyntheticCallableReferenceChecker

In K1 such properties were not considered synthetic and are called
JavaPropertyDescriptor. That's why we need to do an additional check in
K2 checker, while in K1 we didn't need to do it

Also see the previous commit for more related tests that already was
green without this fix but are related to KT-58061 problem
This commit is contained in:
Nikita Bobko
2023-04-19 12:07:15 +02:00
committed by Space Team
parent 11f376ae84
commit 8314812ef9
9 changed files with 109 additions and 4 deletions
@@ -4323,6 +4323,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia
runTest("compiler/testData/diagnostics/tests/callableReference/unsupported/callableReferenceToLocalVariable.kt");
}
@Test
@TestMetadata("javaOverridesKotlinProperty.kt")
public void testJavaOverridesKotlinProperty() throws Exception {
runTest("compiler/testData/diagnostics/tests/callableReference/unsupported/javaOverridesKotlinProperty.kt");
}
@Test
@TestMetadata("localVariable.kt")
public void testLocalVariable() throws Exception {
@@ -4352,6 +4358,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia
public void testSyntheticProperties() throws Exception {
runTest("compiler/testData/diagnostics/tests/callableReference/unsupported/syntheticProperties.kt");
}
@Test
@TestMetadata("syntheticPropertiesOnJavaAnnotation.kt")
public void testSyntheticPropertiesOnJavaAnnotation() throws Exception {
runTest("compiler/testData/diagnostics/tests/callableReference/unsupported/syntheticPropertiesOnJavaAnnotation.kt");
}
}
}
@@ -4323,6 +4323,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated
runTest("compiler/testData/diagnostics/tests/callableReference/unsupported/callableReferenceToLocalVariable.kt");
}
@Test
@TestMetadata("javaOverridesKotlinProperty.kt")
public void testJavaOverridesKotlinProperty() throws Exception {
runTest("compiler/testData/diagnostics/tests/callableReference/unsupported/javaOverridesKotlinProperty.kt");
}
@Test
@TestMetadata("localVariable.kt")
public void testLocalVariable() throws Exception {
@@ -4352,6 +4358,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated
public void testSyntheticProperties() throws Exception {
runTest("compiler/testData/diagnostics/tests/callableReference/unsupported/syntheticProperties.kt");
}
@Test
@TestMetadata("syntheticPropertiesOnJavaAnnotation.kt")
public void testSyntheticPropertiesOnJavaAnnotation() throws Exception {
runTest("compiler/testData/diagnostics/tests/callableReference/unsupported/syntheticPropertiesOnJavaAnnotation.kt");
}
}
}