You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MyPy reports the incorrect line number when passing a lambda into a covariant class. This is probably related to #8191 and shouldn't report an error at all.
foo.py:13: error: Cannot use a covariant type variable as a parameter
foo.py:17: error: Cannot use a covariant type variable as a parameter
Found 2 errors in 1 file (checked 1 source file)
Your Environment
Mypy version used:
$ mypy --version
mypy 0.790
Mypy command-line flags: mypy foo.py
Mypy configuration options from mypy.ini (and other config files): N/A
The bug here is not that the error is reported on the wrong line. The bug is that it's reported at all. The variance of parameter and return types should not be enforced for inner-scoped functions and lambdas.
This issue could therefore be considered a duplicate of #8191 and closed.
Bug Report
MyPy reports the incorrect line number when passing a lambda into a covariant class. This is probably related to #8191 and shouldn't report an error at all.
To Reproduce
foo.py:
Actual Behavior
Your Environment
mypy foo.py
mypy.ini
(and other config files): N/AThe text was updated successfully, but these errors were encountered: