{"action":"created","issue":{"url":"https://api.github.com/repos/Whiley/WhileyCompiler/issues/853","repository_url":"https://api.github.com/repos/Whiley/WhileyCompiler","labels_url":"https://api.github.com/repos/Whiley/WhileyCompiler/issues/853/labels{/name}","comments_url":"https://api.github.com/repos/Whiley/WhileyCompiler/issues/853/comments","events_url":"https://api.github.com/repos/Whiley/WhileyCompiler/issues/853/events","html_url":"https://github.com/Whiley/WhileyCompiler/issues/853","id":316067347,"number":853,"title":"ConcreteTypeExtractor is Broken?","user":{"login":"DavePearce","id":484459,"avatar_url":"https://avatars2.githubusercontent.com/u/484459?v=4","gravatar_id":"","url":"https://api.github.com/users/DavePearce","html_url":"https://github.com/DavePearce","followers_url":"https://api.github.com/users/DavePearce/followers","following_url":"https://api.github.com/users/DavePearce/following{/other_user}","gists_url":"https://api.github.com/users/DavePearce/gists{/gist_id}","starred_url":"https://api.github.com/users/DavePearce/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DavePearce/subscriptions","organizations_url":"https://api.github.com/users/DavePearce/orgs","repos_url":"https://api.github.com/users/DavePearce/repos","events_url":"https://api.github.com/users/DavePearce/events{/privacy}","received_events_url":"https://api.github.com/users/DavePearce/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-04-19T22:50:12Z","updated_at":"2018-04-21T01:03:32Z","closed_at":null,"author_association":"OWNER","body":"It seems to me that `ConcreteTypeExtractor` is broken because it cannot intersect infinite lists properly.  The following should seem to break it (though doesn't):\r\n```\r\ntype A_List is { int|null data, null|A_List next }\r\ntype B_List is { int|bool data, null|B_List next }\r\ntype C_List is { int data, null|C_List next }\r\n\r\nfunction intersect(A_List l) -> null|C_List:\r\n    if l is B_List:\r\n        return l\r\n    else:\r\n        return null\r\n```\r\n\r\nFor some reason, it extracts `void` from `A_List & B_List` ... which doesn't make sense!\r\n\r\nOne way to tackle this problem is to just avoid it.  That is, change the way that the runtime type test operator works so that this becomes impossible.  Specifically, where intersection only selects one or more existing types from a list.  It does not construct \"new\" types."},"comment":{"url":"https://api.github.com/repos/Whiley/WhileyCompiler/issues/comments/383256012","html_url":"https://github.com/Whiley/WhileyCompiler/issues/853#issuecomment-383256012","issue_url":"https://api.github.com/repos/Whiley/WhileyCompiler/issues/853","id":383256012,"user":{"login":"DavePearce","id":484459,"avatar_url":"https://avatars2.githubusercontent.com/u/484459?v=4","gravatar_id":"","url":"https://api.github.com/users/DavePearce","html_url":"https://github.com/DavePearce","followers_url":"https://api.github.com/users/DavePearce/followers","following_url":"https://api.github.com/users/DavePearce/following{/other_user}","gists_url":"https://api.github.com/users/DavePearce/gists{/gist_id}","starred_url":"https://api.github.com/users/DavePearce/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DavePearce/subscriptions","organizations_url":"https://api.github.com/users/DavePearce/orgs","repos_url":"https://api.github.com/users/DavePearce/repos","events_url":"https://api.github.com/users/DavePearce/events{/privacy}","received_events_url":"https://api.github.com/users/DavePearce/received_events","type":"User","site_admin":false},"created_at":"2018-04-21T01:03:32Z","updated_at":"2018-04-21T01:03:32Z","author_association":"OWNER","body":"This is now generating the expected infinite loop after a series of bug fixes and refactoring.  `ConcreteTypeExtractor` is no longer at fault as the offending component is now `AbstractTypeCombinator` and it's two subclasses `TypeIntersector` and `TypeSubtractor`.\r\n\r\nThe case of intersecting nominals with the same name is now resolved.  But, it remains to determine how to resolve the rest.  This needs some kind of substitution."}}
{"actor":{"display_login":"DavePearce"}}