From 5bc19dd5f6e6b84ba894f5217772acda4010b6ab Mon Sep 17 00:00:00 2001 From: Burak Emir Date: Sat, 2 Jun 2007 09:09:55 +0000 Subject: fix #1163 --- test/files/run/patmatnew.scala | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'test/files') diff --git a/test/files/run/patmatnew.scala b/test/files/run/patmatnew.scala index 89b9afb32b..16336a516c 100644 --- a/test/files/run/patmatnew.scala +++ b/test/files/run/patmatnew.scala @@ -21,7 +21,8 @@ object Test extends TestConsoleMain { new TestSimpleIntSwitch, new Test717, new TestGuards, - new TestStream + new TestStream, + new Test1163_Order ) @@ -83,6 +84,22 @@ object Test extends TestConsoleMain { def runTest() = assertEquals(sum(str), 6) } + class Test1163_Order extends TestCase("bug#1163 order of temps must be preserved") { + abstract class Function + case class Var(n: String) extends Function + case class Const(v: double) extends Function + + def f(): (Function, Function) = { + (Var("x"): Function, Var("y"): Function) match { + case (Const(v), Const(w)) => throw new Error + case (leftOne, Var("z")) => throw new Error + case (leftTwo, rightTwo) => (leftTwo, rightTwo) // was giving "y","x" + } + } + + def runTest() = assertEquals("both", (Var("x"),Var("y")), f) + } + class Test806_818 { // #806, #811 compile only -- type of bind // bug811 trait Core { -- cgit v1.2.3