Skip to content

Commit 5a1fc99

Browse files
committed
Deprecation warnings for old syntax (xs: _* varargs)
1 parent f61026d commit 5a1fc99

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

compiler/src/dotty/tools/dotc/parsing/Parsers.scala

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2344,11 +2344,12 @@ object Parsers {
23442344
val isVarargSplice = location.inArgs && followingIsVararg()
23452345
in.nextToken()
23462346
if isVarargSplice then
2347-
report.errorOrMigrationWarning(
2348-
em"The syntax `x: _*` is no longer supported for vararg splices; use `x*` instead${rewriteNotice(`future-migration`)}",
2347+
report.gradualErrorOrMigrationWarning(
2348+
em"The syntax `x: _*` is no longer supported for vararg splices; use `x*` instead${rewriteNotice(`3.4-migration`)}",
23492349
in.sourcePos(uscoreStart),
2350-
future)
2351-
if sourceVersion == `future-migration` then
2350+
warnFrom = `3.4`,
2351+
errorFrom = future)
2352+
if sourceVersion.isMigrating && sourceVersion.isAtLeast(`3.4-migration`) then
23522353
patch(source, Span(t.span.end, in.lastOffset), "*")
23532354
else if opStack.nonEmpty then
23542355
report.errorOrMigrationWarning(

0 commit comments

Comments
 (0)