mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-07 14:34:31 +08:00
Fix issues with unreachable flows.
This benefits static analysis as well as autocompletion: Unreachable code (things like code within 'if 0:') should still be resolveable.
This commit is contained in:
@@ -182,3 +182,26 @@ isinst(1.0)
|
||||
isinst(False)
|
||||
#? int()
|
||||
isinst('')
|
||||
|
||||
# -----------------
|
||||
# flows that are not reachable should be able to access parent scopes.
|
||||
# -----------------
|
||||
|
||||
foobar = ''
|
||||
|
||||
if 0:
|
||||
within_flow = 1.0
|
||||
#? float()
|
||||
within_flow
|
||||
#? str()
|
||||
foobar
|
||||
if 0:
|
||||
nested = 1
|
||||
#? int()
|
||||
nested
|
||||
#? float()
|
||||
within_flow
|
||||
#? str()
|
||||
foobar
|
||||
#?
|
||||
nested
|
||||
|
||||
Reference in New Issue
Block a user