Inline union assigned to type alias produces error #14302
Labels
bug
mypy got something wrong
topic-pep-585
PEP 585 (builtin generics)
topic-type-alias
TypeAlias and other type alias issues
Bug Report
The following code produces an error when using mypy as a linter in Visual Studio Code:
(Using pylint as a linter, the above code does not produce an errror.)
The following (equivalent, AFAIK) code does not produce an error when using mypy as a linter:
For reasons that aren't really clear, the following code does not produce an error (even though it seems similar to the code that produces an error):
For reference, the error (in Visual Studio Code) is this:
(A clear and concise description of what the bug is.)
To Reproduce
Expected Behavior
The code should be accepted by mypy.
Actual Behavior
mypy gives the following error:
Your Environment
mypy.ini
(and other config files): NoneThe text was updated successfully, but these errors were encountered: