-
Notifications
You must be signed in to change notification settings - Fork 213
Inferred type too general? #2069
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
Comments
In the case where we're computing the least upper bound of The rule Rold is specified here. This rule is rather simplistic and it yields upper bounds that are considerably less tight than they could be. For example, the least upper bound of But it is certainly a known issue that the least upper bound algorithm delivers suboptimal results in this particular case. See
least-upper-bound
|
Note: this issue is relevant to #844 and spebbe/dartz#32. Anyone trying to do something similar will eventually come across this. |
I'm going to close this issue because I don't think that it's likely that many people would benefit from focusing on this issue alone. I think that a fresh discussion around #844 (and, more broadly, use cases for phantom types, e.g., #2865 & #3273) would be needed to make discussing this particular issue worthwhile. |
Hello,
Could it be a bug that the type of
listA
isn'tList<Base<All>>
butList<Object>
?My expectation was that the type of
listA
would be the most specific type possible i.e.List<Base<All>>
in this case and notList<Object>
.The text was updated successfully, but these errors were encountered: