diff options
author | Adriaan Moors <adriaan.moors@typesafe.com> | 2013-08-20 10:31:23 -0700 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@typesafe.com> | 2013-08-20 10:31:23 -0700 |
commit | 38d5b203745e799d819759ccce2f96655085f537 (patch) | |
tree | 5c0e664803a9682bb25c6b48658d0660d9727a02 /test/pending/neg/t6680b.scala | |
parent | 1df7b32a15bac0c57d4371b6e081f06d9e145aaf (diff) | |
parent | 01f771e687291803da1983bdac97d9288c069bfe (diff) | |
download | scala-38d5b203745e799d819759ccce2f96655085f537.tar.gz scala-38d5b203745e799d819759ccce2f96655085f537.tar.bz2 scala-38d5b203745e799d819759ccce2f96655085f537.zip |
Merge pull request #2848 from paulp/patmat2
Pattern matcher: extractors become name-based.
Diffstat (limited to 'test/pending/neg/t6680b.scala')
-rw-r--r-- | test/pending/neg/t6680b.scala | 10 |
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 |