aboutsummaryrefslogtreecommitdiff
path: root/tests/untried/neg/unchecked-suppress.scala
diff options
context:
space:
mode:
Diffstat (limited to 'tests/untried/neg/unchecked-suppress.scala')
-rw-r--r--tests/untried/neg/unchecked-suppress.scala10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/untried/neg/unchecked-suppress.scala b/tests/untried/neg/unchecked-suppress.scala
new file mode 100644
index 000000000..7bd61a2a4
--- /dev/null
+++ b/tests/untried/neg/unchecked-suppress.scala
@@ -0,0 +1,10 @@
+class A {
+ def f(x: Any) = x match {
+ case xs: List[String @unchecked] => xs.head // okay
+ case xs: Set[Int] => xs.head // unchecked
+ case xs: Map[String @unchecked, String] => xs.head // one unchecked, one okay
+ case f: ((Int @unchecked) => (Int @unchecked)) => f(5) // okay
+ case f: ((Int, Int) => Int) => // unchecked
+ case _ => ""
+ }
+}