Evaluated type of expression varies based on evaluation order #2983
Labels
addressed in next version
Issue is fixed and will appear in next published version
bug
Something isn't working
This is a tracking bug. The original is found here: microsoft/pylance-release#2324.
The evaluated type of the return expression depends on the order of evaluation. It should be order invariant.
To repro, hover over the
e
in the return statement while modifying the file. The hover will cause thee
in the return statement to be evaluated prior to the other statements, and the inferred return type will be evaluated asLiteral[0]
rather than the correct answer ofUnknown | Literal[0]
.The text was updated successfully, but these errors were encountered: