summaryrefslogtreecommitdiff
path: root/test/files/neg/type-diagnostics.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/files/neg/type-diagnostics.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/files/neg/type-diagnostics.scala')
-rw-r--r--test/files/neg/type-diagnostics.scala18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/files/neg/type-diagnostics.scala b/test/files/neg/type-diagnostics.scala
new file mode 100644
index 0000000000..fdc0978138
--- /dev/null
+++ b/test/files/neg/type-diagnostics.scala
@@ -0,0 +1,18 @@
+object SetVsSet {
+ case class Calculator[+T](name: String, parameters: Set[String])
+ val binding = Map.empty[String, String]
+ def f = Calculator("Hello",binding.keySet)
+}
+
+object TParamConfusion {
+ def strings(xs: List[String]) = xs
+
+ def f1[a <% Ordered[a]](x: List[a]) = {
+ def f2[b >: List[a] <% Ordered[b]](x: List[a], y: b): Int = {
+ def f3(xs: List[a], ys: List[a]) = -1
+ y match { case y1: List[a] => f3(x, y1) }
+ }
+ }
+
+ def f2[String](s: String) = strings(List(s))
+}