{"push_id":852658428,"size":1,"distinct_size":1,"ref":"refs/heads/fix-compiler-crash-weird-switch-match","head":"4ba2a5aeb672fb295247bcb4a392215c1e817da8","before":"5b8a9219dc6e466791508f2dfee91c705841866f","commits":[{"sha":"4ba2a5aeb672fb295247bcb4a392215c1e817da8","author":{"email":"2832a3611e91a3b35b084da8a16440b68c3bd8c7@gmail.com","name":"Sébastien Doeraene"},"message":"Fix #1955: Recognize an additional shape of Match in the back-end.\n\nAfter mixin, scalac gives us the following tree for the bug()\nmethod:\n\n    def bug(e: Boolean): Unit = {\n      {\n        case <synthetic> val x1: Int = 1;\n        (x1: Int) match {\n          case 1 => Bug.this.doSomething(123, 456, scala.runtime.BoxedUnit.UNIT)\n          case 2 => {\n            if (e)\n              ()\n            else\n              default4();\n            scala.runtime.BoxedUnit.UNIT\n          }\n          case _ => default4(){\n            throw new MatchError(scala.Int.box(x1))\n          }\n        }\n      };\n      ()\n    };\n\nin which the `case 2 =>` has the BoxedUnit.UNIT *after* the\nif/else, instead of inside the branches, as one might expect.\nWe now recognize this shape, and rewrite it by injecting\n`scala.runtime.BoxedUnit.UNIT` in the two branches of the if,\nso that it fits the shape we can deal with.","distinct":true,"url":"https://api.github.com/repos/sjrd/scala-js/commits/4ba2a5aeb672fb295247bcb4a392215c1e817da8"}]}