Skip to content

Better error message for unknown variable named as an ignored variable #4686

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

Merged
merged 5 commits into from
Jun 18, 2025

Conversation

giacomocavalieri
Copy link
Member

When a variable has the same name as an ignored variable the compiler can now show more context in the "unknown variable" error, pointing to the ignored variable.
This PR fixes #4512

Copy link
Member

@lpil lpil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! I've left some notes

I think ignored is a new term? We call them discarded in patterns.

@llakala
Copy link

llakala commented Jun 17, 2025

Why doesn't Github notify me when an issue I make has a PR marking it as fixed?

Thanks so much for doing this!

@giacomocavalieri
Copy link
Member Author

Everything should be fixed and ready now!

Copy link
Member

@lpil lpil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!!

@lpil lpil merged commit fc0a3dc into gleam-lang:main Jun 18, 2025
12 checks passed
@giacomocavalieri giacomocavalieri deleted the fix-4512 branch June 18, 2025 08:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Show custom warning when using an ignored variable
3 participants