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

FunctionClauseError on dynamic ranges #119

Closed
maennchen opened this issue Jan 18, 2024 · 1 comment
Closed

FunctionClauseError on dynamic ranges #119

maennchen opened this issue Jan 18, 2024 · 1 comment

Comments

@maennchen
Copy link

maennchen commented Jan 18, 2024

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
@novaugust
Copy link
Contributor

thanks much for the issue! fix released in 0.11.5 =)

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

2 participants