jfecher / ante

A safe, easy systems language
http://antelang.org
MIT License
1.89k stars 79 forks source link

Improve Location for "type variable is already in scope" error #158

Open jfecher opened 1 year ago

jfecher commented 1 year ago

Minimal repro for error:

type Foo t t = x: t

Current error:

$ ante t.an --no-color
t.an:1:1    error: Type variable 't' is already in scope
type Foo t t = x: t
^^^^^^^^^^^^^^^^^^^

Desired error:

$ ante t.an --no-color
t.an:1:12   error: Type variable 't' is already in scope
type Foo t t = x: t
           ^

t.an:1:10   note: 't' was previously declared here
type Foo t t = x: t
         ^