Skip to content

Commit

Permalink
Remove unnecessary guard from migration warnings (#18827)
Browse files Browse the repository at this point in the history
Note that the `errorOrMigrationWarning ` is only emitted on `future` and
the patch on `future-migration`.
  • Loading branch information
nicolasstucki committed Nov 3, 2023
2 parents 94dceed + 276a20b commit dc012c3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions compiler/src/dotty/tools/dotc/parsing/Parsers.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3518,7 +3518,7 @@ object Parsers {

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

0 comments on commit dc012c3

Please sign in to comment.