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

Report non-byte aligned bit array patterns as compile errors for JS target #3487

Merged
merged 1 commit into from
Sep 12, 2024

Conversation

richard-viney
Copy link
Contributor

This PR contains three small changes:

  • Non-byte aligned integers in bit array patterns are now compile time errors on JS
  • A couple of existing errors related to unsupported bit array features on JS are now more descriptive
  • Small optimisation to sizedInt() in the JS prelude that avoids a .reverse() call

Can split these out to separate PRs if that's preferred

@richard-viney richard-viney force-pushed the js_byte_alignment_compile_error branch from d4ddb08 to 507b41d Compare August 5, 2024 12:07
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.

Very nice! Could you add some tests please 🙏

@lpil lpil marked this pull request as draft August 14, 2024 13:38
@richard-viney richard-viney force-pushed the js_byte_alignment_compile_error branch 2 times, most recently from da8c649 to c6710e4 Compare September 8, 2024 04:30
@richard-viney
Copy link
Contributor Author

Tests have been added, should be good to go. Pre-existing tests cover the changes made in prelude.mjs.

@richard-viney richard-viney marked this pull request as ready for review September 8, 2024 04:32
@richard-viney
Copy link
Contributor Author

I believe the CI failure is caused by minor linter incompatibilities with Rust 1.81 that was released a couple of days ago, not by the changes in this PR.

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 force-pushed the js_byte_alignment_compile_error branch from 202d30b to f5472b4 Compare September 12, 2024 16:22
@lpil lpil merged commit effb7e6 into gleam-lang:main Sep 12, 2024
12 checks passed
@richard-viney richard-viney deleted the js_byte_alignment_compile_error branch September 12, 2024 22:53
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.

2 participants