Skip to content

Not-implemented iteration for objects #4

Closed
@DartBot

Description

@DartBot

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    closed-invalidClosed as we don't believe the reported issue is generally actionable

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions