Fix an issue with interpreter completion, see also #1628

This commit is contained in:
Dave Halter
2020-07-12 22:01:55 +02:00
parent 0c618a4456
commit 396d7df314
2 changed files with 17 additions and 4 deletions

View File

@@ -681,3 +681,9 @@ def test_string_annotation(annotations, result, code):
x.__annotations__ = annotations
defs = jedi.Interpreter(code or 'x()', [locals()]).infer()
assert [d.name for d in defs] == result
def test_variable_reuse():
x = 1
d, = jedi.Interpreter('y = x\ny', [locals()]).infer()
assert d.name == 'int'