Minor, rename method
This commit is contained in:
@@ -230,7 +230,7 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
|
|||||||
//JVMS7: A class must have an EnclosingMethod attribute if and only if it is a local class or an anonymous class.
|
//JVMS7: A class must have an EnclosingMethod attribute if and only if it is a local class or an anonymous class.
|
||||||
DeclarationDescriptor parentDescriptor = descriptor.getContainingDeclaration();
|
DeclarationDescriptor parentDescriptor = descriptor.getContainingDeclaration();
|
||||||
|
|
||||||
boolean isObjectLiteral = DescriptorUtils.isAnonymous(descriptor);
|
boolean isObjectLiteral = DescriptorUtils.isAnonymousObject(descriptor);
|
||||||
|
|
||||||
boolean isLocalOrAnonymousClass = isObjectLiteral ||
|
boolean isLocalOrAnonymousClass = isObjectLiteral ||
|
||||||
!(parentDescriptor instanceof NamespaceDescriptor || parentDescriptor instanceof ClassDescriptor);
|
!(parentDescriptor instanceof NamespaceDescriptor || parentDescriptor instanceof ClassDescriptor);
|
||||||
|
|||||||
@@ -1076,7 +1076,7 @@ public class DescriptorResolver {
|
|||||||
@NotNull BindingTrace trace
|
@NotNull BindingTrace trace
|
||||||
) {
|
) {
|
||||||
ClassifierDescriptor classifierDescriptor = type.getConstructor().getDeclarationDescriptor();
|
ClassifierDescriptor classifierDescriptor = type.getConstructor().getDeclarationDescriptor();
|
||||||
if (classifierDescriptor == null || !DescriptorUtils.isAnonymous(classifierDescriptor)) {
|
if (classifierDescriptor == null || !DescriptorUtils.isAnonymousObject(classifierDescriptor)) {
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -231,7 +231,7 @@ public class DescriptorUtils {
|
|||||||
return isKindOf(descriptor, ClassKind.CLASS_OBJECT);
|
return isKindOf(descriptor, ClassKind.CLASS_OBJECT);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isAnonymous(@NotNull ClassifierDescriptor descriptor) {
|
public static boolean isAnonymousObject(@NotNull ClassifierDescriptor descriptor) {
|
||||||
return isKindOf(descriptor, ClassKind.OBJECT) && descriptor.getName().isSpecial();
|
return isKindOf(descriptor, ClassKind.OBJECT) && descriptor.getName().isSpecial();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -220,7 +220,7 @@ public class SpecifyTypeExplicitlyAction extends PsiElementBaseIntentionAction {
|
|||||||
assert !exprType.isError() : "Unexpected error type: " + namedDeclaration.getText();
|
assert !exprType.isError() : "Unexpected error type: " + namedDeclaration.getText();
|
||||||
|
|
||||||
ClassifierDescriptor descriptor = exprType.getConstructor().getDeclarationDescriptor();
|
ClassifierDescriptor descriptor = exprType.getConstructor().getDeclarationDescriptor();
|
||||||
boolean isAnonymous = descriptor != null && DescriptorUtils.isAnonymous(descriptor);
|
boolean isAnonymous = descriptor != null && DescriptorUtils.isAnonymousObject(descriptor);
|
||||||
|
|
||||||
Set<JetType> allSupertypes = TypeUtils.getAllSupertypes(exprType);
|
Set<JetType> allSupertypes = TypeUtils.getAllSupertypes(exprType);
|
||||||
List<JetType> types = isAnonymous ? new ArrayList<JetType>() : Lists.newArrayList(exprType);
|
List<JetType> types = isAnonymous ? new ArrayList<JetType>() : Lists.newArrayList(exprType);
|
||||||
|
|||||||
Reference in New Issue
Block a user