Versions Used
Kaffy: 0.10.2
Phoenix: 1.7.11
Elixir: 1.17.0-rc.0
I'm getting a compilation error after upgrading to Elixir 1.17-rc.0. The only thing I changed is the Elixir version; everything worked fine on 1.16.
==> kaffy
Compiling 26 files (.ex)
== Compilation error in file lib/kaffy/resource_query.ex ==
** (Ecto.Query.CompileError) binding list should contain only variables or `{as, var}` tuples, got: ...
(ecto 3.10.3) expanding macro: Ecto.Query.from/2
(kaffy 0.10.2) lib/kaffy/resource_query.ex:188: Kaffy.ResourceQuery.build_query/7
(elixir 1.17.0-rc.0) expanding macro: Kernel.if/2
(kaffy 0.10.2) lib/kaffy/resource_query.ex:184: Kaffy.ResourceQuery.build_query/7
(elixir 1.17.0-rc.0) expanding macro: Kernel.if/2
The error is coming from these lines in Kaffy, that pass ... to Ecto.Query.from
if Kaffy.ResourceSchema.field_type(the_association, f) == :string or
term_type == :string do
term = "%#{term}%"
from([..., r] in current_query,
or_where: ilike(type(field(r, ^f), :string), ^term)
)
else
if Kaffy.ResourceSchema.field_type(schema, f) in [:id, :integer] and
term_type == :decimal do
current_query
else
from([..., r] in current_query,
or_where: field(r, ^f) == ^term
)
end
end
I'm not sure if this a problem with Kaffy per se or with Ecto, or with Elixir 1.17.0-rc.0. But I see the following in the Elixir changelog for 1.17.0-rc.0:
Resolve inconsistencies of how .. and ... are handled at the AST level
… which may be related.
Does anyone know what might be going wrong here and how it could be fixed?
Versions Used Kaffy: 0.10.2 Phoenix: 1.7.11 Elixir: 1.17.0-rc.0
I'm getting a compilation error after upgrading to Elixir 1.17-rc.0. The only thing I changed is the Elixir version; everything worked fine on 1.16.
The error is coming from these lines in Kaffy, that pass
...
toEcto.Query.from
I'm not sure if this a problem with Kaffy per se or with Ecto, or with Elixir 1.17.0-rc.0. But I see the following in the Elixir changelog for 1.17.0-rc.0:
… which may be related.
Does anyone know what might be going wrong here and how it could be fixed?