File tree Expand file tree Collapse file tree 3 files changed +11
-36
lines changed
src/dotty/tools/dotc/reporting
test/dotty/tools/dotc/reporting Expand file tree Collapse file tree 3 files changed +11
-36
lines changed Original file line number Diff line number Diff line change 11package dotty .tools .dotc .reporting
22
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+ *
410 * @param isActive Whether or not the compile still emits this ErrorMessageID
511 **/
612enum ErrorMessageID (val isActive : Boolean = true ) extends java.lang.Enum [ErrorMessageID ]:
713
8- // IMPORTANT: Add new IDs only at the end and never remove IDs
9- case LazyErrorId // // errorNumber: -2
1014 case NoExplanationID // errorNumber: -1
1115
1216 case EmptyCatchOrFinallyBlockID extends ErrorMessageID (isActive = false ) // errorNumber: 0
@@ -180,12 +184,12 @@ enum ErrorMessageID(val isActive: Boolean = true) extends java.lang.Enum[ErrorMe
180184 case ImplicitSearchTooLargeID // errorNumber: 168
181185 case TargetNameOnTopLevelClassID // errorNumber: 169
182186
183- def errorNumber = ordinal - 2
187+ def errorNumber = ordinal - 1
184188
185189object ErrorMessageID :
186190 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
189193 Some (fromOrdinal(enumId))
190194 else
191195 None
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ object Message {
4343 * Instead use the `persist` method to create an instance that does not keep a
4444 * reference to these contexts.
4545 *
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
4747 * used to reference documentation online
4848 */
4949abstract class Message (val errorId : ErrorMessageID ) { self =>
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments