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

Incorrect transformation #57

Closed
leandrocp opened this issue Jul 14, 2023 · 3 comments · Fixed by #58
Closed

Incorrect transformation #57

leandrocp opened this issue Jul 14, 2023 · 3 comments · Fixed by #58

Comments

@leandrocp
Copy link

Versions

  • Elixir: Elixir 1.16.0-dev (7795adc) (compiled with Erlang/OTP 26)
  • Styler: locked at 0.8.0 (styler) 32c76963

Example Input

This code:

  defp expand_alias({:__aliases__, _, _} = alias, env),
    do: Macro.expand(alias, %{env | function: {:beacon_live_admin, 2}})

Gets transformed into:

   defp expand_alias({:__aliases__, _, _} = alias, env),
     do: alias(Macro . :expand, %{env | function: {:beacon_live_admin, 2}})

Stacktrace / Current Behaviour

** (SyntaxError) invalid syntax found on lib/beacon/live_admin/router.ex:112:23:
     ┌─ error: lib/beacon/live_admin/router.ex:112:23
     │
 112 │     do: alias(Macro . :expand, %{env | function: {:beacon_live_admin, 2}})
     │                       ^
     │
     syntax error before: expand
@novaugust
Copy link
Contributor

thanks much for the issue + easy repro =)

@leandrocp
Copy link
Author

Thank you for this library!

@novaugust
Copy link
Contributor

shipped v0.8.1 w/ this fix 👍

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