diff --git a/tests/neg/7043.scala b/tests/neg/7043.scala new file mode 100644 index 000000000000..df8e7e0e016e --- /dev/null +++ b/tests/neg/7043.scala @@ -0,0 +1,15 @@ +object Test { + type StrHead[X <: Tuple] = X match { + case (x <: String) *: _ => x // error + } + + // Futher minimized + type M[X] = X match { + case (x) *: _ => Int + } + + // The exception can also be reached with normal pattern matching + 1 match { + case _: Option[(x)] => () + } +}