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

Fix locations in Internal hole substitution (only for the case of substituting identifiers) #2995

Merged
merged 3 commits into from
Sep 5, 2024

Conversation

lukaszcz
Copy link
Collaborator

@lukaszcz lukaszcz commented Sep 4, 2024

Type checking messes up the locations by substituting the holes (instance holes and ordinary holes) without adjusting the location of the expression substituted into the hole. Instead, the location of the expression substituted into the hole is preserved. This messes up locations in type-checked Internal, because the substituted expressions can come from anywhere. Later on, the error locations are wrong in Core, and get wrongly displayed e.g. for pattern matching coverage errors.

This PR implements a partial solution for the (most common) case when the substituted expression is an identifier. In the future, we should have a general solution to preserve the hole locations.

@lukaszcz lukaszcz added this to the 0.6.7 milestone Sep 4, 2024
@lukaszcz lukaszcz self-assigned this Sep 4, 2024
@janmasrovira janmasrovira merged commit d7c69db into main Sep 5, 2024
4 checks passed
@janmasrovira janmasrovira deleted the fix-location-instances branch September 5, 2024 08:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants