{"action":"created","issue":{"url":"https://api.github.com/repos/crystal-lang/crystal/issues/3415","repository_url":"https://api.github.com/repos/crystal-lang/crystal","labels_url":"https://api.github.com/repos/crystal-lang/crystal/issues/3415/labels{/name}","comments_url":"https://api.github.com/repos/crystal-lang/crystal/issues/3415/comments","events_url":"https://api.github.com/repos/crystal-lang/crystal/issues/3415/events","html_url":"https://github.com/crystal-lang/crystal/issues/3415","id":182557615,"number":3415,"title":"flat_map bug?","user":{"login":"trans","id":23423,"avatar_url":"https://avatars.githubusercontent.com/u/23423?v=3","gravatar_id":"","url":"https://api.github.com/users/trans","html_url":"https://github.com/trans","followers_url":"https://api.github.com/users/trans/followers","following_url":"https://api.github.com/users/trans/following{/other_user}","gists_url":"https://api.github.com/users/trans/gists{/gist_id}","starred_url":"https://api.github.com/users/trans/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trans/subscriptions","organizations_url":"https://api.github.com/users/trans/orgs","repos_url":"https://api.github.com/users/trans/repos","events_url":"https://api.github.com/users/trans/events{/privacy}","received_events_url":"https://api.github.com/users/trans/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/crystal-lang/crystal/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/crystal-lang/crystal/labels/standard%20library","name":"standard library","color":"fad8c7"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-10-12T15:31:40Z","updated_at":"2016-10-12T17:17:48Z","closed_at":null,"body":"Is `flat_map` supposed to not handle elements that are not in arrays?\r\n\r\n```ruby\r\na = [ [1,2,3], 4, 5]\r\nx = a.flat_map do |x|\r\n  x\r\nend\r\np x\r\n```\r\n\r\n```\r\ninstantiating 'Array(Array(Int32) | Int32)#flat_map()'\r\n\r\nx = a.flat_map do |x|\r\n      ^~~~~~~~\r\n\r\nin /opt/crystal/src/enumerable.cr:255: instantiating 'each()'\r\n\r\n    each { |e| ary.concat(yield e) }\r\n    ^~~~\r\n\r\nin /opt/crystal/src/indexable.cr:151: instantiating 'each_index()'\r\n\r\n    each_index do |i|\r\n    ^~~~~~~~~~\r\n\r\nin /opt/crystal/src/indexable.cr:151: instantiating 'each_index()'\r\n\r\n    each_index do |i|\r\n    ^~~~~~~~~~\r\n\r\nin /opt/crystal/src/enumerable.cr:255: instantiating 'each()'\r\n\r\n    each { |e| ary.concat(yield e) }\r\n    ^~~~\r\n\r\nin /opt/crystal/src/enumerable.cr:255: no overload matches 'Array(Int32)#concat' with type (Array(Int32) | Int32)\r\nOverloads are:\r\n - Array(T)#concat(other : Array)\r\n - Array(T)#concat(other : Enumerable)\r\nCouldn't find overloads for these types:\r\n - Array(Int32)#concat(other : Int32)\r\n\r\n    each { |e| ary.concat(yield e) }\r\n```"},"comment":{"url":"https://api.github.com/repos/crystal-lang/crystal/issues/comments/253278119","html_url":"https://github.com/crystal-lang/crystal/issues/3415#issuecomment-253278119","issue_url":"https://api.github.com/repos/crystal-lang/crystal/issues/3415","id":253278119,"user":{"login":"trans","id":23423,"avatar_url":"https://avatars.githubusercontent.com/u/23423?v=3","gravatar_id":"","url":"https://api.github.com/users/trans","html_url":"https://github.com/trans","followers_url":"https://api.github.com/users/trans/followers","following_url":"https://api.github.com/users/trans/following{/other_user}","gists_url":"https://api.github.com/users/trans/gists{/gist_id}","starred_url":"https://api.github.com/users/trans/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trans/subscriptions","organizations_url":"https://api.github.com/users/trans/orgs","repos_url":"https://api.github.com/users/trans/repos","events_url":"https://api.github.com/users/trans/events{/privacy}","received_events_url":"https://api.github.com/users/trans/received_events","type":"User","site_admin":false},"created_at":"2016-10-12T17:17:48Z","updated_at":"2016-10-12T17:17:48Z","body":"Perhaps unnecessary. I am going to bring up the topic of Functors and Monads in another issue, and that would no doubt effect this behavior."}}
{"actor":{"display_login":"trans"}}