From 276a20b99bd91bf02c330db442262fc90f694cce Mon Sep 17 00:00:00 2001 From: Nicolas Stucki Date: Thu, 2 Nov 2023 15:02:43 +0100 Subject: [PATCH] Remove unnecessary guard from migration warnings --- compiler/src/dotty/tools/dotc/parsing/Parsers.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/src/dotty/tools/dotc/parsing/Parsers.scala b/compiler/src/dotty/tools/dotc/parsing/Parsers.scala index 5073cbad9b6a..c845ea8f74c7 100644 --- a/compiler/src/dotty/tools/dotc/parsing/Parsers.scala +++ b/compiler/src/dotty/tools/dotc/parsing/Parsers.scala @@ -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(), @@ -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(),