@@ -21,6 +21,7 @@ import ErrorMessageID._
2121import Denotations .SingleDenotation
2222import dotty .tools .dotc .ast .Trees
2323import dotty .tools .dotc .ast .untpd .Modifiers
24+ import dotty .tools .dotc .config .ScalaVersion
2425import dotty .tools .dotc .core .Flags .{FlagSet , Mutable }
2526import dotty .tools .dotc .core .SymDenotations .SymDenotation
2627import scala .util .control .NonFatal
@@ -140,7 +141,7 @@ object messages {
140141 }
141142
142143 case class EmptyCatchBlock (tryBody : untpd.Tree )(implicit ctx : Context )
143- extends EmptyCatchOrFinallyBlock (tryBody, EmptyCatchBlockID ) {
144+ extends EmptyCatchOrFinallyBlock (tryBody, EmptyCatchBlockID ) {
144145 val kind = " Syntax"
145146 val msg =
146147 hl """ |The ${" catch" } block does not contain a valid expression, try
@@ -1973,6 +1974,31 @@ object messages {
19731974 val explanation = " A sealed class or trait can only be extended in the same file as its declaration"
19741975 }
19751976
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+
19762002 case class UnableToEmitSwitch ()(implicit ctx : Context )
19772003 extends Message (UnableToEmitSwitchID ) {
19782004 val kind = " Syntax"
0 commit comments