Skip to content
Snippets Groups Projects
Commit c1d70abd authored by Nicholas Robinson's avatar Nicholas Robinson
Browse files

fix multiple inherited abstract methods

- fix for Tests/A3/J1_supermethod_override11/
parent e78369a8
No related branches found
No related tags found
No related merge requests found
...@@ -85,9 +85,13 @@ class ClassInterNode(ASTNode): ...@@ -85,9 +85,13 @@ class ClassInterNode(ASTNode):
sicOverwritten = False sicOverwritten = False
for scc in superClassContains: for scc in superClassContains:
if type(sic) == type(scc) and sic == scc: if type(sic) == type(scc) and sic == scc:
safeReplace(sic, scc, self.name) # sic is implicitly abstract, if scc is abstract, then it is not replacing sic
sicOverwritten = True # Thus scc will be added to superContains as well (having 1+ abstract methods with same signiture is fine)
break # Example: Tests/A3/J1_supermethod_override11/
if 'abstract' not in scc.mods:
safeReplace(sic, scc, self.name)
sicOverwritten = True
break
if not sicOverwritten: if not sicOverwritten:
superContains.append(sic) superContains.append(sic)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment