LC: weaken condition to lookup nested annotation
FIR LC has a different abstraction, so using the specific class name is literally too specific to FE 1.0 LC. We could introduce a common interface for those, but checking `kotlinOrigin` is good enough, and thus type-checking their common ancestor is good enough too.
This commit is contained in:
committed by
Ilya Kirillov
parent
744961bd00
commit
fe41c4513f
@@ -177,7 +177,7 @@ fun KtElement.toLightAnnotation(): PsiAnnotation? {
|
|||||||
if (lightElement !is PsiModifierListOwner) continue
|
if (lightElement !is PsiModifierListOwner) continue
|
||||||
for (rootAnnotation in lightElement.modifierList?.annotations ?: continue) {
|
for (rootAnnotation in lightElement.modifierList?.annotations ?: continue) {
|
||||||
for (annotation in rootAnnotation.withNestedAnnotations()) {
|
for (annotation in rootAnnotation.withNestedAnnotations()) {
|
||||||
if (annotation is KtLightAnnotationForSourceEntry && annotation.kotlinOrigin == this)
|
if (annotation is KtLightElement<*, *> && annotation.kotlinOrigin == this)
|
||||||
return annotation
|
return annotation
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user