Skip to content

quote/2 breaks compilation when both :bind_quoted and :context are given #13590

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

Closed
am-kantox opened this issue May 23, 2024 · 1 comment
Closed

Comments

@am-kantox
Copy link
Contributor

am-kantox commented May 23, 2024

Elixir and Erlang/OTP versions

Erlang/OTP 27 [erts-15.0] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit:ns]

Elixir 1.17.0-dev (f23434e) (compiled with Erlang/OTP 27)

Operating system

Linux 6.5.0-14-generic #14-Ubuntu SMP PREEMPT_DYNAMIC Tue Nov 14 14:59:49 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

Current behavior

The module below

defmodule VersionMeta do
  defmacro failing(some_var) do
    quote bind_quoted: [some_var: some_var], context: __CALLER__.context do
      some_var
    end
  end
end

fails to compile with the following error message

** (MatchError) no match of right hand side value: false
    (elixir 1.17.0-dev) src/elixir_erl_var.erl:16: :elixir_erl_var.translate/4
    (stdlib 6.0) lists.erl:2343: :lists.mapfoldl_1/3
    (stdlib 6.0) lists.erl:2344: :lists.mapfoldl_1/3
    (elixir 1.17.0-dev) src/elixir_erl_pass.erl:42: :elixir_erl_pass.translate/3
    (elixir 1.17.0-dev) src/elixir_erl_pass.erl:315: :elixir_erl_pass.translate_list/4
    (stdlib 6.0) lists.erl:2343: :lists.mapfoldl_1/3
    (stdlib 6.0) lists.erl:2344: :lists.mapfoldl_1/3

If either of bind_quoted and/or context is not presented, there is no issue.

Expected behavior

It should compile.

Related forum thread

https://elixirforum.com/t/compilation-fails-on-1-17-0-dev-because-of-lack-of-version-meta-key/63732/3

@sabiwara
Copy link
Contributor

As mentioned in the forum thread, this is the commit which introduced it: 37d36f8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants