summaryrefslogtreecommitdiff
path: root/test/files/pos/bug1048.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2011-07-13 06:58:04 +0000
committerPaul Phillips <paulp@improving.org>2011-07-13 06:58:04 +0000
commitd8e882ad5ccd7006a4304d9378a7a9328f55e173 (patch)
treea18c07da73515be37e48b1bd1c15ed1e8f3df0ce /test/files/pos/bug1048.scala
parente032852d12a301fb8ee8b10fe1f6a6f6eb09b7d4 (diff)
downloadscala-d8e882ad5ccd7006a4304d9378a7a9328f55e173.tar.gz
scala-d8e882ad5ccd7006a4304d9378a7a9328f55e173.tar.bz2
scala-d8e882ad5ccd7006a4304d9378a7a9328f55e173.zip
Bounded wildcard types arising during pattern t...
Bounded wildcard types arising during pattern type inference can cause unnecessary crashes. Closes #1048, review by odersky.
Diffstat (limited to 'test/files/pos/bug1048.scala')
-rw-r--r--test/files/pos/bug1048.scala15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/files/pos/bug1048.scala b/test/files/pos/bug1048.scala
new file mode 100644
index 0000000000..f88dbbc88b
--- /dev/null
+++ b/test/files/pos/bug1048.scala
@@ -0,0 +1,15 @@
+trait T[U] {
+ def x: T[V] forSome { type V <: U }
+}
+
+object T {
+ def unapply[U](t: T[U]): Option[T[V] forSome { type V <: U }] = Some(t.x)
+}
+
+object Test {
+ def f[W](t: T[W]) = t match {
+ case T(T(_)) => ()
+ }
+}
+
+