diff --git a/tests/warn/i21218.scala b/tests/warn/i21218.scala new file mode 100644 index 000000000000..29fa957e2e70 --- /dev/null +++ b/tests/warn/i21218.scala @@ -0,0 +1,10 @@ +def Test[U, A](thisElem: A, thatElem: U) = { + case object passedEnd + val any: Seq[Any] = ??? + any.zip(any) + .map { + case (`passedEnd`, r: U @unchecked) => (thisElem, r) + case (l: A @unchecked, `passedEnd`) => (l, thatElem) + case t: (A, U) @unchecked => t // false-positive warning + } +}