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

extract module attribute values to variables when moving them below references #156

Closed
novaugust opened this issue Apr 10, 2024 · 0 comments · Fixed by #168
Closed

extract module attribute values to variables when moving them below references #156

novaugust opened this issue Apr 10, 2024 · 0 comments · Fixed by #168
Labels
1.0.0 bug Something isn't working

Comments

@novaugust
Copy link
Contributor

novaugust commented Apr 10, 2024

this would fix the compilation-breakage that is detailed in the readme

# before
defmodule MyGreatLibrary do
  @library_options [ ... ]
  @moduledoc make_pretty_docs(@library_options)
  use OptionsMagic, my_opts: @library_options

end

# after
library_options = [ ... ]

defmodule MyGreatLibrary do
  @moduledoc make_pretty_docs(library_options)
  use OptionsMagic, my_opts: unquote(library_options)

  @library_options library_options
end

there'll likely be many edge cases to consider with this system, but i'm happy shipping it with just this test passing

@novaugust novaugust added bug Something isn't working 1.0.0 labels Apr 16, 2024
novaugust added a commit that referenced this issue May 20, 2024
Fixes the longstanding compilation-breaking bug that occurs when module attributes are moved below directives that reference them.

Closes #156, Ref #65 and #43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.0.0 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant