diff options
Diffstat (limited to 'src/mem/slicc/ast/MethodCallExprAST.py')
-rw-r--r-- | src/mem/slicc/ast/MethodCallExprAST.py | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/src/mem/slicc/ast/MethodCallExprAST.py b/src/mem/slicc/ast/MethodCallExprAST.py index cf30cfa96..bf133b374 100644 --- a/src/mem/slicc/ast/MethodCallExprAST.py +++ b/src/mem/slicc/ast/MethodCallExprAST.py @@ -140,23 +140,21 @@ class MemberMethodCallExprAST(MethodCallExprAST): implemented_paramTypes.append(implemented_paramType) + implementedMethodId = "" if implements_interface: - implementedMethodId = obj_type.methodIdAbstract(self.proc_name, - implemented_paramTypes) - else: - implementedMethodId = "" + implementedMethodId = obj_type.methodIdAbstract( + self.proc_name, implemented_paramTypes) if implementedMethodId not in obj_type.methods: - self.error("Invalid method call: " \ - "Type '%s' does not have a method %s, '%s' nor '%s'", - obj_type, self.proc_name, methodId, implementedMethodId) - else: - # - # Replace the methodId with the implementedMethodId found in - # the method list. - # - methodId = implementedMethodId - return_type = obj_type.methods[methodId].return_type + self.error("Invalid method call: Type '%s' " \ + "does not have a method %s, '%s' nor '%s'", + obj_type, self.proc_name, methodId, + implementedMethodId) + + # Replace the methodId with the implementedMethodId + # found in the method list. + methodId = implementedMethodId + return_type = obj_type.methods[methodId].return_type if return_type.isInterface: prefix = "static_cast<%s &>" % return_type.c_ident |