Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
unkarjedy opened this issue Jan 16, 2020 · 0 comments · Fixed by #8039
Closed

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

unkarjedy opened this issue Jan 16, 2020 · 0 comments · Fixed by #8039
Assignees

Comments

@unkarjedy
Copy link
Contributor

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

@unkarjedy unkarjedy changed the title please review and update vararg-patterns Compatibility / Migration docs section review and update vararg-patterns Compatibility / Migration docs section Jan 16, 2020
@liufengyun liufengyun self-assigned this Jan 17, 2020
liufengyun added a commit to dotty-staging/dotty that referenced this issue Jan 20, 2020
nicolasstucki added a commit that referenced this issue Jan 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants