exquisite
exquisite copied to clipboard
Compilation error after upgrading elixir
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)
Noticed in https://github.com/meh/exquisite/commit/ff8446c9aab2dfcfcc1796849575fe86c708b6ba that this is already being worked on, yay :)
How soon until an updated hex package will be available?
Also eagerly waiting for a new release 👍
@meh do you plan on making a release soon for compatibility with Elixir 1.7?
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.
@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