Skip to content

Conversation

@katafrakt
Copy link

This PR add support for function calls using __MODULE__ special form, like:

___MODULE__.function1()

It was not working, because Forge parses __MODULE__ as {:var, ~c"__MODULE__"}, not as an atom/module. Because of that, a special handling case just for {:var, ~c"__MODULE__"} needed to be added.

Recognizing __MODULE__ as :var, while might be semantically incorrect, does not seem to be a problem in scope of definition finding.

The PR also adds an additional test, making sure that a popular formula of using alias __MODULE__ in the module is correctly handled by the Engine.

…MODULE__

This wasn't working, as __MODULE__ is recognized as :var, not as
:module in AST. What was needed is to add a special handling of it in
`expand_alias` function.

Recognizing __MODULE__ as :var, while semantically incorrect, does not
seem to be a problem in scope of definition finding. It's not strictly a
module either, so to be super-correct, we would need to add a special
handling just for it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant