From c1d70abd1313c6c65eea9bdfa55ba8ade95d844c Mon Sep 17 00:00:00 2001 From: Nicholas Robinson <nwrobins@edu.uwaterloo.ca> Date: Fri, 6 Mar 2020 18:26:23 -0500 Subject: [PATCH] fix multiple inherited abstract methods - fix for Tests/A3/J1_supermethod_override11/ --- TypeNodes.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/TypeNodes.py b/TypeNodes.py index 1f10b13..85d32ee 100644 --- a/TypeNodes.py +++ b/TypeNodes.py @@ -85,9 +85,13 @@ class ClassInterNode(ASTNode): sicOverwritten = False for scc in superClassContains: if type(sic) == type(scc) and sic == scc: - safeReplace(sic, scc, self.name) - sicOverwritten = True - break + # sic is implicitly abstract, if scc is abstract, then it is not replacing sic + # Thus scc will be added to superContains as well (having 1+ abstract methods with same signiture is fine) + # Example: Tests/A3/J1_supermethod_override11/ + if 'abstract' not in scc.mods: + safeReplace(sic, scc, self.name) + sicOverwritten = True + break if not sicOverwritten: superContains.append(sic) -- GitLab