MyPy doesn't report any errors when using TypeVars within TypeVar constraints
Bug Report
According to this, using TypeVars to constraint other TypeVars is not possible. However, MyPy doesn't report any errors in such cases.
To Reproduce
https://mypy-play.net/?mypy=latest&python=3.11&gist=e4febb3ef7aeaa11ea0aaabd4a068739
Expected Behavior
Some error should be reported
Actual Behavior
No error is reported
Your Environment
- Mypy version used: 1.9.0
- Mypy command-line flags: N/A
- Mypy configuration options from
mypy.ini(and other config files): N/A - Python version used: 3.11
FWIW, I just updated the typing spec conformance tests to validate this part of the spec. Previously, the tests were attempting to validate this, but they were written in a way that masked the false negative in mypy. The updated tests correctly identify this conformance failure, and this is reflected in the latest conformance results summary.