summaryrefslogtreecommitdiff
path: root/test/pending/neg/t6680b.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2013-08-17 09:58:54 -0700
committerPaul Phillips <paulp@improving.org>2013-08-17 10:58:14 -0700
commit1cd7a9e840158dab17a3aafc0ce849605706a561 (patch)
tree3777a5c8bdfe0edcdcd45aa453d28704242a8702 /test/pending/neg/t6680b.scala
parent8f05647ca53da781b420be0723faf1cdbf14b2ff (diff)
downloadscala-1cd7a9e840158dab17a3aafc0ce849605706a561.tar.gz
scala-1cd7a9e840158dab17a3aafc0ce849605706a561.tar.bz2
scala-1cd7a9e840158dab17a3aafc0ce849605706a561.zip
New tests for name-based pattern matcher.
Diffstat (limited to 'test/pending/neg/t6680b.scala')
-rw-r--r--test/pending/neg/t6680b.scala10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/pending/neg/t6680b.scala b/test/pending/neg/t6680b.scala
new file mode 100644
index 0000000000..e9f6468315
--- /dev/null
+++ b/test/pending/neg/t6680b.scala
@@ -0,0 +1,10 @@
+trait Super[+A]
+// `Hidden` must occur in both variance positions (covariant/contravariant) for the sneakiness to work
+// this way type inference will infer Any for `Hidden` and `A` in the pattern below
+case class Concrete[Hidden, +A](havoc: Hidden => Hidden) extends Super[A]
+
+object Test extends App {
+ (Concrete((x: Int) => x): Super[Any]) match {
+ case Concrete(f) => f("not what you'd expect")
+ }
+} \ No newline at end of file