scala/scala — pull request #2975 by retronym (2013-09-23 08:41:49+00:00)
Title: SI-7868 Account for numeric widening in match translation

Pattern match translation was unprepared for trees of the shape:

(0: Short) match {
case A.unapply(.toInt) (_) => ()
case _ => ()
}

While a scrutinee is inelibigle for implicit views in order to
conform to the type of the extractor call, it is allowed to
weakly conform. In this case, the typechecker will add the
numeric widening with a `toInt` call.

This commit:

- Changes treeInfo.Unapplied to recognize this tree shape
- Changes spliceApply to recognize and preserve the widening
when substituting the unapply selector with the binder
- Tests reification of such pattern matches, which also depends
on treeInfo.Unapplied.

Review by @adriaanm