Skip to content

Test ContextTest/test_resolve fails on correct code. #8292

@lrhn

Description

@lrhn

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.

Metadata

Metadata

Assignees

Labels

closed-obsoleteClosed as the reported issue is no longer relevantlegacy-area-analyzerUse area-devexp instead.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions