[LL/FIR] add more resolve tests for declarations with annotations

^KT-63042
This commit is contained in:
Dmitrii Gridin
2023-11-28 17:30:13 +01:00
committed by Space Team
parent 5bd1a97632
commit 69559689fd
156 changed files with 25942 additions and 0 deletions
@@ -2046,6 +2046,12 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir
runTest("compiler/testData/diagnostics/tests/annotations/kt1886annotationBody_before.kt");
}
@Test
@TestMetadata("localImplicitTypeUnavailable.kt")
public void testLocalImplicitTypeUnavailable() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/localImplicitTypeUnavailable.kt");
}
@Test
@TestMetadata("missingValOnParameter.kt")
public void testMissingValOnParameter() throws Exception {
@@ -2148,6 +2154,30 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir
runTest("compiler/testData/diagnostics/tests/annotations/onMultiDeclaration.kt");
}
@Test
@TestMetadata("propagationAnnotationToLocalMemberFunction.kt")
public void testPropagationAnnotationToLocalMemberFunction() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/propagationAnnotationToLocalMemberFunction.kt");
}
@Test
@TestMetadata("propagationBetweenLocalMemberProperties.kt")
public void testPropagationBetweenLocalMemberProperties() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/propagationBetweenLocalMemberProperties.kt");
}
@Test
@TestMetadata("propagationFromLocalMemberFunctionAnnotation.kt")
public void testPropagationFromLocalMemberFunctionAnnotation() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/propagationFromLocalMemberFunctionAnnotation.kt");
}
@Test
@TestMetadata("propagationToLocalMemberProperty.kt")
public void testPropagationToLocalMemberProperty() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/propagationToLocalMemberProperty.kt");
}
@Test
@TestMetadata("qualifiedNestedClassAsAnnotationParameter.kt")
public void testQualifiedNestedClassAsAnnotationParameter() throws Exception {
@@ -2052,6 +2052,12 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia
runTest("compiler/testData/diagnostics/tests/annotations/kt1886annotationBody_before.kt");
}
@Test
@TestMetadata("localImplicitTypeUnavailable.kt")
public void testLocalImplicitTypeUnavailable() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/localImplicitTypeUnavailable.kt");
}
@Test
@TestMetadata("missingValOnParameter.kt")
public void testMissingValOnParameter() throws Exception {
@@ -2154,6 +2160,30 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia
runTest("compiler/testData/diagnostics/tests/annotations/onMultiDeclaration.kt");
}
@Test
@TestMetadata("propagationAnnotationToLocalMemberFunction.kt")
public void testPropagationAnnotationToLocalMemberFunction() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/propagationAnnotationToLocalMemberFunction.kt");
}
@Test
@TestMetadata("propagationBetweenLocalMemberProperties.kt")
public void testPropagationBetweenLocalMemberProperties() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/propagationBetweenLocalMemberProperties.kt");
}
@Test
@TestMetadata("propagationFromLocalMemberFunctionAnnotation.kt")
public void testPropagationFromLocalMemberFunctionAnnotation() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/propagationFromLocalMemberFunctionAnnotation.kt");
}
@Test
@TestMetadata("propagationToLocalMemberProperty.kt")
public void testPropagationToLocalMemberProperty() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/propagationToLocalMemberProperty.kt");
}
@Test
@TestMetadata("qualifiedNestedClassAsAnnotationParameter.kt")
public void testQualifiedNestedClassAsAnnotationParameter() throws Exception {
@@ -0,0 +1,23 @@
// FIR_IDENTICAL
package second
import kotlin.reflect.KClass
@Target(AnnotationTarget.TYPE)
annotation class Anno(val str: KClass<*>)
fun check() {
class A {
val bar get() = B().foo
fun baz() = B().doo()
private inner class B {
var foo: @Anno(C::class) List<@Anno(C::class) Collection<@Anno(C::class) String>>? = null
fun doo(): @Anno(C::class) List<@Anno(C::class) Collection<@Anno(C::class) String>>? = null
private inner class C
}
}
val a = A().bar
val b = A().baz()
}
@@ -0,0 +1,14 @@
// FIR_IDENTICAL
@Target(AnnotationTarget.TYPE)
annotation class Anno(val str: String)
const val prop = "str"
fun bar(): @Anno("bar $prop") List<@Anno("nested bar $prop") Collection<@Anno("nested nested bar $prop") Int>>? = null
fun foo() {
class Local {
fun doo() = foo()
fun foo() = bar()
fun baz() = foo()
}
}
@@ -0,0 +1,15 @@
// FIR_IDENTICAL
package util
@Target(AnnotationTarget.TYPE)
annotation class Anno(val str: String)
const val prop = "str"
fun foo() {
class Local {
val foo get() = bar
var bar: @Anno("bar $prop") List<@Anno("nested bar $prop") Collection<@Anno("nested nested bar $prop") Int>>? = null
var foo2 = bar
}
}
@@ -0,0 +1,12 @@
// FIR_IDENTICAL
@Target(AnnotationTarget.TYPE)
annotation class Anno(val str: String)
const val prop = "str"
fun foo() {
class Local {
fun foo() = bar()
fun bar(): @Anno("bar $prop") List<@Anno("nested bar $prop") Collection<@Anno("nested nested bar $prop") Int>>? = null
fun baz() = bar()
}
}
@@ -0,0 +1,16 @@
// FIR_IDENTICAL
package util
@Target(AnnotationTarget.TYPE)
annotation class Anno(val str: String)
const val prop = "str"
var bar: @Anno("bar $prop") List<@Anno("nested bar $prop") Collection<@Anno("nested nested bar $prop") Int>>? = null
fun foo() {
class Local {
val doo get() = foo
var foo = bar
var baz = foo
}
}
@@ -2052,6 +2052,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
runTest("compiler/testData/diagnostics/tests/annotations/kt1886annotationBody_before.kt");
}
@Test
@TestMetadata("localImplicitTypeUnavailable.kt")
public void testLocalImplicitTypeUnavailable() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/localImplicitTypeUnavailable.kt");
}
@Test
@TestMetadata("missingValOnParameter.kt")
public void testMissingValOnParameter() throws Exception {
@@ -2154,6 +2160,30 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
runTest("compiler/testData/diagnostics/tests/annotations/onMultiDeclaration.kt");
}
@Test
@TestMetadata("propagationAnnotationToLocalMemberFunction.kt")
public void testPropagationAnnotationToLocalMemberFunction() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/propagationAnnotationToLocalMemberFunction.kt");
}
@Test
@TestMetadata("propagationBetweenLocalMemberProperties.kt")
public void testPropagationBetweenLocalMemberProperties() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/propagationBetweenLocalMemberProperties.kt");
}
@Test
@TestMetadata("propagationFromLocalMemberFunctionAnnotation.kt")
public void testPropagationFromLocalMemberFunctionAnnotation() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/propagationFromLocalMemberFunctionAnnotation.kt");
}
@Test
@TestMetadata("propagationToLocalMemberProperty.kt")
public void testPropagationToLocalMemberProperty() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/propagationToLocalMemberProperty.kt");
}
@Test
@TestMetadata("qualifiedNestedClassAsAnnotationParameter.kt")
public void testQualifiedNestedClassAsAnnotationParameter() throws Exception {