@@ -4927,15 +4927,15 @@ def _get_node_for_class_scoped_import(
4927
4927
# when it can also be a FuncBase. Once fixed, `f` in the following can be removed.
4928
4928
# See also https://github.com/mypyc/mypyc/issues/892
4929
4929
f = cast (Any , lambda x : x )
4930
- if isinstance (f (symbol_node ), (FuncBase , Var )):
4930
+ if isinstance (f (symbol_node ), (Decorator , FuncBase , Var )):
4931
4931
# For imports in class scope, we construct a new node to represent the symbol and
4932
4932
# set its `info` attribute to `self.type`.
4933
4933
existing = self .current_symbol_table ().get (name )
4934
4934
if (
4935
4935
# The redefinition checks in `add_symbol_table_node` don't work for our
4936
4936
# constructed Var / FuncBase, so check for possible redefinitions here.
4937
4937
existing is not None
4938
- and isinstance (f (existing .node ), (FuncBase , Var ))
4938
+ and isinstance (f (existing .node ), (Decorator , FuncBase , Var ))
4939
4939
and (
4940
4940
isinstance (f (existing .type ), f (AnyType ))
4941
4941
or f (existing .type ) == f (symbol_node ).type
@@ -4944,7 +4944,7 @@ def _get_node_for_class_scoped_import(
4944
4944
return existing .node
4945
4945
4946
4946
# Construct the new node
4947
- if isinstance (f (symbol_node ), FuncBase ):
4947
+ if isinstance (f (symbol_node ), ( FuncBase , Decorator ) ):
4948
4948
# In theory we could construct a new node here as well, but in practice
4949
4949
# it doesn't work well, see #12197
4950
4950
typ : Optional [Type ] = AnyType (TypeOfAny .from_error )
0 commit comments