Describe the bug
Code after lambda declaration with untyped function raising an exception is incorrectly marked as unreachable.
To Reproduce
Consider this piece of code
def dummy():
def error():
raise Exception
x = lambda: error()
print("Hello World") # This is marked as unreachable code
dummy()
However, this problem does not appear if -> None is added to the error() signature.
Expected behavior
Code shouldn't be marked as unreachable.
Additional context
json
{
"pyright.typeCheckingMode": "strict",
"pyright.useLibraryCodeForTypes": true
}
Thanks for the bug report. This will be fixed in the next published version of Pyright.
This is now fixed in version 1.1.44, which I just published.