All Downloads are FREE. Search and download functionalities are using the official Maven repository.

dotty.tools.dotc.reporting.MessageKind.scala Maven / Gradle / Ivy

There is a newer version: 3.6.4-RC1-bin-20241220-0bfa1af-NIGHTLY
Show newest version
package dotty.tools.dotc.reporting

/** Message kinds that can be used in a Message.
 *  NOTE: Keep in mind that if you have a new message or a new ErrorMessageID
 *  that doesn't fit well into an existing kind, create a new one.
 */
enum MessageKind:
  case NoKind
  case Syntax
  case Type
  case TypeMismatch
  case Naming
  case Declaration
  case NotFound
  case PatternMatch
  case Cyclic
  case Reference
  case DocComment
  case LossyConversion
  case PatternMatchExhaustivity
  case MatchCaseUnreachable
  case Compatibility
  case PotentialIssue
  case UnusedSymbol
  case Staging

  /** Human readable message that will end up being shown to the user.
   *  NOTE: This is only used in the situation where you have multiple words
   *  and don't want to rely on the default toString of the enum.
   */
  def message: String =
    this match
      case NoKind => "No Kind"
      case TypeMismatch => "Type Mismatch"
      case NotFound => "Not Found"
      case PatternMatch => "Pattern Match"
      case DocComment => "Doc Comment"
      case LossyConversion => "Lossy Conversion"
      case PatternMatchExhaustivity => "Pattern Match Exhaustivity"
      case MatchCaseUnreachable => "Match case Unreachable"
      case PotentialIssue => "Potential Issue"
      case UnusedSymbol => "Unused Symbol"
      case Staging => "Staging Issue"
      case kind => kind.toString
end MessageKind




© 2015 - 2025 Weber Informatics LLC | Privacy Policy