diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2013-09-23 23:36:04 -0700 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2013-09-23 23:36:04 -0700 |
commit | c2e3b0656bb449e95a529e266294aeabb9cbef3f (patch) | |
tree | 1dc9915c79f23424d697f34f408ad33b1260ff63 /test/files | |
parent | 7d570b54c3c895bc8948adeca2e463d135e38feb (diff) | |
parent | 16d963bcb032deb669247e4a95c6391971cafd75 (diff) | |
download | scala-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 'test/files')
-rw-r--r-- | test/files/run/t7868.scala | 13 | ||||
-rw-r--r-- | test/files/run/t7868b.check | 6 | ||||
-rw-r--r-- | test/files/run/t7868b.scala | 11 |
3 files changed, 30 insertions, 0 deletions
diff --git a/test/files/run/t7868.scala b/test/files/run/t7868.scala new file mode 100644 index 0000000000..1f938adf31 --- /dev/null +++ b/test/files/run/t7868.scala @@ -0,0 +1,13 @@ +object A { + def unapply(n: Int): Option[Int] = Some(n) + + def run = (0: Short) match { + case A(_) => + case _ => + } +} + + +object Test extends App { + A.run +} diff --git a/test/files/run/t7868b.check b/test/files/run/t7868b.check new file mode 100644 index 0000000000..6577c4bc4e --- /dev/null +++ b/test/files/run/t7868b.check @@ -0,0 +1,6 @@ +Expr[Int]({ + val x = (0: Short): @unchecked match { + case A((x @ _)) => x + }; + x +}) diff --git a/test/files/run/t7868b.scala b/test/files/run/t7868b.scala new file mode 100644 index 0000000000..759eeaf862 --- /dev/null +++ b/test/files/run/t7868b.scala @@ -0,0 +1,11 @@ +object A { + def unapply(n: Int): Option[Int] = Some(1) +} + +object Test extends App { + import reflect.runtime.universe._ + println(reify { + val A(x) = (0: Short) + x + }) +} |