Skip to content

review and update vararg-patterns Compatibility / Migration docs section #8015

Closed
@unkarjedy

Description

@unkarjedy

Vararg Patterns Documentation says:

Under the -language:Scala2Compat option, Dotty will accept both the old and the new syntax. A migration warning will be emitted when the old syntax is encountered.

I am using Dotty "0.21.0-RC1" with this example with the old syntax:

object Example {
  List() match { case List(_@_*) => }
  List() match { case List(_*) => }
}

Looks like:

  1. old syntax compiles just fine, without any warnings, with and without -language:Scala2Compat flag (is the flag used by the compiler at all?)
  2. adding -strict flag leads to compiler error The syntax '_*' is no longer supported; use 'x : _*' instead, while docs do not mention the flag (for example Pattern Bindings docs does mention -strict flag)

It would be nice to update the docs page to reflect the latest state of affairs.

related: Support changed Vararg Patterns

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions