summaryrefslogtreecommitdiff
path: root/test/files
diff options
context:
space:
mode:
authorBurak Emir <emir@epfl.ch>2007-06-02 09:09:55 +0000
committerBurak Emir <emir@epfl.ch>2007-06-02 09:09:55 +0000
commit5bc19dd5f6e6b84ba894f5217772acda4010b6ab (patch)
tree02b15f00566f490fcf98f5c32d2af43d2c08081a /test/files
parent1f166dfd3a2e092be5d0ac8205ad7bff9911a24a (diff)
downloadscala-5bc19dd5f6e6b84ba894f5217772acda4010b6ab.tar.gz
scala-5bc19dd5f6e6b84ba894f5217772acda4010b6ab.tar.bz2
scala-5bc19dd5f6e6b84ba894f5217772acda4010b6ab.zip
fix #1163
Diffstat (limited to 'test/files')
-rw-r--r--test/files/run/patmatnew.scala19
1 files changed, 18 insertions, 1 deletions
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 {