Skip to content

Incorrect line number reported in repl when error is in a previous command #29

@timfennis

Description

@timfennis
fn add(a, b) { a + b }
[1,2,3,"test"].reduce(add);

reports

  × Error while executing code
  ╰─▶ operator + is not defined for int and string
   ╭────
 1 │ [1,2,3,"test"].reduce(add)
   ·               ──┬──
   ·                 ╰── related to this
   ╰────

it wants to point to the a + b expression but think the span is in the previously entered line

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions