diff --git a/mypy/typeanal.py b/mypy/typeanal.py index ed5d0e0474e4..183a9a792c91 100644 --- a/mypy/typeanal.py +++ b/mypy/typeanal.py @@ -43,6 +43,7 @@ 'typing.Union', 'typing.Literal', 'typing_extensions.Literal', + 'typing.Annotated', 'typing_extensions.Annotated', } # type: Final @@ -311,7 +312,7 @@ def try_analyze_special_unbound_type(self, t: UnboundType, fullname: str) -> Opt return UninhabitedType(is_noreturn=True) elif fullname in ('typing_extensions.Literal', 'typing.Literal'): return self.analyze_literal_type(t) - elif fullname == 'typing_extensions.Annotated': + elif fullname in ('typing_extensions.Annotated', 'typing.Annotated'): if len(t.args) < 2: self.fail("Annotated[...] must have exactly one type argument" " and at least one annotation", t)