Skip to content

Analyzer fails to respect certain "is" checks #11080

@nex3

Description

@nex3

Consider the following code:

    import "dart:typed_data";

    void doIt(List list) {
      if (list is TypedData) print(list.buffer);
    }

Running the analyzer on this produces the following error:

    [warning] There is no such getter 'buffer' in 'List'

despite the fact that "list" must be an instance of TypedData in the "if" block, and TypedData defines a "buffer" getter.

Metadata

Metadata

Assignees

Labels

area-languageDart language related items (some items might be better tracked at github.com/dart-lang/language).closed-duplicateClosed in favor of an existing report

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions