{"action":"opened","issue":{"url":"https://api.github.com/repos/Araq/Nim/issues/2134","labels_url":"https://api.github.com/repos/Araq/Nim/issues/2134/labels{/name}","comments_url":"https://api.github.com/repos/Araq/Nim/issues/2134/comments","events_url":"https://api.github.com/repos/Araq/Nim/issues/2134/events","html_url":"https://github.com/Araq/Nim/issues/2134","id":57711986,"number":2134,"title":"fields iterator misbehavior on break statement","user":{"login":"matkuki","id":10289651,"avatar_url":"https://avatars.githubusercontent.com/u/10289651?v=3","gravatar_id":"","url":"https://api.github.com/users/matkuki","html_url":"https://github.com/matkuki","followers_url":"https://api.github.com/users/matkuki/followers","following_url":"https://api.github.com/users/matkuki/following{/other_user}","gists_url":"https://api.github.com/users/matkuki/gists{/gist_id}","starred_url":"https://api.github.com/users/matkuki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matkuki/subscriptions","organizations_url":"https://api.github.com/users/matkuki/orgs","repos_url":"https://api.github.com/users/matkuki/repos","events_url":"https://api.github.com/users/matkuki/events{/privacy}","received_events_url":"https://api.github.com/users/matkuki/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-02-15T00:20:41Z","updated_at":"2015-02-15T00:20:41Z","closed_at":null,"body":"The \"break\" statement in the following code breaks out of both for loops:\r\n```nim\r\ntype\r\n    TestType = object\r\n        one: int\r\n        two: int\r\n        three: int\r\n\r\nvar\r\n    ab = TestType(one:1, two:2, three:3)\r\n    ac = TestType(one:4, two:5, three:6)\r\n    ad = TestType(one:7, two:8, three:9)\r\n    tstSeq = [ab, ac, ad]\r\n    \r\necho \"start\"\r\nfor tstElement in mitems(tstSeq):\r\n    echo tstElement\r\n    for tstField in fields(tstElement):\r\n        echo tstField\r\n        if tstField == 4:\r\n            break\r\n```\r\nI was told that the \"break\" should not be allowed in a \"fields\" iterator and\r\nshould be a compiler error."}}