[LL FIR] add test on lazy resolve annotation with type argument

^KT-56543
This commit is contained in:
Dmitrii Gridin
2023-03-23 09:05:19 +01:00
committed by Space Team
parent 8c599a84af
commit bc5c1b2a6c
4 changed files with 222 additions and 0 deletions
@@ -0,0 +1,8 @@
package one
annotation class Anno<T : Number>(val value: KClass<T>)
@Anno<Int>(Int::class)
fun resolveMe() {
}
@@ -0,0 +1,202 @@
RAW_FIR:
FILE: [RAW_FIR] annotationWithTypeArgument.kt
[RAW_FIR] annotations container
public? final? [RAW_FIR] annotation class Anno<[RAW_FIR] T : Number> : R|kotlin/Annotation| {
public? [RAW_FIR] [ContainingClassKey=Anno] constructor<[RAW_FIR] T : Number>([RAW_FIR] [CorrespondingProperty=one/Anno.value] value: KClass<T>): R|one/Anno<T>| {
LAZY_super<R|kotlin/Any|>
}
public? final? [RAW_FIR] [IsFromPrimaryConstructor=true] val value: KClass<T> = R|<local>/value|
public? [RAW_FIR] [ContainingClassKey=Anno] get(): KClass<T>
}
@Anno<Int>(LAZY_EXPRESSION) public? final? [RAW_FIR] fun resolveMe(): R|kotlin/Unit| { LAZY_BLOCK }
IMPORTS:
FILE: [IMPORTS] annotationWithTypeArgument.kt
[RAW_FIR] annotations container
public? final? [RAW_FIR] annotation class Anno<[RAW_FIR] T : Number> : R|kotlin/Annotation| {
public? [RAW_FIR] [ContainingClassKey=Anno] constructor<[RAW_FIR] T : Number>([RAW_FIR] [CorrespondingProperty=one/Anno.value] value: KClass<T>): R|one/Anno<T>| {
LAZY_super<R|kotlin/Any|>
}
public? final? [RAW_FIR] [IsFromPrimaryConstructor=true] val value: KClass<T> = R|<local>/value|
public? [RAW_FIR] [ContainingClassKey=Anno] get(): KClass<T>
}
@Anno<Int>(LAZY_EXPRESSION) public? final? [RAW_FIR] fun resolveMe(): R|kotlin/Unit| { LAZY_BLOCK }
COMPILER_REQUIRED_ANNOTATIONS:
FILE: [IMPORTS] annotationWithTypeArgument.kt
[RAW_FIR] annotations container
public? final? [RAW_FIR] annotation class Anno<[RAW_FIR] T : Number> : R|kotlin/Annotation| {
public? [RAW_FIR] [ContainingClassKey=Anno] constructor<[RAW_FIR] T : Number>([RAW_FIR] [CorrespondingProperty=one/Anno.value] value: KClass<T>): R|one/Anno<T>| {
LAZY_super<R|kotlin/Any|>
}
public? final? [RAW_FIR] [IsFromPrimaryConstructor=true] val value: KClass<T> = R|<local>/value|
public? [RAW_FIR] [ContainingClassKey=Anno] get(): KClass<T>
}
@Anno<Int>(LAZY_EXPRESSION) public? final? [COMPILER_REQUIRED_ANNOTATIONS] fun resolveMe(): R|kotlin/Unit| { LAZY_BLOCK }
COMPANION_GENERATION:
FILE: [IMPORTS] annotationWithTypeArgument.kt
[RAW_FIR] annotations container
public? final? [RAW_FIR] annotation class Anno<[RAW_FIR] T : Number> : R|kotlin/Annotation| {
public? [RAW_FIR] [ContainingClassKey=Anno] constructor<[RAW_FIR] T : Number>([RAW_FIR] [CorrespondingProperty=one/Anno.value] value: KClass<T>): R|one/Anno<T>| {
LAZY_super<R|kotlin/Any|>
}
public? final? [RAW_FIR] [IsFromPrimaryConstructor=true] val value: KClass<T> = R|<local>/value|
public? [RAW_FIR] [ContainingClassKey=Anno] get(): KClass<T>
}
@Anno<Int>(LAZY_EXPRESSION) public? final? [COMPANION_GENERATION] fun resolveMe(): R|kotlin/Unit| { LAZY_BLOCK }
SUPER_TYPES:
FILE: [IMPORTS] annotationWithTypeArgument.kt
[RAW_FIR] annotations container
public? final? [RAW_FIR] annotation class Anno<[RAW_FIR] T : Number> : R|kotlin/Annotation| {
public? [RAW_FIR] [ContainingClassKey=Anno] constructor<[RAW_FIR] T : Number>([RAW_FIR] [CorrespondingProperty=one/Anno.value] value: KClass<T>): R|one/Anno<T>| {
LAZY_super<R|kotlin/Any|>
}
public? final? [RAW_FIR] [IsFromPrimaryConstructor=true] val value: KClass<T> = R|<local>/value|
public? [RAW_FIR] [ContainingClassKey=Anno] get(): KClass<T>
}
@Anno<Int>(LAZY_EXPRESSION) public? final? [SUPER_TYPES] fun resolveMe(): R|kotlin/Unit| { LAZY_BLOCK }
TYPES:
FILE: [IMPORTS] annotationWithTypeArgument.kt
[RAW_FIR] annotations container
public? final? [RAW_FIR] annotation class Anno<[RAW_FIR] T : Number> : R|kotlin/Annotation| {
public? [RAW_FIR] [ContainingClassKey=Anno] constructor<[RAW_FIR] T : Number>([RAW_FIR] [CorrespondingProperty=one/Anno.value] value: KClass<T>): R|one/Anno<T>| {
LAZY_super<R|kotlin/Any|>
}
public? final? [RAW_FIR] [IsFromPrimaryConstructor=true] val value: KClass<T> = R|<local>/value|
public? [RAW_FIR] [ContainingClassKey=Anno] get(): KClass<T>
}
@R|one/Anno<kotlin/Int>|(LAZY_EXPRESSION) public? final? [TYPES] fun resolveMe(): R|kotlin/Unit| { LAZY_BLOCK }
STATUS:
FILE: [IMPORTS] annotationWithTypeArgument.kt
[RAW_FIR] annotations container
public? final? [RAW_FIR] annotation class Anno<[RAW_FIR] T : Number> : R|kotlin/Annotation| {
public? [RAW_FIR] [ContainingClassKey=Anno] constructor<[RAW_FIR] T : Number>([RAW_FIR] [CorrespondingProperty=one/Anno.value] value: KClass<T>): R|one/Anno<T>| {
LAZY_super<R|kotlin/Any|>
}
public? final? [RAW_FIR] [IsFromPrimaryConstructor=true] val value: KClass<T> = R|<local>/value|
public? [RAW_FIR] [ContainingClassKey=Anno] get(): KClass<T>
}
@R|one/Anno<kotlin/Int>|(LAZY_EXPRESSION) public final [STATUS] fun resolveMe(): R|kotlin/Unit| { LAZY_BLOCK }
EXPECT_ACTUAL_MATCHING:
FILE: [IMPORTS] annotationWithTypeArgument.kt
[RAW_FIR] annotations container
public? final? [RAW_FIR] annotation class Anno<[RAW_FIR] T : Number> : R|kotlin/Annotation| {
public? [RAW_FIR] [ContainingClassKey=Anno] constructor<[RAW_FIR] T : Number>([RAW_FIR] [CorrespondingProperty=one/Anno.value] value: KClass<T>): R|one/Anno<T>| {
LAZY_super<R|kotlin/Any|>
}
public? final? [RAW_FIR] [IsFromPrimaryConstructor=true] val value: KClass<T> = R|<local>/value|
public? [RAW_FIR] [ContainingClassKey=Anno] get(): KClass<T>
}
@R|one/Anno<kotlin/Int>|(<getClass>(Int#)) public final [EXPECT_ACTUAL_MATCHING] fun resolveMe(): R|kotlin/Unit| {
}
ARGUMENTS_OF_ANNOTATIONS:
FILE: [IMPORTS] annotationWithTypeArgument.kt
[RAW_FIR] annotations container
public? final? [RAW_FIR] annotation class Anno<[RAW_FIR] T : Number> : R|kotlin/Annotation| {
public? [RAW_FIR] [ContainingClassKey=Anno] constructor<[RAW_FIR] T : Number>([RAW_FIR] [CorrespondingProperty=one/Anno.value] value: KClass<T>): R|one/Anno<T>| {
LAZY_super<R|kotlin/Any|>
}
public? final? [RAW_FIR] [IsFromPrimaryConstructor=true] val value: KClass<T> = R|<local>/value|
public? [RAW_FIR] [ContainingClassKey=Anno] get(): KClass<T>
}
@R|one/Anno<kotlin/Int>|(<getClass>(Q|kotlin/Int|)) public final [ARGUMENTS_OF_ANNOTATIONS] fun resolveMe(): R|kotlin/Unit| {
}
CONTRACTS:
FILE: [IMPORTS] annotationWithTypeArgument.kt
[RAW_FIR] annotations container
public? final? [RAW_FIR] annotation class Anno<[RAW_FIR] T : Number> : R|kotlin/Annotation| {
public? [RAW_FIR] [ContainingClassKey=Anno] constructor<[RAW_FIR] T : Number>([RAW_FIR] [CorrespondingProperty=one/Anno.value] value: KClass<T>): R|one/Anno<T>| {
LAZY_super<R|kotlin/Any|>
}
public? final? [RAW_FIR] [IsFromPrimaryConstructor=true] val value: KClass<T> = R|<local>/value|
public? [RAW_FIR] [ContainingClassKey=Anno] get(): KClass<T>
}
@R|one/Anno<kotlin/Int>|(<getClass>(Q|kotlin/Int|)) public final [CONTRACTS] fun resolveMe(): R|kotlin/Unit| {
}
IMPLICIT_TYPES_BODY_RESOLVE:
FILE: [IMPORTS] annotationWithTypeArgument.kt
[RAW_FIR] annotations container
public? final? [RAW_FIR] annotation class Anno<[RAW_FIR] T : Number> : R|kotlin/Annotation| {
public? [RAW_FIR] [ContainingClassKey=Anno] constructor<[RAW_FIR] T : Number>([RAW_FIR] [CorrespondingProperty=one/Anno.value] value: KClass<T>): R|one/Anno<T>| {
LAZY_super<R|kotlin/Any|>
}
public? final? [RAW_FIR] [IsFromPrimaryConstructor=true] val value: KClass<T> = R|<local>/value|
public? [RAW_FIR] [ContainingClassKey=Anno] get(): KClass<T>
}
@R|one/Anno<kotlin/Int>|(<getClass>(Q|kotlin/Int|)) public final [IMPLICIT_TYPES_BODY_RESOLVE] fun resolveMe(): R|kotlin/Unit| {
}
ANNOTATIONS_ARGUMENTS_MAPPING:
FILE: [IMPORTS] annotationWithTypeArgument.kt
[RAW_FIR] annotations container
public final [TYPES] annotation class Anno<[TYPES] T : R|kotlin/Number|> : R|kotlin/Annotation| {
public [STATUS] [ContainingClassKey=Anno] constructor<[TYPES] T : R|kotlin/Number|>([STATUS] [CorrespondingProperty=one/Anno.value] value: <ERROR TYPE REF: Symbol not found for KClass>): R|one/Anno<T>| {
LAZY_super<R|kotlin/Any|>
}
public final [TYPES] [IsFromPrimaryConstructor=true] val value: <ERROR TYPE REF: Symbol not found for KClass> = R|<local>/value|
public [TYPES] [ContainingClassKey=Anno] get(): <ERROR TYPE REF: Symbol not found for KClass>
}
@R|one/Anno<kotlin/Int>|(value = <getClass>(Q|kotlin/Int|)) public final [ANNOTATIONS_ARGUMENTS_MAPPING] fun resolveMe(): R|kotlin/Unit| {
}
BODY_RESOLVE:
FILE: [IMPORTS] annotationWithTypeArgument.kt
[RAW_FIR] annotations container
public final [TYPES] annotation class Anno<[TYPES] T : R|kotlin/Number|> : R|kotlin/Annotation| {
public [STATUS] [ContainingClassKey=Anno] constructor<[TYPES] T : R|kotlin/Number|>([STATUS] [CorrespondingProperty=one/Anno.value] value: <ERROR TYPE REF: Symbol not found for KClass>): R|one/Anno<T>| {
LAZY_super<R|kotlin/Any|>
}
public final [TYPES] [IsFromPrimaryConstructor=true] val value: <ERROR TYPE REF: Symbol not found for KClass> = R|<local>/value|
public [TYPES] [ContainingClassKey=Anno] get(): <ERROR TYPE REF: Symbol not found for KClass>
}
@R|one/Anno<kotlin/Int>|(value = <getClass>(Q|kotlin/Int|)) public final [BODY_RESOLVE] fun resolveMe(): R|kotlin/Unit| {
}
FILE RAW TO BODY:
FILE: [IMPORTS] annotationWithTypeArgument.kt
[BODY_RESOLVE] annotations container
public final [BODY_RESOLVE] annotation class Anno<[BODY_RESOLVE] T : R|kotlin/Number|> : R|kotlin/Annotation| {
public [BODY_RESOLVE] [ContainingClassKey=Anno] constructor<[BODY_RESOLVE] T : R|kotlin/Number|>([BODY_RESOLVE] [CorrespondingProperty=one/Anno.value] value: <ERROR TYPE REF: Symbol not found for KClass>): R|one/Anno<T>| {
super<R|kotlin/Any|>()
}
public final [BODY_RESOLVE] [IsFromPrimaryConstructor=true] val value: <ERROR TYPE REF: Symbol not found for KClass> = R|<local>/value|
public [BODY_RESOLVE] [ContainingClassKey=Anno] get(): <ERROR TYPE REF: Symbol not found for KClass>
}
@R|one/Anno<kotlin/Int>|(value = <getClass>(Q|kotlin/Int|)) public final [BODY_RESOLVE] fun resolveMe(): R|kotlin/Unit| {
}
@@ -30,6 +30,12 @@ public class FirOutOfContentRootLazyDeclarationResolveTestGenerated extends Abst
runTest("analysis/low-level-api-fir/testdata/lazyResolve/annotationParameters.kt");
}
@Test
@TestMetadata("annotationWithTypeArgument.kt")
public void testAnnotationWithTypeArgument() throws Exception {
runTest("analysis/low-level-api-fir/testdata/lazyResolve/annotationWithTypeArgument.kt");
}
@Test
@TestMetadata("annotations.kt")
public void testAnnotations() throws Exception {
@@ -30,6 +30,12 @@ public class FirSourceLazyDeclarationResolveTestGenerated extends AbstractFirSou
runTest("analysis/low-level-api-fir/testdata/lazyResolve/annotationParameters.kt");
}
@Test
@TestMetadata("annotationWithTypeArgument.kt")
public void testAnnotationWithTypeArgument() throws Exception {
runTest("analysis/low-level-api-fir/testdata/lazyResolve/annotationWithTypeArgument.kt");
}
@Test
@TestMetadata("annotations.kt")
public void testAnnotations() throws Exception {