{"push_id":559351247,"size":1,"distinct_size":1,"ref":"refs/heads/ticket/9086","head":"509177c64cf39c411558408bf9ff248f44132e5b","before":"3c97888ab896e7ffc63e44515902aba1c5022072","commits":[{"sha":"509177c64cf39c411558408bf9ff248f44132e5b","author":{"email":"8287c3bf2f3045ed7dda958850d2b0fdb9e67898@gmail.com","name":"Jason Zaugg"},"message":"SI-9086 More coherent trees with patmat, dependent types\n\nThe pattern matcher needs to substitute references to bound\nvariables with references to either a) synthetic temporary vals,\nor to b) selections. The latter occurs under -optimize to avoid\nto be frugal with local variable slots.\n\nFor instance:\n\n```\ndef test(s: Some[String]) = s match {\n  case Some(elem) => elem.length\n}\n```\n\nIs translated to:\n\n```\ndef test(s: Some[String]): Int = {\n  case <synthetic> val x1: Some[String] = s;\n  case4(){\n    if (x1.ne(null))\n      matchEnd3(x1.x.length())\n    else\n      case5()\n  };\n  case5(){\n    matchEnd3(throw new MatchError(x1))\n  };\n  matchEnd3(x: Int){\n    x\n  }\n}\n```\n\nHowever, for a long time this translation failed to consider\nreferences to the binder in types. #4122 tried to address this\nby either using standard substitution facilities where available\n(references to temp vals), and by expanding the patmat's\nhome grown substitution to handle the more complex case of\nreferencing a selection.\n\nHowever, this left the tree in an incoherent state; while it\npatched up the `.tpe` field of `Tree`s, it failed to modify the\ninfo of `Symbol`-s.\n\nThis led to a crash in the later uncurry phase under\n`-Ydelambdafy:method`.\n\nThis commit modifies the info of such symbols to get rid of stray\nrefeferences to the pattern binder symbols.","distinct":true,"url":"https://api.github.com/repos/retronym/scala/commits/509177c64cf39c411558408bf9ff248f44132e5b"}]}