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 let-patterns inside named arguments #3274

Merged
merged 2 commits into from
Jan 13, 2025
Merged

Fix let-patterns inside named arguments #3274

merged 2 commits into from
Jan 13, 2025

Conversation

lukaszcz
Copy link
Collaborator

@lukaszcz lukaszcz commented Jan 10, 2025

  • Closes impossible crash #3269
  • The problem was that NameKind of a name used as a variable was not properly updated to KNameLocal, which later caused the identifier to be converted into IdenFunction by substitutionE called by the code handling named arguments. The function substitutionE calls toExpression on the name instead of on the identifier expression, and toExpression called on a name chooses the kind of identifier to create based on NameKind. In my opinion, it is error-prone to have two distinct places which determine the kind of an identifier. In genPatternDefs, I changed IdenFunction to IdenVar but forgot about adjusting NameKind.

@lukaszcz lukaszcz added this to the 0.6.10 milestone Jan 10, 2025
@lukaszcz lukaszcz requested a review from janmasrovira January 10, 2025 18:01
@lukaszcz lukaszcz self-assigned this Jan 10, 2025
@lukaszcz lukaszcz marked this pull request as ready for review January 10, 2025 18:03
@janmasrovira janmasrovira merged commit df0c017 into main Jan 13, 2025
7 of 8 checks passed
@janmasrovira janmasrovira deleted the fix-let-patterns branch January 13, 2025 09:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

impossible crash
2 participants