[FIR] add more tests for implicit type phase

These tests demonstrate the implicit type phase problem - annotations
are also resolved, although they should not

^KT-56551
This commit is contained in:
Dmitrii Gridin
2023-09-22 15:54:50 +02:00
committed by Space Team
parent d4bc5dc717
commit 889c210576
36 changed files with 761 additions and 0 deletions
@@ -1716,6 +1716,102 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia
runTest("compiler/testData/diagnostics/tests/annotations/ConstructorCallAllowed.kt");
}
@Test
@TestMetadata("cycleAnnotationOnFunction.kt")
public void testCycleAnnotationOnFunction() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnFunction.kt");
}
@Test
@TestMetadata("cycleAnnotationOnFunctionInsideLocalClass.kt")
public void testCycleAnnotationOnFunctionInsideLocalClass() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnFunctionInsideLocalClass.kt");
}
@Test
@TestMetadata("cycleAnnotationOnFunctionParameterType.kt")
public void testCycleAnnotationOnFunctionParameterType() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnFunctionParameterType.kt");
}
@Test
@TestMetadata("cycleAnnotationOnFunctionParameterTypeInsideLocalClass.kt")
public void testCycleAnnotationOnFunctionParameterTypeInsideLocalClass() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnFunctionParameterTypeInsideLocalClass.kt");
}
@Test
@TestMetadata("cycleAnnotationOnProperty.kt")
public void testCycleAnnotationOnProperty() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnProperty.kt");
}
@Test
@TestMetadata("cycleAnnotationOnPropertyField.kt")
public void testCycleAnnotationOnPropertyField() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnPropertyField.kt");
}
@Test
@TestMetadata("cycleAnnotationOnPropertyFieldInsideLocalClass.kt")
public void testCycleAnnotationOnPropertyFieldInsideLocalClass() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnPropertyFieldInsideLocalClass.kt");
}
@Test
@TestMetadata("cycleAnnotationOnPropertyInsideLocalClass.kt")
public void testCycleAnnotationOnPropertyInsideLocalClass() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnPropertyInsideLocalClass.kt");
}
@Test
@TestMetadata("cycleAnnotationOnReceiverParameterFunction.kt")
public void testCycleAnnotationOnReceiverParameterFunction() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnReceiverParameterFunction.kt");
}
@Test
@TestMetadata("cycleAnnotationOnReceiverParameterFunctionInsideLocalClass.kt")
public void testCycleAnnotationOnReceiverParameterFunctionInsideLocalClass() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnReceiverParameterFunctionInsideLocalClass.kt");
}
@Test
@TestMetadata("cycleAnnotationOnReceiverParameterProperty.kt")
public void testCycleAnnotationOnReceiverParameterProperty() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnReceiverParameterProperty.kt");
}
@Test
@TestMetadata("cycleAnnotationOnReceiverParameterPropertyInsideLocalClass.kt")
public void testCycleAnnotationOnReceiverParameterPropertyInsideLocalClass() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnReceiverParameterPropertyInsideLocalClass.kt");
}
@Test
@TestMetadata("cycleAnnotationOnTypeParameterFunction.kt")
public void testCycleAnnotationOnTypeParameterFunction() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnTypeParameterFunction.kt");
}
@Test
@TestMetadata("cycleAnnotationOnTypeParameterFunctionInsideLocalClass.kt")
public void testCycleAnnotationOnTypeParameterFunctionInsideLocalClass() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnTypeParameterFunctionInsideLocalClass.kt");
}
@Test
@TestMetadata("cycleAnnotationOnTypeParameterProperty.kt")
public void testCycleAnnotationOnTypeParameterProperty() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnTypeParameterProperty.kt");
}
@Test
@TestMetadata("cycleAnnotationOnTypeParameterPropertyInsideLocalClass.kt")
public void testCycleAnnotationOnTypeParameterPropertyInsideLocalClass() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnTypeParameterPropertyInsideLocalClass.kt");
}
@Test
@TestMetadata("cycleInParameters_after.kt")
public void testCycleInParameters_after() throws Exception {
@@ -1716,6 +1716,102 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated
runTest("compiler/testData/diagnostics/tests/annotations/ConstructorCallAllowed.kt");
}
@Test
@TestMetadata("cycleAnnotationOnFunction.kt")
public void testCycleAnnotationOnFunction() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnFunction.kt");
}
@Test
@TestMetadata("cycleAnnotationOnFunctionInsideLocalClass.kt")
public void testCycleAnnotationOnFunctionInsideLocalClass() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnFunctionInsideLocalClass.kt");
}
@Test
@TestMetadata("cycleAnnotationOnFunctionParameterType.kt")
public void testCycleAnnotationOnFunctionParameterType() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnFunctionParameterType.kt");
}
@Test
@TestMetadata("cycleAnnotationOnFunctionParameterTypeInsideLocalClass.kt")
public void testCycleAnnotationOnFunctionParameterTypeInsideLocalClass() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnFunctionParameterTypeInsideLocalClass.kt");
}
@Test
@TestMetadata("cycleAnnotationOnProperty.kt")
public void testCycleAnnotationOnProperty() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnProperty.kt");
}
@Test
@TestMetadata("cycleAnnotationOnPropertyField.kt")
public void testCycleAnnotationOnPropertyField() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnPropertyField.kt");
}
@Test
@TestMetadata("cycleAnnotationOnPropertyFieldInsideLocalClass.kt")
public void testCycleAnnotationOnPropertyFieldInsideLocalClass() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnPropertyFieldInsideLocalClass.kt");
}
@Test
@TestMetadata("cycleAnnotationOnPropertyInsideLocalClass.kt")
public void testCycleAnnotationOnPropertyInsideLocalClass() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnPropertyInsideLocalClass.kt");
}
@Test
@TestMetadata("cycleAnnotationOnReceiverParameterFunction.kt")
public void testCycleAnnotationOnReceiverParameterFunction() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnReceiverParameterFunction.kt");
}
@Test
@TestMetadata("cycleAnnotationOnReceiverParameterFunctionInsideLocalClass.kt")
public void testCycleAnnotationOnReceiverParameterFunctionInsideLocalClass() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnReceiverParameterFunctionInsideLocalClass.kt");
}
@Test
@TestMetadata("cycleAnnotationOnReceiverParameterProperty.kt")
public void testCycleAnnotationOnReceiverParameterProperty() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnReceiverParameterProperty.kt");
}
@Test
@TestMetadata("cycleAnnotationOnReceiverParameterPropertyInsideLocalClass.kt")
public void testCycleAnnotationOnReceiverParameterPropertyInsideLocalClass() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnReceiverParameterPropertyInsideLocalClass.kt");
}
@Test
@TestMetadata("cycleAnnotationOnTypeParameterFunction.kt")
public void testCycleAnnotationOnTypeParameterFunction() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnTypeParameterFunction.kt");
}
@Test
@TestMetadata("cycleAnnotationOnTypeParameterFunctionInsideLocalClass.kt")
public void testCycleAnnotationOnTypeParameterFunctionInsideLocalClass() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnTypeParameterFunctionInsideLocalClass.kt");
}
@Test
@TestMetadata("cycleAnnotationOnTypeParameterProperty.kt")
public void testCycleAnnotationOnTypeParameterProperty() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnTypeParameterProperty.kt");
}
@Test
@TestMetadata("cycleAnnotationOnTypeParameterPropertyInsideLocalClass.kt")
public void testCycleAnnotationOnTypeParameterPropertyInsideLocalClass() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnTypeParameterPropertyInsideLocalClass.kt");
}
@Test
@TestMetadata("cycleInParameters_after.kt")
public void testCycleInParameters_after() throws Exception {
@@ -1716,6 +1716,102 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir
runTest("compiler/testData/diagnostics/tests/annotations/ConstructorCallAllowed.kt");
}
@Test
@TestMetadata("cycleAnnotationOnFunction.kt")
public void testCycleAnnotationOnFunction() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnFunction.kt");
}
@Test
@TestMetadata("cycleAnnotationOnFunctionInsideLocalClass.kt")
public void testCycleAnnotationOnFunctionInsideLocalClass() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnFunctionInsideLocalClass.kt");
}
@Test
@TestMetadata("cycleAnnotationOnFunctionParameterType.kt")
public void testCycleAnnotationOnFunctionParameterType() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnFunctionParameterType.kt");
}
@Test
@TestMetadata("cycleAnnotationOnFunctionParameterTypeInsideLocalClass.kt")
public void testCycleAnnotationOnFunctionParameterTypeInsideLocalClass() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnFunctionParameterTypeInsideLocalClass.kt");
}
@Test
@TestMetadata("cycleAnnotationOnProperty.kt")
public void testCycleAnnotationOnProperty() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnProperty.kt");
}
@Test
@TestMetadata("cycleAnnotationOnPropertyField.kt")
public void testCycleAnnotationOnPropertyField() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnPropertyField.kt");
}
@Test
@TestMetadata("cycleAnnotationOnPropertyFieldInsideLocalClass.kt")
public void testCycleAnnotationOnPropertyFieldInsideLocalClass() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnPropertyFieldInsideLocalClass.kt");
}
@Test
@TestMetadata("cycleAnnotationOnPropertyInsideLocalClass.kt")
public void testCycleAnnotationOnPropertyInsideLocalClass() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnPropertyInsideLocalClass.kt");
}
@Test
@TestMetadata("cycleAnnotationOnReceiverParameterFunction.kt")
public void testCycleAnnotationOnReceiverParameterFunction() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnReceiverParameterFunction.kt");
}
@Test
@TestMetadata("cycleAnnotationOnReceiverParameterFunctionInsideLocalClass.kt")
public void testCycleAnnotationOnReceiverParameterFunctionInsideLocalClass() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnReceiverParameterFunctionInsideLocalClass.kt");
}
@Test
@TestMetadata("cycleAnnotationOnReceiverParameterProperty.kt")
public void testCycleAnnotationOnReceiverParameterProperty() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnReceiverParameterProperty.kt");
}
@Test
@TestMetadata("cycleAnnotationOnReceiverParameterPropertyInsideLocalClass.kt")
public void testCycleAnnotationOnReceiverParameterPropertyInsideLocalClass() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnReceiverParameterPropertyInsideLocalClass.kt");
}
@Test
@TestMetadata("cycleAnnotationOnTypeParameterFunction.kt")
public void testCycleAnnotationOnTypeParameterFunction() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnTypeParameterFunction.kt");
}
@Test
@TestMetadata("cycleAnnotationOnTypeParameterFunctionInsideLocalClass.kt")
public void testCycleAnnotationOnTypeParameterFunctionInsideLocalClass() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnTypeParameterFunctionInsideLocalClass.kt");
}
@Test
@TestMetadata("cycleAnnotationOnTypeParameterProperty.kt")
public void testCycleAnnotationOnTypeParameterProperty() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnTypeParameterProperty.kt");
}
@Test
@TestMetadata("cycleAnnotationOnTypeParameterPropertyInsideLocalClass.kt")
public void testCycleAnnotationOnTypeParameterPropertyInsideLocalClass() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnTypeParameterPropertyInsideLocalClass.kt");
}
@Test
@TestMetadata("cycleInParameters_after.kt")
public void testCycleInParameters_after() throws Exception {
@@ -1716,6 +1716,102 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia
runTest("compiler/testData/diagnostics/tests/annotations/ConstructorCallAllowed.kt");
}
@Test
@TestMetadata("cycleAnnotationOnFunction.kt")
public void testCycleAnnotationOnFunction() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnFunction.kt");
}
@Test
@TestMetadata("cycleAnnotationOnFunctionInsideLocalClass.kt")
public void testCycleAnnotationOnFunctionInsideLocalClass() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnFunctionInsideLocalClass.kt");
}
@Test
@TestMetadata("cycleAnnotationOnFunctionParameterType.kt")
public void testCycleAnnotationOnFunctionParameterType() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnFunctionParameterType.kt");
}
@Test
@TestMetadata("cycleAnnotationOnFunctionParameterTypeInsideLocalClass.kt")
public void testCycleAnnotationOnFunctionParameterTypeInsideLocalClass() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnFunctionParameterTypeInsideLocalClass.kt");
}
@Test
@TestMetadata("cycleAnnotationOnProperty.kt")
public void testCycleAnnotationOnProperty() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnProperty.kt");
}
@Test
@TestMetadata("cycleAnnotationOnPropertyField.kt")
public void testCycleAnnotationOnPropertyField() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnPropertyField.kt");
}
@Test
@TestMetadata("cycleAnnotationOnPropertyFieldInsideLocalClass.kt")
public void testCycleAnnotationOnPropertyFieldInsideLocalClass() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnPropertyFieldInsideLocalClass.kt");
}
@Test
@TestMetadata("cycleAnnotationOnPropertyInsideLocalClass.kt")
public void testCycleAnnotationOnPropertyInsideLocalClass() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnPropertyInsideLocalClass.kt");
}
@Test
@TestMetadata("cycleAnnotationOnReceiverParameterFunction.kt")
public void testCycleAnnotationOnReceiverParameterFunction() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnReceiverParameterFunction.kt");
}
@Test
@TestMetadata("cycleAnnotationOnReceiverParameterFunctionInsideLocalClass.kt")
public void testCycleAnnotationOnReceiverParameterFunctionInsideLocalClass() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnReceiverParameterFunctionInsideLocalClass.kt");
}
@Test
@TestMetadata("cycleAnnotationOnReceiverParameterProperty.kt")
public void testCycleAnnotationOnReceiverParameterProperty() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnReceiverParameterProperty.kt");
}
@Test
@TestMetadata("cycleAnnotationOnReceiverParameterPropertyInsideLocalClass.kt")
public void testCycleAnnotationOnReceiverParameterPropertyInsideLocalClass() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnReceiverParameterPropertyInsideLocalClass.kt");
}
@Test
@TestMetadata("cycleAnnotationOnTypeParameterFunction.kt")
public void testCycleAnnotationOnTypeParameterFunction() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnTypeParameterFunction.kt");
}
@Test
@TestMetadata("cycleAnnotationOnTypeParameterFunctionInsideLocalClass.kt")
public void testCycleAnnotationOnTypeParameterFunctionInsideLocalClass() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnTypeParameterFunctionInsideLocalClass.kt");
}
@Test
@TestMetadata("cycleAnnotationOnTypeParameterProperty.kt")
public void testCycleAnnotationOnTypeParameterProperty() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnTypeParameterProperty.kt");
}
@Test
@TestMetadata("cycleAnnotationOnTypeParameterPropertyInsideLocalClass.kt")
public void testCycleAnnotationOnTypeParameterPropertyInsideLocalClass() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnTypeParameterPropertyInsideLocalClass.kt");
}
@Test
@TestMetadata("cycleInParameters_after.kt")
public void testCycleInParameters_after() throws Exception {
@@ -0,0 +1,6 @@
package myPack
annotation class Anno(val number: Int)
@Anno(<!ANNOTATION_ARGUMENT_MUST_BE_CONST, TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM!>function(42)<!>)
fun function(@Anno(<!ANNOTATION_ARGUMENT_MUST_BE_CONST, TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM!>function(24)<!>) param: Int = <!TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM!>function(0)<!>) = 1
@@ -0,0 +1,6 @@
package myPack
annotation class Anno(val number: Int)
@Anno(<!ANNOTATION_ARGUMENT_MUST_BE_CONST!>function(42)<!>)
fun function(@Anno(<!ANNOTATION_ARGUMENT_MUST_BE_CONST!>function(24)<!>) param: Int = function(0)) = 1
@@ -0,0 +1,10 @@
package myPack
annotation class Anno(val number: Int)
fun topLevelFun() {
class LocalClass {
@Anno(<!TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM!>function(42)<!>)
fun function(@Anno(<!TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM!>function(24)<!>) param: Int = <!TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM!>function(0)<!>) = 1
}
}
@@ -0,0 +1,10 @@
package myPack
annotation class Anno(val number: Int)
fun topLevelFun() {
class LocalClass {
@Anno(<!ANNOTATION_ARGUMENT_MUST_BE_CONST!>function(42)<!>)
fun function(@Anno(<!ANNOTATION_ARGUMENT_MUST_BE_CONST!>function(24)<!>) param: Int = function(0)) = 1
}
}
@@ -0,0 +1,5 @@
java.lang.AssertionError: Recursion detected on input: function under LockBasedStorageManager@5adb4b3a (TopDownAnalyzer for JVM)
at org.jetbrains.kotlin.resolve.lazy.descriptors.AbstractLazyMemberScope.getContributedFunctions(AbstractLazyMemberScope.kt:97)
at org.jetbrains.kotlin.resolve.scopes.ChainedMemberScope.getContributedFunctions(ChainedMemberScope.kt:41)
at org.jetbrains.kotlin.resolve.scopes.AbstractScopeAdapter.getContributedFunctions(AbstractScopeAdapter.kt:40)
at org.jetbrains.kotlin.resolve.lazy.FileScopeFactory$currentPackageScope$1.getContributedFunctions(FileScopeFactory.kt:289)
@@ -0,0 +1,7 @@
// FIR_IDENTICAL
package myPack
@Target(AnnotationTarget.TYPE)
annotation class Anno(val number: Int)
fun function(param: @Anno(<!ANNOTATION_ARGUMENT_MUST_BE_CONST, TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM!>function(42)<!>) Int) = 1
@@ -0,0 +1,10 @@
java.lang.AssertionError: Recursion detected on input: function under LockBasedStorageManager@6b989874 (TopDownAnalyzer for JVM)
at org.jetbrains.kotlin.resolve.lazy.descriptors.AbstractLazyMemberScope.getContributedFunctions(AbstractLazyMemberScope.kt:97)
at org.jetbrains.kotlin.resolve.lazy.descriptors.LazyClassMemberScope.getContributedFunctions(LazyClassMemberScope.kt:280)
at org.jetbrains.kotlin.resolve.calls.tower.TowerLevelsKt.getContributedFunctionsAndIntercept(TowerLevels.kt:510)
at org.jetbrains.kotlin.resolve.calls.tower.TowerLevelsKt.access$getContributedFunctionsAndIntercept(TowerLevels.kt:1)
at org.jetbrains.kotlin.resolve.calls.tower.MemberScopeTowerLevel$getFunctions$1.invoke(TowerLevels.kt:194)
at org.jetbrains.kotlin.resolve.calls.tower.MemberScopeTowerLevel$getFunctions$1.invoke(TowerLevels.kt:193)
at org.jetbrains.kotlin.resolve.calls.tower.MemberScopeTowerLevel.collectMembers(TowerLevels.kt:106)
at org.jetbrains.kotlin.resolve.calls.tower.MemberScopeTowerLevel.getFunctions(TowerLevels.kt:193)
at org.jetbrains.kotlin.resolve.calls.tower.ScopeTowerProcessorsKt$createSimpleFunctionProcessor$1.invoke(ScopeTowerProcessors.kt:304)
@@ -0,0 +1,11 @@
// FIR_IDENTICAL
package myPack
@Target(AnnotationTarget.TYPE)
annotation class Anno(val number: Int)
fun topLevelFun() {
class LocalClass {
fun function(param: @Anno(<!TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM!>function(42)<!>) Int) = 1
}
}
@@ -0,0 +1,10 @@
package myPack
annotation class Anno(val number: Int)
@Anno(<!ANNOTATION_ARGUMENT_MUST_BE_CONST, TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM!>prop<!>)
var prop
@Anno(<!ANNOTATION_ARGUMENT_MUST_BE_CONST, TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM!>prop<!>)
get() = 22
@Anno(<!ANNOTATION_ARGUMENT_MUST_BE_CONST!>prop<!>)
set(@Anno(<!ANNOTATION_ARGUMENT_MUST_BE_CONST!>prop<!>) value) = Unit
@@ -0,0 +1,10 @@
package myPack
annotation class Anno(val number: Int)
@Anno(<!ANNOTATION_ARGUMENT_MUST_BE_CONST!>prop<!>)
var prop
@Anno(<!ANNOTATION_ARGUMENT_MUST_BE_CONST!>prop<!>)
get() = 22
@Anno(<!ANNOTATION_ARGUMENT_MUST_BE_CONST!>prop<!>)
set(@Anno(<!ANNOTATION_ARGUMENT_MUST_BE_CONST!>prop<!>) value) = Unit
@@ -0,0 +1,12 @@
// FIR_IDENTICAL
package myPack
annotation class Anno(val number: String)
@Anno(<!ANNOTATION_ARGUMENT_MUST_BE_CONST!>variableToResolve<!>)
@field:Anno(<!ANNOTATION_ARGUMENT_MUST_BE_CONST!>variableToResolve<!>)
var variableToResolve = "${42}"
@Anno(<!ANNOTATION_ARGUMENT_MUST_BE_CONST!>variableToResolve<!>)
get() = field + "str"
@Anno(<!ANNOTATION_ARGUMENT_MUST_BE_CONST!>variableToResolve<!>)
set(@Anno(<!ANNOTATION_ARGUMENT_MUST_BE_CONST!>variableToResolve<!>) value) = Unit
@@ -0,0 +1,15 @@
package myPack
annotation class Anno(val number: String)
fun topLevelFun() {
class LocalClass {
@Anno(variableToResolve)
@field:Anno(variableToResolve)
var variableToResolve = "${42}"
@Anno(variableToResolve)
get() = field + "str"
@Anno(variableToResolve)
set(@Anno(variableToResolve) value) = Unit
}
}
@@ -0,0 +1,15 @@
package myPack
annotation class Anno(val number: String)
fun topLevelFun() {
class LocalClass {
@Anno(<!ANNOTATION_ARGUMENT_MUST_BE_CONST!>variableToResolve<!>)
@field:Anno(<!ANNOTATION_ARGUMENT_MUST_BE_CONST!>variableToResolve<!>)
var variableToResolve = "${42}"
@Anno(<!ANNOTATION_ARGUMENT_MUST_BE_CONST!>variableToResolve<!>)
get() = field + "str"
@Anno(<!ANNOTATION_ARGUMENT_MUST_BE_CONST!>variableToResolve<!>)
set(@Anno(<!ANNOTATION_ARGUMENT_MUST_BE_CONST!>variableToResolve<!>) value) = Unit
}
}
@@ -0,0 +1,14 @@
package myPack
annotation class Anno(val number: Int)
fun topLevel() {
class LocalClass {
@Anno(<!TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM!>prop<!>)
var prop
@Anno(<!TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM!>prop<!>)
get() = 22
@Anno(prop)
set(@Anno(prop) value) = Unit
}
}
@@ -0,0 +1,14 @@
package myPack
annotation class Anno(val number: Int)
fun topLevel() {
class LocalClass {
@Anno(<!ANNOTATION_ARGUMENT_MUST_BE_CONST!>prop<!>)
var prop
@Anno(<!ANNOTATION_ARGUMENT_MUST_BE_CONST!>prop<!>)
get() = 22
@Anno(<!ANNOTATION_ARGUMENT_MUST_BE_CONST!>prop<!>)
set(@Anno(<!ANNOTATION_ARGUMENT_MUST_BE_CONST!>prop<!>) value) = Unit
}
}
@@ -0,0 +1,5 @@
package myPack
annotation class Anno(val number: Int)
fun @receiver:Anno(<!ANNOTATION_ARGUMENT_MUST_BE_CONST, TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM!>42.function()<!>) Int.function() = 1
@@ -0,0 +1,5 @@
package myPack
annotation class Anno(val number: Int)
fun @receiver:Anno(<!ANNOTATION_ARGUMENT_MUST_BE_CONST!>42.function()<!>) Int.function() = 1
@@ -0,0 +1,9 @@
package myPack
annotation class Anno(val number: Int)
fun topLevelFun() {
class LocalClass {
fun @receiver:Anno(<!TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM!>42.function()<!>) Int.function() = 1
}
}
@@ -0,0 +1,9 @@
package myPack
annotation class Anno(val number: Int)
fun topLevelFun() {
class LocalClass {
fun @receiver:Anno(<!ANNOTATION_ARGUMENT_MUST_BE_CONST!>42.function()<!>) Int.function() = 1
}
}
@@ -0,0 +1,5 @@
package myPack
annotation class Anno(val number: Int)
val @receiver:Anno(<!ANNOTATION_ARGUMENT_MUST_BE_CONST, TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM!>42.prop<!>) Int.prop get() = 22
@@ -0,0 +1,5 @@
package myPack
annotation class Anno(val number: Int)
val @receiver:Anno(<!ANNOTATION_ARGUMENT_MUST_BE_CONST!>42.prop<!>) Int.prop get() = 22
@@ -0,0 +1,9 @@
package myPack
annotation class Anno(val number: Int)
fun topLevelFun() {
class LocalClass {
val @receiver:Anno(42.<!UNRESOLVED_REFERENCE!>prop<!>) Int.prop get() = 22
}
}
@@ -0,0 +1,9 @@
package myPack
annotation class Anno(val number: Int)
fun topLevelFun() {
class LocalClass {
val @receiver:Anno(<!ANNOTATION_ARGUMENT_MUST_BE_CONST!>42.prop<!>) Int.prop get() = 22
}
}
@@ -0,0 +1,7 @@
java.lang.AssertionError: Recursion detected on input: function under LockBasedStorageManager@71c18c53 (TopDownAnalyzer for JVM)
at org.jetbrains.kotlin.resolve.lazy.descriptors.AbstractLazyMemberScope.getContributedFunctions(AbstractLazyMemberScope.kt:97)
at org.jetbrains.kotlin.resolve.scopes.ChainedMemberScope.getContributedFunctions(ChainedMemberScope.kt:41)
at org.jetbrains.kotlin.resolve.scopes.AbstractScopeAdapter.getContributedFunctions(AbstractScopeAdapter.kt:40)
at org.jetbrains.kotlin.resolve.lazy.FileScopeFactory$currentPackageScope$1.getContributedFunctions(FileScopeFactory.kt:289)
at org.jetbrains.kotlin.resolve.calls.tower.TowerLevelsKt.getContributedFunctionsAndConstructors(TowerLevels.kt:474)
at org.jetbrains.kotlin.resolve.calls.tower.TowerLevelsKt.access$getContributedFunctionsAndConstructors(TowerLevels.kt:1)
@@ -0,0 +1,7 @@
// FIR_IDENTICAL
package myPack
@Target(AnnotationTarget.TYPE_PARAMETER)
annotation class Anno(val number: Int)
fun <@Anno(<!ANNOTATION_ARGUMENT_MUST_BE_CONST, TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM!>function<String>()<!>) T> function() = 1
@@ -0,0 +1,10 @@
java.lang.AssertionError: Recursion detected on input: function under LockBasedStorageManager@442128d8 (TopDownAnalyzer for JVM)
at org.jetbrains.kotlin.resolve.lazy.descriptors.AbstractLazyMemberScope.getContributedFunctions(AbstractLazyMemberScope.kt:97)
at org.jetbrains.kotlin.resolve.lazy.descriptors.LazyClassMemberScope.getContributedFunctions(LazyClassMemberScope.kt:280)
at org.jetbrains.kotlin.resolve.calls.tower.TowerLevelsKt.getContributedFunctionsAndIntercept(TowerLevels.kt:510)
at org.jetbrains.kotlin.resolve.calls.tower.TowerLevelsKt.access$getContributedFunctionsAndIntercept(TowerLevels.kt:1)
at org.jetbrains.kotlin.resolve.calls.tower.MemberScopeTowerLevel$getFunctions$1.invoke(TowerLevels.kt:194)
at org.jetbrains.kotlin.resolve.calls.tower.MemberScopeTowerLevel$getFunctions$1.invoke(TowerLevels.kt:193)
at org.jetbrains.kotlin.resolve.calls.tower.MemberScopeTowerLevel.collectMembers(TowerLevels.kt:106)
at org.jetbrains.kotlin.resolve.calls.tower.MemberScopeTowerLevel.getFunctions(TowerLevels.kt:193)
at org.jetbrains.kotlin.resolve.calls.tower.ScopeTowerProcessorsKt$createSimpleFunctionProcessor$1.invoke(ScopeTowerProcessors.kt:304)
@@ -0,0 +1,11 @@
// FIR_IDENTICAL
package myPack
@Target(AnnotationTarget.TYPE_PARAMETER)
annotation class Anno(val number: Int)
fun topLevelFun() {
class LocalClass {
fun <@Anno(<!TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM!>function<String>()<!>) T> function() = 1
}
}
@@ -0,0 +1,8 @@
java.lang.AssertionError: Recursion detected on input: prop under LockBasedStorageManager@6e6cdd1d (TopDownAnalyzer for JVM)
at org.jetbrains.kotlin.resolve.lazy.descriptors.AbstractLazyMemberScope.getContributedVariables(AbstractLazyMemberScope.kt:144)
at org.jetbrains.kotlin.resolve.scopes.ChainedMemberScope.getContributedVariables(ChainedMemberScope.kt:38)
at org.jetbrains.kotlin.resolve.scopes.AbstractScopeAdapter.getContributedVariables(AbstractScopeAdapter.kt:48)
at org.jetbrains.kotlin.resolve.lazy.FileScopeFactory$currentPackageScope$1.getContributedVariables(FileScopeFactory.kt:283)
at org.jetbrains.kotlin.resolve.calls.tower.TowerLevelsKt.getContributedVariablesAndIntercept(TowerLevels.kt:498)
at org.jetbrains.kotlin.resolve.calls.tower.TowerLevelsKt.access$getContributedVariablesAndIntercept(TowerLevels.kt:1)
at org.jetbrains.kotlin.resolve.calls.tower.ScopeBasedTowerLevel.getVariables(TowerLevels.kt:329)
@@ -0,0 +1,7 @@
// FIR_IDENTICAL
package myPack
@Target(AnnotationTarget.TYPE_PARAMETER)
annotation class Anno(val number: Int)
val <@Anno(<!ANNOTATION_ARGUMENT_MUST_BE_CONST, TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM!>42.prop<!>) T> T.prop get() = 22
@@ -0,0 +1,9 @@
java.lang.AssertionError: Recursion detected on input: prop under LockBasedStorageManager@38c6a10 (TopDownAnalyzer for JVM)
at org.jetbrains.kotlin.resolve.lazy.descriptors.AbstractLazyMemberScope.getContributedVariables(AbstractLazyMemberScope.kt:144)
at org.jetbrains.kotlin.resolve.lazy.descriptors.LazyClassMemberScope.getContributedVariables(LazyClassMemberScope.kt:409)
at org.jetbrains.kotlin.resolve.calls.tower.TowerLevelsKt.getContributedVariablesAndIntercept(TowerLevels.kt:498)
at org.jetbrains.kotlin.resolve.calls.tower.TowerLevelsKt.access$getContributedVariablesAndIntercept(TowerLevels.kt:1)
at org.jetbrains.kotlin.resolve.calls.tower.MemberScopeTowerLevel$getVariables$1.invoke(TowerLevels.kt:179)
at org.jetbrains.kotlin.resolve.calls.tower.MemberScopeTowerLevel$getVariables$1.invoke(TowerLevels.kt:179)
at org.jetbrains.kotlin.resolve.calls.tower.MemberScopeTowerLevel.collectMembers(TowerLevels.kt:106)
at org.jetbrains.kotlin.resolve.calls.tower.MemberScopeTowerLevel.getVariables(TowerLevels.kt:179)
@@ -0,0 +1,11 @@
// FIR_IDENTICAL
package myPack
@Target(AnnotationTarget.TYPE_PARAMETER)
annotation class Anno(val number: Int)
fun topLevelFun() {
class LocalClass {
val <@Anno(42.<!UNRESOLVED_REFERENCE!>prop<!>) T> T.prop get() = 22
}
}
@@ -1716,6 +1716,102 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
runTest("compiler/testData/diagnostics/tests/annotations/ConstructorCallAllowed.kt");
}
@Test
@TestMetadata("cycleAnnotationOnFunction.kt")
public void testCycleAnnotationOnFunction() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnFunction.kt");
}
@Test
@TestMetadata("cycleAnnotationOnFunctionInsideLocalClass.kt")
public void testCycleAnnotationOnFunctionInsideLocalClass() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnFunctionInsideLocalClass.kt");
}
@Test
@TestMetadata("cycleAnnotationOnFunctionParameterType.kt")
public void testCycleAnnotationOnFunctionParameterType() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnFunctionParameterType.kt");
}
@Test
@TestMetadata("cycleAnnotationOnFunctionParameterTypeInsideLocalClass.kt")
public void testCycleAnnotationOnFunctionParameterTypeInsideLocalClass() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnFunctionParameterTypeInsideLocalClass.kt");
}
@Test
@TestMetadata("cycleAnnotationOnProperty.kt")
public void testCycleAnnotationOnProperty() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnProperty.kt");
}
@Test
@TestMetadata("cycleAnnotationOnPropertyField.kt")
public void testCycleAnnotationOnPropertyField() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnPropertyField.kt");
}
@Test
@TestMetadata("cycleAnnotationOnPropertyFieldInsideLocalClass.kt")
public void testCycleAnnotationOnPropertyFieldInsideLocalClass() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnPropertyFieldInsideLocalClass.kt");
}
@Test
@TestMetadata("cycleAnnotationOnPropertyInsideLocalClass.kt")
public void testCycleAnnotationOnPropertyInsideLocalClass() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnPropertyInsideLocalClass.kt");
}
@Test
@TestMetadata("cycleAnnotationOnReceiverParameterFunction.kt")
public void testCycleAnnotationOnReceiverParameterFunction() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnReceiverParameterFunction.kt");
}
@Test
@TestMetadata("cycleAnnotationOnReceiverParameterFunctionInsideLocalClass.kt")
public void testCycleAnnotationOnReceiverParameterFunctionInsideLocalClass() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnReceiverParameterFunctionInsideLocalClass.kt");
}
@Test
@TestMetadata("cycleAnnotationOnReceiverParameterProperty.kt")
public void testCycleAnnotationOnReceiverParameterProperty() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnReceiverParameterProperty.kt");
}
@Test
@TestMetadata("cycleAnnotationOnReceiverParameterPropertyInsideLocalClass.kt")
public void testCycleAnnotationOnReceiverParameterPropertyInsideLocalClass() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnReceiverParameterPropertyInsideLocalClass.kt");
}
@Test
@TestMetadata("cycleAnnotationOnTypeParameterFunction.kt")
public void testCycleAnnotationOnTypeParameterFunction() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnTypeParameterFunction.kt");
}
@Test
@TestMetadata("cycleAnnotationOnTypeParameterFunctionInsideLocalClass.kt")
public void testCycleAnnotationOnTypeParameterFunctionInsideLocalClass() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnTypeParameterFunctionInsideLocalClass.kt");
}
@Test
@TestMetadata("cycleAnnotationOnTypeParameterProperty.kt")
public void testCycleAnnotationOnTypeParameterProperty() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnTypeParameterProperty.kt");
}
@Test
@TestMetadata("cycleAnnotationOnTypeParameterPropertyInsideLocalClass.kt")
public void testCycleAnnotationOnTypeParameterPropertyInsideLocalClass() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnTypeParameterPropertyInsideLocalClass.kt");
}
@Test
@TestMetadata("cycleInParameters_after.kt")
public void testCycleInParameters_after() throws Exception {