-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Confusing inference for List<Object> foo = ['foo', 'bar'] #27586
Comments
Yeah we always prefer most precise type information (for better or worse). I chatted with Leaf earlier and will take a look at improving the inference, so it prefers downwards info. The tricky part to this is that we sometimes have imprecise downward info for nested generic methods, and we don't want those types to take priority. |
related: #27625 |
We hit a nasty instance of this internally (thanks @leafpetersen). If this isn't fixed/addressed soon, I'd recommend clearly documenting this (as best you can) in the DDC usage/strong-mode guide - it was definitely very confusing (and the stack trace you get offers almost nothing to help fix it). |
Cross referencing: #27933 |
Hi @matanlurey - can you explain what you mean by stack trace? If the compiler/analyzer threw an error that sounds like a different bug. |
should result in foo having runtime type
List<Object>
notList<String>
This was broken in a recent dart dev compiler roll.
The text was updated successfully, but these errors were encountered: