Skip to content

Analyzer and dart2js compute least upper bounds incorrectly for function types #23381

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

Closed
leafpetersen opened this issue May 4, 2015 · 2 comments
Assignees
Labels
legacy-area-analyzer Use area-devexp instead. P2 A bug or feature request we're likely to work on

Comments

@leafpetersen
Copy link
Member

The analyzer and dart2js both seem to treat the least upper bound of function types as always dynamic. This program generates no warnings:

void foo(bool b, int f(k), int g(int k)) {
  (b ? f : g).bar;
}

Per the spec (16.20), the type of the conditional expression should be the lub of the types of the arms of the conditional, and per 19.8.2, the lub of these two functions types should be dynamic -> int, which should generate a warning for this program.

Dart-to-JavaScript compiler (dart2js) version: 1.10.0-dev.1.5+2

dartanalyzer version 1.10.0-dev.1.5+2

@bwilkerson
Copy link
Member

Removed Priority-Unassigned label.
Added Priority-Medium label.

@munificent
Copy link
Member

Unless anyone doesn't want me to, I'll hack on this.

@kevmoo kevmoo added P2 A bug or feature request we're likely to work on and removed Priority-Medium labels Mar 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
legacy-area-analyzer Use area-devexp instead. P2 A bug or feature request we're likely to work on
Projects
None yet
Development

No branches or pull requests

4 participants