@@ -40,42 +40,42 @@ import transform.SymUtils._
40
40
*/
41
41
42
42
abstract class SyntaxMsg (errorId : ErrorMessageID ) extends Message (errorId):
43
- def kind = " Syntax"
43
+ def kind = MessageKind . Syntax
44
44
45
45
abstract class TypeMsg (errorId : ErrorMessageID ) extends Message (errorId):
46
- def kind = " Type"
46
+ def kind = MessageKind . Type
47
47
48
48
trait ShowMatchTrace (tps : Type * )(using Context ) extends Message :
49
49
override def msgSuffix : String = matchReductionAddendum(tps* )
50
50
51
51
abstract class TypeMismatchMsg (found : Type , expected : Type )(errorId : ErrorMessageID )(using Context )
52
52
extends Message (errorId), ShowMatchTrace (found, expected):
53
- def kind = " Type Mismatch "
53
+ def kind = MessageKind . TypeMismatch
54
54
def explain = err.whyNoMatchStr(found, expected)
55
55
override def canExplain = true
56
56
57
57
abstract class NamingMsg (errorId : ErrorMessageID ) extends Message (errorId):
58
- def kind = " Naming"
58
+ def kind = MessageKind . Naming
59
59
60
60
abstract class DeclarationMsg (errorId : ErrorMessageID ) extends Message (errorId):
61
- def kind = " Declaration"
61
+ def kind = MessageKind . Declaration
62
62
63
63
/** A simple not found message (either for idents, or member selection.
64
64
* Messages of this class are sometimes dropped in favor of other, more
65
65
* specific messages.
66
66
*/
67
67
abstract class NotFoundMsg (errorId : ErrorMessageID ) extends Message (errorId):
68
- def kind = " Not Found "
68
+ def kind = MessageKind . NotFound
69
69
def name : Name
70
70
71
71
abstract class PatternMatchMsg (errorId : ErrorMessageID ) extends Message (errorId):
72
- def kind = " Pattern Match "
72
+ def kind = MessageKind . PatternMatch
73
73
74
74
abstract class CyclicMsg (errorId : ErrorMessageID ) extends Message (errorId):
75
- def kind = " Cyclic"
75
+ def kind = MessageKind . Cyclic
76
76
77
77
abstract class ReferenceMsg (errorId : ErrorMessageID ) extends Message (errorId):
78
- def kind = " Reference"
78
+ def kind = MessageKind . Reference
79
79
80
80
abstract class EmptyCatchOrFinallyBlock (tryBody : untpd.Tree , errNo : ErrorMessageID )(using Context )
81
81
extends SyntaxMsg (EmptyCatchOrFinallyBlockID ) {
@@ -638,7 +638,7 @@ import transform.SymUtils._
638
638
639
639
class ProperDefinitionNotFound ()(using Context )
640
640
extends Message (ProperDefinitionNotFoundID ) {
641
- def kind : String = " Doc Comment "
641
+ def kind = MessageKind . DocComment
642
642
def msg = em """ Proper definition was not found in ${hl(" @usecase" )}"""
643
643
644
644
def explain = {
@@ -818,14 +818,14 @@ import transform.SymUtils._
818
818
819
819
class LossyWideningConstantConversion (sourceType : Type , targetType : Type )(using Context )
820
820
extends Message (LossyWideningConstantConversionID ):
821
- def kind = " Lossy Conversion "
821
+ def kind = MessageKind . LossyConversion
822
822
def msg = em """ |Widening conversion from $sourceType to $targetType loses precision.
823
823
|Write `.to $targetType` instead. """ .stripMargin
824
824
def explain = " "
825
825
826
826
class PatternMatchExhaustivity (uncoveredFn : => String , hasMore : Boolean )(using Context )
827
827
extends Message (PatternMatchExhaustivityID ) {
828
- def kind = " Pattern Match Exhaustivity "
828
+ def kind = MessageKind . PatternMatchExhaustivity
829
829
lazy val uncovered = uncoveredFn
830
830
def msg =
831
831
val addendum = if hasMore then " (More unmatched cases are elided)" else " "
@@ -856,7 +856,7 @@ import transform.SymUtils._
856
856
857
857
class MatchCaseUnreachable ()(using Context )
858
858
extends Message (MatchCaseUnreachableID ) {
859
- def kind = " Match case Unreachable "
859
+ def kind = MessageKind . MatchCaseUnreachable
860
860
def msg = " Unreachable case"
861
861
def explain = " "
862
862
}
@@ -1783,7 +1783,7 @@ import transform.SymUtils._
1783
1783
1784
1784
class FailureToEliminateExistential (tp : Type , tp1 : Type , tp2 : Type , boundSyms : List [Symbol ], classRoot : Symbol )(using Context )
1785
1785
extends Message (FailureToEliminateExistentialID ) {
1786
- def kind : String = " Compatibility"
1786
+ def kind = MessageKind . Compatibility
1787
1787
def msg =
1788
1788
val originalType = ctx.printer.dclsText(boundSyms, " ; " ).show
1789
1789
em """ An existential type that came from a Scala-2 classfile for $classRoot
@@ -2228,7 +2228,7 @@ import transform.SymUtils._
2228
2228
2229
2229
class PureExpressionInStatementPosition (stat : untpd.Tree , val exprOwner : Symbol )(using Context )
2230
2230
extends Message (PureExpressionInStatementPositionID ) {
2231
- def kind = " Potential Issue "
2231
+ def kind = MessageKind . PotentialIssue
2232
2232
def msg = " A pure expression does nothing in statement position; you may be omitting necessary parentheses"
2233
2233
def explain =
2234
2234
em """ The pure expression $stat doesn't have any side effect and its result is not assigned elsewhere.
0 commit comments