Skip to content
This repository was archived by the owner on Apr 14, 2022. It is now read-only.

Assignments don't always change variable types #428

Closed
jakebailey opened this issue Nov 21, 2018 · 4 comments
Closed

Assignments don't always change variable types #428

jakebailey opened this issue Nov 21, 2018 · 4 comments
Labels
gen from the generated tests

Comments

@jakebailey
Copy link
Member

image

Here, a is initially a list of strings, but after line 4, it should be known to be a list of ints.

Found in #334.

@MikhailArkhipov
Copy link

This is not currently possible as analysis is static. Code does not track type by location. Thus, at best, variable will have two types. In order to make this work the engine either has to eval code to the completion point (JavaScript editor used to do this) or types attached to variable need to have 'applicable spans' associated with them.

@jakebailey
Copy link
Member Author

Unfortunately I think reassigning variables with different types is a pretty normal thing to do in a non-static language like Python, and it's probably worthwhile to try to do this.

@MikhailArkhipov
Copy link

It would be a fundamental and pretty expensive change.

@MikhailArkhipov
Copy link

New analysis uses the last assignment. Location tracking folding into #682

@jakebailey jakebailey added the gen from the generated tests label Sep 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
gen from the generated tests
Projects
None yet
Development

No branches or pull requests

2 participants