Skip to content
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

first..last pattern matching without step is deprecated #294

Open
AidenDrake opened this issue Dec 1, 2024 · 0 comments
Open

first..last pattern matching without step is deprecated #294

AidenDrake opened this issue Dec 1, 2024 · 0 comments

Comments

@AidenDrake
Copy link

My VSCode extension shows a deprecation warning for the koan beginning:

  koan "I want the first and last in the range" do
    first..last = Range.new(1, 10)

in numbers.ex

This first..last syntax without a specified step was deprecated as of elixir 1.12 - https://hexdocs.pm/elixir/1.12/changelog.html#3-soft-deprecations-no-warnings-emitted

I think it should be changed to:

    first..last//_ = Range.new(1, 10)

but I'm still learning the language so I'm not sure!

This is a pretty small detail but the koans are meant to provide an idiomatic tour of the language. I think that should include showing how to use these statements in a non-deprecated style :)

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

No branches or pull requests

1 participant