{"action":"created","issue":{"url":"https://api.github.com/repos/ponylang/ponyc/issues/1465","repository_url":"https://api.github.com/repos/ponylang/ponyc","labels_url":"https://api.github.com/repos/ponylang/ponyc/issues/1465/labels{/name}","comments_url":"https://api.github.com/repos/ponylang/ponyc/issues/1465/comments","events_url":"https://api.github.com/repos/ponylang/ponyc/issues/1465/events","html_url":"https://github.com/ponylang/ponyc/issues/1465","id":194507349,"number":1465,"title":"Compiler segfault with union type in lambda","user":{"login":"Theodus","id":9407624,"avatar_url":"https://avatars.githubusercontent.com/u/9407624?v=3","gravatar_id":"","url":"https://api.github.com/users/Theodus","html_url":"https://github.com/Theodus","followers_url":"https://api.github.com/users/Theodus/followers","following_url":"https://api.github.com/users/Theodus/following{/other_user}","gists_url":"https://api.github.com/users/Theodus/gists{/gist_id}","starred_url":"https://api.github.com/users/Theodus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Theodus/subscriptions","organizations_url":"https://api.github.com/users/Theodus/orgs","repos_url":"https://api.github.com/users/Theodus/repos","events_url":"https://api.github.com/users/Theodus/events{/privacy}","received_events_url":"https://api.github.com/users/Theodus/received_events","type":"User","site_admin":false},"labels":[{"id":335735910,"url":"https://api.github.com/repos/ponylang/ponyc/labels/bug:%202%20-%20under%20investigation","name":"bug: 2 - under investigation","color":"f9d0c4","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-12-09T03:47:58Z","updated_at":"2016-12-09T17:43:18Z","closed_at":null,"body":"The following code causes the compiler to segfault:\r\n```pony\r\nuse \"itertools\"\r\n\r\ntype StringTuple is ((String, String) | None)\r\n\r\nactor Main\r\n  new create(env: Env) =>\r\n    try\r\n      Iter[StringTuple]([(\"foo\",\"bar\")].values())\r\n        .find({(tuple: StringTuple): Bool => true})\r\n    end\r\n```\r\nBut it compiles when you change the type `StringTuple` to `(String, String)`"},"comment":{"url":"https://api.github.com/repos/ponylang/ponyc/issues/comments/266075116","html_url":"https://github.com/ponylang/ponyc/issues/1465#issuecomment-266075116","issue_url":"https://api.github.com/repos/ponylang/ponyc/issues/1465","id":266075116,"user":{"login":"Praetonus","id":5193706,"avatar_url":"https://avatars.githubusercontent.com/u/5193706?v=3","gravatar_id":"","url":"https://api.github.com/users/Praetonus","html_url":"https://github.com/Praetonus","followers_url":"https://api.github.com/users/Praetonus/followers","following_url":"https://api.github.com/users/Praetonus/following{/other_user}","gists_url":"https://api.github.com/users/Praetonus/gists{/gist_id}","starred_url":"https://api.github.com/users/Praetonus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Praetonus/subscriptions","organizations_url":"https://api.github.com/users/Praetonus/orgs","repos_url":"https://api.github.com/users/Praetonus/repos","events_url":"https://api.github.com/users/Praetonus/events{/privacy}","received_events_url":"https://api.github.com/users/Praetonus/received_events","type":"User","site_admin":false},"created_at":"2016-12-09T17:43:18Z","updated_at":"2016-12-09T17:43:18Z","body":"It looks like the compiler believes that `Iterator[(String, String)]` is a subtype of `Iterator[((String, String) | None)]`. I think I understand the reasoning behind it but I'm not sure if it's right in that case.\r\n\r\nThe compiler failure is caused by `StringTuple` not being reached before code generation (because the compiler takes the `(String, String)` path.\r\n\r\nI don't know whether the real bug is on the subtyping side or on the reachability side, do you have any input on this @sylvanc?"}}
{"actor":{"display_login":"Praetonus"}}