Skip to content

Commit

Permalink
Fixed false positive unreachable local object
Browse files Browse the repository at this point in the history
I think this was fixed in PR 21000, but I didn't check.
  • Loading branch information
dwijnand committed Sep 3, 2024
1 parent 8527a9b commit 54ae45d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/warn/i21218.scala
Original file line number Diff line number Diff line change
@@ -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
}
}

0 comments on commit 54ae45d

Please sign in to comment.