{"action":"created","issue":{"url":"https://api.github.com/repos/D-Programming-Language/dmd/issues/4371","labels_url":"https://api.github.com/repos/D-Programming-Language/dmd/issues/4371/labels{/name}","comments_url":"https://api.github.com/repos/D-Programming-Language/dmd/issues/4371/comments","events_url":"https://api.github.com/repos/D-Programming-Language/dmd/issues/4371/events","html_url":"https://github.com/D-Programming-Language/dmd/pull/4371","id":56292609,"number":4371,"title":"Diagnostics that hints about use of std.array.array","user":{"login":"nordlow","id":829407,"avatar_url":"https://avatars.githubusercontent.com/u/829407?v=3","gravatar_id":"","url":"https://api.github.com/users/nordlow","html_url":"https://github.com/nordlow","followers_url":"https://api.github.com/users/nordlow/followers","following_url":"https://api.github.com/users/nordlow/following{/other_user}","gists_url":"https://api.github.com/users/nordlow/gists{/gist_id}","starred_url":"https://api.github.com/users/nordlow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nordlow/subscriptions","organizations_url":"https://api.github.com/users/nordlow/orgs","repos_url":"https://api.github.com/users/nordlow/repos","events_url":"https://api.github.com/users/nordlow/events{/privacy}","received_events_url":"https://api.github.com/users/nordlow/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-02-02T21:02:22Z","updated_at":"2015-02-03T13:11:32Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/D-Programming-Language/dmd/pulls/4371","html_url":"https://github.com/D-Programming-Language/dmd/pull/4371","diff_url":"https://github.com/D-Programming-Language/dmd/pull/4371.diff","patch_url":"https://github.com/D-Programming-Language/dmd/pull/4371.patch"},"body":"This adds logic that hints the new developer on when to use `std.array.array` to force evaluation of a lazy range and write it into an array when trying to assign a non-array range to an D array as in\r\n\r\n```D\r\n    int[] x = [1, 2, 3].map!\"a*2\";\r\n```\r\n\r\ngives error:\r\n\r\n```\r\ncannot implicitly convert expression (map([1, 2, 3])) of type MapResult!(unaryFun, int[]) to int[], suffix Range with std.array.array\r\n```\r\n\r\nAssignment to non D-arrays such as\r\n\r\n```D\r\n    int x = [1, 2, 3].map!\"a*2\";\r\n```\r\n\r\nhas unchanged diagnostics.\r\n\r\nFor background discussion see\r\n\r\nhttp://forum.dlang.org/thread/xyvznufauehijucwwjav@forum.dlang.org?page=1\r\n\r\nThis is in an early stage. Feedback, please!"},"comment":{"url":"https://api.github.com/repos/D-Programming-Language/dmd/issues/comments/72647355","html_url":"https://github.com/D-Programming-Language/dmd/pull/4371#issuecomment-72647355","issue_url":"https://api.github.com/repos/D-Programming-Language/dmd/issues/4371","id":72647355,"user":{"login":"nordlow","id":829407,"avatar_url":"https://avatars.githubusercontent.com/u/829407?v=3","gravatar_id":"","url":"https://api.github.com/users/nordlow","html_url":"https://github.com/nordlow","followers_url":"https://api.github.com/users/nordlow/followers","following_url":"https://api.github.com/users/nordlow/following{/other_user}","gists_url":"https://api.github.com/users/nordlow/gists{/gist_id}","starred_url":"https://api.github.com/users/nordlow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nordlow/subscriptions","organizations_url":"https://api.github.com/users/nordlow/orgs","repos_url":"https://api.github.com/users/nordlow/repos","events_url":"https://api.github.com/users/nordlow/events{/privacy}","received_events_url":"https://api.github.com/users/nordlow/received_events","type":"User","site_admin":false},"created_at":"2015-02-03T13:11:32Z","updated_at":"2015-02-03T13:11:32Z","body":"Is it worse than hinting about `writeln`?"}}