Skip to content
This repository was archived by the owner on Feb 22, 2018. It is now read-only.
This repository was archived by the owner on Feb 22, 2018. It is now read-only.

inference results in different behavior with "is" tests #567

Closed
@jmesserly

Description

@jmesserly

reported by @vsmenon in this comment

On a very related note, after #236, strong mode and standard Dart print different values for:

class Foo<T> {
  bool bar(x) => x is T;
}
void main() {
  Foo<int> foo = new Foo();
  print(foo.bar("hello"));
}

We used to reject this.


comment by me:

ah, because of inference... eeeep.

class Foo<T> {
  bool bar(x) => x is T;
}
void main() {
  Foo<int> foo = new Foo();
  var foo2 = new Foo<int>();
  print(foo.bar("hello"));
  print(foo2.bar("hello"));
}

it seems really nice if foo2 could work, even if foo doesn't.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions