Skip to content

Commit dc012c3

Browse files
Remove unnecessary guard from migration warnings (#18827)
Note that the `errorOrMigrationWarning ` is only emitted on `future` and the patch on `future-migration`.
2 parents 94dceed + 276a20b commit dc012c3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3518,7 +3518,7 @@ object Parsers {
35183518

35193519
/** ‘*' | ‘_' */
35203520
def wildcardSelector() =
3521-
if in.token == USCORE && sourceVersion.isAtLeast(future) then
3521+
if in.token == USCORE then
35223522
report.errorOrMigrationWarning(
35233523
em"`_` is no longer supported for a wildcard $exprName; use `*` instead${rewriteNotice(`future-migration`)}",
35243524
in.sourcePos(),
@@ -3538,7 +3538,7 @@ object Parsers {
35383538
/** id [‘as’ (id | ‘_’) */
35393539
def namedSelector(from: Ident) =
35403540
if in.token == ARROW || isIdent(nme.as) then
3541-
if in.token == ARROW && sourceVersion.isAtLeast(future) then
3541+
if in.token == ARROW then
35423542
report.errorOrMigrationWarning(
35433543
em"The $exprName renaming `a => b` is no longer supported ; use `a as b` instead${rewriteNotice(`future-migration`)}",
35443544
in.sourcePos(),

0 commit comments

Comments
 (0)