K2 resolve: prefer derived class property to base class field

#KT-50082 Fixed
This commit is contained in:
Mikhail Glukhikh
2022-11-16 17:14:56 +01:00
committed by teamcity
parent 642bbd38ba
commit 59bafedd8a
15 changed files with 407 additions and 41 deletions
@@ -3407,6 +3407,12 @@ public class DiagnosisCompilerFirTestdataTestGenerated extends AbstractDiagnosis
runTest("compiler/fir/analysis-tests/testData/resolve/problems/emptySelectorInQualifiedExpression.kt");
}
@Test
@TestMetadata("enumEntryFieldShadow.kt")
public void testEnumEntryFieldShadow() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolve/problems/enumEntryFieldShadow.kt");
}
@Test
@TestMetadata("expectConstructor.kt")
public void testExpectConstructor() throws Exception {
@@ -3568,6 +3574,34 @@ public class DiagnosisCompilerFirTestdataTestGenerated extends AbstractDiagnosis
}
}
@Nested
@TestMetadata("compiler/fir/analysis-tests/testData/resolve/propertyVsField")
@TestDataPath("$PROJECT_ROOT")
public class PropertyVsField {
@Test
public void testAllFilesPresentInPropertyVsField() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/propertyVsField"), Pattern.compile("^([^.]+)\\.kt$"), null, true);
}
@Test
@TestMetadata("fieldPropertyShadow.kt")
public void testFieldPropertyShadow() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolve/propertyVsField/fieldPropertyShadow.kt");
}
@Test
@TestMetadata("propertyAndTwoFields.kt")
public void testPropertyAndTwoFields() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolve/propertyVsField/propertyAndTwoFields.kt");
}
@Test
@TestMetadata("propertyFieldShadow.kt")
public void testPropertyFieldShadow() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolve/propertyVsField/propertyFieldShadow.kt");
}
}
@Nested
@TestMetadata("compiler/fir/analysis-tests/testData/resolve/references")
@TestDataPath("$PROJECT_ROOT")