Beispiel #1
0
 def visit_instance(self, inst: Instance) -> None:
     # TODO: Combine Instances that are exactly the same?
     type_ref = inst.type_ref
     if type_ref is None:
         return  # We've already been here.
     del inst.type_ref
     node = lookup_qualified(self.modules, type_ref, self.quick_and_dirty)
     if isinstance(node, TypeInfo):
         inst.type = node
         # TODO: Is this needed or redundant?
         # Also fix up the bases, just in case.
         for base in inst.type.bases:
             if base.type is NOT_READY:
                 base.accept(self)
     else:
         # Looks like a missing TypeInfo in quick mode, put something there
         assert self.quick_and_dirty, "Should never get here in normal mode"
         inst.type = stale_info(self.modules)
     for a in inst.args:
         a.accept(self)
Beispiel #2
0
 def visit_instance(self, inst: Instance) -> None:
     # TODO: Combine Instances that are exactly the same?
     type_ref = inst.type_ref
     if type_ref is None:
         return  # We've already been here.
     inst.type_ref = None
     inst.type = lookup_qualified_typeinfo(self.modules, type_ref, self.quick_and_dirty)
     # TODO: Is this needed or redundant?
     # Also fix up the bases, just in case.
     for base in inst.type.bases:
         if base.type is NOT_READY:
             base.accept(self)
     for a in inst.args:
         a.accept(self)
Beispiel #3
0
 def visit_instance(self, inst: Instance) -> None:
     # TODO: Combine Instances that are exactly the same?
     type_ref = inst.type_ref
     if type_ref is None:
         return  # We've already been here.
     del inst.type_ref
     node = lookup_qualified(self.modules, type_ref)
     if isinstance(node, TypeInfo):
         inst.type = node
         # TODO: Is this needed or redundant?
         # Also fix up the bases, just in case.
         for base in inst.type.bases:
             if base.type is None:
                 base.accept(self)
     for a in inst.args:
         a.accept(self)
Beispiel #4
0
 def visit_instance(self, inst: Instance) -> None:
     # TODO: Combine Instances that are exactly the same?
     type_ref = inst.type_ref
     if type_ref is None:
         return  # We've already been here.
     del inst.type_ref
     node = lookup_qualified(self.modules, type_ref)
     if isinstance(node, TypeInfo):
         inst.type = node
         # TODO: Is this needed or redundant?
         # Also fix up the bases, just in case.
         for base in inst.type.bases:
             if base.type is None:
                 base.accept(self)
     for a in inst.args:
         a.accept(self)
Beispiel #5
0
 def visit_instance(self, inst: Instance) -> None:
     # TODO: Combine Instances that are exactly the same?
     type_ref = inst.type_ref
     if type_ref is None:
         return  # We've already been here.
     inst.type_ref = None
     inst.type = lookup_qualified_typeinfo(self.modules, type_ref, self.quick_and_dirty)
     # TODO: Is this needed or redundant?
     # Also fix up the bases, just in case.
     for base in inst.type.bases:
         if base.type is NOT_READY:
             base.accept(self)
     for a in inst.args:
         a.accept(self)
     if inst.final_value is not None:
         inst.final_value.accept(self)
Beispiel #6
0
 def visit_instance(self, inst: Instance) -> None:
     # TODO: Combine Instances that are exactly the same?
     type_ref = inst.type_ref
     if type_ref is None:
         return  # We've already been here.
     inst.type_ref = None
     inst.type = lookup_fully_qualified_typeinfo(
         self.modules, type_ref, allow_missing=self.allow_missing)
     # TODO: Is this needed or redundant?
     # Also fix up the bases, just in case.
     for base in inst.type.bases:
         if base.type is NOT_READY:
             base.accept(self)
     for a in inst.args:
         a.accept(self)
     if inst.last_known_value is not None:
         inst.last_known_value.accept(self)
Beispiel #7
0
 def visit_instance(self, typ: Instance) -> None:
     typ.type = self.fixup(typ.type)
     for arg in typ.args:
         arg.accept(self)
     if typ.last_known_value:
         typ.last_known_value.accept(self)
Beispiel #8
0
 def visit_instance(self, typ: Instance) -> None:
     typ.type = self.fixup(typ.type)
     for arg in typ.args:
         arg.accept(self)
Beispiel #9
0
 def visit_instance(self, typ: Instance) -> None:
     typ.type = self.fixup(typ.type)
     for arg in typ.args:
         arg.accept(self)
     if typ.last_known_value:
         typ.last_known_value.accept(self)
Beispiel #10
0
 def visit_instance(self, typ: Instance) -> None:
     typ.type = self.fixup(typ.type)
     for arg in typ.args:
         arg.accept(self)