Skip to content

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

Description

@AidenDrake

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 :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions