Exemplo n.º 1
0
 def visit_member_expr(self, node: MemberExpr) -> None:
     self.strip_ref_expr(node)
     if self.is_duplicate_attribute_def(node):
         # This is marked as an instance variable definition but a base class
         # defines an attribute with the same name, and we can't have
         # multiple definitions for an attribute. Defer to the base class
         # definition.
         if self.type is not None:
             del self.type.names[node.name]
         node.is_inferred_def = False
         node.def_var = None
     super().visit_member_expr(node)
Exemplo n.º 2
0
 def visit_member_expr(self, node: MemberExpr) -> None:
     self.strip_ref_expr(node)
     if self.is_duplicate_attribute_def(node):
         # This is marked as an instance variable definition but a base class
         # defines an attribute with the same name, and we can't have
         # multiple definitions for an attribute. Defer to the base class
         # definition.
         if self.type is not None:
             del self.type.names[node.name]
         node.is_inferred_def = False
         node.def_var = None
     super().visit_member_expr(node)
Exemplo n.º 3
0
 def visit_member_expr(self, node: MemberExpr) -> None:
     self.strip_ref_expr(node)
     # These need to cleared for member expressions but not for other RefExprs since
     # these can change based on changed in a base class.
     node.is_new_def = False
     node.is_inferred_def = False
     if self.is_duplicate_attribute_def(node):
         # This is marked as an instance variable definition but a base class
         # defines an attribute with the same name, and we can't have
         # multiple definitions for an attribute. Defer to the base class
         # definition.
         self.strip_class_attr(node.name)
         node.def_var = None
     super().visit_member_expr(node)
Exemplo n.º 4
0
 def visit_member_expr(self, node: MemberExpr) -> None:
     self.strip_ref_expr(node)
     # These need to cleared for member expressions but not for other RefExprs since
     # these can change based on changed in a base class.
     node.is_new_def = False
     node.is_inferred_def = False
     if self.is_duplicate_attribute_def(node):
         # This is marked as an instance variable definition but a base class
         # defines an attribute with the same name, and we can't have
         # multiple definitions for an attribute. Defer to the base class
         # definition.
         self.strip_class_attr(node.name)
         node.def_var = None
     if isinstance(node.node, Var):
         self._reset_var_final_flags(node.node)
     super().visit_member_expr(node)