@@ -2084,10 +2084,10 @@ object Parsers {
2084
2084
val isVarargSplice = location.inArgs && followingIsVararg()
2085
2085
in.nextToken()
2086
2086
if isVarargSplice then
2087
- if sourceVersion.isAtLeast(future) then
2088
- report.errorOrMigrationWarning(
2089
- em " The syntax `x: _*` is no longer supported for vararg splices; use `x*` instead ${rewriteNotice( " future " )} " ,
2090
- in.sourcePos(uscoreStart) )
2087
+ report.errorOrMigrationWarning(
2088
+ em " The syntax `x: _*` is no longer supported for vararg splices; use `x*` instead ${rewriteNotice( " future " )} " ,
2089
+ in.sourcePos(uscoreStart) ,
2090
+ future )
2091
2091
if sourceVersion == `future-migration` then
2092
2092
patch(source, Span (t.span.end, in.lastOffset), " *" )
2093
2093
else if opStack.nonEmpty then
@@ -2162,12 +2162,10 @@ object Parsers {
2162
2162
val name = bindingName()
2163
2163
val t =
2164
2164
if (in.token == COLON && location == Location .InBlock ) {
2165
- if sourceVersion.isAtLeast(future) then
2166
- // Don't error in non-strict mode, as the alternative syntax "implicit (x: T) => ... "
2167
- // is not supported by Scala2.x
2168
- report.errorOrMigrationWarning(
2169
- s " This syntax is no longer supported; parameter needs to be enclosed in (...) ${rewriteNotice(" future" )}" ,
2170
- source.atSpan(Span (start, in.lastOffset)))
2165
+ report.errorOrMigrationWarning(
2166
+ s " This syntax is no longer supported; parameter needs to be enclosed in (...) ${rewriteNotice(" future" )}" ,
2167
+ source.atSpan(Span (start, in.lastOffset)),
2168
+ from = future)
2171
2169
in.nextToken()
2172
2170
val t = infixType()
2173
2171
if (sourceVersion == `future-migration`) {
@@ -2665,10 +2663,10 @@ object Parsers {
2665
2663
p
2666
2664
2667
2665
private def warnStarMigration (p : Tree ) =
2668
- if sourceVersion.isAtLeast(future) then
2669
- report.errorOrMigrationWarning(
2670
- em " The syntax `x: _*` is no longer supported for vararg splices; use `x*` instead " ,
2671
- in.sourcePos(startOffset(p)) )
2666
+ report.errorOrMigrationWarning(
2667
+ em " The syntax `x: _*` is no longer supported for vararg splices; use `x*` instead " ,
2668
+ in.sourcePos(startOffset(p)) ,
2669
+ from = future )
2672
2670
2673
2671
/** InfixPattern ::= SimplePattern {id [nl] SimplePattern}
2674
2672
*/
@@ -3124,7 +3122,8 @@ object Parsers {
3124
3122
if in.token == USCORE && sourceVersion.isAtLeast(future) then
3125
3123
report.errorOrMigrationWarning(
3126
3124
em " `_` is no longer supported for a wildcard import; use `*` instead ${rewriteNotice(" future" )}" ,
3127
- in.sourcePos())
3125
+ in.sourcePos(),
3126
+ from = future)
3128
3127
patch(source, Span (in.offset, in.offset + 1 ), " *" )
3129
3128
ImportSelector (atSpan(in.skipToken()) { Ident (nme.WILDCARD ) })
3130
3129
@@ -3142,7 +3141,8 @@ object Parsers {
3142
3141
if in.token == ARROW && sourceVersion.isAtLeast(future) then
3143
3142
report.errorOrMigrationWarning(
3144
3143
em " The import renaming `a => b` is no longer supported ; use `a as b` instead ${rewriteNotice(" future" )}" ,
3145
- in.sourcePos())
3144
+ in.sourcePos(),
3145
+ from = future)
3146
3146
patch(source, Span (in.offset, in.offset + 2 ),
3147
3147
if testChar(in.offset - 1 , ' ' ) && testChar(in.offset + 2 , ' ' ) then " as"
3148
3148
else " as " )
0 commit comments