[FIR] Add companion scope before static scope

Static scope is checked first during resolution
(scopes are in reverse order).
This fixes a difference between how K1 and K2 resolve annotations.

#KT-63249 Fixed
This commit is contained in:
Kirill Rakhman
2023-12-12 18:49:45 +01:00
committed by Space Team
parent 2c74a2356a
commit 44b3c66ad7
10 changed files with 603 additions and 5 deletions
@@ -1746,6 +1746,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia
runTest("compiler/testData/diagnostics/tests/annotations/classAnnotationsInLocalClass.kt");
}
@Test
@TestMetadata("companionAnnotations.kt")
public void testCompanionAnnotations() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/companionAnnotations.kt");
}
@Test
@TestMetadata("constantFromOuterScopeAsAnnotaionParameter.kt")
public void testConstantFromOuterScopeAsAnnotaionParameter() throws Exception {
@@ -1746,6 +1746,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated
runTest("compiler/testData/diagnostics/tests/annotations/classAnnotationsInLocalClass.kt");
}
@Test
@TestMetadata("companionAnnotations.kt")
public void testCompanionAnnotations() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/companionAnnotations.kt");
}
@Test
@TestMetadata("constantFromOuterScopeAsAnnotaionParameter.kt")
public void testConstantFromOuterScopeAsAnnotaionParameter() throws Exception {