Pylance fails to parse walrus operator inside of list comprehension condition inside of decorator argument list #1745
Labels
bug
Something isn't working
fixed in next version (main)
A fix has been implemented and will appear in an upcoming version
Environment data
Expected behaviour
Pylance should be able to parse changes in my file properly.
Actual behavior
Pylance reports the error below at the top of the file.
Additionally pylance reports a bunch of random errors throughout the rest of the file. Every line of code that isn't at the module level gets flagged as unreachable, and every non-module-level identifier reference is marked as not defined.
Logs
Python Language Server Log
https://pastebin.com/2G2nPLPh
Code Snippet / Additional information
This specific diff breaks pylance parsing. The file before was parsed properly, but after this change pylance throws the error and reports a bunch of nonsense errors.
I suspect the walrus operator inside of the list comprehension, inside of the decorator argument list is causing some kind of problem with whatever is trying to parse/make sense of this. This code generates over 8000 tests, so I definitely won't be keeping it.
If you have
poetry
set up, you can clone the project and run the tests to demonstrate that it parses and runs as valid python.git clone git@github.com:Jordan-Cottle/discommand.git cd discommand/ git checkout break-pylance poetry install pytest
Example test output below
The text was updated successfully, but these errors were encountered: