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
When passing in a lambda to return the value passed in, it should interpret that the second generic type is the same as the first.
Actual Behavior
It is ok if you pass a lambda in the constructor. It throws an error if you have it as a default in the constructor.
main.py:8: error: Incompatible default for argument "parse_to" (default has type "Callable[[V], V]", argument has type "Callable[[V], K]") [assignment]
main.py:8: error: Incompatible return value type (got "V", expected "K") [return-value]
The text was updated successfully, but these errors were encountered:
Bug Report
When you use a function as a default in a generic class, its types are not interpreted correctly
(A clear and concise description of what the bug is.)
To Reproduce
LINK TO GIST
Expected Behavior
When passing in a lambda to return the value passed in, it should interpret that the second generic type is the same as the first.
Actual Behavior
It is ok if you pass a lambda in the constructor. It throws an error if you have it as a default in the constructor.
main.py:8: error: Incompatible default for argument "parse_to" (default has type "Callable[[V], V]", argument has type "Callable[[V], K]") [assignment]
main.py:8: error: Incompatible return value type (got "V", expected "K") [return-value]
The text was updated successfully, but these errors were encountered: