Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unified error terms and text #49

Open
gomoripeti opened this issue Oct 11, 2018 · 4 comments
Open

Unified error terms and text #49

gomoripeti opened this issue Oct 11, 2018 · 4 comments

Comments

@gomoripeti
Copy link
Collaborator

gomoripeti commented Oct 11, 2018

It would be good to have an option to return errors as erlang terms (when called from Erlang, not cli).

  • various frontends can format the errors according to their taste (eg Elixir syntax formatting).
  • also testing negative cases could be more precise

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

@zuiderkwast
Copy link
Collaborator

zuiderkwast commented Oct 24, 2018

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.

@Zalastax
Copy link
Collaborator

@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.

@zuiderkwast
Copy link
Collaborator

zuiderkwast commented Oct 26, 2018

I can answer yes on this question. Almost certain that Josef doesn't mind that you sort this out!

@josefs
Copy link
Owner

josefs commented Oct 26, 2018

@Zalastax, go wild! I'd love to see this happen.

@Zalastax Zalastax self-assigned this Oct 26, 2018
Zalastax added a commit to Zalastax/Gradualizer that referenced this issue Oct 28, 2018
@Zalastax Zalastax removed their assignment Oct 28, 2018
Zalastax added a commit to Zalastax/Gradualizer that referenced this issue Nov 27, 2018
Zalastax added a commit to Zalastax/Gradualizer that referenced this issue Nov 27, 2018
Zalastax added a commit to Zalastax/Gradualizer that referenced this issue Dec 3, 2018
Zalastax added a commit to Zalastax/Gradualizer that referenced this issue Dec 17, 2018
Zalastax added a commit to Zalastax/Gradualizer that referenced this issue Dec 17, 2018
Zalastax added a commit to Zalastax/Gradualizer that referenced this issue Dec 17, 2018
Zalastax added a commit that referenced this issue Dec 18, 2018
Zalastax added a commit to Zalastax/Gradualizer that referenced this issue Dec 19, 2018
Zalastax added a commit to Zalastax/Gradualizer that referenced this issue Dec 20, 2018
Zalastax added a commit to Zalastax/Gradualizer that referenced this issue Dec 30, 2018
Zalastax added a commit that referenced this issue Dec 30, 2018
berbiche pushed a commit to berbiche/Gradualizer that referenced this issue Feb 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants