summaryrefslogtreecommitdiff
path: root/src/compiler
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2013-09-23 23:36:04 -0700
committerJason Zaugg <jzaugg@gmail.com>2013-09-23 23:36:04 -0700
commitc2e3b0656bb449e95a529e266294aeabb9cbef3f (patch)
tree1dc9915c79f23424d697f34f408ad33b1260ff63 /src/compiler
parent7d570b54c3c895bc8948adeca2e463d135e38feb (diff)
parent16d963bcb032deb669247e4a95c6391971cafd75 (diff)
downloadscala-c2e3b0656bb449e95a529e266294aeabb9cbef3f.tar.gz
scala-c2e3b0656bb449e95a529e266294aeabb9cbef3f.tar.bz2
scala-c2e3b0656bb449e95a529e266294aeabb9cbef3f.zip
Merge pull request #2975 from retronym/ticket/7868
SI-7868 Account for numeric widening in match translation
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/scala/tools/nsc/transform/patmat/MatchTranslation.scala8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/transform/patmat/MatchTranslation.scala b/src/compiler/scala/tools/nsc/transform/patmat/MatchTranslation.scala
index 75335f7920..ab19660da5 100644
--- a/src/compiler/scala/tools/nsc/transform/patmat/MatchTranslation.scala
+++ b/src/compiler/scala/tools/nsc/transform/patmat/MatchTranslation.scala
@@ -600,9 +600,15 @@ trait MatchTranslation {
protected def spliceApply(binder: Symbol): Tree = {
object splice extends Transformer {
+ def binderRef(pos: Position): Tree =
+ REF(binder) setPos pos
override def transform(t: Tree) = t match {
+ // duplicated with the extractor Unapplied
case Apply(x, List(i @ Ident(nme.SELECTOR_DUMMY))) =>
- treeCopy.Apply(t, x, (REF(binder) setPos i.pos) :: Nil)
+ treeCopy.Apply(t, x, binderRef(i.pos) :: Nil)
+ // SI-7868 Account for numeric widening, e.g. <unappplySelector>.toInt
+ case Apply(x, List(i @ (sel @ Select(Ident(nme.SELECTOR_DUMMY), name)))) =>
+ treeCopy.Apply(t, x, treeCopy.Select(sel, binderRef(i.pos), name) :: Nil)
case _ =>
super.transform(t)
}