Skip to content

Commit

Permalink
Fix an IllegalStateException
Browse files Browse the repository at this point in the history
  • Loading branch information
valis committed Feb 5, 2024
1 parent 32bafde commit 229c29f
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1333,20 +1333,25 @@ private TypecheckingResult typecheckClassExt(List<? extends Concrete.ClassFieldI
for (Concrete.ClassFieldImpl classFieldImpl : classFieldImpls) {
Definition definition = referableToDefinition(classFieldImpl.getImplementedField(), classFieldImpl);
if (definition != null) {
implementations.add(new Pair<>(definition,classFieldImpl));
boolean ok = true;
if (definition instanceof ClassField) {
if (baseClass.getFields().contains(definition)) {
defined.add((ClassField) definition);
} else {
errorReporter.report(new IncorrectImplementationError((ClassField) definition, baseClass, classFieldImpl));
ok = false;
}
} else if (definition instanceof ClassDefinition) {
if (baseClass.isSubClassOf((ClassDefinition) definition)) {
defined.addAll(((ClassDefinition) definition).getFields());
} else {
errorReporter.report(new IncorrectImplementationError((ClassDefinition) definition, baseClass, classFieldImpl));
ok = false;
}
}
if (ok) {
implementations.add(new Pair<>(definition, classFieldImpl));
}
}
}

Expand Down

0 comments on commit 229c29f

Please sign in to comment.