Skip to content

Commit 2984e57

Browse files
authored
Merge pull request #6548 from dotty-staging/migration-seq
Move `@ _*` to `: _*` error under -strict
2 parents 7ce5bcd + 688ed1b commit 2984e57

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)