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

Compilation error after upgrading elixir #10

Open
astutecat opened this issue Aug 10, 2018 · 5 comments
Open

Compilation error after upgrading elixir #10

astutecat opened this issue Aug 10, 2018 · 5 comments

Comments

@astutecat
Copy link

I've upgraded my version of elixir to 1.7.1 and since then, this error is happening for when I attempt to compile my (previously compiling without issue) code:

== Compilation error in file lib/exquisite.ex ==
** (CompileError) lib/exquisite.ex:103: __CALLER__ is available only inside defmacro and defmacrop
    lib/exquisite.ex:103: (module)
@astutecat
Copy link
Author

Noticed in ff8446c that this is already being worked on, yay :)

How soon until an updated hex package will be available?

@jkscheung
Copy link

Also eagerly waiting for a new release 👍

@indocomsoft
Copy link

@meh do you plan on making a release soon for compatibility with Elixir 1.7?

@meh
Copy link
Owner

meh commented Oct 15, 2018

There are still issues with this, and I have no idea how to make it work again, I already spent a couple hours on it and I gave up, if I find the will to live and time to do it I'll try again soon enough.

@noizu
Copy link
Contributor

noizu commented Nov 20, 2018

@meh, It appears that Elixir macro expansion is more strict in 1.7.4 when dealing with and and or commands causing it macro expansion in the library to load error values when working with queries that include and, or or.

I implemented two temporary work around by 1. overloading &&& and ||| as infix operators and updating exquisite to handle them. (custom infix functions) and by 2. manually altering the macro input to replace :and and :or with :andelse, :orelse although the final version of the change likely needs to account for table fields or variables named and, or or

With this change everything including tests run fine for me on Elixir 1.7.4, OTP 21 (erts-10.1.2) I additionally added a test specifically to verify and/or works.

This change adds the &&&, ||| workaround.
&&& || Workaround

This change walks back and provides the work around for existing queries.
and, or workaround

The longer term fix would be to handle the unexpected and state by manipulating the generated AST code. Which is not my forte.

I will verify if this also resolves the open issue meh/amnesia#70

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

5 participants