diff options
author | Dmitry Petrashko <dark@d-d.me> | 2015-02-13 14:31:58 +0100 |
---|---|---|
committer | Dmitry Petrashko <dark@d-d.me> | 2015-02-13 14:31:58 +0100 |
commit | 2e72811fb1cedb94c7967acf96c92172f010a20b (patch) | |
tree | 621fd55bf3967fe734d0192cb491ab0e01bc627b /tests | |
parent | c12f21306ea01bd0411f07074a5a0637f23187ff (diff) | |
parent | 37c2dcc2268e6840cfcd89fc5937d461a493e1fd (diff) | |
download | dotty-2e72811fb1cedb94c7967acf96c92172f010a20b.tar.gz dotty-2e72811fb1cedb94c7967acf96c92172f010a20b.tar.bz2 dotty-2e72811fb1cedb94c7967acf96c92172f010a20b.zip |
Merge pull request #359 from dotty-staging/fix/erasure-lub-alternative
Fix/erasure lub alternative
Diffstat (limited to 'tests')
-rw-r--r-- | tests/pos/erased-lub.scala | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/pos/erased-lub.scala b/tests/pos/erased-lub.scala new file mode 100644 index 000000000..d3d2183c1 --- /dev/null +++ b/tests/pos/erased-lub.scala @@ -0,0 +1,27 @@ +// Verify that expressions below perform correct boxings in erasure. +object Test { + def id[T](t: T) = t + + val x = true + val one = 1 + + { if (x) id(one) else 0 } + 1 + + { if (x) new scala.util.Random()}.asInstanceOf[Runnable] + + { x match { + case true => id(one) + case _ => 0 + } + } + 1 + + { try { + id(one) + } catch { + case ex: Exception => 0 + } + }.asInstanceOf[Runnable] + + val arr = Array(id(one), 0) + +} |