-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Description
It seems the ContextTest/test_resolve test errs on code in the core library that isn't wrong.
The error is detected in the Editor and on the buildbot. In the Editor, it can be turned off by disabling type inference based warnings, which suggests that the test on the buildbot runs with those enabled. That is dangerous, since the code in question explicitly uses a "var" temporary to avoid a static warning:
class ...<T> ...
T min ([int compare(T a, T b)]) {
if (compare == null) {
var defaultCompare = Comparable.compare;
compare = defaultCompare;
}
...
Type inference based warnings tells me that Comparable isn't always compatible with T, which is correct and deliberate. You are expected to get errors if you omit the default on an Iterable where T isn't a subclass of Comparable.