Skip to content

Improve precision of error locs #468

Open
@bugarela

Description

@bugarela

The highlighting for some expressions currently looks like this:

>>> 0.to(100).exists(x => x == x)
syntax error: <input>:0:1 - error: Conflicting definitions found for name x in module __REPL
0: val x = 1
   ^^^^^^^^^
<input>:2:18 - error: Conflicting definitions found for name x in module __REPL
2: 0.to(100).exists(x => x == x)
                    ^^^^^^^^^^^

where it should be

>>> 0.to(100).exists(x => x == x)
syntax error: <input>:0:1 - error: Conflicting definitions found for name x in module __REPL
0: val x = 1
       ^    
<input>:2:18 - error: Conflicting definitions found for name x in module __REPL
2: 0.to(100).exists(x => x == x)
                    ^

We should make sure that IR sub-components also get an ID and a source map entry so we can point to them when reporting errors. In this case, we want to highlight a definition's name and a lambda parameter, both of which don't get their own IDs.

Originated from #464

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions