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