summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIulian Dragos <jaguarul@gmail.com>2007-09-24 17:29:55 +0000
committerIulian Dragos <jaguarul@gmail.com>2007-09-24 17:29:55 +0000
commitde68205eba7d3cf883822c59239d9c871c48d47e (patch)
tree57285343c7c7d7255bd72daaffc4816befa2ec7b
parenta20315a54eebf7361185965f18edc1ec7171be43 (diff)
downloadscala-de68205eba7d3cf883822c59239d9c871c48d47e.tar.gz
scala-de68205eba7d3cf883822c59239d9c871c48d47e.tar.bz2
scala-de68205eba7d3cf883822c59239d9c871c48d47e.zip
Fixed ticket #88 (verify error, exceptions).
-rw-r--r--src/compiler/scala/tools/nsc/backend/icode/GenICode.scala2
-rw-r--r--test/files/run/exceptions-2.check3
-rw-r--r--test/files/run/exceptions-2.scala12
3 files changed, 16 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/backend/icode/GenICode.scala b/src/compiler/scala/tools/nsc/backend/icode/GenICode.scala
index 462b32debd..06c8585840 100644
--- a/src/compiler/scala/tools/nsc/backend/icode/GenICode.scala
+++ b/src/compiler/scala/tools/nsc/backend/icode/GenICode.scala
@@ -930,7 +930,7 @@ abstract class GenICode extends SubComponent {
generatedType = DOUBLE
case (NullTag, _) =>
ctx.bb.emit(CONSTANT(value), tree.pos);
- generatedType = expectedType
+ generatedType = SCALA_ALLREF
case _ =>
ctx.bb.emit(CONSTANT(value), tree.pos);
generatedType = toTypeKind(value.tpe)
diff --git a/test/files/run/exceptions-2.check b/test/files/run/exceptions-2.check
index 95728fb058..139b4c401f 100644
--- a/test/files/run/exceptions-2.check
+++ b/test/files/run/exceptions-2.check
@@ -10,6 +10,9 @@ Finally!
withValue1:
Oh, oh
10
+withValue2:
+droped a null
+null
method2:
10
Exception occurred
diff --git a/test/files/run/exceptions-2.scala b/test/files/run/exceptions-2.scala
index d76a52f5e8..0805ffe295 100644
--- a/test/files/run/exceptions-2.scala
+++ b/test/files/run/exceptions-2.scala
@@ -122,6 +122,15 @@ object Test {
Console.println(x);
}
+ def withValue2: Unit = {
+ val x = try {
+ null
+ } finally {
+ Console.println("droped a null");
+ };
+ Console.println(x);
+ }
+
def tryFinallyTry: Unit = {
try {
()
@@ -246,6 +255,9 @@ object Test {
Console.println("withValue1:");
execute(withValue1);
+ Console.println("withValue2:");
+ execute(withValue2);
+
Console.println("method2:");
execute(method2);