-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Incorrect type inference when a lambda is conditionally reassigned #8229
Labels
addressed in next version
Issue is fixed and will appear in next published version
bug
Something isn't working
Comments
Thanks for the bug report. I'm able to repro, and I've confirmed that it doesn't occur in 1.1.368. I'll investigate further. |
This is addressed in pyright 1.1.370 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
addressed in next version
Issue is fixed and will appear in next published version
bug
Something isn't working
With pyright 1.1.369, I'm running into a problem where if a lambda function is reassigned within an
if
statement, it can cause an incorrect inferred type of anasync
function that calls that lambda. Best to just illustrate with an example:When I run
pyright
on it, I get the following:When I hover over
warpped_fn
, it says the the type isNone
, when it should beCoroutine[Any, Any, None]
:Note that the following three modified versions of the code do not have this error (the change in each function has a comment above it):
The text was updated successfully, but these errors were encountered: