-
Notifications
You must be signed in to change notification settings - Fork 126
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
Invalid sequence index, more debug info #984
Comments
|
There are a couple of things we could do here: First, in order to be able to attach source location information onto exceptions, we would need to extend the The second thing we might want to do is to preserve more location information in the type-checked AST. Right now, the |
I've done some things like that on other projects and one thing to watch out for is how names are handled: we may want to distinguish between the definition site of a name and use sites of a name, otherwise you end up with rather confusing locations. Some potential options are:
To me (3) feels like the best option. Another tricky bit is that transformations on the annotated AST would have to be careful about having sensible locations, and we should not assume that nesting in the AST implies containment of the locations (e.g., if you inline something). The biggest transformation we do at the moment is probably specialization so we'd have to be a bit careful there. |
Coincidentally, I've been working on this exact issue. I have a branch that prints source locations for runtime errors. I'll have to see what we can do for |
With the merge of #995, we now get results like the following.
|
Do you think it would be possible to output a line number or something when running a function gives an invalid sequence error? Right now, if something is going to index out of bounds, it just says
Invalid sequence index: 640
but doesn't give any more information.The text was updated successfully, but these errors were encountered: