From 53e0d8562ac88ef2450caea299c8bd6a68858f74 Mon Sep 17 00:00:00 2001 From: Burak Emir Date: Sun, 19 Aug 2007 10:14:47 +0000 Subject: fix #1276, encoding equals test in types means ... fix #1276, encoding equals test in types means one has be careful when using <:<... for an "equalsclass" type, extracts the type of the value which is to be compared by equality, used in optimization --- test/files/run/patmatnew.scala | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'test/files/run/patmatnew.scala') diff --git a/test/files/run/patmatnew.scala b/test/files/run/patmatnew.scala index c55e7821df..a28f94c539 100644 --- a/test/files/run/patmatnew.scala +++ b/test/files/run/patmatnew.scala @@ -28,6 +28,7 @@ object Test extends TestConsoleMain { new SimpleUnapply, new Test717, new TestGuards, + TestEqualsPatternOpt, new TestStream, new Test903, new Test1093, @@ -101,6 +102,17 @@ object Test extends TestConsoleMain { } } + object TestEqualsPatternOpt extends TestCase("test EqualsPatternClass in combination with MixTypes opt, bug #1276") { + val NoContext = new Object + override def runTest { + assertEquals(1,((NoContext:Any) match { + case that : AnyRef if this eq that => 0 + case NoContext => 1 + case _ => 2 + })) + } + } + class TestStream extends TestCase("unapply for Streams") { def sum(stream: Stream[int]): int = stream match { -- cgit v1.2.3