diff --git a/compiler/fir/analysis-tests/testData/resolve/problems/kt42346.kt b/compiler/fir/analysis-tests/testData/resolve/problems/kt42346.kt new file mode 100644 index 00000000000..a471e801990 --- /dev/null +++ b/compiler/fir/analysis-tests/testData/resolve/problems/kt42346.kt @@ -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 = [StepRequest.STEP_INTO.toLong(), StepRequest.STEP_OVER.toLong(), StepRequest.STEP_OUT.toLong()]) +val kotlinDepth: Int = 42 diff --git a/compiler/fir/analysis-tests/testData/resolve/problems/kt42346.txt b/compiler/fir/analysis-tests/testData/resolve/problems/kt42346.txt new file mode 100644 index 00000000000..0d3fd08d077 --- /dev/null +++ b/compiler/fir/analysis-tests/testData/resolve/problems/kt42346.txt @@ -0,0 +1,36 @@ +FILE: kt42346.kt + public final class StepRequest : R|kotlin/Any| { + public constructor(): R|StepRequest| { + super() + } + + public final companion object Companion : R|kotlin/Any| { + private constructor(): R|StepRequest.Companion| { + super() + } + + 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 = (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() + } + + public final val intValues: R|kotlin/LongArray| = R|/intValues| + public get(): R|kotlin/LongArray| + + } + @R|KotlinMagicConstant|(intValues = (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| diff --git a/compiler/fir/analysis-tests/tests/org/jetbrains/kotlin/fir/FirDiagnosticsTestGenerated.java b/compiler/fir/analysis-tests/tests/org/jetbrains/kotlin/fir/FirDiagnosticsTestGenerated.java index 1fdbe9d31dd..8e6817bea54 100644 --- a/compiler/fir/analysis-tests/tests/org/jetbrains/kotlin/fir/FirDiagnosticsTestGenerated.java +++ b/compiler/fir/analysis-tests/tests/org/jetbrains/kotlin/fir/FirDiagnosticsTestGenerated.java @@ -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"); diff --git a/compiler/fir/analysis-tests/tests/org/jetbrains/kotlin/fir/FirDiagnosticsWithLightTreeTestGenerated.java b/compiler/fir/analysis-tests/tests/org/jetbrains/kotlin/fir/FirDiagnosticsWithLightTreeTestGenerated.java index c5f8b10bd49..0be8dc5dada 100644 --- a/compiler/fir/analysis-tests/tests/org/jetbrains/kotlin/fir/FirDiagnosticsWithLightTreeTestGenerated.java +++ b/compiler/fir/analysis-tests/tests/org/jetbrains/kotlin/fir/FirDiagnosticsWithLightTreeTestGenerated.java @@ -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");