diff options
author | Lex Spoon <lex@lexspoon.org> | 2006-03-28 13:32:29 +0000 |
---|---|---|
committer | Lex Spoon <lex@lexspoon.org> | 2006-03-28 13:32:29 +0000 |
commit | d746f73c9d612b08640c38b5aad5f97a26e2a0b2 (patch) | |
tree | c61b683f493e43757f2b7c86498f77ca821e988b | |
parent | 626a6597f7c373ff1d4bc793a7d874045900df93 (diff) | |
download | scala-d746f73c9d612b08640c38b5aad5f97a26e2a0b2.tar.gz scala-d746f73c9d612b08640c38b5aad5f97a26e2a0b2.tar.bz2 scala-d746f73c9d612b08640c38b5aad5f97a26e2a0b2.zip |
-rw-r--r-- | test/files/pos/bug344.scala | 12 | ||||
-rw-r--r-- | test/files/pos/bug374.scala | 21 |
2 files changed, 33 insertions, 0 deletions
diff --git a/test/files/pos/bug344.scala b/test/files/pos/bug344.scala new file mode 100644 index 0000000000..8a6ad9120d --- /dev/null +++ b/test/files/pos/bug344.scala @@ -0,0 +1,12 @@ +object Bug { + class A; + case class A1 extends A; + case class A2 extends A; + def f: A = + if (true) + A1() + else { + val a = if (true) A1() else A2(); + a + }; +} diff --git a/test/files/pos/bug374.scala b/test/files/pos/bug374.scala new file mode 100644 index 0000000000..9a452cbb79 --- /dev/null +++ b/test/files/pos/bug374.scala @@ -0,0 +1,21 @@ +object tokens extends Enumeration { + type Token = Value; + val BAD = Value("<bad>"); + val IDENT = Value("ident"); + val NAME = Value("name"); +} + +object test extends Object with Application { + import tokens._; + + val reserved = new scala.collection.mutable.HashMap[String, Token](); + + if (true) { + reserved.get("a") match { + case None => IDENT + case Some(tk) => tk + } + } + else + BAD +} |