[FIR] Don't ignore annotations on when subjects
^KT-53565 Fixed
This commit is contained in:
committed by
Space Team
parent
05ed134fbb
commit
97bbf69bdc
+6
@@ -711,6 +711,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia
|
|||||||
runTest("compiler/testData/diagnostics/tests/missingIteratorMissing.kt");
|
runTest("compiler/testData/diagnostics/tests/missingIteratorMissing.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("missingWrongAnnotationTarget.kt")
|
||||||
|
public void testMissingWrongAnnotationTarget() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/missingWrongAnnotationTarget.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("MultilineStringTemplates.kt")
|
@TestMetadata("MultilineStringTemplates.kt")
|
||||||
public void testMultilineStringTemplates() throws Exception {
|
public void testMultilineStringTemplates() throws Exception {
|
||||||
|
|||||||
+6
@@ -711,6 +711,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated
|
|||||||
runTest("compiler/testData/diagnostics/tests/missingIteratorMissing.kt");
|
runTest("compiler/testData/diagnostics/tests/missingIteratorMissing.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("missingWrongAnnotationTarget.kt")
|
||||||
|
public void testMissingWrongAnnotationTarget() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/missingWrongAnnotationTarget.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("MultilineStringTemplates.kt")
|
@TestMetadata("MultilineStringTemplates.kt")
|
||||||
public void testMultilineStringTemplates() throws Exception {
|
public void testMultilineStringTemplates() throws Exception {
|
||||||
|
|||||||
+6
@@ -711,6 +711,12 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir
|
|||||||
runTest("compiler/testData/diagnostics/tests/missingIteratorMissing.kt");
|
runTest("compiler/testData/diagnostics/tests/missingIteratorMissing.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("missingWrongAnnotationTarget.kt")
|
||||||
|
public void testMissingWrongAnnotationTarget() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/missingWrongAnnotationTarget.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("MultilineStringTemplates.kt")
|
@TestMetadata("MultilineStringTemplates.kt")
|
||||||
public void testMultilineStringTemplates() throws Exception {
|
public void testMultilineStringTemplates() throws Exception {
|
||||||
|
|||||||
+6
@@ -711,6 +711,12 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia
|
|||||||
runTest("compiler/testData/diagnostics/tests/missingIteratorMissing.kt");
|
runTest("compiler/testData/diagnostics/tests/missingIteratorMissing.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("missingWrongAnnotationTarget.kt")
|
||||||
|
public void testMissingWrongAnnotationTarget() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/missingWrongAnnotationTarget.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("MultilineStringTemplates.kt")
|
@TestMetadata("MultilineStringTemplates.kt")
|
||||||
public void testMultilineStringTemplates() throws Exception {
|
public void testMultilineStringTemplates() throws Exception {
|
||||||
|
|||||||
+1
@@ -728,6 +728,7 @@ class LightTreeRawFirExpressionBuilder(
|
|||||||
symbol = FirPropertySymbol(variable.name)
|
symbol = FirPropertySymbol(variable.name)
|
||||||
isLocal = true
|
isLocal = true
|
||||||
status = FirDeclarationStatusImpl(Visibilities.Local, Modality.FINAL)
|
status = FirDeclarationStatusImpl(Visibilities.Local, Modality.FINAL)
|
||||||
|
annotations += variable.annotations
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
DESTRUCTURING_DECLARATION -> subjectExpression =
|
DESTRUCTURING_DECLARATION -> subjectExpression =
|
||||||
|
|||||||
@@ -2384,6 +2384,7 @@ open class PsiRawFirBuilder(
|
|||||||
symbol = FirPropertySymbol(name)
|
symbol = FirPropertySymbol(name)
|
||||||
isLocal = true
|
isLocal = true
|
||||||
status = FirDeclarationStatusImpl(Visibilities.Local, Modality.FINAL)
|
status = FirDeclarationStatusImpl(Visibilities.Local, Modality.FINAL)
|
||||||
|
ktSubjectExpression.extractAnnotationsTo(this)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else -> null
|
else -> null
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
|
// ISSUE: KT-53565
|
||||||
|
|
||||||
|
@Target(AnnotationTarget.CLASS)
|
||||||
|
annotation class InvalidAnn
|
||||||
|
|
||||||
|
fun wrongAnnotationTargetInWhenSubject() {
|
||||||
|
// Error expected on annotation
|
||||||
|
when(<!WRONG_ANNOTATION_TARGET!>@InvalidAnn<!> val x = 0) {
|
||||||
|
0 -> {}
|
||||||
|
}
|
||||||
|
}
|
||||||
Generated
+6
@@ -711,6 +711,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
|
|||||||
runTest("compiler/testData/diagnostics/tests/missingIteratorMissing.kt");
|
runTest("compiler/testData/diagnostics/tests/missingIteratorMissing.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("missingWrongAnnotationTarget.kt")
|
||||||
|
public void testMissingWrongAnnotationTarget() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/missingWrongAnnotationTarget.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("MultilineStringTemplates.kt")
|
@TestMetadata("MultilineStringTemplates.kt")
|
||||||
public void testMultilineStringTemplates() throws Exception {
|
public void testMultilineStringTemplates() throws Exception {
|
||||||
|
|||||||
Reference in New Issue
Block a user