use correct safe delete processor for members of local classes and objects
#KT-8894 Fixed
This commit is contained in:
@@ -251,8 +251,7 @@ public class LightClassUtil {
|
||||
return getPsiClass(((JetConstructor) declaration).getContainingClassOrObject());
|
||||
}
|
||||
|
||||
//noinspection unchecked
|
||||
if (PsiTreeUtil.getParentOfType(declaration, JetFunction.class, JetProperty.class) != null) {
|
||||
if (!canGenerateLightClass(declaration)) {
|
||||
// Can't get wrappers for internal declarations. Their classes are not generated during calcStub
|
||||
// with ClassBuilderMode.LIGHT_CLASSES mode, and this produces "Class not found exception" in getDelegate()
|
||||
return null;
|
||||
@@ -274,6 +273,11 @@ public class LightClassUtil {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static boolean canGenerateLightClass(JetDeclaration declaration) {
|
||||
//noinspection unchecked
|
||||
return PsiTreeUtil.getParentOfType(declaration, JetFunction.class, JetProperty.class) == null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private static PropertyAccessorsPsiMethods extractPropertyAccessors(
|
||||
@NotNull JetDeclaration jetDeclaration,
|
||||
|
||||
Reference in New Issue
Block a user