@@ -41,45 +41,56 @@ import cc.CaptureSet.IdentityCaptRefMap
41
41
*/
42
42
43
43
abstract class SyntaxMsg (errorId : ErrorMessageID ) extends Message (errorId):
44
+ this : SyntaxMsg =>
44
45
def kind = MessageKind .Syntax
45
46
46
47
abstract class TypeMsg (errorId : ErrorMessageID ) extends Message (errorId):
48
+ this : TypeMsg =>
47
49
def kind = MessageKind .Type
48
50
49
51
trait ShowMatchTrace (tps : Type * )(using Context ) extends Message :
52
+ this : ShowMatchTrace =>
50
53
override def msgSuffix : String = matchReductionAddendum(tps* )
51
54
52
55
abstract class TypeMismatchMsg (found : Type , expected : Type )(errorId : ErrorMessageID )(using Context )
53
56
extends Message (errorId), ShowMatchTrace (found, expected):
57
+ this : TypeMismatchMsg =>
54
58
def kind = MessageKind .TypeMismatch
55
59
def explain = err.whyNoMatchStr(found, expected)
56
60
override def canExplain = true
57
61
58
62
abstract class NamingMsg (errorId : ErrorMessageID ) extends Message (errorId):
63
+ this : NamingMsg =>
59
64
def kind = MessageKind .Naming
60
65
61
66
abstract class DeclarationMsg (errorId : ErrorMessageID ) extends Message (errorId):
67
+ this : DeclarationMsg =>
62
68
def kind = MessageKind .Declaration
63
69
64
70
/** A simple not found message (either for idents, or member selection.
65
71
* Messages of this class are sometimes dropped in favor of other, more
66
72
* specific messages.
67
73
*/
68
74
abstract class NotFoundMsg (errorId : ErrorMessageID ) extends Message (errorId):
75
+ this : NotFoundMsg =>
69
76
def kind = MessageKind .NotFound
70
77
def name : Name
71
78
72
79
abstract class PatternMatchMsg (errorId : ErrorMessageID ) extends Message (errorId):
80
+ this : PatternMatchMsg =>
73
81
def kind = MessageKind .PatternMatch
74
82
75
83
abstract class CyclicMsg (errorId : ErrorMessageID ) extends Message (errorId):
84
+ this : CyclicMsg =>
76
85
def kind = MessageKind .Cyclic
77
86
78
87
abstract class ReferenceMsg (errorId : ErrorMessageID ) extends Message (errorId):
88
+ this : ReferenceMsg =>
79
89
def kind = MessageKind .Reference
80
90
81
91
abstract class EmptyCatchOrFinallyBlock (tryBody : untpd.Tree , errNo : ErrorMessageID )(using Context )
82
92
extends SyntaxMsg (errNo) {
93
+ this : EmptyCatchOrFinallyBlock =>
83
94
def explain = {
84
95
val tryString = tryBody match {
85
96
case Block (Nil , untpd.EmptyTree ) => " {}"
@@ -242,7 +253,7 @@ import cc.CaptureSet.IdentityCaptRefMap
242
253
}
243
254
}
244
255
245
- class TypeMismatch (found : Type , expected : Type , inTree : Option [untpd.Tree ], addenda : = > String * )(using Context )
256
+ class TypeMismatch (found : Type , expected : Type , inTree : Option [untpd.Tree ], addenda : - > String * )(using Context )
246
257
extends TypeMismatchMsg (found, expected)(TypeMismatchID ):
247
258
248
259
// replace constrained TypeParamRefs and their typevars by their bounds where possible
@@ -298,7 +309,7 @@ import cc.CaptureSet.IdentityCaptRefMap
298
309
299
310
end TypeMismatch
300
311
301
- class NotAMember (site : Type , val name : Name , selected : String , addendum : = > String = " " )(using Context )
312
+ class NotAMember (site : Type , val name : Name , selected : String , addendum : - > String = " " )(using Context )
302
313
extends NotFoundMsg (NotAMemberID ), ShowMatchTrace (site) {
303
314
// println(i"site = $site, decls = ${site.decls}, source = ${site.typeSymbol.sourceFile}") //DEBUG
304
315
@@ -822,7 +833,7 @@ import cc.CaptureSet.IdentityCaptRefMap
822
833
|Write `.to $targetType` instead. """ .stripMargin
823
834
def explain = " "
824
835
825
- class PatternMatchExhaustivity (uncoveredFn : = > String , hasMore : Boolean )(using Context )
836
+ class PatternMatchExhaustivity (uncoveredFn : - > String , hasMore : Boolean )(using Context )
826
837
extends Message (PatternMatchExhaustivityID ) {
827
838
def kind = MessageKind .PatternMatchExhaustivity
828
839
lazy val uncovered = uncoveredFn
@@ -842,7 +853,7 @@ import cc.CaptureSet.IdentityCaptRefMap
842
853
| """
843
854
}
844
855
845
- class UncheckedTypePattern (msgFn : = > String )(using Context )
856
+ class UncheckedTypePattern (msgFn : - > String )(using Context )
846
857
extends PatternMatchMsg (UncheckedTypePatternID ) {
847
858
def msg = msgFn
848
859
def explain =
@@ -1972,7 +1983,7 @@ import cc.CaptureSet.IdentityCaptRefMap
1972
1983
}
1973
1984
}
1974
1985
1975
- class CyclicInheritance (symbol : Symbol , addendum : = > String )(using Context ) extends SyntaxMsg (CyclicInheritanceID ) {
1986
+ class CyclicInheritance (symbol : Symbol , addendum : - > String )(using Context ) extends SyntaxMsg (CyclicInheritanceID ) {
1976
1987
def msg = em " Cyclic inheritance: $symbol extends itself $addendum"
1977
1988
def explain = {
1978
1989
val codeExample = " class A extends A"
0 commit comments