@@ -4788,7 +4788,7 @@ def add_imported_symbol(self,
4788
4788
assert not module_hidden or not module_public
4789
4789
4790
4790
symbol_node : Optional [SymbolNode ] = node .node
4791
- if self .is_class_scope () and isinstance (symbol_node , (FuncBase , Var )):
4791
+ if self .is_class_scope () and isinstance (symbol_node , (Var , FuncBase )):
4792
4792
# We construct a new node to represent this symbol and set its `info` attribute
4793
4793
# to `self.type`. Note that imports inside class scope do not produce methods, so
4794
4794
# in all cases constructing a Var gets us the assignment like behaviour we want.
@@ -4802,7 +4802,12 @@ def add_imported_symbol(self,
4802
4802
# constructed Var, so check for possible redefinitions here.
4803
4803
symbol_node = existing .node
4804
4804
else :
4805
- symbol_node = Var (symbol_node .name , symbol_node .type )
4805
+ # Dumb if statement to appease mypyc
4806
+ if isinstance (symbol_node , Var ):
4807
+ symbol_node = Var (symbol_node .name , symbol_node .type )
4808
+ else :
4809
+ symbol_node = Var (symbol_node .name , symbol_node .type )
4810
+
4806
4811
assert self .type is not None
4807
4812
symbol_node .info = self .type
4808
4813
symbol_node ._fullname = self .qualified_name (name )
0 commit comments