alpaca-lang / alpaca

Functional programming inspired by ML for the Erlang VM
Other
1.44k stars 48 forks source link

Incorrect line numbers for missing record field errors #263

Open j14159 opened 5 years ago

j14159 commented 5 years ago
module mod
let foo :b = {b=0}
let foo :a = {a=true, b=0}

The typer currently and _incorrectly reports a missing member a on line 3:

{error, {missing_record_field, mod, 3, a}}

I believe this is because even though it's correctly finding the lower bound (a record with a and b members), the environment doesn't track the source (line) of the initial type, {b: bool} and thus can't accurately report the true problem location.