@@ -1767,7 +1767,7 @@ object Parsers {
17671767 } :: contextBounds(pname)
17681768 case VIEWBOUND =>
17691769 report.errorOrMigrationWarning(
1770- " view bounds `<%' are deprecated , use a context bound `:' instead" ,
1770+ " view bounds `<%' are no longer supported , use a context bound `:' instead" ,
17711771 in.sourcePos())
17721772 atSpan(in.skipToken()) {
17731773 Function (Ident (pname) :: Nil , toplevelTyp())
@@ -2027,10 +2027,10 @@ object Parsers {
20272027 val isVarargSplice = location.inArgs && followingIsVararg()
20282028 in.nextToken()
20292029 if isVarargSplice then
2030- if sourceVersion.isAtLeast(future) then
2031- report.errorOrMigrationWarning(
2032- em " The syntax `x: _*` is no longer supported for vararg splices; use `x*` instead ${rewriteNotice( " future " )} " ,
2033- in.sourcePos(uscoreStart) )
2030+ report.errorOrMigrationWarning(
2031+ em " The syntax `x: _*` is no longer supported for vararg splices; use `x*` instead ${rewriteNotice( " future " )} " ,
2032+ in.sourcePos(uscoreStart) ,
2033+ future )
20342034 if sourceVersion == `future-migration` then
20352035 patch(source, Span (t.span.end, in.lastOffset), " *" )
20362036 else if opStack.nonEmpty then
@@ -2103,12 +2103,10 @@ object Parsers {
21032103 val name = bindingName()
21042104 val t =
21052105 if (in.token == COLON && location == Location .InBlock ) {
2106- if sourceVersion.isAtLeast(future) then
2107- // Don't error in non-strict mode, as the alternative syntax "implicit (x: T) => ... "
2108- // is not supported by Scala2.x
2109- report.errorOrMigrationWarning(
2110- s " This syntax is no longer supported; parameter needs to be enclosed in (...) ${rewriteNotice(" future" )}" ,
2111- source.atSpan(Span (start, in.lastOffset)))
2106+ report.errorOrMigrationWarning(
2107+ s " This syntax is no longer supported; parameter needs to be enclosed in (...) ${rewriteNotice(" future" )}" ,
2108+ source.atSpan(Span (start, in.lastOffset)),
2109+ from = future)
21122110 in.nextToken()
21132111 val t = infixType()
21142112 if (sourceVersion == `future-migration`) {
@@ -2603,10 +2601,10 @@ object Parsers {
26032601 p
26042602
26052603 private def warnStarMigration (p : Tree ) =
2606- if sourceVersion.isAtLeast(future) then
2607- report.errorOrMigrationWarning(
2608- em " The syntax `x: _*` is no longer supported for vararg splices; use `x*` instead " ,
2609- in.sourcePos(startOffset(p)) )
2604+ report.errorOrMigrationWarning(
2605+ em " The syntax `x: _*` is no longer supported for vararg splices; use `x*` instead " ,
2606+ in.sourcePos(startOffset(p)) ,
2607+ from = future )
26102608
26112609 /** InfixPattern ::= SimplePattern {id [nl] SimplePattern}
26122610 */
@@ -3064,7 +3062,8 @@ object Parsers {
30643062 if in.token == USCORE && sourceVersion.isAtLeast(future) then
30653063 report.errorOrMigrationWarning(
30663064 em " `_` is no longer supported for a wildcard import; use `*` instead ${rewriteNotice(" future" )}" ,
3067- in.sourcePos())
3065+ in.sourcePos(),
3066+ from = future)
30683067 patch(source, Span (in.offset, in.offset + 1 ), " *" )
30693068 ImportSelector (atSpan(in.skipToken()) { Ident (nme.WILDCARD ) })
30703069
@@ -3082,7 +3081,8 @@ object Parsers {
30823081 if in.token == ARROW && sourceVersion.isAtLeast(future) then
30833082 report.errorOrMigrationWarning(
30843083 em " The import renaming `a => b` is no longer supported ; use `a as b` instead ${rewriteNotice(" future" )}" ,
3085- in.sourcePos())
3084+ in.sourcePos(),
3085+ from = future)
30863086 patch(source, Span (in.offset, in.offset + 2 ),
30873087 if testChar(in.offset - 1 , ' ' ) && testChar(in.offset + 2 , ' ' ) then " as"
30883088 else " as " )
0 commit comments