diff options
Diffstat (limited to 'test/files/run/regularpatmatnew.scala')
-rw-r--r-- | test/files/run/regularpatmatnew.scala | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/test/files/run/regularpatmatnew.scala b/test/files/run/regularpatmatnew.scala index 617293028c..9e056af9f8 100644 --- a/test/files/run/regularpatmatnew.scala +++ b/test/files/run/regularpatmatnew.scala @@ -9,7 +9,8 @@ object Test { new Test02, new Test03, new Test04, - new Test05 + new Test05, + new Test06 ).run(tr) @@ -110,4 +111,24 @@ object Test { } } + class Test06 extends TestCase("sei (not regular) fancy guards / bug#644 ") { + + case class A(i:Any) + + def doMatch(x:Any, bla:int) = x match { + case x:A if (bla==1) => + 0 + case A(1) => + 1 + case A(A(1)) => + 2 + } + + override def runTest(): Unit= { + assertEquals(doMatch(A(null),1), 0) + assertEquals(doMatch(A(1),2), 1) + assertEquals(doMatch(A(A(1)),2), 2) + } + + } } |