[FIR] Add problematic test for KT-42346 (double vararg in annotation)

This commit is contained in:
Mikhail Glukhikh
2020-10-05 13:41:04 +03:00
parent 862fb6a405
commit 6f432ea5dd
4 changed files with 69 additions and 0 deletions
@@ -0,0 +1,23 @@
// FILE: MagicConstant.java
public @interface MagicConstant {
long[] intValues() default {};
}
// FILE: kt42346.kt
class StepRequest {
companion object {
const val STEP_INTO = 0
const val STEP_OVER = 1
const val STEP_OUT = 2
}
}
@MagicConstant(intValues = [StepRequest.STEP_INTO.toLong(), StepRequest.STEP_OVER.toLong(), StepRequest.STEP_OUT.toLong()])
val depth: Int = 42
annotation class KotlinMagicConstant(val intValues: LongArray)
@KotlinMagicConstant(intValues = <!NON_CONST_VAL_USED_IN_CONSTANT_EXPRESSION!>[StepRequest.STEP_INTO.<!ANNOTATION_ARGUMENT_MUST_BE_CONST!>toLong()<!>, StepRequest.STEP_OVER.<!ANNOTATION_ARGUMENT_MUST_BE_CONST!>toLong()<!>, StepRequest.STEP_OUT.<!ANNOTATION_ARGUMENT_MUST_BE_CONST!>toLong()<!>]<!>)
val kotlinDepth: Int = 42
@@ -0,0 +1,36 @@
FILE: kt42346.kt
public final class StepRequest : R|kotlin/Any| {
public constructor(): R|StepRequest| {
super<R|kotlin/Any|>()
}
public final companion object Companion : R|kotlin/Any| {
private constructor(): R|StepRequest.Companion| {
super<R|kotlin/Any|>()
}
public final const val STEP_INTO: R|kotlin/Int| = Int(0)
public get(): R|kotlin/Int|
public final const val STEP_OVER: R|kotlin/Int| = Int(1)
public get(): R|kotlin/Int|
public final const val STEP_OUT: R|kotlin/Int| = Int(2)
public get(): R|kotlin/Int|
}
}
@R|MagicConstant|(vararg(intValues = <implicitArrayOf>(Q|StepRequest|.R|/StepRequest.Companion.STEP_INTO|.R|kotlin/Int.toLong|(), Q|StepRequest|.R|/StepRequest.Companion.STEP_OVER|.R|kotlin/Int.toLong|(), Q|StepRequest|.R|/StepRequest.Companion.STEP_OUT|.R|kotlin/Int.toLong|()))) public final val depth: R|kotlin/Int| = Int(42)
public get(): R|kotlin/Int|
public final annotation class KotlinMagicConstant : R|kotlin/Annotation| {
public constructor(intValues: R|kotlin/LongArray|): R|KotlinMagicConstant| {
super<R|kotlin/Any|>()
}
public final val intValues: R|kotlin/LongArray| = R|<local>/intValues|
public get(): R|kotlin/LongArray|
}
@R|KotlinMagicConstant|(intValues = <implicitArrayOf>(Q|StepRequest|.R|/StepRequest.Companion.STEP_INTO|.R|kotlin/Int.toLong|(), Q|StepRequest|.R|/StepRequest.Companion.STEP_OVER|.R|kotlin/Int.toLong|(), Q|StepRequest|.R|/StepRequest.Companion.STEP_OUT|.R|kotlin/Int.toLong|())) public final val kotlinDepth: R|kotlin/Int| = Int(42)
public get(): R|kotlin/Int|
@@ -2019,6 +2019,11 @@ public class FirDiagnosticsTestGenerated extends AbstractFirDiagnosticsTest {
runTest("compiler/fir/analysis-tests/testData/resolve/problems/javaQualifier.kt");
}
@TestMetadata("kt42346.kt")
public void testKt42346() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolve/problems/kt42346.kt");
}
@TestMetadata("multipleJavaClassesInOneFile.kt")
public void testMultipleJavaClassesInOneFile() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolve/problems/multipleJavaClassesInOneFile.kt");
@@ -2019,6 +2019,11 @@ public class FirDiagnosticsWithLightTreeTestGenerated extends AbstractFirDiagnos
runTest("compiler/fir/analysis-tests/testData/resolve/problems/javaQualifier.kt");
}
@TestMetadata("kt42346.kt")
public void testKt42346() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolve/problems/kt42346.kt");
}
@TestMetadata("multipleJavaClassesInOneFile.kt")
public void testMultipleJavaClassesInOneFile() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolve/problems/multipleJavaClassesInOneFile.kt");