enum Animal {
case Cat(name: String)
case Dog(name: String)
}
object Main {
def foo(a: Animal) = {
a match
case Animal.Cat(name) => println(name)
}
}
correctly reports diagnostic that a pattern match is not exhaustive, however there should also be an actionable item attached to the diagnostic provided by the compiler to fix missing cases.
For example following code:
correctly reports diagnostic that a pattern match is not exhaustive, however there should also be an actionable item attached to the diagnostic provided by the compiler to fix missing cases.