diff --git a/src/nagini_translation/analyzer.py b/src/nagini_translation/analyzer.py index c027a883..0015c232 100644 --- a/src/nagini_translation/analyzer.py +++ b/src/nagini_translation/analyzer.py @@ -577,7 +577,7 @@ def visit_ClassDef(self, node: ast.ClassDef) -> None: # check if a class is complex (when it or one of its parents had a @Complex class decorator) # complex class instance attributes are stored in __dict__ # ME: Set to true to make all classes complex by default and test if things still work. - cls.is_complex = True # self.is_complex_class(node) + cls.is_complex = self.is_complex_class(node) for member in node.body: member.is_complex = cls.is_complex diff --git a/src/nagini_translation/lib/program_nodes.py b/src/nagini_translation/lib/program_nodes.py index 043802bd..c9f69601 100644 --- a/src/nagini_translation/lib/program_nodes.py +++ b/src/nagini_translation/lib/program_nodes.py @@ -385,7 +385,7 @@ def __init__(self, name: str, superscope: PythonScope, # defining an algebraic data type or one of its constructors. # This flag is set transitively across subclasses. # ME: Set to true to make all classes complex by default and test if things still work. - self.is_complex = True # False + self.is_complex = False self.illegal_attribute_names = set() @property diff --git a/src/nagini_translation/translators/expression.py b/src/nagini_translation/translators/expression.py index 6e1c6652..257e3838 100644 --- a/src/nagini_translation/translators/expression.py +++ b/src/nagini_translation/translators/expression.py @@ -937,7 +937,9 @@ def translate_Attribute(self, node: ast.Attribute, recv_getattr = self._get_function_call(recv_type, func_name, args, arg_types, node, ctx, position) - ret = (stmt, recv_getattr) + # ret = (stmt, recv_getattr) + ret_stmt = [] + ret_val = recv_getattr else: ret_stmt, ret_val = self.get_complex_attr(node, self.translate_string(node.attr, None, ctx),