diff options
Diffstat (limited to 'test/files')
-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 +} |