Prohibit non-const expressions through varargs in annotations
Fixes #KT-23153 for Kotlin 1.3 The problem was in the type check of expression type against expected type. When feature `AssigningArraysToVarargsInNamedFormInAnnotations` (KT-20171) appeared, expected type could be wrong, which led to failed type check
This commit is contained in:
@@ -24536,6 +24536,18 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTest {
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("assignNonConstSingleArrayElementAsVarargInAnnotation.kt")
|
||||
public void testAssignNonConstSingleArrayElementAsVarargInAnnotation() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/varargs/assignNonConstSingleArrayElementAsVarargInAnnotation.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("assignNonConstSingleArrayElementAsVarargInAnnotationError.kt")
|
||||
public void testAssignNonConstSingleArrayElementAsVarargInAnnotationError() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/varargs/assignNonConstSingleArrayElementAsVarargInAnnotationError.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("assigningArraysToVarargsInAnnotations.kt")
|
||||
public void testAssigningArraysToVarargsInAnnotations() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/varargs/assigningArraysToVarargsInAnnotations.kt");
|
||||
|
||||
Reference in New Issue
Block a user