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

Save source location information in types #2343

Open
byorgey opened this issue Mar 10, 2025 · 0 comments
Open

Save source location information in types #2343

byorgey opened this issue Mar 10, 2025 · 0 comments
Labels
Z-Feature A new feature to be added to the game.

Comments

@byorgey
Copy link
Member

byorgey commented Mar 10, 2025

We save source spans in the AST representing terms, but we don't save any source location information for types; but we should!

One place this recently came up is #2340 , where it's possible to have an error message referring to two different type variables with the same name, where one shadows the other. It could be nice to have source location info in order to disambiguate them in the error message.

I'm not yet sure whether this means saving source location info in every single type and threading it through everywhere, or whether we should have two separate types: one representing an abstract type, and one representing concrete parsed syntax for a type with embedded source info.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Z-Feature A new feature to be added to the game.
Projects
None yet
Development

No branches or pull requests

1 participant