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

Given substructure positions for errors #12

Open
ndmitchell opened this issue Mar 18, 2021 · 0 comments
Open

Given substructure positions for errors #12

ndmitchell opened this issue Mar 18, 2021 · 0 comments

Comments

@ndmitchell
Copy link
Contributor

Broken out from #7, using the idea from @Mythra. Once we have #11, we get a path of what was wrong with a value - e.g. we'll know that [1, "test"] has an error at index 1. Combined with positional information for the initial value (which is pretty easy to wire through), and an AST for the module (which we can recreate from the full original source in the codemap), we can observe if the argument is a literal list. If it is, we can then give a span that more precisely targets the field within that list that is wrong. That results in better error messages, e.g.

foo([1,"test"])
       ^^^^^^ -- expected an int
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

1 participant