New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incomplete code completion from static collection #11062
Comments
Note, if I change the list to: static List<String> strings = new List<String>(); I see the expected code completion options. |
Set owner to @stevemessick. |
It appears type propagation is ignoring generics. Set owner to @bwilkerson. |
Removed Area-Editor label. |
Removed this from the M8 milestone. |
This comment was originally written by @chalin Isn't there concern that strings might have its value changed? To me the fact that completion make use of the declared type of strings makes sense. If strings were a local variable then doing intra-procedural analysis is tractable (and so you could assume that strings was still assigned a List<String> value), but having inter-procedural analysis conclude that the Foo.strings field is still a List<String> in main seems risky to me (in the general case). |
Yes. And it's possible that we won't do anything about this issue for that very reason. But if it we could record that 'String' is a "high probability" value for the element type then we could potentially order the code completion results with the ones for String closer to the beginning. I suspect that this would place the desired completions near the top more frequently. |
Removed this from the Later milestone. |
Removed Oldschool-Milestone-Later label. |
Closing as stale. |
Consider this code:
class Foo {
static List strings = new List<String>();
}
void main() {
Foo.strings.first.[CODE COMPLETE]
}
expected:
options for a string
actual:
options from Object
Please see attached screenshot.
Hope this helps!
Attachment:
[Screen Shot 2013-06-03 at 9.42.08 PM.png](https://storage.googleapis.com/google-code-attachments/dart/issue-11062/comment-0/Screen Shot 2013-06-03 at 9.42.08 PM.png) (72.57 KB)
The text was updated successfully, but these errors were encountered: