Closed
Description
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