-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Strong mode analyzer ignores function types in conditional operator #25248
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
There are two related issues here. The first is that the analyzer (normal mode) does not currently implement least upper bound for function types, see: #23381 and #23663 . The second is that we shouldn't really be using the dart spec version of least upper bound, since it produces very bad results in lots of places. dart-archive/dev_compiler#288 Getting a DDC lub implemented is on my list of things to do fairly soon. |
@leafpetersen is an improved LUB something we want to tackle in Q1? |
Yes. It doesn't have to be complete, but the function case comes up surprisingly often, in addition to the EfficientLength kind of issue. |
I've merged dart-archive/dev_compiler#288 into this issue. There's some useful discussion on that bug, but the code is part of analyzer now. |
I think @munificent fixed the first part (LUB in normal mode) ... I think we still need a strong-mode LUB, as the spec version is not sound. |
merging this into #25802 |
Dart VM version: 1.14.0-dev.4.0.
This is OK:
However this
results in
WARNING: t ? foo : bar (Function) will need runtime check to cast to type (int) → int
.The text was updated successfully, but these errors were encountered: