Open gomoripeti opened 5 years ago
For a type error on the form of an expression E not matching a type T, I suggest the simple structure {type_error, E, T}
where E and T are abstract syntax. Line number can be extracted from E. This would cover many of the currently different type errors.
@josefs can we get your blessing to make this happen? I expect that I can dish out a PR addressing this issue before the week ends if we can agree on the format.
I can answer yes on this question. Almost certain that Josef doesn't mind that you sort this out!
@Zalastax, go wild! I'd love to see this happen.
It would be good to have an option to return errors as erlang terms (when called from Erlang, not cli).
This requires unifying and documenting the error terms, each one having the same structure (common fields in same position: eg filename, line number, expected type etc.)
Also the default formatter (used by the cli) could have a format similar to other tools, like the compiler:
file-name:line-number:error-text