Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

List<String> not a subtype of List<String> in function type test #14573

Closed
peter-ahe-google opened this issue Oct 29, 2013 · 2 comments
Closed
Assignees
Labels
closed-obsolete Closed as the reported issue is no longer relevant web-dart2js

Comments

@peter-ahe-google
Copy link
Contributor

typedef T Func<T>();

class Foo<S> {
  m(x) => x is Func<S>;
}

class Bar<T> {
  f() {
    T local() {}
    return local;
  }
}

void main() {
  var x = new Foo<List<String>>();
  if (new DateTime.now().millisecondsSinceEpoch == 42) x = new Foo<int>();
  print(x.m(new Bar<String>().f()));
  print(x.m(new Bar<List<String>>().f()));
}

@srawlins
Copy link
Member

This now just prints (using the VM):

false
true

@lrhn
Copy link
Member

lrhn commented Jan 19, 2016

That's the correct result, and dart2js does the same, so I guess the problem has been fixed at some point.

@lrhn lrhn closed this as completed Jan 19, 2016
@lrhn lrhn added the closed-obsolete Closed as the reported issue is no longer relevant label Jan 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-obsolete Closed as the reported issue is no longer relevant web-dart2js
Projects
None yet
Development

No branches or pull requests

5 participants