|
94 | 94 | from mypy.errorcodes import ErrorCode |
95 | 95 | from mypy import message_registry, errorcodes as codes |
96 | 96 | from mypy.types import ( |
97 | | - FunctionLike, UnboundType, TypeVarType, TupleType, UnionType, StarType, |
| 97 | + NEVER_NAMES, FunctionLike, UnboundType, TypeVarType, TupleType, UnionType, StarType, |
98 | 98 | CallableType, Overloaded, Instance, Type, AnyType, LiteralType, LiteralValue, |
99 | 99 | TypeTranslator, TypeOfAny, TypeType, NoneType, PlaceholderType, TPDICT_NAMES, ProperType, |
100 | 100 | get_proper_type, get_proper_types, TypeAliasType, TypeVarLikeType, |
@@ -2227,11 +2227,7 @@ def is_type_ref(self, rv: Expression, bare: bool = False) -> bool: |
2227 | 2227 | # Assignment color = Color['RED'] defines a variable, not an alias. |
2228 | 2228 | return not rv.node.is_enum |
2229 | 2229 | if isinstance(rv.node, Var): |
2230 | | - return rv.node.fullname in ( |
2231 | | - 'typing.NoReturn', |
2232 | | - 'typing_extensions.NoReturn', |
2233 | | - 'mypy_extensions.NoReturn', |
2234 | | - ) |
| 2230 | + return rv.node.fullname in NEVER_NAMES |
2235 | 2231 |
|
2236 | 2232 | if isinstance(rv, NameExpr): |
2237 | 2233 | n = self.lookup(rv.name, rv) |
|
0 commit comments