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

dart2js: incomplete test for Iterable<int> #32810

Closed
rakudrama opened this issue Apr 6, 2018 · 2 comments
Closed

dart2js: incomplete test for Iterable<int> #32810

rakudrama opened this issue Apr 6, 2018 · 2 comments
Assignees
Labels
language-strong-mode-polish P2 A bug or feature request we're likely to work on web-dart2js
Milestone

Comments

@rakudrama
Copy link
Member

This program does not throw a TypeError when compiled with --strong:

foo(Iterable<int> a) {
  print(a);
}

main() {
  dynamic f = foo;
  f(<String>['hi']);
}

The generated code calls listSuperNativeTypeCheck:

    function(a) {
      H.printString(H.S(H.listSuperNativeTypeCheck(a, "$isIterable")));
    },

It is probably best to simply always avoid listSuperNativeTypeCheck, since it can't handle type arguments, and contains two getInterceptor calls. The logic for picking the 'optimized' xxxTypeCheck is based on the Dart 1 libraries many years ago.

@rakudrama rakudrama added this to the Dart2 Beta 4 milestone Apr 6, 2018
@rakudrama
Copy link
Member Author

Fixing this is blocked on #32829.
If we fix the 'is Iterator' test, then the sync* Iterables will fail.

@sigmundch sigmundch added the P2 A bug or feature request we're likely to work on label Apr 13, 2018
@rakudrama rakudrama self-assigned this Apr 18, 2018
dart-bot pushed a commit that referenced this issue Apr 24, 2018
Bug: #32810
Change-Id: I0d34185725bd9cbd627a5da66d3ef5eea5b7e4dd
Reviewed-on: https://dart-review.googlesource.com/52402
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
@sigmundch
Copy link
Member

@rakudrama I wonder if we can close this now (is bcc5e6e the entire fix, or is there more to follow up here?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
language-strong-mode-polish P2 A bug or feature request we're likely to work on web-dart2js
Projects
None yet
Development

No branches or pull requests

2 participants