-
-
Notifications
You must be signed in to change notification settings - Fork 873
Fix discarded variable sized string segment patterns not being disallowed #4875
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! Could you update the changelog bug fix section please 🙏
7203abc
to
8c4a13b
Compare
I've updated the changelog as well as rebasing onto the latest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
Force pushing is good by me 👍
Looks like there's a snapshot that needs to be accepted! |
Head branch was pushed to by a user without write access
Hopefully it should work now? I ran |
Well there are more checks passing now, but still some failing. Looking at the big block of code in the output for them, it seems like the code contains references to |
Looks like it's failing from this line of the stdlib: https://github.com/gleam-lang/stdlib/blob/main/src/gleam/bit_array.gleam#L70 |
Ah, thanks for the input. So I'm assuming the stdlib may need to be updated to use |
Seems like it yes. In that case would this be considered a breaking change? Or will we treat it like a bug which was never intended? |
This fixes the issue where the following code snippets with discarded variables in utf8 bit array patterns are allowed to compile:
When the variable is not discarded, the compiler already correctly disallows the pattern, as variable length string matches are not allowed for bit arrays:
The fix is just this single line change:
Credit to Julian (@julian.nz) in the Gleam Discord server for finding this issue.