Skip to content

Commit 5a7627a

Browse files
authored
Fixed false positive unreachable local object (#21532)
2 parents 21a3d39 + 54ae45d commit 5a7627a

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests/warn/i21218.scala

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
def Test[U, A](thisElem: A, thatElem: U) = {
2+
case object passedEnd
3+
val any: Seq[Any] = ???
4+
any.zip(any)
5+
.map {
6+
case (`passedEnd`, r: U @unchecked) => (thisElem, r)
7+
case (l: A @unchecked, `passedEnd`) => (l, thatElem)
8+
case t: (A, U) @unchecked => t // false-positive warning
9+
}
10+
}

0 commit comments

Comments
 (0)