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

incorrect token in error message for list[wrong-index] #29

Open
zxul767 opened this issue Dec 7, 2022 · 0 comments
Open

incorrect token in error message for list[wrong-index] #29

zxul767 opened this issue Dec 7, 2022 · 0 comments
Labels
bug Something isn't working p1

Comments

@zxul767
Copy link
Owner

zxul767 commented Dec 7, 2022

consider the following code:

>>> var l = list()
>>> l.append(1)
>>> l[1]
Runtime Error: tried to access index 1, but valid range is [0..0] or [-1..-1]
[line 1, token: 'at']

the last error is expected to say [line 1, token: '[']; the current message happens because internally, index access is desugared to the list.at function, but this can be quite confusing for users.

@zxul767 zxul767 added bug Something isn't working p1 labels Dec 7, 2022
@zxul767 zxul767 changed the title incorrect token in error message for list[oob-index] incorrect token in error message for list[wrong-index] Dec 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working p1
Projects
None yet
Development

No branches or pull requests

1 participant