Skip to content

Commit 688ed1b

Browse files
committed
Move @ _* to : _* error under -strict
Projects that cross-compile with Scala 2 cannot use the new syntax, and are therefore forced to set `-language:Scala2` currently even if they don't need any of the other changes enabled by this flag to compile.
1 parent 3bcaf1d commit 688ed1b

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1858,14 +1858,16 @@ object Parsers {
18581858
// compatibility for Scala2 `x @ _*` syntax
18591859
infixPattern() match {
18601860
case pt @ Ident(tpnme.WILDCARD_STAR) =>
1861-
migrationWarningOrError("The syntax `x @ _*' is no longer supported; use `x : _*' instead", startOffset(p))
1861+
if (ctx.settings.strict.value)
1862+
migrationWarningOrError("The syntax `x @ _*' is no longer supported; use `x : _*' instead", startOffset(p))
18621863
atSpan(startOffset(p), offset) { Typed(p, pt) }
18631864
case pt =>
18641865
atSpan(startOffset(p), 0) { Bind(name, pt) }
18651866
}
18661867
case p @ Ident(tpnme.WILDCARD_STAR) =>
18671868
// compatibility for Scala2 `_*` syntax
1868-
migrationWarningOrError("The syntax `_*' is no longer supported; use `x : _*' instead", startOffset(p))
1869+
if (ctx.settings.strict.value)
1870+
migrationWarningOrError("The syntax `_*' is no longer supported; use `x : _*' instead", startOffset(p))
18691871
atSpan(startOffset(p)) { Typed(Ident(nme.WILDCARD), p) }
18701872
case p =>
18711873
p
File renamed without changes.

0 commit comments

Comments
 (0)