We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the bug When using :(erlang:byte_size(SomeVar))/binary in a bit string match, the match fails when it shouldn't.
:(erlang:byte_size(SomeVar))/binary
To Reproduce
Within a module:
-module(foo). -export([foo/0]). foo() -> A = 0, B = <<1, 2, 3>>, % works <<A, B:3/binary>> = <<0, 1, 2, 3>>, % fails <<A, B:(erlang:byte_size(B))/binary>> = <<0, 1, 2, 3>>.
** exception error: no match of right hand side value <<0,1,2,3>> in function foo:foo/0 (foo.erl, line 10)
Note: interpreted code in erl is unaffected, only happens within compiled modules.
erl
Expected behavior The pattern should match.
Affected versions Reproduced on both:
OS: macOS 14.1.1
Additional context
Originally reported in elixir-lang/elixir#13420.
The text was updated successfully, but these errors were encountered:
Fix failing binary match
5049e4c
Closes erlang#8280
Thanks! Fixed in the linked pull request.
Sorry, something went wrong.
Merge pull request #8284 from bjorng/bjorn/compiler/fix-bs_ensure/GH-…
e5b938e
…8280/OTP-19035 Fix failing binary match
d0dc1eb
Merge branch 'bjorn/compiler/fix-bs_ensure/GH-8280/OTP-19035' into ma…
8e70878
…int-26 * bjorn/compiler/fix-bs_ensure/GH-8280/OTP-19035: Fix failing binary match
bjorng
Successfully merging a pull request may close this issue.
Describe the bug
When using
:(erlang:byte_size(SomeVar))/binary
in a bit string match, the match fails when it shouldn't.To Reproduce
Within a module:
Note: interpreted code in
erl
is unaffected, only happens within compiled modules.Expected behavior
The pattern should match.
Affected versions
Reproduced on both:
OS: macOS 14.1.1
Additional context
Originally reported in elixir-lang/elixir#13420.
The text was updated successfully, but these errors were encountered: