-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
More higher-order function type variable unification issues #5855
Comments
Sorry for the slow response on this. I've made several unsuccessful attempts at fixing this. It's a very challenging case to handle. Interestingly, the latest version of mypy (1.7.x) includes a new constraint solver algorithm that addresses many bugs and limitations found in its old constraint solver, but its new algorithm cannot handle the code sample above. It now generates a false positive error similar to the one pyright is generating. I've filed this bug in the mypy project. I'll also note that pyright does work correctly if you swap the order of the arguments. Obviously, this shouldn't be necessary. It should work regardless of argument ordering. def bfn(x: Gen[Gen[A]]) -> Gen[A]:
return bfn_generic(x=x, step=bstep, id_=id_) |
This is addressed in pyright 1.1.374. |
Thanks for addressing #5838!
In pyright 1.1.325, the following code:
produces three type errors on the same line:
I was having trouble simplifying this any further but was able to isolate this error:
I would have expected all these to type check and indeed they do in mypy (I also double-checked the equivalent Haskell against GHC to ensure this wasn't just mypy being too lax).
The text was updated successfully, but these errors were encountered: