@@ -21,6 +21,7 @@ import ErrorMessageID._
21
21
import Denotations .SingleDenotation
22
22
import dotty .tools .dotc .ast .Trees
23
23
import dotty .tools .dotc .ast .untpd .Modifiers
24
+ import dotty .tools .dotc .config .ScalaVersion
24
25
import dotty .tools .dotc .core .Flags .{FlagSet , Mutable }
25
26
import dotty .tools .dotc .core .SymDenotations .SymDenotation
26
27
import scala .util .control .NonFatal
@@ -140,7 +141,7 @@ object messages {
140
141
}
141
142
142
143
case class EmptyCatchBlock (tryBody : untpd.Tree )(implicit ctx : Context )
143
- extends EmptyCatchOrFinallyBlock (tryBody, EmptyCatchBlockID ) {
144
+ extends EmptyCatchOrFinallyBlock (tryBody, EmptyCatchBlockID ) {
144
145
val kind = " Syntax"
145
146
val msg =
146
147
hl """ |The ${" catch" } block does not contain a valid expression, try
@@ -1973,6 +1974,31 @@ object messages {
1973
1974
val explanation = " A sealed class or trait can only be extended in the same file as its declaration"
1974
1975
}
1975
1976
1977
+ case class SymbolHasUnparsableVersionNumber (symbol : Symbol , migrationMessage : String )(implicit ctx : Context )
1978
+ extends Message (SymbolHasUnparsableVersionNumberID ) {
1979
+ val kind = " Syntax"
1980
+ val msg = hl " ${symbol.showLocated} has an unparsable version number: $migrationMessage"
1981
+ val explanation =
1982
+ hl """ $migrationMessage
1983
+ |
1984
+ |The ${symbol.showLocated} is marked with ${" @migration" } indicating it has changed semantics
1985
+ |between versions and the ${" -Xmigration" } settings is used to warn about constructs
1986
+ |whose behavior may have changed since version change. """
1987
+ }
1988
+
1989
+ case class SymbolChangedSemanticsInVersion (
1990
+ symbol : Symbol ,
1991
+ migrationVersion : ScalaVersion
1992
+ )(implicit ctx : Context ) extends Message (SymbolChangedSemanticsInVersionID ) {
1993
+ val kind = " Syntax"
1994
+ val msg = hl " ${symbol.showLocated} has changed semantics in version $migrationVersion"
1995
+ val explanation = {
1996
+ hl """ The ${symbol.showLocated} is marked with ${" @migration" } indicating it has changed semantics
1997
+ |between versions and the ${" -Xmigration" } settings is used to warn about constructs
1998
+ |whose behavior may have changed since version change. """
1999
+ }
2000
+ }
2001
+
1976
2002
case class UnableToEmitSwitch ()(implicit ctx : Context )
1977
2003
extends Message (UnableToEmitSwitchID ) {
1978
2004
val kind = " Syntax"
0 commit comments