scalacenter / scastie

An interactive playground for Scala
https://scastie.scala-lang.org
Apache License 2.0
429 stars 102 forks source link

feature request: add support for actionable diagnostics #1074

Open ghostbuster91 opened 3 months ago

ghostbuster91 commented 3 months ago

For example following code:

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.