[FIR] do not capture class context during class annotations processing

^KT-62587
This commit is contained in:
Dmitrii Gridin
2023-10-16 19:52:06 +02:00
committed by Space Team
parent b03e3f0b0d
commit dfdd86da1f
4 changed files with 5 additions and 33 deletions
@@ -63,11 +63,11 @@ private class FirDeclarationsResolveTransformerForArgumentAnnotations(
override fun transformRegularClass(regularClass: FirRegularClass, data: ResolutionMode): FirRegularClass {
regularClass.transformAnnotations(this, data)
.transformTypeParameters(transformer, data)
.transformSuperTypeRefs(transformer, data)
withRegularClass(regularClass) {
regularClass
.transformTypeParameters(transformer, data)
.transformSuperTypeRefs(transformer, data)
.transformDeclarations(transformer, data)
regularClass.transformDeclarations(transformer, data)
}
return regularClass
@@ -1,13 +0,0 @@
import kotlin.reflect.KClass
@Target(AnnotationTarget.CLASS, AnnotationTarget.TYPE_PARAMETER, AnnotationTarget.TYPE)
annotation class Special(val why: KClass<*>)
interface Interface
class Outer {
@Special(<!ANNOTATION_ARGUMENT_MUST_BE_CONST!><!UNRESOLVED_REFERENCE!>NestedNested<!>::class<!>)
class Nested<@Special(NestedNested::class) T> : @Special(NestedNested::class) Interface {
class NestedNested
}
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
import kotlin.reflect.KClass
@Target(AnnotationTarget.CLASS, AnnotationTarget.TYPE_PARAMETER, AnnotationTarget.TYPE)
@@ -1,16 +0,0 @@
// 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(<!ANNOTATION_ARGUMENT_MUST_BE_CONST!><!UNRESOLVED_REFERENCE!>NestedNested<!>::class<!>)
class Nested<@Special(<!ANNOTATION_ARGUMENT_MUST_BE_CONST!><!UNRESOLVED_REFERENCE!>NestedNested<!>::class<!>) T> : @Special(<!ANNOTATION_ARGUMENT_MUST_BE_CONST!><!UNRESOLVED_REFERENCE!>NestedNested<!>::class<!>) Interface {
class NestedNested
}
}