Skip to content

Commit

Permalink
check isAnonymous on inferred type
Browse files Browse the repository at this point in the history
  • Loading branch information
LorenzoBettini committed Jan 3, 2024
1 parent be96f6a commit e5d2970
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -811,17 +811,17 @@ protected void reportMissingImplementations(XtendTypeDeclaration xtendClass, Jvm
StringBuilder errorMsg = new StringBuilder();
String name = xtendClass.getName();
boolean needsNewLine = operationsMissingImplementation.size() > 1;
if (xtendClass.isAnonymous()) {
if (inferredType.isAnonymous()) {
JvmTypeReference superType = Iterables.getLast(inferredType.getSuperTypes());
errorMsg.append("The anonymous subclass of ").append(superType.getSimpleName());
errorMsg.append(" does not implement ");
} else {
errorMsg.append("The class ").append(name);
errorMsg.append(" must be defined abstract because it does not implement ");
}
if (needsNewLine) {
errorMsg.append("its inherited abstract methods ");
}
if (needsNewLine) {
errorMsg.append("its inherited abstract methods ");
}
IResolvedOperation operation;
for(int i=0; i<operationsMissingImplementation.size() && i<3; ++i) {
operation = operationsMissingImplementation.get(i);
Expand All @@ -838,7 +838,7 @@ public String apply(IResolvedOperation from) {
return EcoreUtil.getURI(from.getDeclaration()).toString();
}
});
if (xtendClass.isAnonymous()) {
if (inferredType.isAnonymous()) {
error(errorMsg.toString(), xtendClass, ANONYMOUS_CLASS__CONSTRUCTOR_CALL, ANONYMOUS_CLASS_MISSING_MEMBERS,
toArray(uris, String.class));
} else {
Expand Down

0 comments on commit e5d2970

Please sign in to comment.