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

Not-implemented iteration for objects #4

Closed
DartBot opened this issue Oct 10, 2011 · 1 comment
Closed

Not-implemented iteration for objects #4

DartBot opened this issue Oct 10, 2011 · 1 comment
Labels
closed-invalid Closed as we don't believe the reported issue is generally actionable

Comments

@DartBot
Copy link

DartBot commented Oct 10, 2011

This issue was originally filed by vjeuxx...@gmail.com


What steps will reproduce the problem?

  main() {
    var obj = {"a": 1, "b": 2};
    for (var key in obj) {
      print(key);
    }
  }
http://try-dart-lang.appspot.com/s/EmEO

What is the expected output?
a
b

What do you see instead?
NoSuchMethodException - receiver: '' function name: 'iterator$named' arguments: []]

What version of the product are you using? On what operating system?
Online dart compiler.

Please provide any additional information below.

In the specification it says that "for in" construct is desugared into var n0 = e.iterator(); while (n0.hasNext()) { finalVarOrType id = n0.next();
It is not working because obj.iterator does not exist.

@DartBot
Copy link
Author

DartBot commented Oct 10, 2011

This comment was originally written by antonm@google.com


obj should be of type Map which doesn't implement Iterable. Please, try for (key in obj.getKeys()).


Added Invalid label.

@DartBot DartBot added Type-Defect closed-invalid Closed as we don't believe the reported issue is generally actionable labels Oct 10, 2011
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-invalid Closed as we don't believe the reported issue is generally actionable
Projects
None yet
Development

No branches or pull requests

1 participant