Fix script properties kind in modifier checker #KT-18234 Fixed
This commit is contained in:
committed by
Mikhail Glukhikh
parent
29f25ebeb9
commit
ecfc2236a6
@@ -68,8 +68,13 @@ public class KtProperty extends KtTypeParameterListOwnerStub<KotlinPropertyStub>
|
||||
}
|
||||
|
||||
public boolean isLocal() {
|
||||
return !isTopLevel() && !isMember();
|
||||
}
|
||||
|
||||
public boolean isMember() {
|
||||
PsiElement parent = getParent();
|
||||
return !(parent instanceof KtFile || parent instanceof KtClassBody);
|
||||
return parent instanceof KtClassOrObject || parent instanceof KtClassBody ||
|
||||
parent instanceof KtBlockExpression && parent.getParent() instanceof KtScript;
|
||||
}
|
||||
|
||||
public boolean isTopLevel() {
|
||||
|
||||
@@ -204,7 +204,7 @@ class AnnotationChecker(private val additionalCheckers: Iterable<AdditionalAnnot
|
||||
is KtProperty -> {
|
||||
if (annotated.isLocal)
|
||||
TargetLists.T_LOCAL_VARIABLE
|
||||
else if (annotated.parent is KtClassOrObject || annotated.parent is KtClassBody)
|
||||
else if (annotated.isMember)
|
||||
TargetLists.T_MEMBER_PROPERTY(descriptor.hasBackingField(trace), annotated.hasDelegate())
|
||||
else
|
||||
TargetLists.T_TOP_LEVEL_PROPERTY(descriptor.hasBackingField(trace), annotated.hasDelegate())
|
||||
|
||||
Reference in New Issue
Block a user