elixir icon indicating copy to clipboard operation
elixir copied to clipboard

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

Open lukaszsamson opened this issue 1 year ago • 0 comments

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

lukaszsamson avatar May 06 '24 19:05 lukaszsamson