Skip to content

Duplicated closing meta on AST nodes with nested function calls #14119

@lukaszsamson

Description

@lukaszsamson

Elixir and Erlang/OTP versions

Erlang/OTP 26 [erts-14.2.5.4] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1] [jit]

Elixir 1.18.1 (compiled with Erlang/OTP 26)

Operating system

any

Current behavior

buffer = "defmodule MyModule do\n  foo(bar())()\nend\n"

Code.string_to_quoted!(buffer, token_metadata: true, columns: true)
{:defmodule,
 [
   end_of_expression: [newlines: 1, line: 3, column: 4],
   do: [line: 1, column: 20],
   end: [line: 3, column: 1],
   line: 1,
   column: 1
 ],
 [
   {:__aliases__, [last: [line: 1, column: 11], line: 1, column: 11],
    [:MyModule]},
   [
     do: {{:foo, [closing: [line: 2, column: 12], line: 2, column: 3],
       [{:bar, [closing: [line: 2, column: 11], line: 2, column: 7], []}]},
      [
        end_of_expression: [newlines: 1, line: 2, column: 15],
        closing: [line: 2, column: 14],
        closing: [line: 2, column: 12],
        line: 2,
        column: 3
      ], []}
   ]
 ]}

Notice closing appears twice with different columns

Expected behavior

Only closing: [line: 2, column: 14] should be present on that node

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions