Skip to content

FunctionClauseError on dynamic ranges #119

@maennchen

Description

@maennchen

Versions

  • Elixir: 1.16.0
  • Styler: locked at 0.11.4 (styler) 93c210da

Example Input

String.slice("fooo", 0..(7 - 1))

The example does not make a lot of sense, this is a simplified version of more useful code.

Stacktrace / Current Behaviour

** (Styler.StyleError) Error running style Deprecations on scripts/test.exs
   Please consider opening an issue at: https://github.com/adobe/elixir-styler/issues/new
** (FunctionClauseError) no function clause matching in Styler.Style.Deprecations.extract_value_from_range/1

    (styler 0.11.4) lib/style/deprecations.ex:80: Styler.Style.Deprecations.extract_value_from_range({:-, [line: 1], [{:__block__, [token: "7", line: 1], ~c"\a"}, {:__block__, [token: "1", line: 1], [1]}]})
    (styler 0.11.4) lib/style/deprecations.ex:69: Styler.Style.Deprecations.add_step_to_decreasing_range/1
    (styler 0.11.4) lib/style/deprecations.ex:48: Styler.Style.Deprecations.style/1
    (styler 0.11.4) lib/style/deprecations.ex:18: Styler.Style.Deprecations.run/2
    (styler 0.11.4) lib/zipper.ex:368: Styler.Zipper.do_traverse_while/3
    (styler 0.11.4) lib/styler.ex:38: anonymous fn/4 in Styler.style/3
    (elixir 1.16.0) lib/enum.ex:2528: Enum."-reduce/3-lists^foldl/2-0-"/3
    (styler 0.11.4) lib/styler.ex:36: Styler.style/3

Skipping style and continuing on

Metadata

Metadata

Assignees

No one assigned

    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