You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
classPetPrinter {
defprintPet(pet: Pet):Unit= println(
pet match {
caseDog(_) =>"I'm a dog."caseCat(_) =>"I'm a cat."
},
)
}
Observe the following compiler error:
[Error] .../Scala2.scala:5:22: unreachable code
[Error] Applicable -Wconf / @nowarn filters for this fatal warning: msg=<part of the message>, cat=other-match-analysis, site=PetPrinter.printPet
[Error] case Cat(_) => "I'm a cat."
[Error]
Problem
The Scala 2 code should've compiled successfully.
The text was updated successfully, but these errors were encountered:
I tried but could not reproduce this; I'm not getting the "unreachable code" warning. Can you share step by step instructions, or a small project that shows the issue?
Reproduction steps
Scala 2 version: 2.13.16
Scala 3 version: 3.6.3
Problem
The Scala 2 code should've compiled successfully.
The text was updated successfully, but these errors were encountered: