summaryrefslogtreecommitdiff
path: root/test/pending/run/instanceOfAndTypeMatching.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2010-11-18 01:11:37 +0000
committerPaul Phillips <paulp@improving.org>2010-11-18 01:11:37 +0000
commita86453a5eed21abf5dfa5fd1d0321c8eb0298302 (patch)
tree360448d50fe40940a3d9dfb255801a93b28da07f /test/pending/run/instanceOfAndTypeMatching.scala
parent48451f980e1a252a0470e72dfd944b1eee52891b (diff)
downloadscala-a86453a5eed21abf5dfa5fd1d0321c8eb0298302.tar.gz
scala-a86453a5eed21abf5dfa5fd1d0321c8eb0298302.tar.bz2
scala-a86453a5eed21abf5dfa5fd1d0321c8eb0298302.zip
Some refinement of the error messages when the ...
Some refinement of the error messages when the found and required types have the same simple names. No longer must we watch people scratch their heads at such messages as: found : scala.collection.Set[String] required: Set[String] Now so clear you could enjoy a movie through it: found : scala.collection.Set[String] required: scala.collection.immutable.Set[String] No review.
Diffstat (limited to 'test/pending/run/instanceOfAndTypeMatching.scala')
-rw-r--r--test/pending/run/instanceOfAndTypeMatching.scala11
1 files changed, 5 insertions, 6 deletions
diff --git a/test/pending/run/instanceOfAndTypeMatching.scala b/test/pending/run/instanceOfAndTypeMatching.scala
index 9ab2d6c3c4..60b11ef0c1 100644
--- a/test/pending/run/instanceOfAndTypeMatching.scala
+++ b/test/pending/run/instanceOfAndTypeMatching.scala
@@ -87,8 +87,7 @@ class Outer {
}
}
-object Test
-{
+object Test {
val outer1 = new Outer
val outer2 = new Outer
val inner1 = new outer1.Inner
@@ -118,8 +117,8 @@ object Test
List("These should be true under any scenario: ",
inner1.isInstanceOf[outer1.Inner] ,
inner1.isInstanceOf[Outer#Inner] ,
- inner1 match { case _: Outer#Inner => true ; case _ => false } ,
- inner1 match { case _: outer1.Inner => true ; case _ => false } ,
+ (inner1: Any) match { case _: Outer#Inner => true ; case _ => false } ,
+ (inner1: Any) match { case _: outer1.Inner => true ; case _ => false } ,
inner1.compareSharpWithTypeMatch(inner2) ,
inner1.compareSharpWithInstanceOf(inner2)
) foreach println
@@ -139,7 +138,7 @@ object Test
) foreach println
List("These are doing the wrong thing under current proposal",
- inner1 match { case _: outer2.Inner => true ; case _ => false } // should be false
+ (inner1: Any) match { case _: outer2.Inner => true ; case _ => false } // should be false
) foreach println
}
@@ -159,7 +158,7 @@ object Test
// required: MethodInner where type MethodInner <: java.lang.Object with ScalaObject{def passOuter(other: Outer): Unit; def passThisType(other: Test.outer1.type): Unit; def passInner(other: Test.outer1.Inner): Unit; def passInner2(other: Test.outer1.Inner): Unit; def passInnerSharp(other: Outer#Inner): Unit; def passMethodInner(other: MethodInner): Unit}
// method1.passMethodInner(method1)
// ^
- // method1.passMethodInner(method1)
+ method1.passMethodInner(method1)
// these should all fail to compile, and do
//