@@ -89,7 +89,7 @@ object messages {
89
89
import dotc .ast .untpd
90
90
91
91
// Syntax Errors ---------------------------------------------------------- //
92
- abstract class EmptyCatchOrFinallyBlock (tryBody : untpd.Tree , errNo : String )(implicit ctx : Context )
92
+ abstract class EmptyCatchOrFinallyBlock (tryBody : untpd.Tree , errNo : Int )(implicit ctx : Context )
93
93
extends Message (errNo) {
94
94
val explanation = {
95
95
val tryString = tryBody match {
@@ -121,23 +121,23 @@ object messages {
121
121
}
122
122
123
123
case class EmptyCatchBlock (tryBody : untpd.Tree )(implicit ctx : Context )
124
- extends EmptyCatchOrFinallyBlock (tryBody, " E001 " ) {
124
+ extends EmptyCatchOrFinallyBlock (tryBody, 1 ) {
125
125
val kind = " Syntax"
126
126
val msg =
127
127
hl """ |The ${" catch" } block does not contain a valid expression, try
128
128
|adding a case like - ` ${" case e: Exception =>" }` to the block """ .stripMargin
129
129
}
130
130
131
131
case class EmptyCatchAndFinallyBlock (tryBody : untpd.Tree )(implicit ctx : Context )
132
- extends EmptyCatchOrFinallyBlock (tryBody, " E002 " ) {
132
+ extends EmptyCatchOrFinallyBlock (tryBody, 2 ) {
133
133
val kind = " Syntax"
134
134
val msg =
135
135
hl """ |A ${" try" } without ${" catch" } or ${" finally" } is equivalent to putting
136
136
|its body in a block; no exceptions are handled. """ .stripMargin
137
137
}
138
138
139
139
case class DeprecatedWithOperator ()(implicit ctx : Context )
140
- extends Message (" E003 " ) {
140
+ extends Message (3 ) {
141
141
val kind = " Syntax"
142
142
val msg =
143
143
hl """ ${" with" } as a type operator has been deprecated; use `&' instead """
@@ -168,7 +168,7 @@ object messages {
168
168
169
169
// Type Errors ------------------------------------------------------------ //
170
170
case class DuplicateBind (bind : untpd.Bind , tree : untpd.CaseDef )(implicit ctx : Context )
171
- extends Message (" E004 " ) {
171
+ extends Message (4 ) {
172
172
val kind = " Naming"
173
173
val msg = em " duplicate pattern variable: ` ${bind.name}` "
174
174
@@ -195,7 +195,7 @@ object messages {
195
195
}
196
196
197
197
case class MissingIdent (tree : untpd.Ident , treeKind : String , name : String )(implicit ctx : Context )
198
- extends Message (" E005 " ) {
198
+ extends Message (5 ) {
199
199
val kind = " Missing Identifier"
200
200
val msg = em " not found: $treeKind$name"
201
201
@@ -206,7 +206,7 @@ object messages {
206
206
}
207
207
208
208
case class TypeMismatch (found : Type , expected : Type , whyNoMatch : String = " " , implicitFailure : String = " " )(implicit ctx : Context )
209
- extends Message (" E006 " ) {
209
+ extends Message (6 ) {
210
210
val kind = " Type Mismatch"
211
211
private val (where, printCtx) = Formatting .disambiguateTypes(found, expected)
212
212
private val (fnd, exp) = Formatting .typeDiff(found, expected)(printCtx)
0 commit comments