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

line option does not work on quote special form when file is set #13542

Closed
lukaszsamson opened this issue May 6, 2024 · 0 comments
Closed

line option does not work on quote special form when file is set #13542

lukaszsamson opened this issue May 6, 2024 · 0 comments

Comments

@lukaszsamson
Copy link
Contributor

Elixir and Erlang/OTP versions

master

Operating system

any

Current behavior

When file is set line has no effect
expanding

quote [line: 123, file: "some.ex"], do: bar(1, 2, 3)

results in

{:{}, [], [:bar, [keep: {"some.ex", 1}, closing: [line: 1, column: 39]], [1, 2, 3]]}

while

quote [line: 123], do: bar(1, 2, 3)

properly sets the line (token metadata is invalid)

{:{}, [], [:bar, [closing: [line: 1, column: 35], line: 123], [1, 2, 3]]}

It's also visible in iex

iex(1)> quote [line: 123, file: "some.ex"], do: bar(1, 2, 3)
{:bar, [keep: {"some.ex", 1}], [1, 2, 3]}
iex(2)> quote [line: 123], do: bar(1, 2, 3)
{:bar, [line: 123], [1, 2, 3]}

Expected behavior

The opts should both work unless they are contradictory. It doesn't seem som from the documentation

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

1 participant