diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2014-02-22 12:21:11 +0100 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2014-02-22 12:21:11 +0100 |
commit | 63d4dfaf7cf25f2cf5c00c97986d3d060733268f (patch) | |
tree | 17c4b8a833e6945a13cb1bf158319d5c7cd2d6a2 /test/files/pos | |
parent | 00624a39ed84c3fd245dd9df7454d4cec4399e13 (diff) | |
parent | 64ed64ed5c2f64ee83a7963273bedf490926050e (diff) | |
download | scala-63d4dfaf7cf25f2cf5c00c97986d3d060733268f.tar.gz scala-63d4dfaf7cf25f2cf5c00c97986d3d060733268f.tar.bz2 scala-63d4dfaf7cf25f2cf5c00c97986d3d060733268f.zip |
Merge pull request #3567 from retronym/ticket/8315
SI-8315 Fix crash in dead code elimination
Diffstat (limited to 'test/files/pos')
-rw-r--r-- | test/files/pos/t8315.flags | 1 | ||||
-rw-r--r-- | test/files/pos/t8315.scala | 12 | ||||
-rw-r--r-- | test/files/pos/t8315b.flags | 1 | ||||
-rw-r--r-- | test/files/pos/t8315b.scala | 11 |
4 files changed, 25 insertions, 0 deletions
diff --git a/test/files/pos/t8315.flags b/test/files/pos/t8315.flags new file mode 100644 index 0000000000..c926ad6493 --- /dev/null +++ b/test/files/pos/t8315.flags @@ -0,0 +1 @@ +-Yinline -Ydead-code diff --git a/test/files/pos/t8315.scala b/test/files/pos/t8315.scala new file mode 100644 index 0000000000..2f7742ed67 --- /dev/null +++ b/test/files/pos/t8315.scala @@ -0,0 +1,12 @@ +object Test { + def crash(as: Listt): Unit = { + map(as, (_: Any) => return) + } + + final def map(x: Listt, f: Any => Any): Any = { + if (x eq Nill) "" else f("") + } +} + +object Nill extends Listt +class Listt diff --git a/test/files/pos/t8315b.flags b/test/files/pos/t8315b.flags new file mode 100644 index 0000000000..c926ad6493 --- /dev/null +++ b/test/files/pos/t8315b.flags @@ -0,0 +1 @@ +-Yinline -Ydead-code diff --git a/test/files/pos/t8315b.scala b/test/files/pos/t8315b.scala new file mode 100644 index 0000000000..d7a2bf565f --- /dev/null +++ b/test/files/pos/t8315b.scala @@ -0,0 +1,11 @@ +object Test extends Object { + def crash: Unit = { + val key = "" + try map(new F(key)) + catch { case _: Throwable => } + }; + final def map(f: F): Any = f.apply(""); +}; +final class F(key: String) { + final def apply(a: Any): Any = throw new RuntimeException(key); +} |