Closed
Description
Bug Report
A generic alias using a TypeVar with a bound allows type arguments that don't match the bound
To Reproduce
% cat tvbound.py
import typing
FooT = typing.TypeVar("FooT", bound=str)
FooIsh = typing.Union[int, FooT]
bat2: FooIsh[float] = 1.0
% mypy tvbound.py
Success: no issues found in 1 source file
% mypy --version
mypy 0.820+dev.e8afde621531880c2b9c51acba8e565a29cde0b1
Expected Behavior
I would expect an error saying that the value of FooT
cannot be float
.
Found this as a result of microsoft/pyright#1839.