File tree 3 files changed +11
-36
lines changed
src/dotty/tools/dotc/reporting
test/dotty/tools/dotc/reporting
3 files changed +11
-36
lines changed Original file line number Diff line number Diff line change 1
1
package dotty .tools .dotc .reporting
2
2
3
- /** Unique IDs identifying the messages
3
+ // ////////////////////////////////////////////////////////////////////////
4
+ // IMPORTANT //
5
+ // Only add new IDs at end of the enumeration list and never remove IDs //
6
+ // ////////////////////////////////////////////////////////////////////////
7
+
8
+ /** Unique IDs identifying the messages, this will be used to reference documentation online.
9
+ *
4
10
* @param isActive Whether or not the compile still emits this ErrorMessageID
5
11
**/
6
12
enum ErrorMessageID (val isActive : Boolean = true ) extends java.lang.Enum [ErrorMessageID ]:
7
13
8
- // IMPORTANT: Add new IDs only at the end and never remove IDs
9
- case LazyErrorId // // errorNumber: -2
10
14
case NoExplanationID // errorNumber: -1
11
15
12
16
case EmptyCatchOrFinallyBlockID extends ErrorMessageID (isActive = false ) // errorNumber: 0
@@ -180,12 +184,12 @@ enum ErrorMessageID(val isActive: Boolean = true) extends java.lang.Enum[ErrorMe
180
184
case ImplicitSearchTooLargeID // errorNumber: 168
181
185
case TargetNameOnTopLevelClassID // errorNumber: 169
182
186
183
- def errorNumber = ordinal - 2
187
+ def errorNumber = ordinal - 1
184
188
185
189
object ErrorMessageID :
186
190
def fromErrorNumber (n : Int ): Option [ErrorMessageID ] =
187
- val enumId = n + 2
188
- if enumId >= 2 && enumId < ErrorMessageID .values.length then
191
+ val enumId = n + 1
192
+ if enumId >= 1 && enumId < ErrorMessageID .values.length then
189
193
Some (fromOrdinal(enumId))
190
194
else
191
195
None
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ object Message {
43
43
* Instead use the `persist` method to create an instance that does not keep a
44
44
* reference to these contexts.
45
45
*
46
- * @param errorId a unique id identifying the message, this will later be
46
+ * @param errorId a unique id identifying the message, this will be
47
47
* used to reference documentation online
48
48
*/
49
49
abstract class Message (val errorId : ErrorMessageID ) { self =>
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments