Skip to content

Commit

Permalink
Move test to warn
Browse files Browse the repository at this point in the history
  • Loading branch information
noti0na1 committed Dec 3, 2024
1 parent 67024a9 commit a7b23d6
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions tests/neg/i22051.scala → tests/warn/i22051.scala
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
//> using options -Werror

def boundary[T](body: (T => RuntimeException) => T): T =
case class Break(value: T) extends RuntimeException
try body(Break.apply)
catch case Break(t) => t // error: pattern matching on local classes is unsound currently
catch case Break(t) => t // warn: pattern matching on local classes is unsound currently

def test =
boundary[Int]: EInt =>
Expand All @@ -16,4 +14,4 @@ def boundaryCorrectBehaviour[T](body: (T => RuntimeException) => T): T =
// A correct implementation, but is still treated as a local class right now
case class Break(value: T) extends RuntimeException
try body(local.Break.apply)
catch case local.Break(t) => t // error
catch case local.Break(t) => t // warn

0 comments on commit a7b23d6

Please sign in to comment.