diff options
author | Burak Emir <emir@epfl.ch> | 2007-08-19 10:14:47 +0000 |
---|---|---|
committer | Burak Emir <emir@epfl.ch> | 2007-08-19 10:14:47 +0000 |
commit | 53e0d8562ac88ef2450caea299c8bd6a68858f74 (patch) | |
tree | cccc0fd8f7fd7f2a17030053fda915bbcd7224bf /test | |
parent | f507e25804b6f1ad2ae278c3492c232e765b2a53 (diff) | |
download | scala-53e0d8562ac88ef2450caea299c8bd6a68858f74.tar.gz scala-53e0d8562ac88ef2450caea299c8bd6a68858f74.tar.bz2 scala-53e0d8562ac88ef2450caea299c8bd6a68858f74.zip |
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
Diffstat (limited to 'test')
-rw-r--r-- | test/files/run/patmatnew.scala | 12 |
1 files changed, 12 insertions, 0 deletions
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 { |