diff --git a/compiler/src/dotty/tools/dotc/parsing/Parsers.scala b/compiler/src/dotty/tools/dotc/parsing/Parsers.scala index 1be923d6d778..481de5476db3 100644 --- a/compiler/src/dotty/tools/dotc/parsing/Parsers.scala +++ b/compiler/src/dotty/tools/dotc/parsing/Parsers.scala @@ -1858,14 +1858,16 @@ object Parsers { // compatibility for Scala2 `x @ _*` syntax infixPattern() match { case pt @ Ident(tpnme.WILDCARD_STAR) => - migrationWarningOrError("The syntax `x @ _*' is no longer supported; use `x : _*' instead", startOffset(p)) + if (ctx.settings.strict.value) + migrationWarningOrError("The syntax `x @ _*' is no longer supported; use `x : _*' instead", startOffset(p)) atSpan(startOffset(p), offset) { Typed(p, pt) } case pt => atSpan(startOffset(p), 0) { Bind(name, pt) } } case p @ Ident(tpnme.WILDCARD_STAR) => // compatibility for Scala2 `_*` syntax - migrationWarningOrError("The syntax `_*' is no longer supported; use `x : _*' instead", startOffset(p)) + if (ctx.settings.strict.value) + migrationWarningOrError("The syntax `_*' is no longer supported; use `x : _*' instead", startOffset(p)) atSpan(startOffset(p)) { Typed(Ident(nme.WILDCARD), p) } case p => p diff --git a/tests/neg/i1059.scala b/tests/neg-strict/i1059.scala similarity index 100% rename from tests/neg/i1059.scala rename to tests/neg-strict/i1059.scala