summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIulian Dragos <jaguarul@gmail.com>2011-05-17 10:57:28 +0000
committerIulian Dragos <jaguarul@gmail.com>2011-05-17 10:57:28 +0000
commit4074f0e1c21be9605592f6370adb398cef9f0379 (patch)
tree7d8333a9a4c611a3b639c63ea148486c98636b17
parenta22be1267ace5faa9c16787910ed32227367177d (diff)
downloadscala-4074f0e1c21be9605592f6370adb398cef9f0379.tar.gz
scala-4074f0e1c21be9605592f6370adb398cef9f0379.tar.bz2
scala-4074f0e1c21be9605592f6370adb398cef9f0379.zip
Fixed #4593.
-rw-r--r--src/compiler/scala/tools/nsc/transform/Erasure.scala1
-rw-r--r--test/files/pos/t4593.scala20
2 files changed, 21 insertions, 0 deletions
diff --git a/src/compiler/scala/tools/nsc/transform/Erasure.scala b/src/compiler/scala/tools/nsc/transform/Erasure.scala
index 3f509eae65..915aba63db 100644
--- a/src/compiler/scala/tools/nsc/transform/Erasure.scala
+++ b/src/compiler/scala/tools/nsc/transform/Erasure.scala
@@ -529,6 +529,7 @@ abstract class Erasure extends AddInterfaces
case UnitClass =>
if (treeInfo isPureExpr tree) REF(BoxedUnit_UNIT)
else BLOCK(tree, REF(BoxedUnit_UNIT))
+ case NothingClass => tree // a non-terminating expression doesn't need boxing
case x =>
assert(x != ArrayClass)
tree match {
diff --git a/test/files/pos/t4593.scala b/test/files/pos/t4593.scala
new file mode 100644
index 0000000000..250f68216a
--- /dev/null
+++ b/test/files/pos/t4593.scala
@@ -0,0 +1,20 @@
+// ticket #4593
+trait A {
+
+ class B
+ case object D extends B
+
+ class C {
+
+ var x: B = D
+
+ def y = synchronized {
+ x match {
+ case D => {}
+ }
+ }
+
+ }
+
+}
+