diff --git a/analysis/low-level-api-fir/testData/lazyResolve/classes/annotationWithConstantFromNestedClass.kt b/analysis/low-level-api-fir/testData/lazyResolve/classes/annotationWithConstantFromNestedClass.kt new file mode 100644 index 00000000000..51580198b77 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolve/classes/annotationWithConstantFromNestedClass.kt @@ -0,0 +1,10 @@ +annotation class Anno(val number: Int) + +class Outer { + companion object { + const val CONSTANT_FROM_COMPANION = 42 + + @Anno(CONSTANT_FROM_COMPANION) + class Nested + } +} diff --git a/analysis/low-level-api-fir/testData/lazyResolve/classes/annotationWithConstantFromNestedClass.txt b/analysis/low-level-api-fir/testData/lazyResolve/classes/annotationWithConstantFromNestedClass.txt new file mode 100644 index 00000000000..0849622d989 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolve/classes/annotationWithConstantFromNestedClass.txt @@ -0,0 +1,489 @@ +RAW_FIR: +FILE: [ResolvedTo(RAW_FIR)] annotationWithConstantFromNestedClass.kt + public? final? [ResolvedTo(RAW_FIR)] annotation class Anno : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Anno.number] number: Int): R|Anno| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val number: Int = R|/number| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): Int + + } + public? final? [ResolvedTo(RAW_FIR)] class Outer : R|kotlin/Any| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Outer] constructor(): R|Outer| { + LAZY_super + } + + public? final? companion [ResolvedTo(RAW_FIR)] object Companion : R|kotlin/Any| { + private [ResolvedTo(RAW_FIR)] [ContainingClassKey=Companion] constructor(): R|Outer.Companion| { + LAZY_super + } + + public? final? const [ResolvedTo(RAW_FIR)] val CONSTANT_FROM_COMPANION: = LAZY_EXPRESSION + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Companion] get(): + + @Anno[Unresolved](LAZY_EXPRESSION) public? final? [ResolvedTo(RAW_FIR)] class Nested : R|kotlin/Any| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Nested] constructor(): R|Outer.Companion.Nested| { + LAZY_super + } + + } + + } + + } + +IMPORTS: +FILE: [ResolvedTo(IMPORTS)] annotationWithConstantFromNestedClass.kt + public? final? [ResolvedTo(RAW_FIR)] annotation class Anno : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Anno.number] number: Int): R|Anno| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val number: Int = R|/number| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): Int + + } + public? final? [ResolvedTo(RAW_FIR)] class Outer : R|kotlin/Any| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Outer] constructor(): R|Outer| { + LAZY_super + } + + public? final? companion [ResolvedTo(RAW_FIR)] object Companion : R|kotlin/Any| { + private [ResolvedTo(RAW_FIR)] [ContainingClassKey=Companion] constructor(): R|Outer.Companion| { + LAZY_super + } + + public? final? const [ResolvedTo(RAW_FIR)] val CONSTANT_FROM_COMPANION: = LAZY_EXPRESSION + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Companion] get(): + + @Anno[Unresolved](LAZY_EXPRESSION) public? final? [ResolvedTo(RAW_FIR)] class Nested : R|kotlin/Any| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Nested] constructor(): R|Outer.Companion.Nested| { + LAZY_super + } + + } + + } + + } + +COMPILER_REQUIRED_ANNOTATIONS: +FILE: [ResolvedTo(IMPORTS)] annotationWithConstantFromNestedClass.kt + public? final? [ResolvedTo(RAW_FIR)] annotation class Anno : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Anno.number] number: Int): R|Anno| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val number: Int = R|/number| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): Int + + } + public? final? [ResolvedTo(RAW_FIR)] class Outer : R|kotlin/Any| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Outer] constructor(): R|Outer| { + LAZY_super + } + + public? final? companion [ResolvedTo(RAW_FIR)] object Companion : R|kotlin/Any| { + private [ResolvedTo(RAW_FIR)] [ContainingClassKey=Companion] constructor(): R|Outer.Companion| { + LAZY_super + } + + public? final? const [ResolvedTo(RAW_FIR)] val CONSTANT_FROM_COMPANION: = LAZY_EXPRESSION + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Companion] get(): + + @Anno[Unresolved](LAZY_EXPRESSION) public? final? [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] class Nested : R|kotlin/Any| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Nested] constructor(): R|Outer.Companion.Nested| { + LAZY_super + } + + } + + } + + } + +COMPANION_GENERATION: +FILE: [ResolvedTo(IMPORTS)] annotationWithConstantFromNestedClass.kt + public? final? [ResolvedTo(RAW_FIR)] annotation class Anno : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Anno.number] number: Int): R|Anno| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val number: Int = R|/number| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): Int + + } + public? final? [ResolvedTo(RAW_FIR)] class Outer : R|kotlin/Any| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Outer] constructor(): R|Outer| { + LAZY_super + } + + public? final? companion [ResolvedTo(RAW_FIR)] object Companion : R|kotlin/Any| { + private [ResolvedTo(RAW_FIR)] [ContainingClassKey=Companion] constructor(): R|Outer.Companion| { + LAZY_super + } + + public? final? const [ResolvedTo(RAW_FIR)] val CONSTANT_FROM_COMPANION: = LAZY_EXPRESSION + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Companion] get(): + + @Anno[Unresolved](LAZY_EXPRESSION) public? final? [ResolvedTo(COMPANION_GENERATION)] class Nested : R|kotlin/Any| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Nested] constructor(): R|Outer.Companion.Nested| { + LAZY_super + } + + } + + } + + } + +SUPER_TYPES: +FILE: [ResolvedTo(IMPORTS)] annotationWithConstantFromNestedClass.kt + public? final? [ResolvedTo(RAW_FIR)] annotation class Anno : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Anno.number] number: Int): R|Anno| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val number: Int = R|/number| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): Int + + } + public? final? [ResolvedTo(SUPER_TYPES)] class Outer : R|kotlin/Any| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Outer] constructor(): R|Outer| { + LAZY_super + } + + public? final? companion [ResolvedTo(SUPER_TYPES)] object Companion : R|kotlin/Any| { + private [ResolvedTo(RAW_FIR)] [ContainingClassKey=Companion] constructor(): R|Outer.Companion| { + LAZY_super + } + + public? final? const [ResolvedTo(RAW_FIR)] val CONSTANT_FROM_COMPANION: = LAZY_EXPRESSION + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Companion] get(): + + @Anno[Unresolved](LAZY_EXPRESSION) public? final? [ResolvedTo(SUPER_TYPES)] class Nested : R|kotlin/Any| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Nested] constructor(): R|Outer.Companion.Nested| { + LAZY_super + } + + } + + } + + } + +TYPES: +FILE: [ResolvedTo(IMPORTS)] annotationWithConstantFromNestedClass.kt + public? final? [ResolvedTo(RAW_FIR)] annotation class Anno : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Anno.number] number: Int): R|Anno| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val number: Int = R|/number| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): Int + + } + public? final? [ResolvedTo(TYPES)] class Outer : R|kotlin/Any| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Outer] constructor(): R|Outer| { + LAZY_super + } + + public? final? companion [ResolvedTo(TYPES)] object Companion : R|kotlin/Any| { + private [ResolvedTo(RAW_FIR)] [ContainingClassKey=Companion] constructor(): R|Outer.Companion| { + LAZY_super + } + + public? final? const [ResolvedTo(RAW_FIR)] val CONSTANT_FROM_COMPANION: = LAZY_EXPRESSION + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Companion] get(): + + @R|Anno|[Types](LAZY_EXPRESSION) public? final? [ResolvedTo(TYPES)] class Nested : R|kotlin/Any| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Nested] constructor(): R|Outer.Companion.Nested| { + LAZY_super + } + + } + + } + + } + +STATUS: +FILE: [ResolvedTo(IMPORTS)] annotationWithConstantFromNestedClass.kt + public? final? [ResolvedTo(RAW_FIR)] annotation class Anno : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Anno.number] number: Int): R|Anno| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val number: Int = R|/number| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): Int + + } + public final [ResolvedTo(STATUS)] class Outer : R|kotlin/Any| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Outer] constructor(): R|Outer| { + LAZY_super + } + + public final companion [ResolvedTo(STATUS)] object Companion : R|kotlin/Any| { + private [ResolvedTo(RAW_FIR)] [ContainingClassKey=Companion] constructor(): R|Outer.Companion| { + LAZY_super + } + + public? final? const [ResolvedTo(RAW_FIR)] val CONSTANT_FROM_COMPANION: = LAZY_EXPRESSION + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Companion] get(): + + @R|Anno|[Types](LAZY_EXPRESSION) public final [ResolvedTo(STATUS)] class Nested : R|kotlin/Any| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Nested] constructor(): R|Outer.Companion.Nested| { + LAZY_super + } + + } + + } + + } + +EXPECT_ACTUAL_MATCHING: +FILE: [ResolvedTo(IMPORTS)] annotationWithConstantFromNestedClass.kt + public? final? [ResolvedTo(RAW_FIR)] annotation class Anno : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Anno.number] number: Int): R|Anno| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val number: Int = R|/number| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): Int + + } + public final [ResolvedTo(STATUS)] class Outer : R|kotlin/Any| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Outer] constructor(): R|Outer| { + LAZY_super + } + + public final companion [ResolvedTo(STATUS)] object Companion : R|kotlin/Any| { + private [ResolvedTo(RAW_FIR)] [ContainingClassKey=Companion] constructor(): R|Outer.Companion| { + LAZY_super + } + + public? final? const [ResolvedTo(RAW_FIR)] val CONSTANT_FROM_COMPANION: = LAZY_EXPRESSION + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Companion] get(): + + @R|Anno|[Types](LAZY_EXPRESSION) public final [ResolvedTo(EXPECT_ACTUAL_MATCHING)] class Nested : R|kotlin/Any| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Nested] constructor(): R|Outer.Companion.Nested| { + LAZY_super + } + + } + + } + + } + +ARGUMENTS_OF_ANNOTATIONS: +FILE: [ResolvedTo(IMPORTS)] annotationWithConstantFromNestedClass.kt + public? final? [ResolvedTo(RAW_FIR)] annotation class Anno : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Anno.number] number: Int): R|Anno| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val number: Int = R|/number| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): Int + + } + public final [ResolvedTo(STATUS)] class Outer : R|kotlin/Any| { + public [ResolvedTo(STATUS)] [ContainingClassKey=Outer] constructor(): R|Outer| { + LAZY_super + } + + public final companion [ResolvedTo(STATUS)] object Companion : R|kotlin/Any| { + private [ResolvedTo(STATUS)] [ContainingClassKey=Companion] constructor(): R|Outer.Companion| { + LAZY_super + } + + public final const [ResolvedTo(STATUS)] val CONSTANT_FROM_COMPANION: = LAZY_EXPRESSION + public [ResolvedTo(STATUS)] [ContainingClassKey=Companion] get(): + + @R|Anno|[Types](CONSTANT_FROM_COMPANION#) public final [ResolvedTo(ARGUMENTS_OF_ANNOTATIONS)] class Nested : R|kotlin/Any| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Nested] constructor(): R|Outer.Companion.Nested| { + LAZY_super + } + + } + + } + + } + +CONTRACTS: +FILE: [ResolvedTo(IMPORTS)] annotationWithConstantFromNestedClass.kt + public? final? [ResolvedTo(RAW_FIR)] annotation class Anno : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Anno.number] number: Int): R|Anno| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val number: Int = R|/number| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): Int + + } + public final [ResolvedTo(STATUS)] class Outer : R|kotlin/Any| { + public [ResolvedTo(STATUS)] [ContainingClassKey=Outer] constructor(): R|Outer| { + LAZY_super + } + + public final companion [ResolvedTo(STATUS)] object Companion : R|kotlin/Any| { + private [ResolvedTo(STATUS)] [ContainingClassKey=Companion] constructor(): R|Outer.Companion| { + LAZY_super + } + + public final const [ResolvedTo(STATUS)] val CONSTANT_FROM_COMPANION: = LAZY_EXPRESSION + public [ResolvedTo(STATUS)] [ContainingClassKey=Companion] get(): + + @R|Anno|[Types](CONSTANT_FROM_COMPANION#) public final [ResolvedTo(CONTRACTS)] class Nested : R|kotlin/Any| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Nested] constructor(): R|Outer.Companion.Nested| { + LAZY_super + } + + } + + } + + } + +IMPLICIT_TYPES_BODY_RESOLVE: +FILE: [ResolvedTo(IMPORTS)] annotationWithConstantFromNestedClass.kt + public? final? [ResolvedTo(RAW_FIR)] annotation class Anno : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Anno.number] number: Int): R|Anno| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val number: Int = R|/number| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): Int + + } + public final [ResolvedTo(STATUS)] class Outer : R|kotlin/Any| { + public [ResolvedTo(STATUS)] [ContainingClassKey=Outer] constructor(): R|Outer| { + LAZY_super + } + + public final companion [ResolvedTo(STATUS)] object Companion : R|kotlin/Any| { + private [ResolvedTo(STATUS)] [ContainingClassKey=Companion] constructor(): R|Outer.Companion| { + LAZY_super + } + + public final const [ResolvedTo(STATUS)] val CONSTANT_FROM_COMPANION: = LAZY_EXPRESSION + public [ResolvedTo(STATUS)] [ContainingClassKey=Companion] get(): + + @R|Anno|[Types](CONSTANT_FROM_COMPANION#) public final [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] class Nested : R|kotlin/Any| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Nested] constructor(): R|Outer.Companion.Nested| { + LAZY_super + } + + } + + } + + } + +ANNOTATIONS_ARGUMENTS_MAPPING: +FILE: [ResolvedTo(IMPORTS)] annotationWithConstantFromNestedClass.kt + public final [ResolvedTo(STATUS)] annotation class Anno : R|kotlin/Annotation| { + public [ResolvedTo(STATUS)] [ContainingClassKey=Anno] constructor([ResolvedTo(STATUS)] [CorrespondingProperty=/Anno.number] number: R|kotlin/Int|): R|Anno| { + LAZY_super + } + + public final [ResolvedTo(STATUS)] [IsFromPrimaryConstructor=true] val number: R|kotlin/Int| = R|/number| + public [ResolvedTo(STATUS)] [ContainingClassKey=Anno] get(): R|kotlin/Int| + + } + public final [ResolvedTo(STATUS)] class Outer : R|kotlin/Any| { + public [ResolvedTo(STATUS)] [ContainingClassKey=Outer] constructor(): R|Outer| { + LAZY_super + } + + public final companion [ResolvedTo(STATUS)] object Companion : R|kotlin/Any| { + private [ResolvedTo(STATUS)] [ContainingClassKey=Companion] constructor(): R|Outer.Companion| { + LAZY_super + } + + public final const [ResolvedTo(STATUS)] val CONSTANT_FROM_COMPANION: = LAZY_EXPRESSION + public [ResolvedTo(STATUS)] [ContainingClassKey=Companion] get(): + + @R|Anno|[Types](number = #) public final [ResolvedTo(ANNOTATIONS_ARGUMENTS_MAPPING)] class Nested : R|kotlin/Any| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Nested] constructor(): R|Outer.Companion.Nested| { + LAZY_super + } + + } + + } + + } + +BODY_RESOLVE: +FILE: [ResolvedTo(IMPORTS)] annotationWithConstantFromNestedClass.kt + public final [ResolvedTo(STATUS)] annotation class Anno : R|kotlin/Annotation| { + public [ResolvedTo(STATUS)] [ContainingClassKey=Anno] constructor([ResolvedTo(STATUS)] [CorrespondingProperty=/Anno.number] number: R|kotlin/Int|): R|Anno| { + LAZY_super + } + + public final [ResolvedTo(STATUS)] [IsFromPrimaryConstructor=true] val number: R|kotlin/Int| = R|/number| + public [ResolvedTo(STATUS)] [ContainingClassKey=Anno] get(): R|kotlin/Int| + + } + public final [ResolvedTo(STATUS)] class Outer : R|kotlin/Any| { + public [ResolvedTo(STATUS)] [ContainingClassKey=Outer] constructor(): R|Outer| { + LAZY_super + } + + public final companion [ResolvedTo(STATUS)] object Companion : R|kotlin/Any| { + private [ResolvedTo(STATUS)] [ContainingClassKey=Companion] constructor(): R|Outer.Companion| { + LAZY_super + } + + public final const [ResolvedTo(STATUS)] val CONSTANT_FROM_COMPANION: = LAZY_EXPRESSION + public [ResolvedTo(STATUS)] [ContainingClassKey=Companion] get(): + + @R|Anno|[Types](number = #) public final [ResolvedTo(BODY_RESOLVE)] class Nested : R|kotlin/Any| { + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=Nested] constructor(): R|Outer.Companion.Nested| { + super() + } + + } + + } + + } + +FILE RAW TO BODY: +FILE: [ResolvedTo(BODY_RESOLVE)] annotationWithConstantFromNestedClass.kt + public final [ResolvedTo(BODY_RESOLVE)] annotation class Anno : R|kotlin/Annotation| { + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=Anno] constructor([ResolvedTo(BODY_RESOLVE)] [CorrespondingProperty=/Anno.number] number: R|kotlin/Int|): R|Anno| { + super() + } + + public final [ResolvedTo(BODY_RESOLVE)] [IsFromPrimaryConstructor=true] val number: R|kotlin/Int| = R|/number| + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=Anno] get(): R|kotlin/Int| + + } + public final [ResolvedTo(BODY_RESOLVE)] class Outer : R|kotlin/Any| { + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=Outer] constructor(): R|Outer| { + super() + } + + public final companion [ResolvedTo(BODY_RESOLVE)] object Companion : R|kotlin/Any| { + private [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=Companion] constructor(): R|Outer.Companion| { + super() + } + + public final const [ResolvedTo(BODY_RESOLVE)] val CONSTANT_FROM_COMPANION: R|kotlin/Int| = Int(42) + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=Companion] get(): R|kotlin/Int| + + @R|Anno|[Types](number = #) public final [ResolvedTo(BODY_RESOLVE)] class Nested : R|kotlin/Any| { + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=Nested] constructor(): R|Outer.Companion.Nested| { + super() + } + + } + + } + + } diff --git a/analysis/low-level-api-fir/testData/lazyResolve/classes/nestedClassAsAnnotationArgument.kt b/analysis/low-level-api-fir/testData/lazyResolve/classes/nestedClassAsAnnotationArgument.kt new file mode 100644 index 00000000000..e9433ffa489 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolve/classes/nestedClassAsAnnotationArgument.kt @@ -0,0 +1,11 @@ +import kotlin.reflect.KClass + +@Target(AnnotationTarget.CLASS, AnnotationTarget.TYPE_PARAMETER, AnnotationTarget.TYPE) +annotation class Special(val why: KClass<*>) + +interface Interface + +class Outer { + @Special(Nested::class) + class Nested<@Special(Nested::class) T> : @Special(Nested::class) Interface +} diff --git a/analysis/low-level-api-fir/testData/lazyResolve/classes/nestedClassAsAnnotationArgument.txt b/analysis/low-level-api-fir/testData/lazyResolve/classes/nestedClassAsAnnotationArgument.txt new file mode 100644 index 00000000000..ccbc7a6d2e8 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolve/classes/nestedClassAsAnnotationArgument.txt @@ -0,0 +1,377 @@ +RAW_FIR: +FILE: [ResolvedTo(RAW_FIR)] nestedClassAsAnnotationArgument.kt + @Target[Unresolved](LAZY_EXPRESSION, LAZY_EXPRESSION, LAZY_EXPRESSION) public? final? [ResolvedTo(RAW_FIR)] annotation class Special : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Special] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Special.why] why: KClass<*>): R|Special| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val why: KClass<*> = R|/why| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Special] get(): KClass<*> + + } + public? final? [ResolvedTo(RAW_FIR)] interface Interface : R|kotlin/Any| { + } + public? final? [ResolvedTo(RAW_FIR)] class Outer : R|kotlin/Any| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Outer] constructor(): R|Outer| { + LAZY_super + } + + @Special[Unresolved](LAZY_EXPRESSION) public? final? [ResolvedTo(RAW_FIR)] class Nested<@Special[Unresolved](LAZY_EXPRESSION) [ResolvedTo(RAW_FIR)] T> : @Special[Unresolved](LAZY_EXPRESSION) Interface { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Nested] constructor<@Special[Unresolved](LAZY_EXPRESSION) [ResolvedTo(RAW_FIR)] T>(): R|Outer.Nested| { + LAZY_super<> + } + + } + + } + +IMPORTS: +FILE: [ResolvedTo(IMPORTS)] nestedClassAsAnnotationArgument.kt + @Target[Unresolved](LAZY_EXPRESSION, LAZY_EXPRESSION, LAZY_EXPRESSION) public? final? [ResolvedTo(RAW_FIR)] annotation class Special : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Special] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Special.why] why: KClass<*>): R|Special| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val why: KClass<*> = R|/why| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Special] get(): KClass<*> + + } + public? final? [ResolvedTo(RAW_FIR)] interface Interface : R|kotlin/Any| { + } + public? final? [ResolvedTo(RAW_FIR)] class Outer : R|kotlin/Any| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Outer] constructor(): R|Outer| { + LAZY_super + } + + @Special[Unresolved](LAZY_EXPRESSION) public? final? [ResolvedTo(RAW_FIR)] class Nested<@Special[Unresolved](LAZY_EXPRESSION) [ResolvedTo(RAW_FIR)] T> : @Special[Unresolved](LAZY_EXPRESSION) Interface { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Nested] constructor<@Special[Unresolved](LAZY_EXPRESSION) [ResolvedTo(RAW_FIR)] T>(): R|Outer.Nested| { + LAZY_super<> + } + + } + + } + +COMPILER_REQUIRED_ANNOTATIONS: +FILE: [ResolvedTo(IMPORTS)] nestedClassAsAnnotationArgument.kt + @Target[Unresolved](LAZY_EXPRESSION, LAZY_EXPRESSION, LAZY_EXPRESSION) public? final? [ResolvedTo(RAW_FIR)] annotation class Special : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Special] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Special.why] why: KClass<*>): R|Special| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val why: KClass<*> = R|/why| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Special] get(): KClass<*> + + } + public? final? [ResolvedTo(RAW_FIR)] interface Interface : R|kotlin/Any| { + } + public? final? [ResolvedTo(RAW_FIR)] class Outer : R|kotlin/Any| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Outer] constructor(): R|Outer| { + LAZY_super + } + + @Special[Unresolved](LAZY_EXPRESSION) public? final? [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] class Nested<@Special[Unresolved](LAZY_EXPRESSION) [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] T> : @Special[Unresolved](LAZY_EXPRESSION) Interface { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Nested] constructor<@Special[Unresolved](LAZY_EXPRESSION) [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] T>(): R|Outer.Nested| { + LAZY_super<> + } + + } + + } + +COMPANION_GENERATION: +FILE: [ResolvedTo(IMPORTS)] nestedClassAsAnnotationArgument.kt + @Target[Unresolved](LAZY_EXPRESSION, LAZY_EXPRESSION, LAZY_EXPRESSION) public? final? [ResolvedTo(RAW_FIR)] annotation class Special : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Special] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Special.why] why: KClass<*>): R|Special| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val why: KClass<*> = R|/why| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Special] get(): KClass<*> + + } + public? final? [ResolvedTo(RAW_FIR)] interface Interface : R|kotlin/Any| { + } + public? final? [ResolvedTo(RAW_FIR)] class Outer : R|kotlin/Any| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Outer] constructor(): R|Outer| { + LAZY_super + } + + @Special[Unresolved](LAZY_EXPRESSION) public? final? [ResolvedTo(COMPANION_GENERATION)] class Nested<@Special[Unresolved](LAZY_EXPRESSION) [ResolvedTo(COMPANION_GENERATION)] T> : @Special[Unresolved](LAZY_EXPRESSION) Interface { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Nested] constructor<@Special[Unresolved](LAZY_EXPRESSION) [ResolvedTo(COMPANION_GENERATION)] T>(): R|Outer.Nested| { + LAZY_super<> + } + + } + + } + +SUPER_TYPES: +FILE: [ResolvedTo(IMPORTS)] nestedClassAsAnnotationArgument.kt + @R|kotlin/annotation/Target|[CompilerRequiredAnnotations](Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.CLASS|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE_PARAMETER|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE|) public? final? [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] annotation class Special : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Special] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Special.why] why: KClass<*>): R|Special| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val why: KClass<*> = R|/why| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Special] get(): KClass<*> + + } + public? final? [ResolvedTo(SUPER_TYPES)] interface Interface : R|kotlin/Any| { + } + public? final? [ResolvedTo(SUPER_TYPES)] class Outer : R|kotlin/Any| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Outer] constructor(): R|Outer| { + LAZY_super + } + + @Special[Unresolved](LAZY_EXPRESSION) public? final? [ResolvedTo(SUPER_TYPES)] class Nested<@Special[Unresolved](LAZY_EXPRESSION) [ResolvedTo(SUPER_TYPES)] T> : R|@R|Special|(LAZY_EXPRESSION) Interface| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Nested] constructor<@Special[Unresolved](LAZY_EXPRESSION) [ResolvedTo(SUPER_TYPES)] T>(): R|Outer.Nested| { + LAZY_super<> + } + + } + + } + +TYPES: +FILE: [ResolvedTo(IMPORTS)] nestedClassAsAnnotationArgument.kt + @R|kotlin/annotation/Target|[CompilerRequiredAnnotations](Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.CLASS|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE_PARAMETER|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE|) public? final? [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] annotation class Special : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Special] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Special.why] why: KClass<*>): R|Special| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val why: KClass<*> = R|/why| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Special] get(): KClass<*> + + } + public? final? [ResolvedTo(SUPER_TYPES)] interface Interface : R|kotlin/Any| { + } + public? final? [ResolvedTo(TYPES)] class Outer : R|kotlin/Any| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Outer] constructor(): R|Outer| { + LAZY_super + } + + @R|Special|[Types](LAZY_EXPRESSION) public? final? [ResolvedTo(TYPES)] class Nested<@R|Special|[Types](LAZY_EXPRESSION) [ResolvedTo(TYPES)] T> : R|@R|Special|(LAZY_EXPRESSION) Interface| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Nested] constructor<@R|Special|[Types](LAZY_EXPRESSION) [ResolvedTo(TYPES)] T>(): R|Outer.Nested| { + LAZY_super<> + } + + } + + } + +STATUS: +FILE: [ResolvedTo(IMPORTS)] nestedClassAsAnnotationArgument.kt + @R|kotlin/annotation/Target|[CompilerRequiredAnnotations](Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.CLASS|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE_PARAMETER|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE|) public? final? [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] annotation class Special : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Special] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Special.why] why: KClass<*>): R|Special| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val why: KClass<*> = R|/why| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Special] get(): KClass<*> + + } + public? final? [ResolvedTo(SUPER_TYPES)] interface Interface : R|kotlin/Any| { + } + public final [ResolvedTo(STATUS)] class Outer : R|kotlin/Any| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Outer] constructor(): R|Outer| { + LAZY_super + } + + @R|Special|[Types](LAZY_EXPRESSION) public final [ResolvedTo(STATUS)] class Nested<@R|Special|[Types](LAZY_EXPRESSION) [ResolvedTo(STATUS)] T> : R|@R|Special|(LAZY_EXPRESSION) Interface| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Nested] constructor<@R|Special|[Types](LAZY_EXPRESSION) [ResolvedTo(STATUS)] T>(): R|Outer.Nested| { + LAZY_super<> + } + + } + + } + +EXPECT_ACTUAL_MATCHING: +FILE: [ResolvedTo(IMPORTS)] nestedClassAsAnnotationArgument.kt + @R|kotlin/annotation/Target|[CompilerRequiredAnnotations](Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.CLASS|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE_PARAMETER|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE|) public? final? [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] annotation class Special : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Special] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Special.why] why: KClass<*>): R|Special| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val why: KClass<*> = R|/why| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Special] get(): KClass<*> + + } + public? final? [ResolvedTo(SUPER_TYPES)] interface Interface : R|kotlin/Any| { + } + public final [ResolvedTo(STATUS)] class Outer : R|kotlin/Any| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Outer] constructor(): R|Outer| { + LAZY_super + } + + @R|Special|[Types](LAZY_EXPRESSION) public final [ResolvedTo(EXPECT_ACTUAL_MATCHING)] class Nested<@R|Special|[Types](LAZY_EXPRESSION) [ResolvedTo(EXPECT_ACTUAL_MATCHING)] T> : R|@R|Special|(LAZY_EXPRESSION) Interface| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Nested] constructor<@R|Special|[Types](LAZY_EXPRESSION) [ResolvedTo(EXPECT_ACTUAL_MATCHING)] T>(): R|Outer.Nested| { + LAZY_super<> + } + + } + + } + +ARGUMENTS_OF_ANNOTATIONS: +FILE: [ResolvedTo(IMPORTS)] nestedClassAsAnnotationArgument.kt + @R|kotlin/annotation/Target|[CompilerRequiredAnnotations](Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.CLASS|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE_PARAMETER|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE|) public? final? [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] annotation class Special : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Special] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Special.why] why: KClass<*>): R|Special| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val why: KClass<*> = R|/why| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Special] get(): KClass<*> + + } + public? final? [ResolvedTo(SUPER_TYPES)] interface Interface : R|kotlin/Any| { + } + public final [ResolvedTo(STATUS)] class Outer : R|kotlin/Any| { + public [ResolvedTo(STATUS)] [ContainingClassKey=Outer] constructor(): R|Outer| { + LAZY_super + } + + @R|Special|[Types]((Q|Outer.Nested|)) public final [ResolvedTo(ARGUMENTS_OF_ANNOTATIONS)] class Nested<@R|Special|[Types]((Q|Outer.Nested|)) [ResolvedTo(ARGUMENTS_OF_ANNOTATIONS)] T> : R|@R|Special|((Q|Outer.Nested|)) Interface| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Nested] constructor<@R|Special|[Types]((Q|Outer.Nested|)) [ResolvedTo(ARGUMENTS_OF_ANNOTATIONS)] T>(): R|Outer.Nested| { + LAZY_super<> + } + + } + + } + +CONTRACTS: +FILE: [ResolvedTo(IMPORTS)] nestedClassAsAnnotationArgument.kt + @R|kotlin/annotation/Target|[CompilerRequiredAnnotations](Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.CLASS|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE_PARAMETER|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE|) public? final? [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] annotation class Special : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Special] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Special.why] why: KClass<*>): R|Special| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val why: KClass<*> = R|/why| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Special] get(): KClass<*> + + } + public? final? [ResolvedTo(SUPER_TYPES)] interface Interface : R|kotlin/Any| { + } + public final [ResolvedTo(STATUS)] class Outer : R|kotlin/Any| { + public [ResolvedTo(STATUS)] [ContainingClassKey=Outer] constructor(): R|Outer| { + LAZY_super + } + + @R|Special|[Types]((Q|Outer.Nested|)) public final [ResolvedTo(CONTRACTS)] class Nested<@R|Special|[Types]((Q|Outer.Nested|)) [ResolvedTo(CONTRACTS)] T> : R|@R|Special|((Q|Outer.Nested|)) Interface| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Nested] constructor<@R|Special|[Types]((Q|Outer.Nested|)) [ResolvedTo(CONTRACTS)] T>(): R|Outer.Nested| { + LAZY_super<> + } + + } + + } + +IMPLICIT_TYPES_BODY_RESOLVE: +FILE: [ResolvedTo(IMPORTS)] nestedClassAsAnnotationArgument.kt + @R|kotlin/annotation/Target|[CompilerRequiredAnnotations](Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.CLASS|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE_PARAMETER|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE|) public? final? [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] annotation class Special : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Special] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Special.why] why: KClass<*>): R|Special| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val why: KClass<*> = R|/why| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Special] get(): KClass<*> + + } + public? final? [ResolvedTo(SUPER_TYPES)] interface Interface : R|kotlin/Any| { + } + public final [ResolvedTo(STATUS)] class Outer : R|kotlin/Any| { + public [ResolvedTo(STATUS)] [ContainingClassKey=Outer] constructor(): R|Outer| { + LAZY_super + } + + @R|Special|[Types]((Q|Outer.Nested|)) public final [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] class Nested<@R|Special|[Types]((Q|Outer.Nested|)) [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] T> : R|@R|Special|((Q|Outer.Nested|)) Interface| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Nested] constructor<@R|Special|[Types]((Q|Outer.Nested|)) [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] T>(): R|Outer.Nested| { + LAZY_super<> + } + + } + + } + +ANNOTATIONS_ARGUMENTS_MAPPING: +FILE: [ResolvedTo(IMPORTS)] nestedClassAsAnnotationArgument.kt + @R|kotlin/annotation/Target|[Types](Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.CLASS|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE_PARAMETER|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE|) public final [ResolvedTo(STATUS)] annotation class Special : R|kotlin/Annotation| { + public [ResolvedTo(STATUS)] [ContainingClassKey=Special] constructor([ResolvedTo(STATUS)] [CorrespondingProperty=/Special.why] why: R|kotlin/reflect/KClass<*>|): R|Special| { + LAZY_super + } + + public final [ResolvedTo(STATUS)] [IsFromPrimaryConstructor=true] val why: R|kotlin/reflect/KClass<*>| = R|/why| + public [ResolvedTo(STATUS)] [ContainingClassKey=Special] get(): R|kotlin/reflect/KClass<*>| + + } + public? final? [ResolvedTo(SUPER_TYPES)] interface Interface : R|kotlin/Any| { + } + public final [ResolvedTo(STATUS)] class Outer : R|kotlin/Any| { + public [ResolvedTo(STATUS)] [ContainingClassKey=Outer] constructor(): R|Outer| { + LAZY_super + } + + @R|Special|[Types](why = (#)) public final [ResolvedTo(ANNOTATIONS_ARGUMENTS_MAPPING)] class Nested<@R|Special|[Types](why = (Q|Outer.Nested|)) [ResolvedTo(ANNOTATIONS_ARGUMENTS_MAPPING)] T> : R|@R|Special|(why = (#)) Interface| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Nested] constructor<@R|Special|[Types](why = (Q|Outer.Nested|)) [ResolvedTo(ANNOTATIONS_ARGUMENTS_MAPPING)] T>(): R|Outer.Nested| { + LAZY_super<> + } + + } + + } + +BODY_RESOLVE: +FILE: [ResolvedTo(IMPORTS)] nestedClassAsAnnotationArgument.kt + @R|kotlin/annotation/Target|[Types](Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.CLASS|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE_PARAMETER|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE|) public final [ResolvedTo(STATUS)] annotation class Special : R|kotlin/Annotation| { + public [ResolvedTo(STATUS)] [ContainingClassKey=Special] constructor([ResolvedTo(STATUS)] [CorrespondingProperty=/Special.why] why: R|kotlin/reflect/KClass<*>|): R|Special| { + LAZY_super + } + + public final [ResolvedTo(STATUS)] [IsFromPrimaryConstructor=true] val why: R|kotlin/reflect/KClass<*>| = R|/why| + public [ResolvedTo(STATUS)] [ContainingClassKey=Special] get(): R|kotlin/reflect/KClass<*>| + + } + public abstract [ResolvedTo(STATUS)] interface Interface : R|kotlin/Any| { + } + public final [ResolvedTo(STATUS)] class Outer : R|kotlin/Any| { + public [ResolvedTo(STATUS)] [ContainingClassKey=Outer] constructor(): R|Outer| { + LAZY_super + } + + @R|Special|[Types](why = (#)) public final [ResolvedTo(BODY_RESOLVE)] class Nested<@R|Special|[Types](why = (Q|Outer.Nested|)) [ResolvedTo(BODY_RESOLVE)] T> : R|@R|Special|(why = (#)) Interface| { + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=Nested] constructor<@R|Special|[Types](why = (Q|Outer.Nested|)) [ResolvedTo(BODY_RESOLVE)] T>(): R|Outer.Nested| { + super() + } + + } + + } + +FILE RAW TO BODY: +FILE: [ResolvedTo(BODY_RESOLVE)] nestedClassAsAnnotationArgument.kt + @R|kotlin/annotation/Target|[Types](allowedTargets = vararg(Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.CLASS|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE_PARAMETER|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE|)) public final [ResolvedTo(BODY_RESOLVE)] annotation class Special : R|kotlin/Annotation| { + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=Special] constructor([ResolvedTo(BODY_RESOLVE)] [CorrespondingProperty=/Special.why] why: R|kotlin/reflect/KClass<*>|): R|Special| { + super() + } + + public final [ResolvedTo(BODY_RESOLVE)] [IsFromPrimaryConstructor=true] val why: R|kotlin/reflect/KClass<*>| = R|/why| + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=Special] get(): R|kotlin/reflect/KClass<*>| + + } + public abstract [ResolvedTo(BODY_RESOLVE)] interface Interface : R|kotlin/Any| { + } + public final [ResolvedTo(BODY_RESOLVE)] class Outer : R|kotlin/Any| { + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=Outer] constructor(): R|Outer| { + super() + } + + @R|Special|[Types](why = (#)) public final [ResolvedTo(BODY_RESOLVE)] class Nested<@R|Special|[Types](why = (Q|Outer.Nested|)) [ResolvedTo(BODY_RESOLVE)] T> : R|@R|Special|(why = (#)) Interface| { + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=Nested] constructor<@R|Special|[Types](why = (Q|Outer.Nested|)) [ResolvedTo(BODY_RESOLVE)] T>(): R|Outer.Nested| { + super() + } + + } + + } diff --git a/analysis/low-level-api-fir/testData/lazyResolve/classes/nestedClassAsAnnotationArgument2.kt b/analysis/low-level-api-fir/testData/lazyResolve/classes/nestedClassAsAnnotationArgument2.kt new file mode 100644 index 00000000000..53755afd0c3 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolve/classes/nestedClassAsAnnotationArgument2.kt @@ -0,0 +1,11 @@ +import kotlin.reflect.KClass + +@Target(AnnotationTarget.CLASS, AnnotationTarget.TYPE_PARAMETER, AnnotationTarget.TYPE) +annotation class Special(val why: KClass<*>) + +interface Interface + +class Outer { + @Special(Nested) + class Nested<@Special(Nested) T> : @Special(Nested) Interface +} diff --git a/analysis/low-level-api-fir/testData/lazyResolve/classes/nestedClassAsAnnotationArgument2.txt b/analysis/low-level-api-fir/testData/lazyResolve/classes/nestedClassAsAnnotationArgument2.txt new file mode 100644 index 00000000000..2e16225982c --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolve/classes/nestedClassAsAnnotationArgument2.txt @@ -0,0 +1,377 @@ +RAW_FIR: +FILE: [ResolvedTo(RAW_FIR)] nestedClassAsAnnotationArgument2.kt + @Target[Unresolved](LAZY_EXPRESSION, LAZY_EXPRESSION, LAZY_EXPRESSION) public? final? [ResolvedTo(RAW_FIR)] annotation class Special : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Special] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Special.why] why: KClass<*>): R|Special| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val why: KClass<*> = R|/why| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Special] get(): KClass<*> + + } + public? final? [ResolvedTo(RAW_FIR)] interface Interface : R|kotlin/Any| { + } + public? final? [ResolvedTo(RAW_FIR)] class Outer : R|kotlin/Any| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Outer] constructor(): R|Outer| { + LAZY_super + } + + @Special[Unresolved](LAZY_EXPRESSION) public? final? [ResolvedTo(RAW_FIR)] class Nested<@Special[Unresolved](LAZY_EXPRESSION) [ResolvedTo(RAW_FIR)] T> : @Special[Unresolved](LAZY_EXPRESSION) Interface { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Nested] constructor<@Special[Unresolved](LAZY_EXPRESSION) [ResolvedTo(RAW_FIR)] T>(): R|Outer.Nested| { + LAZY_super<> + } + + } + + } + +IMPORTS: +FILE: [ResolvedTo(IMPORTS)] nestedClassAsAnnotationArgument2.kt + @Target[Unresolved](LAZY_EXPRESSION, LAZY_EXPRESSION, LAZY_EXPRESSION) public? final? [ResolvedTo(RAW_FIR)] annotation class Special : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Special] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Special.why] why: KClass<*>): R|Special| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val why: KClass<*> = R|/why| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Special] get(): KClass<*> + + } + public? final? [ResolvedTo(RAW_FIR)] interface Interface : R|kotlin/Any| { + } + public? final? [ResolvedTo(RAW_FIR)] class Outer : R|kotlin/Any| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Outer] constructor(): R|Outer| { + LAZY_super + } + + @Special[Unresolved](LAZY_EXPRESSION) public? final? [ResolvedTo(RAW_FIR)] class Nested<@Special[Unresolved](LAZY_EXPRESSION) [ResolvedTo(RAW_FIR)] T> : @Special[Unresolved](LAZY_EXPRESSION) Interface { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Nested] constructor<@Special[Unresolved](LAZY_EXPRESSION) [ResolvedTo(RAW_FIR)] T>(): R|Outer.Nested| { + LAZY_super<> + } + + } + + } + +COMPILER_REQUIRED_ANNOTATIONS: +FILE: [ResolvedTo(IMPORTS)] nestedClassAsAnnotationArgument2.kt + @Target[Unresolved](LAZY_EXPRESSION, LAZY_EXPRESSION, LAZY_EXPRESSION) public? final? [ResolvedTo(RAW_FIR)] annotation class Special : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Special] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Special.why] why: KClass<*>): R|Special| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val why: KClass<*> = R|/why| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Special] get(): KClass<*> + + } + public? final? [ResolvedTo(RAW_FIR)] interface Interface : R|kotlin/Any| { + } + public? final? [ResolvedTo(RAW_FIR)] class Outer : R|kotlin/Any| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Outer] constructor(): R|Outer| { + LAZY_super + } + + @Special[Unresolved](LAZY_EXPRESSION) public? final? [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] class Nested<@Special[Unresolved](LAZY_EXPRESSION) [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] T> : @Special[Unresolved](LAZY_EXPRESSION) Interface { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Nested] constructor<@Special[Unresolved](LAZY_EXPRESSION) [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] T>(): R|Outer.Nested| { + LAZY_super<> + } + + } + + } + +COMPANION_GENERATION: +FILE: [ResolvedTo(IMPORTS)] nestedClassAsAnnotationArgument2.kt + @Target[Unresolved](LAZY_EXPRESSION, LAZY_EXPRESSION, LAZY_EXPRESSION) public? final? [ResolvedTo(RAW_FIR)] annotation class Special : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Special] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Special.why] why: KClass<*>): R|Special| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val why: KClass<*> = R|/why| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Special] get(): KClass<*> + + } + public? final? [ResolvedTo(RAW_FIR)] interface Interface : R|kotlin/Any| { + } + public? final? [ResolvedTo(RAW_FIR)] class Outer : R|kotlin/Any| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Outer] constructor(): R|Outer| { + LAZY_super + } + + @Special[Unresolved](LAZY_EXPRESSION) public? final? [ResolvedTo(COMPANION_GENERATION)] class Nested<@Special[Unresolved](LAZY_EXPRESSION) [ResolvedTo(COMPANION_GENERATION)] T> : @Special[Unresolved](LAZY_EXPRESSION) Interface { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Nested] constructor<@Special[Unresolved](LAZY_EXPRESSION) [ResolvedTo(COMPANION_GENERATION)] T>(): R|Outer.Nested| { + LAZY_super<> + } + + } + + } + +SUPER_TYPES: +FILE: [ResolvedTo(IMPORTS)] nestedClassAsAnnotationArgument2.kt + @R|kotlin/annotation/Target|[CompilerRequiredAnnotations](Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.CLASS|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE_PARAMETER|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE|) public? final? [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] annotation class Special : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Special] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Special.why] why: KClass<*>): R|Special| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val why: KClass<*> = R|/why| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Special] get(): KClass<*> + + } + public? final? [ResolvedTo(SUPER_TYPES)] interface Interface : R|kotlin/Any| { + } + public? final? [ResolvedTo(SUPER_TYPES)] class Outer : R|kotlin/Any| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Outer] constructor(): R|Outer| { + LAZY_super + } + + @Special[Unresolved](LAZY_EXPRESSION) public? final? [ResolvedTo(SUPER_TYPES)] class Nested<@Special[Unresolved](LAZY_EXPRESSION) [ResolvedTo(SUPER_TYPES)] T> : R|@R|Special|(LAZY_EXPRESSION) Interface| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Nested] constructor<@Special[Unresolved](LAZY_EXPRESSION) [ResolvedTo(SUPER_TYPES)] T>(): R|Outer.Nested| { + LAZY_super<> + } + + } + + } + +TYPES: +FILE: [ResolvedTo(IMPORTS)] nestedClassAsAnnotationArgument2.kt + @R|kotlin/annotation/Target|[CompilerRequiredAnnotations](Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.CLASS|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE_PARAMETER|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE|) public? final? [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] annotation class Special : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Special] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Special.why] why: KClass<*>): R|Special| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val why: KClass<*> = R|/why| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Special] get(): KClass<*> + + } + public? final? [ResolvedTo(SUPER_TYPES)] interface Interface : R|kotlin/Any| { + } + public? final? [ResolvedTo(TYPES)] class Outer : R|kotlin/Any| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Outer] constructor(): R|Outer| { + LAZY_super + } + + @R|Special|[Types](LAZY_EXPRESSION) public? final? [ResolvedTo(TYPES)] class Nested<@R|Special|[Types](LAZY_EXPRESSION) [ResolvedTo(TYPES)] T> : R|@R|Special|(LAZY_EXPRESSION) Interface| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Nested] constructor<@R|Special|[Types](LAZY_EXPRESSION) [ResolvedTo(TYPES)] T>(): R|Outer.Nested| { + LAZY_super<> + } + + } + + } + +STATUS: +FILE: [ResolvedTo(IMPORTS)] nestedClassAsAnnotationArgument2.kt + @R|kotlin/annotation/Target|[CompilerRequiredAnnotations](Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.CLASS|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE_PARAMETER|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE|) public? final? [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] annotation class Special : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Special] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Special.why] why: KClass<*>): R|Special| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val why: KClass<*> = R|/why| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Special] get(): KClass<*> + + } + public? final? [ResolvedTo(SUPER_TYPES)] interface Interface : R|kotlin/Any| { + } + public final [ResolvedTo(STATUS)] class Outer : R|kotlin/Any| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Outer] constructor(): R|Outer| { + LAZY_super + } + + @R|Special|[Types](LAZY_EXPRESSION) public final [ResolvedTo(STATUS)] class Nested<@R|Special|[Types](LAZY_EXPRESSION) [ResolvedTo(STATUS)] T> : R|@R|Special|(LAZY_EXPRESSION) Interface| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Nested] constructor<@R|Special|[Types](LAZY_EXPRESSION) [ResolvedTo(STATUS)] T>(): R|Outer.Nested| { + LAZY_super<> + } + + } + + } + +EXPECT_ACTUAL_MATCHING: +FILE: [ResolvedTo(IMPORTS)] nestedClassAsAnnotationArgument2.kt + @R|kotlin/annotation/Target|[CompilerRequiredAnnotations](Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.CLASS|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE_PARAMETER|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE|) public? final? [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] annotation class Special : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Special] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Special.why] why: KClass<*>): R|Special| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val why: KClass<*> = R|/why| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Special] get(): KClass<*> + + } + public? final? [ResolvedTo(SUPER_TYPES)] interface Interface : R|kotlin/Any| { + } + public final [ResolvedTo(STATUS)] class Outer : R|kotlin/Any| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Outer] constructor(): R|Outer| { + LAZY_super + } + + @R|Special|[Types](LAZY_EXPRESSION) public final [ResolvedTo(EXPECT_ACTUAL_MATCHING)] class Nested<@R|Special|[Types](LAZY_EXPRESSION) [ResolvedTo(EXPECT_ACTUAL_MATCHING)] T> : R|@R|Special|(LAZY_EXPRESSION) Interface| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Nested] constructor<@R|Special|[Types](LAZY_EXPRESSION) [ResolvedTo(EXPECT_ACTUAL_MATCHING)] T>(): R|Outer.Nested| { + LAZY_super<> + } + + } + + } + +ARGUMENTS_OF_ANNOTATIONS: +FILE: [ResolvedTo(IMPORTS)] nestedClassAsAnnotationArgument2.kt + @R|kotlin/annotation/Target|[CompilerRequiredAnnotations](Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.CLASS|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE_PARAMETER|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE|) public? final? [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] annotation class Special : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Special] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Special.why] why: KClass<*>): R|Special| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val why: KClass<*> = R|/why| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Special] get(): KClass<*> + + } + public? final? [ResolvedTo(SUPER_TYPES)] interface Interface : R|kotlin/Any| { + } + public final [ResolvedTo(STATUS)] class Outer : R|kotlin/Any| { + public [ResolvedTo(STATUS)] [ContainingClassKey=Outer] constructor(): R|Outer| { + LAZY_super + } + + @R|Special|[Types](Q|Outer.Nested|) public final [ResolvedTo(ARGUMENTS_OF_ANNOTATIONS)] class Nested<@R|Special|[Types](Q|Outer.Nested|) [ResolvedTo(ARGUMENTS_OF_ANNOTATIONS)] T> : R|@R|Special|(Q|Outer.Nested|) Interface| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Nested] constructor<@R|Special|[Types](Q|Outer.Nested|) [ResolvedTo(ARGUMENTS_OF_ANNOTATIONS)] T>(): R|Outer.Nested| { + LAZY_super<> + } + + } + + } + +CONTRACTS: +FILE: [ResolvedTo(IMPORTS)] nestedClassAsAnnotationArgument2.kt + @R|kotlin/annotation/Target|[CompilerRequiredAnnotations](Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.CLASS|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE_PARAMETER|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE|) public? final? [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] annotation class Special : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Special] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Special.why] why: KClass<*>): R|Special| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val why: KClass<*> = R|/why| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Special] get(): KClass<*> + + } + public? final? [ResolvedTo(SUPER_TYPES)] interface Interface : R|kotlin/Any| { + } + public final [ResolvedTo(STATUS)] class Outer : R|kotlin/Any| { + public [ResolvedTo(STATUS)] [ContainingClassKey=Outer] constructor(): R|Outer| { + LAZY_super + } + + @R|Special|[Types](Q|Outer.Nested|) public final [ResolvedTo(CONTRACTS)] class Nested<@R|Special|[Types](Q|Outer.Nested|) [ResolvedTo(CONTRACTS)] T> : R|@R|Special|(Q|Outer.Nested|) Interface| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Nested] constructor<@R|Special|[Types](Q|Outer.Nested|) [ResolvedTo(CONTRACTS)] T>(): R|Outer.Nested| { + LAZY_super<> + } + + } + + } + +IMPLICIT_TYPES_BODY_RESOLVE: +FILE: [ResolvedTo(IMPORTS)] nestedClassAsAnnotationArgument2.kt + @R|kotlin/annotation/Target|[CompilerRequiredAnnotations](Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.CLASS|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE_PARAMETER|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE|) public? final? [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] annotation class Special : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Special] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Special.why] why: KClass<*>): R|Special| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val why: KClass<*> = R|/why| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Special] get(): KClass<*> + + } + public? final? [ResolvedTo(SUPER_TYPES)] interface Interface : R|kotlin/Any| { + } + public final [ResolvedTo(STATUS)] class Outer : R|kotlin/Any| { + public [ResolvedTo(STATUS)] [ContainingClassKey=Outer] constructor(): R|Outer| { + LAZY_super + } + + @R|Special|[Types](Q|Outer.Nested|) public final [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] class Nested<@R|Special|[Types](Q|Outer.Nested|) [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] T> : R|@R|Special|(Q|Outer.Nested|) Interface| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Nested] constructor<@R|Special|[Types](Q|Outer.Nested|) [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] T>(): R|Outer.Nested| { + LAZY_super<> + } + + } + + } + +ANNOTATIONS_ARGUMENTS_MAPPING: +FILE: [ResolvedTo(IMPORTS)] nestedClassAsAnnotationArgument2.kt + @R|kotlin/annotation/Target|[Types](Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.CLASS|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE_PARAMETER|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE|) public final [ResolvedTo(STATUS)] annotation class Special : R|kotlin/Annotation| { + public [ResolvedTo(STATUS)] [ContainingClassKey=Special] constructor([ResolvedTo(STATUS)] [CorrespondingProperty=/Special.why] why: R|kotlin/reflect/KClass<*>|): R|Special| { + LAZY_super + } + + public final [ResolvedTo(STATUS)] [IsFromPrimaryConstructor=true] val why: R|kotlin/reflect/KClass<*>| = R|/why| + public [ResolvedTo(STATUS)] [ContainingClassKey=Special] get(): R|kotlin/reflect/KClass<*>| + + } + public? final? [ResolvedTo(SUPER_TYPES)] interface Interface : R|kotlin/Any| { + } + public final [ResolvedTo(STATUS)] class Outer : R|kotlin/Any| { + public [ResolvedTo(STATUS)] [ContainingClassKey=Outer] constructor(): R|Outer| { + LAZY_super + } + + @R|Special|[Types](why = #) public final [ResolvedTo(ANNOTATIONS_ARGUMENTS_MAPPING)] class Nested<@R|Special|[Types](why = Q|Outer.Nested|) [ResolvedTo(ANNOTATIONS_ARGUMENTS_MAPPING)] T> : R|@R|Special|(why = #) Interface| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Nested] constructor<@R|Special|[Types](why = Q|Outer.Nested|) [ResolvedTo(ANNOTATIONS_ARGUMENTS_MAPPING)] T>(): R|Outer.Nested| { + LAZY_super<> + } + + } + + } + +BODY_RESOLVE: +FILE: [ResolvedTo(IMPORTS)] nestedClassAsAnnotationArgument2.kt + @R|kotlin/annotation/Target|[Types](Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.CLASS|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE_PARAMETER|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE|) public final [ResolvedTo(STATUS)] annotation class Special : R|kotlin/Annotation| { + public [ResolvedTo(STATUS)] [ContainingClassKey=Special] constructor([ResolvedTo(STATUS)] [CorrespondingProperty=/Special.why] why: R|kotlin/reflect/KClass<*>|): R|Special| { + LAZY_super + } + + public final [ResolvedTo(STATUS)] [IsFromPrimaryConstructor=true] val why: R|kotlin/reflect/KClass<*>| = R|/why| + public [ResolvedTo(STATUS)] [ContainingClassKey=Special] get(): R|kotlin/reflect/KClass<*>| + + } + public abstract [ResolvedTo(STATUS)] interface Interface : R|kotlin/Any| { + } + public final [ResolvedTo(STATUS)] class Outer : R|kotlin/Any| { + public [ResolvedTo(STATUS)] [ContainingClassKey=Outer] constructor(): R|Outer| { + LAZY_super + } + + @R|Special|[Types](why = #) public final [ResolvedTo(BODY_RESOLVE)] class Nested<@R|Special|[Types](why = Q|Outer.Nested|) [ResolvedTo(BODY_RESOLVE)] T> : R|@R|Special|(why = #) Interface| { + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=Nested] constructor<@R|Special|[Types](why = Q|Outer.Nested|) [ResolvedTo(BODY_RESOLVE)] T>(): R|Outer.Nested| { + super() + } + + } + + } + +FILE RAW TO BODY: +FILE: [ResolvedTo(BODY_RESOLVE)] nestedClassAsAnnotationArgument2.kt + @R|kotlin/annotation/Target|[Types](allowedTargets = vararg(Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.CLASS|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE_PARAMETER|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE|)) public final [ResolvedTo(BODY_RESOLVE)] annotation class Special : R|kotlin/Annotation| { + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=Special] constructor([ResolvedTo(BODY_RESOLVE)] [CorrespondingProperty=/Special.why] why: R|kotlin/reflect/KClass<*>|): R|Special| { + super() + } + + public final [ResolvedTo(BODY_RESOLVE)] [IsFromPrimaryConstructor=true] val why: R|kotlin/reflect/KClass<*>| = R|/why| + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=Special] get(): R|kotlin/reflect/KClass<*>| + + } + public abstract [ResolvedTo(BODY_RESOLVE)] interface Interface : R|kotlin/Any| { + } + public final [ResolvedTo(BODY_RESOLVE)] class Outer : R|kotlin/Any| { + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=Outer] constructor(): R|Outer| { + super() + } + + @R|Special|[Types](why = #) public final [ResolvedTo(BODY_RESOLVE)] class Nested<@R|Special|[Types](why = Q|Outer.Nested|) [ResolvedTo(BODY_RESOLVE)] T> : R|@R|Special|(why = #) Interface| { + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=Nested] constructor<@R|Special|[Types](why = Q|Outer.Nested|) [ResolvedTo(BODY_RESOLVE)] T>(): R|Outer.Nested| { + super() + } + + } + + } diff --git a/analysis/low-level-api-fir/testData/lazyResolve/classes/qualifiedNestedClassAsAnnotationArgument.kt b/analysis/low-level-api-fir/testData/lazyResolve/classes/qualifiedNestedClassAsAnnotationArgument.kt new file mode 100644 index 00000000000..b5d0713d6c0 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolve/classes/qualifiedNestedClassAsAnnotationArgument.kt @@ -0,0 +1,11 @@ +import kotlin.reflect.KClass + +@Target(AnnotationTarget.CLASS, AnnotationTarget.TYPE_PARAMETER, AnnotationTarget.TYPE) +annotation class Special(val why: KClass<*>) + +interface Interface + +class Outer { + @Special(Outer.Nested::class) + class Nested<@Special(Outer.Nested::class) T> : @Special(Outer.Nested::class) Interface +} diff --git a/analysis/low-level-api-fir/testData/lazyResolve/classes/qualifiedNestedClassAsAnnotationArgument.txt b/analysis/low-level-api-fir/testData/lazyResolve/classes/qualifiedNestedClassAsAnnotationArgument.txt new file mode 100644 index 00000000000..7447aa5c1b6 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolve/classes/qualifiedNestedClassAsAnnotationArgument.txt @@ -0,0 +1,377 @@ +RAW_FIR: +FILE: [ResolvedTo(RAW_FIR)] qualifiedNestedClassAsAnnotationArgument.kt + @Target[Unresolved](LAZY_EXPRESSION, LAZY_EXPRESSION, LAZY_EXPRESSION) public? final? [ResolvedTo(RAW_FIR)] annotation class Special : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Special] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Special.why] why: KClass<*>): R|Special| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val why: KClass<*> = R|/why| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Special] get(): KClass<*> + + } + public? final? [ResolvedTo(RAW_FIR)] interface Interface : R|kotlin/Any| { + } + public? final? [ResolvedTo(RAW_FIR)] class Outer : R|kotlin/Any| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Outer] constructor(): R|Outer| { + LAZY_super + } + + @Special[Unresolved](LAZY_EXPRESSION) public? final? [ResolvedTo(RAW_FIR)] class Nested<@Special[Unresolved](LAZY_EXPRESSION) [ResolvedTo(RAW_FIR)] T> : @Special[Unresolved](LAZY_EXPRESSION) Interface { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Nested] constructor<@Special[Unresolved](LAZY_EXPRESSION) [ResolvedTo(RAW_FIR)] T>(): R|Outer.Nested| { + LAZY_super<> + } + + } + + } + +IMPORTS: +FILE: [ResolvedTo(IMPORTS)] qualifiedNestedClassAsAnnotationArgument.kt + @Target[Unresolved](LAZY_EXPRESSION, LAZY_EXPRESSION, LAZY_EXPRESSION) public? final? [ResolvedTo(RAW_FIR)] annotation class Special : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Special] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Special.why] why: KClass<*>): R|Special| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val why: KClass<*> = R|/why| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Special] get(): KClass<*> + + } + public? final? [ResolvedTo(RAW_FIR)] interface Interface : R|kotlin/Any| { + } + public? final? [ResolvedTo(RAW_FIR)] class Outer : R|kotlin/Any| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Outer] constructor(): R|Outer| { + LAZY_super + } + + @Special[Unresolved](LAZY_EXPRESSION) public? final? [ResolvedTo(RAW_FIR)] class Nested<@Special[Unresolved](LAZY_EXPRESSION) [ResolvedTo(RAW_FIR)] T> : @Special[Unresolved](LAZY_EXPRESSION) Interface { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Nested] constructor<@Special[Unresolved](LAZY_EXPRESSION) [ResolvedTo(RAW_FIR)] T>(): R|Outer.Nested| { + LAZY_super<> + } + + } + + } + +COMPILER_REQUIRED_ANNOTATIONS: +FILE: [ResolvedTo(IMPORTS)] qualifiedNestedClassAsAnnotationArgument.kt + @Target[Unresolved](LAZY_EXPRESSION, LAZY_EXPRESSION, LAZY_EXPRESSION) public? final? [ResolvedTo(RAW_FIR)] annotation class Special : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Special] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Special.why] why: KClass<*>): R|Special| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val why: KClass<*> = R|/why| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Special] get(): KClass<*> + + } + public? final? [ResolvedTo(RAW_FIR)] interface Interface : R|kotlin/Any| { + } + public? final? [ResolvedTo(RAW_FIR)] class Outer : R|kotlin/Any| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Outer] constructor(): R|Outer| { + LAZY_super + } + + @Special[Unresolved](LAZY_EXPRESSION) public? final? [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] class Nested<@Special[Unresolved](LAZY_EXPRESSION) [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] T> : @Special[Unresolved](LAZY_EXPRESSION) Interface { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Nested] constructor<@Special[Unresolved](LAZY_EXPRESSION) [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] T>(): R|Outer.Nested| { + LAZY_super<> + } + + } + + } + +COMPANION_GENERATION: +FILE: [ResolvedTo(IMPORTS)] qualifiedNestedClassAsAnnotationArgument.kt + @Target[Unresolved](LAZY_EXPRESSION, LAZY_EXPRESSION, LAZY_EXPRESSION) public? final? [ResolvedTo(RAW_FIR)] annotation class Special : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Special] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Special.why] why: KClass<*>): R|Special| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val why: KClass<*> = R|/why| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Special] get(): KClass<*> + + } + public? final? [ResolvedTo(RAW_FIR)] interface Interface : R|kotlin/Any| { + } + public? final? [ResolvedTo(RAW_FIR)] class Outer : R|kotlin/Any| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Outer] constructor(): R|Outer| { + LAZY_super + } + + @Special[Unresolved](LAZY_EXPRESSION) public? final? [ResolvedTo(COMPANION_GENERATION)] class Nested<@Special[Unresolved](LAZY_EXPRESSION) [ResolvedTo(COMPANION_GENERATION)] T> : @Special[Unresolved](LAZY_EXPRESSION) Interface { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Nested] constructor<@Special[Unresolved](LAZY_EXPRESSION) [ResolvedTo(COMPANION_GENERATION)] T>(): R|Outer.Nested| { + LAZY_super<> + } + + } + + } + +SUPER_TYPES: +FILE: [ResolvedTo(IMPORTS)] qualifiedNestedClassAsAnnotationArgument.kt + @R|kotlin/annotation/Target|[CompilerRequiredAnnotations](Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.CLASS|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE_PARAMETER|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE|) public? final? [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] annotation class Special : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Special] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Special.why] why: KClass<*>): R|Special| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val why: KClass<*> = R|/why| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Special] get(): KClass<*> + + } + public? final? [ResolvedTo(SUPER_TYPES)] interface Interface : R|kotlin/Any| { + } + public? final? [ResolvedTo(SUPER_TYPES)] class Outer : R|kotlin/Any| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Outer] constructor(): R|Outer| { + LAZY_super + } + + @Special[Unresolved](LAZY_EXPRESSION) public? final? [ResolvedTo(SUPER_TYPES)] class Nested<@Special[Unresolved](LAZY_EXPRESSION) [ResolvedTo(SUPER_TYPES)] T> : R|@R|Special|(LAZY_EXPRESSION) Interface| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Nested] constructor<@Special[Unresolved](LAZY_EXPRESSION) [ResolvedTo(SUPER_TYPES)] T>(): R|Outer.Nested| { + LAZY_super<> + } + + } + + } + +TYPES: +FILE: [ResolvedTo(IMPORTS)] qualifiedNestedClassAsAnnotationArgument.kt + @R|kotlin/annotation/Target|[CompilerRequiredAnnotations](Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.CLASS|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE_PARAMETER|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE|) public? final? [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] annotation class Special : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Special] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Special.why] why: KClass<*>): R|Special| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val why: KClass<*> = R|/why| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Special] get(): KClass<*> + + } + public? final? [ResolvedTo(SUPER_TYPES)] interface Interface : R|kotlin/Any| { + } + public? final? [ResolvedTo(TYPES)] class Outer : R|kotlin/Any| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Outer] constructor(): R|Outer| { + LAZY_super + } + + @R|Special|[Types](LAZY_EXPRESSION) public? final? [ResolvedTo(TYPES)] class Nested<@R|Special|[Types](LAZY_EXPRESSION) [ResolvedTo(TYPES)] T> : R|@R|Special|(LAZY_EXPRESSION) Interface| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Nested] constructor<@R|Special|[Types](LAZY_EXPRESSION) [ResolvedTo(TYPES)] T>(): R|Outer.Nested| { + LAZY_super<> + } + + } + + } + +STATUS: +FILE: [ResolvedTo(IMPORTS)] qualifiedNestedClassAsAnnotationArgument.kt + @R|kotlin/annotation/Target|[CompilerRequiredAnnotations](Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.CLASS|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE_PARAMETER|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE|) public? final? [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] annotation class Special : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Special] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Special.why] why: KClass<*>): R|Special| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val why: KClass<*> = R|/why| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Special] get(): KClass<*> + + } + public? final? [ResolvedTo(SUPER_TYPES)] interface Interface : R|kotlin/Any| { + } + public final [ResolvedTo(STATUS)] class Outer : R|kotlin/Any| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Outer] constructor(): R|Outer| { + LAZY_super + } + + @R|Special|[Types](LAZY_EXPRESSION) public final [ResolvedTo(STATUS)] class Nested<@R|Special|[Types](LAZY_EXPRESSION) [ResolvedTo(STATUS)] T> : R|@R|Special|(LAZY_EXPRESSION) Interface| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Nested] constructor<@R|Special|[Types](LAZY_EXPRESSION) [ResolvedTo(STATUS)] T>(): R|Outer.Nested| { + LAZY_super<> + } + + } + + } + +EXPECT_ACTUAL_MATCHING: +FILE: [ResolvedTo(IMPORTS)] qualifiedNestedClassAsAnnotationArgument.kt + @R|kotlin/annotation/Target|[CompilerRequiredAnnotations](Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.CLASS|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE_PARAMETER|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE|) public? final? [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] annotation class Special : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Special] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Special.why] why: KClass<*>): R|Special| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val why: KClass<*> = R|/why| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Special] get(): KClass<*> + + } + public? final? [ResolvedTo(SUPER_TYPES)] interface Interface : R|kotlin/Any| { + } + public final [ResolvedTo(STATUS)] class Outer : R|kotlin/Any| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Outer] constructor(): R|Outer| { + LAZY_super + } + + @R|Special|[Types](LAZY_EXPRESSION) public final [ResolvedTo(EXPECT_ACTUAL_MATCHING)] class Nested<@R|Special|[Types](LAZY_EXPRESSION) [ResolvedTo(EXPECT_ACTUAL_MATCHING)] T> : R|@R|Special|(LAZY_EXPRESSION) Interface| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Nested] constructor<@R|Special|[Types](LAZY_EXPRESSION) [ResolvedTo(EXPECT_ACTUAL_MATCHING)] T>(): R|Outer.Nested| { + LAZY_super<> + } + + } + + } + +ARGUMENTS_OF_ANNOTATIONS: +FILE: [ResolvedTo(IMPORTS)] qualifiedNestedClassAsAnnotationArgument.kt + @R|kotlin/annotation/Target|[CompilerRequiredAnnotations](Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.CLASS|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE_PARAMETER|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE|) public? final? [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] annotation class Special : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Special] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Special.why] why: KClass<*>): R|Special| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val why: KClass<*> = R|/why| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Special] get(): KClass<*> + + } + public? final? [ResolvedTo(SUPER_TYPES)] interface Interface : R|kotlin/Any| { + } + public final [ResolvedTo(STATUS)] class Outer : R|kotlin/Any| { + public [ResolvedTo(STATUS)] [ContainingClassKey=Outer] constructor(): R|Outer| { + LAZY_super + } + + @R|Special|[Types]((Q|Outer.Nested|)) public final [ResolvedTo(ARGUMENTS_OF_ANNOTATIONS)] class Nested<@R|Special|[Types]((Q|Outer.Nested|)) [ResolvedTo(ARGUMENTS_OF_ANNOTATIONS)] T> : R|@R|Special|((Q|Outer.Nested|)) Interface| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Nested] constructor<@R|Special|[Types]((Q|Outer.Nested|)) [ResolvedTo(ARGUMENTS_OF_ANNOTATIONS)] T>(): R|Outer.Nested| { + LAZY_super<> + } + + } + + } + +CONTRACTS: +FILE: [ResolvedTo(IMPORTS)] qualifiedNestedClassAsAnnotationArgument.kt + @R|kotlin/annotation/Target|[CompilerRequiredAnnotations](Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.CLASS|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE_PARAMETER|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE|) public? final? [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] annotation class Special : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Special] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Special.why] why: KClass<*>): R|Special| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val why: KClass<*> = R|/why| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Special] get(): KClass<*> + + } + public? final? [ResolvedTo(SUPER_TYPES)] interface Interface : R|kotlin/Any| { + } + public final [ResolvedTo(STATUS)] class Outer : R|kotlin/Any| { + public [ResolvedTo(STATUS)] [ContainingClassKey=Outer] constructor(): R|Outer| { + LAZY_super + } + + @R|Special|[Types]((Q|Outer.Nested|)) public final [ResolvedTo(CONTRACTS)] class Nested<@R|Special|[Types]((Q|Outer.Nested|)) [ResolvedTo(CONTRACTS)] T> : R|@R|Special|((Q|Outer.Nested|)) Interface| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Nested] constructor<@R|Special|[Types]((Q|Outer.Nested|)) [ResolvedTo(CONTRACTS)] T>(): R|Outer.Nested| { + LAZY_super<> + } + + } + + } + +IMPLICIT_TYPES_BODY_RESOLVE: +FILE: [ResolvedTo(IMPORTS)] qualifiedNestedClassAsAnnotationArgument.kt + @R|kotlin/annotation/Target|[CompilerRequiredAnnotations](Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.CLASS|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE_PARAMETER|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE|) public? final? [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] annotation class Special : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Special] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Special.why] why: KClass<*>): R|Special| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val why: KClass<*> = R|/why| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Special] get(): KClass<*> + + } + public? final? [ResolvedTo(SUPER_TYPES)] interface Interface : R|kotlin/Any| { + } + public final [ResolvedTo(STATUS)] class Outer : R|kotlin/Any| { + public [ResolvedTo(STATUS)] [ContainingClassKey=Outer] constructor(): R|Outer| { + LAZY_super + } + + @R|Special|[Types]((Q|Outer.Nested|)) public final [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] class Nested<@R|Special|[Types]((Q|Outer.Nested|)) [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] T> : R|@R|Special|((Q|Outer.Nested|)) Interface| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Nested] constructor<@R|Special|[Types]((Q|Outer.Nested|)) [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] T>(): R|Outer.Nested| { + LAZY_super<> + } + + } + + } + +ANNOTATIONS_ARGUMENTS_MAPPING: +FILE: [ResolvedTo(IMPORTS)] qualifiedNestedClassAsAnnotationArgument.kt + @R|kotlin/annotation/Target|[Types](Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.CLASS|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE_PARAMETER|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE|) public final [ResolvedTo(STATUS)] annotation class Special : R|kotlin/Annotation| { + public [ResolvedTo(STATUS)] [ContainingClassKey=Special] constructor([ResolvedTo(STATUS)] [CorrespondingProperty=/Special.why] why: R|kotlin/reflect/KClass<*>|): R|Special| { + LAZY_super + } + + public final [ResolvedTo(STATUS)] [IsFromPrimaryConstructor=true] val why: R|kotlin/reflect/KClass<*>| = R|/why| + public [ResolvedTo(STATUS)] [ContainingClassKey=Special] get(): R|kotlin/reflect/KClass<*>| + + } + public? final? [ResolvedTo(SUPER_TYPES)] interface Interface : R|kotlin/Any| { + } + public final [ResolvedTo(STATUS)] class Outer : R|kotlin/Any| { + public [ResolvedTo(STATUS)] [ContainingClassKey=Outer] constructor(): R|Outer| { + LAZY_super + } + + @R|Special|[Types](why = (Q|Outer.Nested|)) public final [ResolvedTo(ANNOTATIONS_ARGUMENTS_MAPPING)] class Nested<@R|Special|[Types](why = (Q|Outer.Nested|)) [ResolvedTo(ANNOTATIONS_ARGUMENTS_MAPPING)] T> : R|@R|Special|(why = (Q|Outer.Nested|)) Interface| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Nested] constructor<@R|Special|[Types](why = (Q|Outer.Nested|)) [ResolvedTo(ANNOTATIONS_ARGUMENTS_MAPPING)] T>(): R|Outer.Nested| { + LAZY_super<> + } + + } + + } + +BODY_RESOLVE: +FILE: [ResolvedTo(IMPORTS)] qualifiedNestedClassAsAnnotationArgument.kt + @R|kotlin/annotation/Target|[Types](Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.CLASS|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE_PARAMETER|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE|) public final [ResolvedTo(STATUS)] annotation class Special : R|kotlin/Annotation| { + public [ResolvedTo(STATUS)] [ContainingClassKey=Special] constructor([ResolvedTo(STATUS)] [CorrespondingProperty=/Special.why] why: R|kotlin/reflect/KClass<*>|): R|Special| { + LAZY_super + } + + public final [ResolvedTo(STATUS)] [IsFromPrimaryConstructor=true] val why: R|kotlin/reflect/KClass<*>| = R|/why| + public [ResolvedTo(STATUS)] [ContainingClassKey=Special] get(): R|kotlin/reflect/KClass<*>| + + } + public abstract [ResolvedTo(STATUS)] interface Interface : R|kotlin/Any| { + } + public final [ResolvedTo(STATUS)] class Outer : R|kotlin/Any| { + public [ResolvedTo(STATUS)] [ContainingClassKey=Outer] constructor(): R|Outer| { + LAZY_super + } + + @R|Special|[Types](why = (Q|Outer.Nested|)) public final [ResolvedTo(BODY_RESOLVE)] class Nested<@R|Special|[Types](why = (Q|Outer.Nested|)) [ResolvedTo(BODY_RESOLVE)] T> : R|@R|Special|(why = (Q|Outer.Nested|)) Interface| { + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=Nested] constructor<@R|Special|[Types](why = (Q|Outer.Nested|)) [ResolvedTo(BODY_RESOLVE)] T>(): R|Outer.Nested| { + super() + } + + } + + } + +FILE RAW TO BODY: +FILE: [ResolvedTo(BODY_RESOLVE)] qualifiedNestedClassAsAnnotationArgument.kt + @R|kotlin/annotation/Target|[Types](allowedTargets = vararg(Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.CLASS|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE_PARAMETER|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE|)) public final [ResolvedTo(BODY_RESOLVE)] annotation class Special : R|kotlin/Annotation| { + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=Special] constructor([ResolvedTo(BODY_RESOLVE)] [CorrespondingProperty=/Special.why] why: R|kotlin/reflect/KClass<*>|): R|Special| { + super() + } + + public final [ResolvedTo(BODY_RESOLVE)] [IsFromPrimaryConstructor=true] val why: R|kotlin/reflect/KClass<*>| = R|/why| + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=Special] get(): R|kotlin/reflect/KClass<*>| + + } + public abstract [ResolvedTo(BODY_RESOLVE)] interface Interface : R|kotlin/Any| { + } + public final [ResolvedTo(BODY_RESOLVE)] class Outer : R|kotlin/Any| { + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=Outer] constructor(): R|Outer| { + super() + } + + @R|Special|[Types](why = (Q|Outer.Nested|)) public final [ResolvedTo(BODY_RESOLVE)] class Nested<@R|Special|[Types](why = (Q|Outer.Nested|)) [ResolvedTo(BODY_RESOLVE)] T> : R|@R|Special|(why = (Q|Outer.Nested|)) Interface| { + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=Nested] constructor<@R|Special|[Types](why = (Q|Outer.Nested|)) [ResolvedTo(BODY_RESOLVE)] T>(): R|Outer.Nested| { + super() + } + + } + + } diff --git a/analysis/low-level-api-fir/testData/lazyResolve/classes/qualifiedNestedClassAsAnnotationArgument2.kt b/analysis/low-level-api-fir/testData/lazyResolve/classes/qualifiedNestedClassAsAnnotationArgument2.kt new file mode 100644 index 00000000000..6379d2f4498 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolve/classes/qualifiedNestedClassAsAnnotationArgument2.kt @@ -0,0 +1,11 @@ +import kotlin.reflect.KClass + +@Target(AnnotationTarget.CLASS, AnnotationTarget.TYPE_PARAMETER, AnnotationTarget.TYPE) +annotation class Special(val why: KClass<*>) + +interface Interface + +class Outer { + @Special(Outer.Nested) + class Nested<@Special(Outer.Nested) T> : @Special(Outer.Nested) Interface +} diff --git a/analysis/low-level-api-fir/testData/lazyResolve/classes/qualifiedNestedClassAsAnnotationArgument2.txt b/analysis/low-level-api-fir/testData/lazyResolve/classes/qualifiedNestedClassAsAnnotationArgument2.txt new file mode 100644 index 00000000000..c83b8288ec0 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolve/classes/qualifiedNestedClassAsAnnotationArgument2.txt @@ -0,0 +1,377 @@ +RAW_FIR: +FILE: [ResolvedTo(RAW_FIR)] qualifiedNestedClassAsAnnotationArgument2.kt + @Target[Unresolved](LAZY_EXPRESSION, LAZY_EXPRESSION, LAZY_EXPRESSION) public? final? [ResolvedTo(RAW_FIR)] annotation class Special : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Special] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Special.why] why: KClass<*>): R|Special| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val why: KClass<*> = R|/why| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Special] get(): KClass<*> + + } + public? final? [ResolvedTo(RAW_FIR)] interface Interface : R|kotlin/Any| { + } + public? final? [ResolvedTo(RAW_FIR)] class Outer : R|kotlin/Any| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Outer] constructor(): R|Outer| { + LAZY_super + } + + @Special[Unresolved](LAZY_EXPRESSION) public? final? [ResolvedTo(RAW_FIR)] class Nested<@Special[Unresolved](LAZY_EXPRESSION) [ResolvedTo(RAW_FIR)] T> : @Special[Unresolved](LAZY_EXPRESSION) Interface { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Nested] constructor<@Special[Unresolved](LAZY_EXPRESSION) [ResolvedTo(RAW_FIR)] T>(): R|Outer.Nested| { + LAZY_super<> + } + + } + + } + +IMPORTS: +FILE: [ResolvedTo(IMPORTS)] qualifiedNestedClassAsAnnotationArgument2.kt + @Target[Unresolved](LAZY_EXPRESSION, LAZY_EXPRESSION, LAZY_EXPRESSION) public? final? [ResolvedTo(RAW_FIR)] annotation class Special : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Special] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Special.why] why: KClass<*>): R|Special| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val why: KClass<*> = R|/why| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Special] get(): KClass<*> + + } + public? final? [ResolvedTo(RAW_FIR)] interface Interface : R|kotlin/Any| { + } + public? final? [ResolvedTo(RAW_FIR)] class Outer : R|kotlin/Any| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Outer] constructor(): R|Outer| { + LAZY_super + } + + @Special[Unresolved](LAZY_EXPRESSION) public? final? [ResolvedTo(RAW_FIR)] class Nested<@Special[Unresolved](LAZY_EXPRESSION) [ResolvedTo(RAW_FIR)] T> : @Special[Unresolved](LAZY_EXPRESSION) Interface { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Nested] constructor<@Special[Unresolved](LAZY_EXPRESSION) [ResolvedTo(RAW_FIR)] T>(): R|Outer.Nested| { + LAZY_super<> + } + + } + + } + +COMPILER_REQUIRED_ANNOTATIONS: +FILE: [ResolvedTo(IMPORTS)] qualifiedNestedClassAsAnnotationArgument2.kt + @Target[Unresolved](LAZY_EXPRESSION, LAZY_EXPRESSION, LAZY_EXPRESSION) public? final? [ResolvedTo(RAW_FIR)] annotation class Special : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Special] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Special.why] why: KClass<*>): R|Special| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val why: KClass<*> = R|/why| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Special] get(): KClass<*> + + } + public? final? [ResolvedTo(RAW_FIR)] interface Interface : R|kotlin/Any| { + } + public? final? [ResolvedTo(RAW_FIR)] class Outer : R|kotlin/Any| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Outer] constructor(): R|Outer| { + LAZY_super + } + + @Special[Unresolved](LAZY_EXPRESSION) public? final? [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] class Nested<@Special[Unresolved](LAZY_EXPRESSION) [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] T> : @Special[Unresolved](LAZY_EXPRESSION) Interface { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Nested] constructor<@Special[Unresolved](LAZY_EXPRESSION) [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] T>(): R|Outer.Nested| { + LAZY_super<> + } + + } + + } + +COMPANION_GENERATION: +FILE: [ResolvedTo(IMPORTS)] qualifiedNestedClassAsAnnotationArgument2.kt + @Target[Unresolved](LAZY_EXPRESSION, LAZY_EXPRESSION, LAZY_EXPRESSION) public? final? [ResolvedTo(RAW_FIR)] annotation class Special : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Special] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Special.why] why: KClass<*>): R|Special| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val why: KClass<*> = R|/why| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Special] get(): KClass<*> + + } + public? final? [ResolvedTo(RAW_FIR)] interface Interface : R|kotlin/Any| { + } + public? final? [ResolvedTo(RAW_FIR)] class Outer : R|kotlin/Any| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Outer] constructor(): R|Outer| { + LAZY_super + } + + @Special[Unresolved](LAZY_EXPRESSION) public? final? [ResolvedTo(COMPANION_GENERATION)] class Nested<@Special[Unresolved](LAZY_EXPRESSION) [ResolvedTo(COMPANION_GENERATION)] T> : @Special[Unresolved](LAZY_EXPRESSION) Interface { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Nested] constructor<@Special[Unresolved](LAZY_EXPRESSION) [ResolvedTo(COMPANION_GENERATION)] T>(): R|Outer.Nested| { + LAZY_super<> + } + + } + + } + +SUPER_TYPES: +FILE: [ResolvedTo(IMPORTS)] qualifiedNestedClassAsAnnotationArgument2.kt + @R|kotlin/annotation/Target|[CompilerRequiredAnnotations](Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.CLASS|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE_PARAMETER|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE|) public? final? [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] annotation class Special : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Special] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Special.why] why: KClass<*>): R|Special| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val why: KClass<*> = R|/why| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Special] get(): KClass<*> + + } + public? final? [ResolvedTo(SUPER_TYPES)] interface Interface : R|kotlin/Any| { + } + public? final? [ResolvedTo(SUPER_TYPES)] class Outer : R|kotlin/Any| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Outer] constructor(): R|Outer| { + LAZY_super + } + + @Special[Unresolved](LAZY_EXPRESSION) public? final? [ResolvedTo(SUPER_TYPES)] class Nested<@Special[Unresolved](LAZY_EXPRESSION) [ResolvedTo(SUPER_TYPES)] T> : R|@R|Special|(LAZY_EXPRESSION) Interface| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Nested] constructor<@Special[Unresolved](LAZY_EXPRESSION) [ResolvedTo(SUPER_TYPES)] T>(): R|Outer.Nested| { + LAZY_super<> + } + + } + + } + +TYPES: +FILE: [ResolvedTo(IMPORTS)] qualifiedNestedClassAsAnnotationArgument2.kt + @R|kotlin/annotation/Target|[CompilerRequiredAnnotations](Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.CLASS|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE_PARAMETER|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE|) public? final? [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] annotation class Special : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Special] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Special.why] why: KClass<*>): R|Special| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val why: KClass<*> = R|/why| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Special] get(): KClass<*> + + } + public? final? [ResolvedTo(SUPER_TYPES)] interface Interface : R|kotlin/Any| { + } + public? final? [ResolvedTo(TYPES)] class Outer : R|kotlin/Any| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Outer] constructor(): R|Outer| { + LAZY_super + } + + @R|Special|[Types](LAZY_EXPRESSION) public? final? [ResolvedTo(TYPES)] class Nested<@R|Special|[Types](LAZY_EXPRESSION) [ResolvedTo(TYPES)] T> : R|@R|Special|(LAZY_EXPRESSION) Interface| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Nested] constructor<@R|Special|[Types](LAZY_EXPRESSION) [ResolvedTo(TYPES)] T>(): R|Outer.Nested| { + LAZY_super<> + } + + } + + } + +STATUS: +FILE: [ResolvedTo(IMPORTS)] qualifiedNestedClassAsAnnotationArgument2.kt + @R|kotlin/annotation/Target|[CompilerRequiredAnnotations](Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.CLASS|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE_PARAMETER|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE|) public? final? [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] annotation class Special : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Special] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Special.why] why: KClass<*>): R|Special| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val why: KClass<*> = R|/why| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Special] get(): KClass<*> + + } + public? final? [ResolvedTo(SUPER_TYPES)] interface Interface : R|kotlin/Any| { + } + public final [ResolvedTo(STATUS)] class Outer : R|kotlin/Any| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Outer] constructor(): R|Outer| { + LAZY_super + } + + @R|Special|[Types](LAZY_EXPRESSION) public final [ResolvedTo(STATUS)] class Nested<@R|Special|[Types](LAZY_EXPRESSION) [ResolvedTo(STATUS)] T> : R|@R|Special|(LAZY_EXPRESSION) Interface| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Nested] constructor<@R|Special|[Types](LAZY_EXPRESSION) [ResolvedTo(STATUS)] T>(): R|Outer.Nested| { + LAZY_super<> + } + + } + + } + +EXPECT_ACTUAL_MATCHING: +FILE: [ResolvedTo(IMPORTS)] qualifiedNestedClassAsAnnotationArgument2.kt + @R|kotlin/annotation/Target|[CompilerRequiredAnnotations](Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.CLASS|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE_PARAMETER|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE|) public? final? [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] annotation class Special : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Special] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Special.why] why: KClass<*>): R|Special| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val why: KClass<*> = R|/why| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Special] get(): KClass<*> + + } + public? final? [ResolvedTo(SUPER_TYPES)] interface Interface : R|kotlin/Any| { + } + public final [ResolvedTo(STATUS)] class Outer : R|kotlin/Any| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Outer] constructor(): R|Outer| { + LAZY_super + } + + @R|Special|[Types](LAZY_EXPRESSION) public final [ResolvedTo(EXPECT_ACTUAL_MATCHING)] class Nested<@R|Special|[Types](LAZY_EXPRESSION) [ResolvedTo(EXPECT_ACTUAL_MATCHING)] T> : R|@R|Special|(LAZY_EXPRESSION) Interface| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Nested] constructor<@R|Special|[Types](LAZY_EXPRESSION) [ResolvedTo(EXPECT_ACTUAL_MATCHING)] T>(): R|Outer.Nested| { + LAZY_super<> + } + + } + + } + +ARGUMENTS_OF_ANNOTATIONS: +FILE: [ResolvedTo(IMPORTS)] qualifiedNestedClassAsAnnotationArgument2.kt + @R|kotlin/annotation/Target|[CompilerRequiredAnnotations](Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.CLASS|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE_PARAMETER|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE|) public? final? [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] annotation class Special : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Special] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Special.why] why: KClass<*>): R|Special| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val why: KClass<*> = R|/why| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Special] get(): KClass<*> + + } + public? final? [ResolvedTo(SUPER_TYPES)] interface Interface : R|kotlin/Any| { + } + public final [ResolvedTo(STATUS)] class Outer : R|kotlin/Any| { + public [ResolvedTo(STATUS)] [ContainingClassKey=Outer] constructor(): R|Outer| { + LAZY_super + } + + @R|Special|[Types](Q|Outer.Nested|) public final [ResolvedTo(ARGUMENTS_OF_ANNOTATIONS)] class Nested<@R|Special|[Types](Q|Outer.Nested|) [ResolvedTo(ARGUMENTS_OF_ANNOTATIONS)] T> : R|@R|Special|(Q|Outer.Nested|) Interface| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Nested] constructor<@R|Special|[Types](Q|Outer.Nested|) [ResolvedTo(ARGUMENTS_OF_ANNOTATIONS)] T>(): R|Outer.Nested| { + LAZY_super<> + } + + } + + } + +CONTRACTS: +FILE: [ResolvedTo(IMPORTS)] qualifiedNestedClassAsAnnotationArgument2.kt + @R|kotlin/annotation/Target|[CompilerRequiredAnnotations](Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.CLASS|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE_PARAMETER|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE|) public? final? [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] annotation class Special : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Special] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Special.why] why: KClass<*>): R|Special| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val why: KClass<*> = R|/why| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Special] get(): KClass<*> + + } + public? final? [ResolvedTo(SUPER_TYPES)] interface Interface : R|kotlin/Any| { + } + public final [ResolvedTo(STATUS)] class Outer : R|kotlin/Any| { + public [ResolvedTo(STATUS)] [ContainingClassKey=Outer] constructor(): R|Outer| { + LAZY_super + } + + @R|Special|[Types](Q|Outer.Nested|) public final [ResolvedTo(CONTRACTS)] class Nested<@R|Special|[Types](Q|Outer.Nested|) [ResolvedTo(CONTRACTS)] T> : R|@R|Special|(Q|Outer.Nested|) Interface| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Nested] constructor<@R|Special|[Types](Q|Outer.Nested|) [ResolvedTo(CONTRACTS)] T>(): R|Outer.Nested| { + LAZY_super<> + } + + } + + } + +IMPLICIT_TYPES_BODY_RESOLVE: +FILE: [ResolvedTo(IMPORTS)] qualifiedNestedClassAsAnnotationArgument2.kt + @R|kotlin/annotation/Target|[CompilerRequiredAnnotations](Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.CLASS|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE_PARAMETER|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE|) public? final? [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] annotation class Special : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Special] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Special.why] why: KClass<*>): R|Special| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val why: KClass<*> = R|/why| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Special] get(): KClass<*> + + } + public? final? [ResolvedTo(SUPER_TYPES)] interface Interface : R|kotlin/Any| { + } + public final [ResolvedTo(STATUS)] class Outer : R|kotlin/Any| { + public [ResolvedTo(STATUS)] [ContainingClassKey=Outer] constructor(): R|Outer| { + LAZY_super + } + + @R|Special|[Types](Q|Outer.Nested|) public final [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] class Nested<@R|Special|[Types](Q|Outer.Nested|) [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] T> : R|@R|Special|(Q|Outer.Nested|) Interface| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Nested] constructor<@R|Special|[Types](Q|Outer.Nested|) [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] T>(): R|Outer.Nested| { + LAZY_super<> + } + + } + + } + +ANNOTATIONS_ARGUMENTS_MAPPING: +FILE: [ResolvedTo(IMPORTS)] qualifiedNestedClassAsAnnotationArgument2.kt + @R|kotlin/annotation/Target|[Types](Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.CLASS|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE_PARAMETER|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE|) public final [ResolvedTo(STATUS)] annotation class Special : R|kotlin/Annotation| { + public [ResolvedTo(STATUS)] [ContainingClassKey=Special] constructor([ResolvedTo(STATUS)] [CorrespondingProperty=/Special.why] why: R|kotlin/reflect/KClass<*>|): R|Special| { + LAZY_super + } + + public final [ResolvedTo(STATUS)] [IsFromPrimaryConstructor=true] val why: R|kotlin/reflect/KClass<*>| = R|/why| + public [ResolvedTo(STATUS)] [ContainingClassKey=Special] get(): R|kotlin/reflect/KClass<*>| + + } + public? final? [ResolvedTo(SUPER_TYPES)] interface Interface : R|kotlin/Any| { + } + public final [ResolvedTo(STATUS)] class Outer : R|kotlin/Any| { + public [ResolvedTo(STATUS)] [ContainingClassKey=Outer] constructor(): R|Outer| { + LAZY_super + } + + @R|Special|[Types](why = Q|Outer.Nested|) public final [ResolvedTo(ANNOTATIONS_ARGUMENTS_MAPPING)] class Nested<@R|Special|[Types](why = Q|Outer.Nested|) [ResolvedTo(ANNOTATIONS_ARGUMENTS_MAPPING)] T> : R|@R|Special|(why = Q|Outer.Nested|) Interface| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Nested] constructor<@R|Special|[Types](why = Q|Outer.Nested|) [ResolvedTo(ANNOTATIONS_ARGUMENTS_MAPPING)] T>(): R|Outer.Nested| { + LAZY_super<> + } + + } + + } + +BODY_RESOLVE: +FILE: [ResolvedTo(IMPORTS)] qualifiedNestedClassAsAnnotationArgument2.kt + @R|kotlin/annotation/Target|[Types](Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.CLASS|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE_PARAMETER|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE|) public final [ResolvedTo(STATUS)] annotation class Special : R|kotlin/Annotation| { + public [ResolvedTo(STATUS)] [ContainingClassKey=Special] constructor([ResolvedTo(STATUS)] [CorrespondingProperty=/Special.why] why: R|kotlin/reflect/KClass<*>|): R|Special| { + LAZY_super + } + + public final [ResolvedTo(STATUS)] [IsFromPrimaryConstructor=true] val why: R|kotlin/reflect/KClass<*>| = R|/why| + public [ResolvedTo(STATUS)] [ContainingClassKey=Special] get(): R|kotlin/reflect/KClass<*>| + + } + public abstract [ResolvedTo(STATUS)] interface Interface : R|kotlin/Any| { + } + public final [ResolvedTo(STATUS)] class Outer : R|kotlin/Any| { + public [ResolvedTo(STATUS)] [ContainingClassKey=Outer] constructor(): R|Outer| { + LAZY_super + } + + @R|Special|[Types](why = Q|Outer.Nested|) public final [ResolvedTo(BODY_RESOLVE)] class Nested<@R|Special|[Types](why = Q|Outer.Nested|) [ResolvedTo(BODY_RESOLVE)] T> : R|@R|Special|(why = Q|Outer.Nested|) Interface| { + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=Nested] constructor<@R|Special|[Types](why = Q|Outer.Nested|) [ResolvedTo(BODY_RESOLVE)] T>(): R|Outer.Nested| { + super() + } + + } + + } + +FILE RAW TO BODY: +FILE: [ResolvedTo(BODY_RESOLVE)] qualifiedNestedClassAsAnnotationArgument2.kt + @R|kotlin/annotation/Target|[Types](allowedTargets = vararg(Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.CLASS|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE_PARAMETER|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE|)) public final [ResolvedTo(BODY_RESOLVE)] annotation class Special : R|kotlin/Annotation| { + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=Special] constructor([ResolvedTo(BODY_RESOLVE)] [CorrespondingProperty=/Special.why] why: R|kotlin/reflect/KClass<*>|): R|Special| { + super() + } + + public final [ResolvedTo(BODY_RESOLVE)] [IsFromPrimaryConstructor=true] val why: R|kotlin/reflect/KClass<*>| = R|/why| + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=Special] get(): R|kotlin/reflect/KClass<*>| + + } + public abstract [ResolvedTo(BODY_RESOLVE)] interface Interface : R|kotlin/Any| { + } + public final [ResolvedTo(BODY_RESOLVE)] class Outer : R|kotlin/Any| { + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=Outer] constructor(): R|Outer| { + super() + } + + @R|Special|[Types](why = Q|Outer.Nested|) public final [ResolvedTo(BODY_RESOLVE)] class Nested<@R|Special|[Types](why = Q|Outer.Nested|) [ResolvedTo(BODY_RESOLVE)] T> : R|@R|Special|(why = Q|Outer.Nested|) Interface| { + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=Nested] constructor<@R|Special|[Types](why = Q|Outer.Nested|) [ResolvedTo(BODY_RESOLVE)] T>(): R|Outer.Nested| { + super() + } + + } + + } diff --git a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/FirOutOfContentRootLazyDeclarationResolveTestGenerated.java b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/FirOutOfContentRootLazyDeclarationResolveTestGenerated.java index e3bc39d6f5f..f6e102883b2 100644 --- a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/FirOutOfContentRootLazyDeclarationResolveTestGenerated.java +++ b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/FirOutOfContentRootLazyDeclarationResolveTestGenerated.java @@ -609,6 +609,12 @@ public class FirOutOfContentRootLazyDeclarationResolveTestGenerated extends Abst runTest("analysis/low-level-api-fir/testData/lazyResolve/classes/annotationWithArgumentInsideSuperTypeCallUnresolved.kt"); } + @Test + @TestMetadata("annotationWithConstantFromNestedClass.kt") + public void testAnnotationWithConstantFromNestedClass() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolve/classes/annotationWithConstantFromNestedClass.kt"); + } + @Test @TestMetadata("annotationWithTarget.kt") public void testAnnotationWithTarget() throws Exception { @@ -663,12 +669,36 @@ public class FirOutOfContentRootLazyDeclarationResolveTestGenerated extends Abst runTest("analysis/low-level-api-fir/testData/lazyResolve/classes/nestedClass.kt"); } + @Test + @TestMetadata("nestedClassAsAnnotationArgument.kt") + public void testNestedClassAsAnnotationArgument() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolve/classes/nestedClassAsAnnotationArgument.kt"); + } + + @Test + @TestMetadata("nestedClassAsAnnotationArgument2.kt") + public void testNestedClassAsAnnotationArgument2() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolve/classes/nestedClassAsAnnotationArgument2.kt"); + } + @Test @TestMetadata("nestedClassWithPropertiesOverrides.kt") public void testNestedClassWithPropertiesOverrides() throws Exception { runTest("analysis/low-level-api-fir/testData/lazyResolve/classes/nestedClassWithPropertiesOverrides.kt"); } + @Test + @TestMetadata("qualifiedNestedClassAsAnnotationArgument.kt") + public void testQualifiedNestedClassAsAnnotationArgument() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolve/classes/qualifiedNestedClassAsAnnotationArgument.kt"); + } + + @Test + @TestMetadata("qualifiedNestedClassAsAnnotationArgument2.kt") + public void testQualifiedNestedClassAsAnnotationArgument2() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolve/classes/qualifiedNestedClassAsAnnotationArgument2.kt"); + } + @Test @TestMetadata("simpleLoopInOverride.kt") public void testSimpleLoopInOverride() throws Exception { diff --git a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/FirSourceLazyDeclarationResolveTestGenerated.java b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/FirSourceLazyDeclarationResolveTestGenerated.java index 6207f88bd6a..08b85f5ad10 100644 --- a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/FirSourceLazyDeclarationResolveTestGenerated.java +++ b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/FirSourceLazyDeclarationResolveTestGenerated.java @@ -609,6 +609,12 @@ public class FirSourceLazyDeclarationResolveTestGenerated extends AbstractFirSou runTest("analysis/low-level-api-fir/testData/lazyResolve/classes/annotationWithArgumentInsideSuperTypeCallUnresolved.kt"); } + @Test + @TestMetadata("annotationWithConstantFromNestedClass.kt") + public void testAnnotationWithConstantFromNestedClass() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolve/classes/annotationWithConstantFromNestedClass.kt"); + } + @Test @TestMetadata("annotationWithTarget.kt") public void testAnnotationWithTarget() throws Exception { @@ -663,12 +669,36 @@ public class FirSourceLazyDeclarationResolveTestGenerated extends AbstractFirSou runTest("analysis/low-level-api-fir/testData/lazyResolve/classes/nestedClass.kt"); } + @Test + @TestMetadata("nestedClassAsAnnotationArgument.kt") + public void testNestedClassAsAnnotationArgument() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolve/classes/nestedClassAsAnnotationArgument.kt"); + } + + @Test + @TestMetadata("nestedClassAsAnnotationArgument2.kt") + public void testNestedClassAsAnnotationArgument2() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolve/classes/nestedClassAsAnnotationArgument2.kt"); + } + @Test @TestMetadata("nestedClassWithPropertiesOverrides.kt") public void testNestedClassWithPropertiesOverrides() throws Exception { runTest("analysis/low-level-api-fir/testData/lazyResolve/classes/nestedClassWithPropertiesOverrides.kt"); } + @Test + @TestMetadata("qualifiedNestedClassAsAnnotationArgument.kt") + public void testQualifiedNestedClassAsAnnotationArgument() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolve/classes/qualifiedNestedClassAsAnnotationArgument.kt"); + } + + @Test + @TestMetadata("qualifiedNestedClassAsAnnotationArgument2.kt") + public void testQualifiedNestedClassAsAnnotationArgument2() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolve/classes/qualifiedNestedClassAsAnnotationArgument2.kt"); + } + @Test @TestMetadata("simpleLoopInOverride.kt") public void testSimpleLoopInOverride() throws Exception { diff --git a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosticCompilerTestFE10TestdataTestGenerated.java b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosticCompilerTestFE10TestdataTestGenerated.java index 43ba6785e88..86aace4664b 100644 --- a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosticCompilerTestFE10TestdataTestGenerated.java +++ b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosticCompilerTestFE10TestdataTestGenerated.java @@ -1722,6 +1722,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia runTest("compiler/testData/diagnostics/tests/annotations/blockLevelOnTheSameLineWarning.kt"); } + @Test + @TestMetadata("constantFromOuterScopeAsAnnotaionParameter.kt") + public void testConstantFromOuterScopeAsAnnotaionParameter() throws Exception { + runTest("compiler/testData/diagnostics/tests/annotations/constantFromOuterScopeAsAnnotaionParameter.kt"); + } + @Test @TestMetadata("ConstructorCall.kt") public void testConstructorCall() throws Exception { @@ -1992,12 +1998,30 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia runTest("compiler/testData/diagnostics/tests/annotations/MutuallyRecursivelyAnnotatedGlobalFunction.kt"); } + @Test + @TestMetadata("nestedClassAsAnnotationParameter.kt") + public void testNestedClassAsAnnotationParameter() throws Exception { + runTest("compiler/testData/diagnostics/tests/annotations/nestedClassAsAnnotationParameter.kt"); + } + + @Test + @TestMetadata("nestedClassAsIsAsAnnotationParameter.kt") + public void testNestedClassAsIsAsAnnotationParameter() throws Exception { + runTest("compiler/testData/diagnostics/tests/annotations/nestedClassAsIsAsAnnotationParameter.kt"); + } + @Test @TestMetadata("nestedClassesInAnnotations.kt") public void testNestedClassesInAnnotations() throws Exception { runTest("compiler/testData/diagnostics/tests/annotations/nestedClassesInAnnotations.kt"); } + @Test + @TestMetadata("nestedObjectAsAnnotationParameter.kt") + public void testNestedObjectAsAnnotationParameter() throws Exception { + runTest("compiler/testData/diagnostics/tests/annotations/nestedObjectAsAnnotationParameter.kt"); + } + @Test @TestMetadata("noNameProperty.kt") public void testNoNameProperty() throws Exception { @@ -2046,6 +2070,18 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia runTest("compiler/testData/diagnostics/tests/annotations/onMultiDeclaration.kt"); } + @Test + @TestMetadata("qualifiedNestedClassAsAnnotationParameter.kt") + public void testQualifiedNestedClassAsAnnotationParameter() throws Exception { + runTest("compiler/testData/diagnostics/tests/annotations/qualifiedNestedClassAsAnnotationParameter.kt"); + } + + @Test + @TestMetadata("qualifiedNestedClassAsIsAsAnnotationParameter.kt") + public void testQualifiedNestedClassAsIsAsAnnotationParameter() throws Exception { + runTest("compiler/testData/diagnostics/tests/annotations/qualifiedNestedClassAsIsAsAnnotationParameter.kt"); + } + @Test @TestMetadata("RecursivelyAnnotated.kt") public void testRecursivelyAnnotated() throws Exception { @@ -2142,6 +2178,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia runTest("compiler/testData/diagnostics/tests/annotations/typealiasWithAnnotatedAbstractClass.kt"); } + @Test + @TestMetadata("unreachableNestedClassAsAnnotationParameter.kt") + public void testUnreachableNestedClassAsAnnotationParameter() throws Exception { + runTest("compiler/testData/diagnostics/tests/annotations/unreachableNestedClassAsAnnotationParameter.kt"); + } + @Test @TestMetadata("UnresolvedAnnotationOnObject.kt") public void testUnresolvedAnnotationOnObject() throws Exception { diff --git a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated.java b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated.java index 7efa64395ad..3040a6db04c 100644 --- a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated.java +++ b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated.java @@ -1722,6 +1722,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated runTest("compiler/testData/diagnostics/tests/annotations/blockLevelOnTheSameLineWarning.kt"); } + @Test + @TestMetadata("constantFromOuterScopeAsAnnotaionParameter.kt") + public void testConstantFromOuterScopeAsAnnotaionParameter() throws Exception { + runTest("compiler/testData/diagnostics/tests/annotations/constantFromOuterScopeAsAnnotaionParameter.kt"); + } + @Test @TestMetadata("ConstructorCall.kt") public void testConstructorCall() throws Exception { @@ -1992,12 +1998,30 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated runTest("compiler/testData/diagnostics/tests/annotations/MutuallyRecursivelyAnnotatedGlobalFunction.kt"); } + @Test + @TestMetadata("nestedClassAsAnnotationParameter.kt") + public void testNestedClassAsAnnotationParameter() throws Exception { + runTest("compiler/testData/diagnostics/tests/annotations/nestedClassAsAnnotationParameter.kt"); + } + + @Test + @TestMetadata("nestedClassAsIsAsAnnotationParameter.kt") + public void testNestedClassAsIsAsAnnotationParameter() throws Exception { + runTest("compiler/testData/diagnostics/tests/annotations/nestedClassAsIsAsAnnotationParameter.kt"); + } + @Test @TestMetadata("nestedClassesInAnnotations.kt") public void testNestedClassesInAnnotations() throws Exception { runTest("compiler/testData/diagnostics/tests/annotations/nestedClassesInAnnotations.kt"); } + @Test + @TestMetadata("nestedObjectAsAnnotationParameter.kt") + public void testNestedObjectAsAnnotationParameter() throws Exception { + runTest("compiler/testData/diagnostics/tests/annotations/nestedObjectAsAnnotationParameter.kt"); + } + @Test @TestMetadata("noNameProperty.kt") public void testNoNameProperty() throws Exception { @@ -2046,6 +2070,18 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated runTest("compiler/testData/diagnostics/tests/annotations/onMultiDeclaration.kt"); } + @Test + @TestMetadata("qualifiedNestedClassAsAnnotationParameter.kt") + public void testQualifiedNestedClassAsAnnotationParameter() throws Exception { + runTest("compiler/testData/diagnostics/tests/annotations/qualifiedNestedClassAsAnnotationParameter.kt"); + } + + @Test + @TestMetadata("qualifiedNestedClassAsIsAsAnnotationParameter.kt") + public void testQualifiedNestedClassAsIsAsAnnotationParameter() throws Exception { + runTest("compiler/testData/diagnostics/tests/annotations/qualifiedNestedClassAsIsAsAnnotationParameter.kt"); + } + @Test @TestMetadata("RecursivelyAnnotated.kt") public void testRecursivelyAnnotated() throws Exception { @@ -2142,6 +2178,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated runTest("compiler/testData/diagnostics/tests/annotations/typealiasWithAnnotatedAbstractClass.kt"); } + @Test + @TestMetadata("unreachableNestedClassAsAnnotationParameter.kt") + public void testUnreachableNestedClassAsAnnotationParameter() throws Exception { + runTest("compiler/testData/diagnostics/tests/annotations/unreachableNestedClassAsAnnotationParameter.kt"); + } + @Test @TestMetadata("UnresolvedAnnotationOnObject.kt") public void testUnresolvedAnnotationOnObject() throws Exception { diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirLightTreeOldFrontendDiagnosticsTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirLightTreeOldFrontendDiagnosticsTestGenerated.java index 2692e96fc6f..30986852855 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirLightTreeOldFrontendDiagnosticsTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirLightTreeOldFrontendDiagnosticsTestGenerated.java @@ -1722,6 +1722,12 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir runTest("compiler/testData/diagnostics/tests/annotations/blockLevelOnTheSameLineWarning.kt"); } + @Test + @TestMetadata("constantFromOuterScopeAsAnnotaionParameter.kt") + public void testConstantFromOuterScopeAsAnnotaionParameter() throws Exception { + runTest("compiler/testData/diagnostics/tests/annotations/constantFromOuterScopeAsAnnotaionParameter.kt"); + } + @Test @TestMetadata("ConstructorCall.kt") public void testConstructorCall() throws Exception { @@ -1992,12 +1998,30 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir runTest("compiler/testData/diagnostics/tests/annotations/MutuallyRecursivelyAnnotatedGlobalFunction.kt"); } + @Test + @TestMetadata("nestedClassAsAnnotationParameter.kt") + public void testNestedClassAsAnnotationParameter() throws Exception { + runTest("compiler/testData/diagnostics/tests/annotations/nestedClassAsAnnotationParameter.kt"); + } + + @Test + @TestMetadata("nestedClassAsIsAsAnnotationParameter.kt") + public void testNestedClassAsIsAsAnnotationParameter() throws Exception { + runTest("compiler/testData/diagnostics/tests/annotations/nestedClassAsIsAsAnnotationParameter.kt"); + } + @Test @TestMetadata("nestedClassesInAnnotations.kt") public void testNestedClassesInAnnotations() throws Exception { runTest("compiler/testData/diagnostics/tests/annotations/nestedClassesInAnnotations.kt"); } + @Test + @TestMetadata("nestedObjectAsAnnotationParameter.kt") + public void testNestedObjectAsAnnotationParameter() throws Exception { + runTest("compiler/testData/diagnostics/tests/annotations/nestedObjectAsAnnotationParameter.kt"); + } + @Test @TestMetadata("noNameProperty.kt") public void testNoNameProperty() throws Exception { @@ -2046,6 +2070,18 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir runTest("compiler/testData/diagnostics/tests/annotations/onMultiDeclaration.kt"); } + @Test + @TestMetadata("qualifiedNestedClassAsAnnotationParameter.kt") + public void testQualifiedNestedClassAsAnnotationParameter() throws Exception { + runTest("compiler/testData/diagnostics/tests/annotations/qualifiedNestedClassAsAnnotationParameter.kt"); + } + + @Test + @TestMetadata("qualifiedNestedClassAsIsAsAnnotationParameter.kt") + public void testQualifiedNestedClassAsIsAsAnnotationParameter() throws Exception { + runTest("compiler/testData/diagnostics/tests/annotations/qualifiedNestedClassAsIsAsAnnotationParameter.kt"); + } + @Test @TestMetadata("RecursivelyAnnotated.kt") public void testRecursivelyAnnotated() throws Exception { @@ -2142,6 +2178,12 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir runTest("compiler/testData/diagnostics/tests/annotations/typealiasWithAnnotatedAbstractClass.kt"); } + @Test + @TestMetadata("unreachableNestedClassAsAnnotationParameter.kt") + public void testUnreachableNestedClassAsAnnotationParameter() throws Exception { + runTest("compiler/testData/diagnostics/tests/annotations/unreachableNestedClassAsAnnotationParameter.kt"); + } + @Test @TestMetadata("UnresolvedAnnotationOnObject.kt") public void testUnresolvedAnnotationOnObject() throws Exception { diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirPsiOldFrontendDiagnosticsTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirPsiOldFrontendDiagnosticsTestGenerated.java index a483e42185a..c165ddc56af 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirPsiOldFrontendDiagnosticsTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirPsiOldFrontendDiagnosticsTestGenerated.java @@ -1722,6 +1722,12 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia runTest("compiler/testData/diagnostics/tests/annotations/blockLevelOnTheSameLineWarning.kt"); } + @Test + @TestMetadata("constantFromOuterScopeAsAnnotaionParameter.kt") + public void testConstantFromOuterScopeAsAnnotaionParameter() throws Exception { + runTest("compiler/testData/diagnostics/tests/annotations/constantFromOuterScopeAsAnnotaionParameter.kt"); + } + @Test @TestMetadata("ConstructorCall.kt") public void testConstructorCall() throws Exception { @@ -1998,12 +2004,30 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia runTest("compiler/testData/diagnostics/tests/annotations/MutuallyRecursivelyAnnotatedGlobalFunction.kt"); } + @Test + @TestMetadata("nestedClassAsAnnotationParameter.kt") + public void testNestedClassAsAnnotationParameter() throws Exception { + runTest("compiler/testData/diagnostics/tests/annotations/nestedClassAsAnnotationParameter.kt"); + } + + @Test + @TestMetadata("nestedClassAsIsAsAnnotationParameter.kt") + public void testNestedClassAsIsAsAnnotationParameter() throws Exception { + runTest("compiler/testData/diagnostics/tests/annotations/nestedClassAsIsAsAnnotationParameter.kt"); + } + @Test @TestMetadata("nestedClassesInAnnotations.kt") public void testNestedClassesInAnnotations() throws Exception { runTest("compiler/testData/diagnostics/tests/annotations/nestedClassesInAnnotations.kt"); } + @Test + @TestMetadata("nestedObjectAsAnnotationParameter.kt") + public void testNestedObjectAsAnnotationParameter() throws Exception { + runTest("compiler/testData/diagnostics/tests/annotations/nestedObjectAsAnnotationParameter.kt"); + } + @Test @TestMetadata("noNameProperty.kt") public void testNoNameProperty() throws Exception { @@ -2052,6 +2076,18 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia runTest("compiler/testData/diagnostics/tests/annotations/onMultiDeclaration.kt"); } + @Test + @TestMetadata("qualifiedNestedClassAsAnnotationParameter.kt") + public void testQualifiedNestedClassAsAnnotationParameter() throws Exception { + runTest("compiler/testData/diagnostics/tests/annotations/qualifiedNestedClassAsAnnotationParameter.kt"); + } + + @Test + @TestMetadata("qualifiedNestedClassAsIsAsAnnotationParameter.kt") + public void testQualifiedNestedClassAsIsAsAnnotationParameter() throws Exception { + runTest("compiler/testData/diagnostics/tests/annotations/qualifiedNestedClassAsIsAsAnnotationParameter.kt"); + } + @Test @TestMetadata("RecursivelyAnnotated.kt") public void testRecursivelyAnnotated() throws Exception { @@ -2148,6 +2184,12 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia runTest("compiler/testData/diagnostics/tests/annotations/typealiasWithAnnotatedAbstractClass.kt"); } + @Test + @TestMetadata("unreachableNestedClassAsAnnotationParameter.kt") + public void testUnreachableNestedClassAsAnnotationParameter() throws Exception { + runTest("compiler/testData/diagnostics/tests/annotations/unreachableNestedClassAsAnnotationParameter.kt"); + } + @Test @TestMetadata("UnresolvedAnnotationOnObject.kt") public void testUnresolvedAnnotationOnObject() throws Exception { diff --git a/compiler/testData/diagnostics/tests/annotations/constantFromOuterScopeAsAnnotaionParameter.kt b/compiler/testData/diagnostics/tests/annotations/constantFromOuterScopeAsAnnotaionParameter.kt new file mode 100644 index 00000000000..0e3298af75a --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/constantFromOuterScopeAsAnnotaionParameter.kt @@ -0,0 +1,11 @@ +// FIR_IDENTICAL +annotation class Anno(val number: Int) + +class Outer { + companion object { + const val CONSTANT_FROM_COMPANION = 42 + + @Anno(CONSTANT_FROM_COMPANION) + class Nested + } +} diff --git a/compiler/testData/diagnostics/tests/annotations/constantFromOuterScopeAsAnnotaionParameter.ll.kt b/compiler/testData/diagnostics/tests/annotations/constantFromOuterScopeAsAnnotaionParameter.ll.kt new file mode 100644 index 00000000000..cfc04908357 --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/constantFromOuterScopeAsAnnotaionParameter.ll.kt @@ -0,0 +1,14 @@ +// LL_FIR_DIVERGENCE +// KT-62587 +// LL_FIR_DIVERGENCE +// FIR_IDENTICAL +annotation class Anno(val number: Int) + +class Outer { + companion object { + const val CONSTANT_FROM_COMPANION = 42 + + @Anno(CONSTANT_FROM_COMPANION) + class Nested + } +} diff --git a/compiler/testData/diagnostics/tests/annotations/nestedClassAsAnnotationParameter.kt b/compiler/testData/diagnostics/tests/annotations/nestedClassAsAnnotationParameter.kt new file mode 100644 index 00000000000..ac0cbae3566 --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/nestedClassAsAnnotationParameter.kt @@ -0,0 +1,12 @@ +// FIR_IDENTICAL +import kotlin.reflect.KClass + +@Target(AnnotationTarget.CLASS, AnnotationTarget.TYPE_PARAMETER, AnnotationTarget.TYPE) +annotation class Special(val why: KClass<*>) + +interface Interface + +class Outer { + @Special(Nested::class) + class Nested<@Special(Nested::class) T> : @Special(Nested::class) Interface +} diff --git a/compiler/testData/diagnostics/tests/annotations/nestedClassAsAnnotationParameter.ll.kt b/compiler/testData/diagnostics/tests/annotations/nestedClassAsAnnotationParameter.ll.kt new file mode 100644 index 00000000000..8c411b52b0e --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/nestedClassAsAnnotationParameter.ll.kt @@ -0,0 +1,15 @@ +// LL_FIR_DIVERGENCE +// KT-62587 +// LL_FIR_DIVERGENCE +// FIR_IDENTICAL +import kotlin.reflect.KClass + +@Target(AnnotationTarget.CLASS, AnnotationTarget.TYPE_PARAMETER, AnnotationTarget.TYPE) +annotation class Special(val why: KClass<*>) + +interface Interface + +class Outer { + @Special(Nested::class) + class Nested<@Special(Nested::class) T> : @Special(Nested::class) Interface +} diff --git a/compiler/testData/diagnostics/tests/annotations/nestedClassAsIsAsAnnotationParameter.fir.kt b/compiler/testData/diagnostics/tests/annotations/nestedClassAsIsAsAnnotationParameter.fir.kt new file mode 100644 index 00000000000..c84514547ab --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/nestedClassAsIsAsAnnotationParameter.fir.kt @@ -0,0 +1,11 @@ +import kotlin.reflect.KClass + +@Target(AnnotationTarget.CLASS, AnnotationTarget.TYPE_PARAMETER, AnnotationTarget.TYPE) +annotation class Special(val why: KClass<*>) + +interface Interface + +class Outer { + @Special(Nested) + class Nested<@Special(Nested) T> : @Special(Nested) Interface +} diff --git a/compiler/testData/diagnostics/tests/annotations/nestedClassAsIsAsAnnotationParameter.kt b/compiler/testData/diagnostics/tests/annotations/nestedClassAsIsAsAnnotationParameter.kt new file mode 100644 index 00000000000..299cee0f129 --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/nestedClassAsIsAsAnnotationParameter.kt @@ -0,0 +1,11 @@ +import kotlin.reflect.KClass + +@Target(AnnotationTarget.CLASS, AnnotationTarget.TYPE_PARAMETER, AnnotationTarget.TYPE) +annotation class Special(val why: KClass<*>) + +interface Interface + +class Outer { + @Special(Nested) + class Nested<@Special(Nested) T> : @Special(Nested) Interface +} diff --git a/compiler/testData/diagnostics/tests/annotations/nestedClassAsIsAsAnnotationParameter.ll.kt b/compiler/testData/diagnostics/tests/annotations/nestedClassAsIsAsAnnotationParameter.ll.kt new file mode 100644 index 00000000000..041d4262185 --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/nestedClassAsIsAsAnnotationParameter.ll.kt @@ -0,0 +1,14 @@ +// LL_FIR_DIVERGENCE +// KT-62587 +// LL_FIR_DIVERGENCE +import kotlin.reflect.KClass + +@Target(AnnotationTarget.CLASS, AnnotationTarget.TYPE_PARAMETER, AnnotationTarget.TYPE) +annotation class Special(val why: KClass<*>) + +interface Interface + +class Outer { + @Special(Nested) + class Nested<@Special(Nested) T> : @Special(Nested) Interface +} diff --git a/compiler/testData/diagnostics/tests/annotations/nestedObjectAsAnnotationParameter.kt b/compiler/testData/diagnostics/tests/annotations/nestedObjectAsAnnotationParameter.kt new file mode 100644 index 00000000000..c708ce585d4 --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/nestedObjectAsAnnotationParameter.kt @@ -0,0 +1,12 @@ +// FIR_IDENTICAL +import kotlin.reflect.KClass + +@Target(AnnotationTarget.CLASS, AnnotationTarget.TYPE) +annotation class Special(val why: KClass<*>) + +interface Interface + +object Outer { + @Special(Nested::class) + object Nested : @Special(Nested::class) Interface +} diff --git a/compiler/testData/diagnostics/tests/annotations/nestedObjectAsAnnotationParameter.ll.kt b/compiler/testData/diagnostics/tests/annotations/nestedObjectAsAnnotationParameter.ll.kt new file mode 100644 index 00000000000..714b4592ce4 --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/nestedObjectAsAnnotationParameter.ll.kt @@ -0,0 +1,15 @@ +// LL_FIR_DIVERGENCE +// KT-62587 +// LL_FIR_DIVERGENCE +// FIR_IDENTICAL +import kotlin.reflect.KClass + +@Target(AnnotationTarget.CLASS, AnnotationTarget.TYPE) +annotation class Special(val why: KClass<*>) + +interface Interface + +object Outer { + @Special(Nested::class) + object Nested : @Special(Nested::class) Interface +} diff --git a/compiler/testData/diagnostics/tests/annotations/qualifiedNestedClassAsAnnotationParameter.kt b/compiler/testData/diagnostics/tests/annotations/qualifiedNestedClassAsAnnotationParameter.kt new file mode 100644 index 00000000000..376c583b07a --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/qualifiedNestedClassAsAnnotationParameter.kt @@ -0,0 +1,12 @@ +// FIR_IDENTICAL +import kotlin.reflect.KClass + +@Target(AnnotationTarget.CLASS, AnnotationTarget.TYPE_PARAMETER, AnnotationTarget.TYPE) +annotation class Special(val why: KClass<*>) + +interface Interface + +class Outer { + @Special(Outer.Nested::class) + class Nested<@Special(Outer.Nested::class) T> : @Special(Outer.Nested::class) Interface +} diff --git a/compiler/testData/diagnostics/tests/annotations/qualifiedNestedClassAsIsAsAnnotationParameter.fir.kt b/compiler/testData/diagnostics/tests/annotations/qualifiedNestedClassAsIsAsAnnotationParameter.fir.kt new file mode 100644 index 00000000000..4d4cc6d9af4 --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/qualifiedNestedClassAsIsAsAnnotationParameter.fir.kt @@ -0,0 +1,11 @@ +import kotlin.reflect.KClass + +@Target(AnnotationTarget.CLASS, AnnotationTarget.TYPE_PARAMETER, AnnotationTarget.TYPE) +annotation class Special(val why: KClass<*>) + +interface Interface + +class Outer { + @Special(Outer.Nested) + class Nested<@Special(Outer.Nested) T> : @Special(Outer.Nested) Interface +} diff --git a/compiler/testData/diagnostics/tests/annotations/qualifiedNestedClassAsIsAsAnnotationParameter.kt b/compiler/testData/diagnostics/tests/annotations/qualifiedNestedClassAsIsAsAnnotationParameter.kt new file mode 100644 index 00000000000..9fe8c484888 --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/qualifiedNestedClassAsIsAsAnnotationParameter.kt @@ -0,0 +1,11 @@ +import kotlin.reflect.KClass + +@Target(AnnotationTarget.CLASS, AnnotationTarget.TYPE_PARAMETER, AnnotationTarget.TYPE) +annotation class Special(val why: KClass<*>) + +interface Interface + +class Outer { + @Special(Outer.Nested) + class Nested<@Special(Outer.Nested) T> : @Special(Outer.Nested) Interface +} diff --git a/compiler/testData/diagnostics/tests/annotations/unreachableNestedClassAsAnnotationParameter.fir.kt b/compiler/testData/diagnostics/tests/annotations/unreachableNestedClassAsAnnotationParameter.fir.kt new file mode 100644 index 00000000000..bda555d2843 --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/unreachableNestedClassAsAnnotationParameter.fir.kt @@ -0,0 +1,13 @@ +import kotlin.reflect.KClass + +@Target(AnnotationTarget.CLASS, AnnotationTarget.TYPE_PARAMETER, AnnotationTarget.TYPE) +annotation class Special(val why: KClass<*>) + +interface Interface + +class Outer { + @Special(NestedNested::class) + class Nested<@Special(NestedNested::class) T> : @Special(NestedNested::class) Interface { + class NestedNested + } +} diff --git a/compiler/testData/diagnostics/tests/annotations/unreachableNestedClassAsAnnotationParameter.kt b/compiler/testData/diagnostics/tests/annotations/unreachableNestedClassAsAnnotationParameter.kt new file mode 100644 index 00000000000..a20d89496f5 --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/unreachableNestedClassAsAnnotationParameter.kt @@ -0,0 +1,13 @@ +import kotlin.reflect.KClass + +@Target(AnnotationTarget.CLASS, AnnotationTarget.TYPE_PARAMETER, AnnotationTarget.TYPE) +annotation class Special(val why: KClass<*>) + +interface Interface + +class Outer { + @Special(NestedNested::class) + class Nested<@Special(NestedNested::class) T> : @Special(NestedNested::class) Interface { + class NestedNested + } +} diff --git a/compiler/testData/diagnostics/tests/annotations/unreachableNestedClassAsAnnotationParameter.ll.kt b/compiler/testData/diagnostics/tests/annotations/unreachableNestedClassAsAnnotationParameter.ll.kt new file mode 100644 index 00000000000..49cd2088e78 --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/unreachableNestedClassAsAnnotationParameter.ll.kt @@ -0,0 +1,16 @@ +// LL_FIR_DIVERGENCE +// KT-62587 +// LL_FIR_DIVERGENCE +import kotlin.reflect.KClass + +@Target(AnnotationTarget.CLASS, AnnotationTarget.TYPE_PARAMETER, AnnotationTarget.TYPE) +annotation class Special(val why: KClass<*>) + +interface Interface + +class Outer { + @Special(NestedNested::class) + class Nested<@Special(NestedNested::class) T> : @Special(NestedNested::class) Interface { + class NestedNested + } +} diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java index fac4aa49966..a454b670af4 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java @@ -1722,6 +1722,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest { runTest("compiler/testData/diagnostics/tests/annotations/blockLevelOnTheSameLineWarning.kt"); } + @Test + @TestMetadata("constantFromOuterScopeAsAnnotaionParameter.kt") + public void testConstantFromOuterScopeAsAnnotaionParameter() throws Exception { + runTest("compiler/testData/diagnostics/tests/annotations/constantFromOuterScopeAsAnnotaionParameter.kt"); + } + @Test @TestMetadata("ConstructorCall.kt") public void testConstructorCall() throws Exception { @@ -1998,12 +2004,30 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest { runTest("compiler/testData/diagnostics/tests/annotations/MutuallyRecursivelyAnnotatedGlobalFunction.kt"); } + @Test + @TestMetadata("nestedClassAsAnnotationParameter.kt") + public void testNestedClassAsAnnotationParameter() throws Exception { + runTest("compiler/testData/diagnostics/tests/annotations/nestedClassAsAnnotationParameter.kt"); + } + + @Test + @TestMetadata("nestedClassAsIsAsAnnotationParameter.kt") + public void testNestedClassAsIsAsAnnotationParameter() throws Exception { + runTest("compiler/testData/diagnostics/tests/annotations/nestedClassAsIsAsAnnotationParameter.kt"); + } + @Test @TestMetadata("nestedClassesInAnnotations.kt") public void testNestedClassesInAnnotations() throws Exception { runTest("compiler/testData/diagnostics/tests/annotations/nestedClassesInAnnotations.kt"); } + @Test + @TestMetadata("nestedObjectAsAnnotationParameter.kt") + public void testNestedObjectAsAnnotationParameter() throws Exception { + runTest("compiler/testData/diagnostics/tests/annotations/nestedObjectAsAnnotationParameter.kt"); + } + @Test @TestMetadata("noNameProperty.kt") public void testNoNameProperty() throws Exception { @@ -2052,6 +2076,18 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest { runTest("compiler/testData/diagnostics/tests/annotations/onMultiDeclaration.kt"); } + @Test + @TestMetadata("qualifiedNestedClassAsAnnotationParameter.kt") + public void testQualifiedNestedClassAsAnnotationParameter() throws Exception { + runTest("compiler/testData/diagnostics/tests/annotations/qualifiedNestedClassAsAnnotationParameter.kt"); + } + + @Test + @TestMetadata("qualifiedNestedClassAsIsAsAnnotationParameter.kt") + public void testQualifiedNestedClassAsIsAsAnnotationParameter() throws Exception { + runTest("compiler/testData/diagnostics/tests/annotations/qualifiedNestedClassAsIsAsAnnotationParameter.kt"); + } + @Test @TestMetadata("RecursivelyAnnotated.kt") public void testRecursivelyAnnotated() throws Exception { @@ -2148,6 +2184,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest { runTest("compiler/testData/diagnostics/tests/annotations/typealiasWithAnnotatedAbstractClass.kt"); } + @Test + @TestMetadata("unreachableNestedClassAsAnnotationParameter.kt") + public void testUnreachableNestedClassAsAnnotationParameter() throws Exception { + runTest("compiler/testData/diagnostics/tests/annotations/unreachableNestedClassAsAnnotationParameter.kt"); + } + @Test @TestMetadata("UnresolvedAnnotationOnObject.kt") public void testUnresolvedAnnotationOnObject() throws Exception {