{"action":"created","issue":{"url":"https://api.github.com/repos/scala/scala/issues/4376","labels_url":"https://api.github.com/repos/scala/scala/issues/4376/labels{/name}","comments_url":"https://api.github.com/repos/scala/scala/issues/4376/comments","events_url":"https://api.github.com/repos/scala/scala/issues/4376/events","html_url":"https://github.com/scala/scala/pull/4376","id":60459188,"number":4376,"title":"SI-8790 detuplify match under -Xexperimental","user":{"login":"adriaanm","id":91083,"avatar_url":"https://avatars.githubusercontent.com/u/91083?v=3","gravatar_id":"","url":"https://api.github.com/users/adriaanm","html_url":"https://github.com/adriaanm","followers_url":"https://api.github.com/users/adriaanm/followers","following_url":"https://api.github.com/users/adriaanm/following{/other_user}","gists_url":"https://api.github.com/users/adriaanm/gists{/gist_id}","starred_url":"https://api.github.com/users/adriaanm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adriaanm/subscriptions","organizations_url":"https://api.github.com/users/adriaanm/orgs","repos_url":"https://api.github.com/users/adriaanm/repos","events_url":"https://api.github.com/users/adriaanm/events{/privacy}","received_events_url":"https://api.github.com/users/adriaanm/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/scala/scala/milestones/48","html_url":"https://github.com/scala/scala/milestones/2.11.7","labels_url":"https://api.github.com/repos/scala/scala/milestones/48/labels","id":985497,"number":48,"title":"2.11.7","description":"Merge to 2.11.x.\r\n","creator":{"login":"adriaanm","id":91083,"avatar_url":"https://avatars.githubusercontent.com/u/91083?v=3","gravatar_id":"","url":"https://api.github.com/users/adriaanm","html_url":"https://github.com/adriaanm","followers_url":"https://api.github.com/users/adriaanm/followers","following_url":"https://api.github.com/users/adriaanm/following{/other_user}","gists_url":"https://api.github.com/users/adriaanm/gists{/gist_id}","starred_url":"https://api.github.com/users/adriaanm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adriaanm/subscriptions","organizations_url":"https://api.github.com/users/adriaanm/orgs","repos_url":"https://api.github.com/users/adriaanm/repos","events_url":"https://api.github.com/users/adriaanm/events{/privacy}","received_events_url":"https://api.github.com/users/adriaanm/received_events","type":"User","site_admin":false},"open_issues":27,"closed_issues":5,"state":"open","created_at":"2015-02-19T00:12:20Z","updated_at":"2015-03-14T18:36:33Z","due_on":"2015-06-01T07:00:00Z","closed_at":null},"comments":9,"created_at":"2015-03-10T07:04:28Z","updated_at":"2015-03-15T22:00:13Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/scala/scala/pulls/4376","html_url":"https://github.com/scala/scala/pull/4376","diff_url":"https://github.com/scala/scala/pull/4376.diff","patch_url":"https://github.com/scala/scala/pull/4376.patch"},"body":"Optimize\r\n\r\n```\r\n(e1,..., eN) match {\r\ncase (p1, ..., pN) if G => B\r\n...\r\ncase _ if G => B\r\n}\r\n```\r\n\r\nto\r\n\r\n``` \r\nval t1 = e1\r\n... val tN = eN\r\n\r\nt1 | ... | TN match {\r\ncase p1 | ... | pN if G => B\r\n...\r\ncase _ if G => B\r\n}\r\n```\r\n\r\nWhere `|` is like magic: its constructor is a no-op, and its accessors are\r\nlocal variable accesses (the `ti`).\r\n\r\nThe optimization supports scrutinees of the shape:\r\n- `new TupleN(e1,...,eN)`\r\n- `TupleN.apply(e1,...,eN)`\r\n\r\nThis is not allowed (can't omit the effect of the `???`)\r\n- `{???; TupleN}.apply(e1,...,eN)` // !isQualifierSafeToElide(fun)\r\n\r\nBuilt on top of a bunch of refactorings:\r\n - SubstOnlyTreeMaker can subst >1 binders\r\n - peel off a few Layers of Abstraction\r\n - simplify `BoundTree`\r\n - move `makers` to ExtractorCall\r\n - pull out scrutineeFor\r\n - Scrutinee encapsulates its sym & tree\r\n - Simplify generation of default case\r\n\r\nAlready incorporates over-the-shoulder review by @retronym. Review by @retronym."},"comment":{"url":"https://api.github.com/repos/scala/scala/issues/comments/81257846","html_url":"https://github.com/scala/scala/pull/4376#issuecomment-81257846","issue_url":"https://api.github.com/repos/scala/scala/issues/4376","id":81257846,"user":{"login":"adriaanm","id":91083,"avatar_url":"https://avatars.githubusercontent.com/u/91083?v=3","gravatar_id":"","url":"https://api.github.com/users/adriaanm","html_url":"https://github.com/adriaanm","followers_url":"https://api.github.com/users/adriaanm/followers","following_url":"https://api.github.com/users/adriaanm/following{/other_user}","gists_url":"https://api.github.com/users/adriaanm/gists{/gist_id}","starred_url":"https://api.github.com/users/adriaanm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adriaanm/subscriptions","organizations_url":"https://api.github.com/users/adriaanm/orgs","repos_url":"https://api.github.com/users/adriaanm/repos","events_url":"https://api.github.com/users/adriaanm/events{/privacy}","received_events_url":"https://api.github.com/users/adriaanm/received_events","type":"User","site_admin":false},"created_at":"2015-03-15T22:00:13Z","updated_at":"2015-03-15T22:00:13Z","body":"Community build is blue! I'll clarify test "}}