diff options
Diffstat (limited to 'test/files/neg')
-rw-r--r-- | test/files/neg/bug414.check | 1 | ||||
-rw-r--r-- | test/files/neg/bug4879.check | 13 | ||||
-rw-r--r-- | test/files/neg/bug4879.scala | 15 |
3 files changed, 29 insertions, 0 deletions
diff --git a/test/files/neg/bug414.check b/test/files/neg/bug414.check index ec23e26337..91bb39caf2 100644 --- a/test/files/neg/bug414.check +++ b/test/files/neg/bug414.check @@ -1,6 +1,7 @@ bug414.scala:5: error: pattern type is incompatible with expected type; found : object Empty required: IntMap[a] +Note: if you intended to match against the class, try `case _: Empty[_]` or `case Empty()` case Empty => ^ bug414.scala:7: error: type mismatch; diff --git a/test/files/neg/bug4879.check b/test/files/neg/bug4879.check new file mode 100644 index 0000000000..6b9e452109 --- /dev/null +++ b/test/files/neg/bug4879.check @@ -0,0 +1,13 @@ +bug4879.scala:6: error: pattern type is incompatible with expected type; + found : object C + required: C +Note: if you intended to match against the class, try `case _: C` or `case C(_)` + case C => true + ^ +bug4879.scala:10: error: pattern type is incompatible with expected type; + found : object D + required: D[T,U,V] +Note: if you intended to match against the class, try `case _: D[_,_,_]` or `case D(_,_,_)` + case D => true + ^ +two errors found diff --git a/test/files/neg/bug4879.scala b/test/files/neg/bug4879.scala new file mode 100644 index 0000000000..7d6561e9e0 --- /dev/null +++ b/test/files/neg/bug4879.scala @@ -0,0 +1,15 @@ +case class C(d: Double) { } +case class D[T, U, V](bingo: Int, donkey: String, private val vegas: Set[A])(jehovah: Int) { } + +class A { + def f = (new C(5)) match { + case C => true + case _ => false + } + def g[T, U, V](x: D[T, U, V]) = x match { + case D => true + case _ => false + } +} + + |