@@ -40,42 +40,42 @@ import transform.SymUtils._
4040 */
4141
4242 abstract class SyntaxMsg (errorId : ErrorMessageID ) extends Message (errorId):
43- def kind = " Syntax"
43+ def kind = MessageKind . Syntax
4444
4545 abstract class TypeMsg (errorId : ErrorMessageID ) extends Message (errorId):
46- def kind = " Type"
46+ def kind = MessageKind . Type
4747
4848 trait ShowMatchTrace (tps : Type * )(using Context ) extends Message :
4949 override def msgSuffix : String = matchReductionAddendum(tps* )
5050
5151 abstract class TypeMismatchMsg (found : Type , expected : Type )(errorId : ErrorMessageID )(using Context )
5252 extends Message (errorId), ShowMatchTrace (found, expected):
53- def kind = " Type Mismatch "
53+ def kind = MessageKind . TypeMismatch
5454 def explain = err.whyNoMatchStr(found, expected)
5555 override def canExplain = true
5656
5757 abstract class NamingMsg (errorId : ErrorMessageID ) extends Message (errorId):
58- def kind = " Naming"
58+ def kind = MessageKind . Naming
5959
6060 abstract class DeclarationMsg (errorId : ErrorMessageID ) extends Message (errorId):
61- def kind = " Declaration"
61+ def kind = MessageKind . Declaration
6262
6363 /** A simple not found message (either for idents, or member selection.
6464 * Messages of this class are sometimes dropped in favor of other, more
6565 * specific messages.
6666 */
6767 abstract class NotFoundMsg (errorId : ErrorMessageID ) extends Message (errorId):
68- def kind = " Not Found "
68+ def kind = MessageKind . NotFound
6969 def name : Name
7070
7171 abstract class PatternMatchMsg (errorId : ErrorMessageID ) extends Message (errorId):
72- def kind = " Pattern Match "
72+ def kind = MessageKind . PatternMatch
7373
7474 abstract class CyclicMsg (errorId : ErrorMessageID ) extends Message (errorId):
75- def kind = " Cyclic"
75+ def kind = MessageKind . Cyclic
7676
7777 abstract class ReferenceMsg (errorId : ErrorMessageID ) extends Message (errorId):
78- def kind = " Reference"
78+ def kind = MessageKind . Reference
7979
8080 abstract class EmptyCatchOrFinallyBlock (tryBody : untpd.Tree , errNo : ErrorMessageID )(using Context )
8181 extends SyntaxMsg (EmptyCatchOrFinallyBlockID ) {
@@ -638,7 +638,7 @@ import transform.SymUtils._
638638
639639 class ProperDefinitionNotFound ()(using Context )
640640 extends Message (ProperDefinitionNotFoundID ) {
641- def kind : String = " Doc Comment "
641+ def kind = MessageKind . DocComment
642642 def msg = em """ Proper definition was not found in ${hl(" @usecase" )}"""
643643
644644 def explain = {
@@ -818,14 +818,14 @@ import transform.SymUtils._
818818
819819 class LossyWideningConstantConversion (sourceType : Type , targetType : Type )(using Context )
820820 extends Message (LossyWideningConstantConversionID ):
821- def kind = " Lossy Conversion "
821+ def kind = MessageKind . LossyConversion
822822 def msg = em """ |Widening conversion from $sourceType to $targetType loses precision.
823823 |Write `.to $targetType` instead. """ .stripMargin
824824 def explain = " "
825825
826826 class PatternMatchExhaustivity (uncoveredFn : => String , hasMore : Boolean )(using Context )
827827 extends Message (PatternMatchExhaustivityID ) {
828- def kind = " Pattern Match Exhaustivity "
828+ def kind = MessageKind . PatternMatchExhaustivity
829829 lazy val uncovered = uncoveredFn
830830 def msg =
831831 val addendum = if hasMore then " (More unmatched cases are elided)" else " "
@@ -856,7 +856,7 @@ import transform.SymUtils._
856856
857857 class MatchCaseUnreachable ()(using Context )
858858 extends Message (MatchCaseUnreachableID ) {
859- def kind = " Match case Unreachable "
859+ def kind = MessageKind . MatchCaseUnreachable
860860 def msg = " Unreachable case"
861861 def explain = " "
862862 }
@@ -1783,7 +1783,7 @@ import transform.SymUtils._
17831783
17841784 class FailureToEliminateExistential (tp : Type , tp1 : Type , tp2 : Type , boundSyms : List [Symbol ], classRoot : Symbol )(using Context )
17851785 extends Message (FailureToEliminateExistentialID ) {
1786- def kind : String = " Compatibility"
1786+ def kind = MessageKind . Compatibility
17871787 def msg =
17881788 val originalType = ctx.printer.dclsText(boundSyms, " ; " ).show
17891789 em """ An existential type that came from a Scala-2 classfile for $classRoot
@@ -2228,7 +2228,7 @@ import transform.SymUtils._
22282228
22292229 class PureExpressionInStatementPosition (stat : untpd.Tree , val exprOwner : Symbol )(using Context )
22302230 extends Message (PureExpressionInStatementPositionID ) {
2231- def kind = " Potential Issue "
2231+ def kind = MessageKind . PotentialIssue
22322232 def msg = " A pure expression does nothing in statement position; you may be omitting necessary parentheses"
22332233 def explain =
22342234 em """ The pure expression $stat doesn't have any side effect and its result is not assigned elsewhere.
0 commit comments