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(compiler): Prevent impossible string error from pattern matching #2218

Merged
merged 3 commits into from
Dec 29, 2024

Conversation

spotandjake
Copy link
Member

I noticed that when we had a non exhaustive pattern including a string such as:

module Main
match ([]) {
  ["str"] => void
}

we would hit an impossible error upon further investigation i noticed that we convert the constructors from typetree nodes back into ParseTree nodes and that we did not add the quotes back onto the string when we do this, I corrected that and added two small regression tests.

Closes: #2216

@ospencer ospencer added this pull request to the merge queue Dec 28, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Dec 29, 2024
@ospencer ospencer enabled auto-merge December 29, 2024 02:00
@ospencer ospencer added this pull request to the merge queue Dec 29, 2024
Merged via the queue into grain-lang:main with commit a1caf87 Dec 29, 2024
12 checks passed
@github-actions github-actions bot mentioned this pull request Dec 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants