Skip to content

[12.x] Fix integer range patterns at int32 boundaries - #8858

Merged
fhammerschmidt merged 2 commits into
maintenance/12.xfrom
backport/8717-v12
Oct 20, 2026
Merged

fhammerschmidt merged 2 commits into
maintenance/12.xfrom
backport/8717-v12

Conversation

@fhammerschmidt

@fhammerschmidt fhammerschmidt commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

Backport #8717 (commit 52783c8f72d24a725060054756cd5f5452c27d71) to maintenance/12.x for the next v12 patch release. The maintenance branch already contains the related fix from #8714.

Use signed int32 bounds for integer match intervals and normalize accepted typed integer constants before pattern analysis. This fixes ranges ending at 2147483647 and wrapped aliases such as -0xFFFF_FFFF/1. Wrapped aliases can now produce unused-case warnings, as described in the 12.3.2 changelog.

Adapt the matching calls to v12's existing location and switch-name arguments. Port the two unit regressions into a registered integer-constant test module using v12's Lambda conversion, retain the runtime and diagnostic regressions, and regenerate the JavaScript snapshot with the v12 compiler.

Validation:

  • Compiler, v12 Rewatch, Ninja, and runtime builds pass with OCaml 5.3.
  • node scripts/test.js -ounit -mocha -bsb -docstrings: 195 unit tests, 921 runtime tests, all 40 build fixtures, stdlib and CommonJS checks, and 754 documentation examples pass.
  • Runtime tests pass again after applying v12 fixture formatting.
  • dune build @fmt with OCamlFormat 0.27.0, ReScript formatting checks for the changed fixtures, and repository Biome 1.9.4 checks pass.
  • Legacy CHANGELOG.md entries for 12.3.2 and whitespace validation.

Backport #8717 to maintenance/12.x. Adapt matching calls and integer constant unit tests to the v12 Lambda representation, and regenerate the runtime snapshot with the v12 compiler.

(cherry picked from commit 52783c8)
Signed-off-by: Florian Hammerschmidt <florianh89@gmail.com>
@fhammerschmidt
fhammerschmidt marked this pull request as ready for review October 13, 2026 17:21
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-14T19:34:25.618097Z 87ad151 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Signed-off-by: Florian Hammerschmidt <florianh89@gmail.com>
@pkg-pr-new

pkg-pr-new Bot commented Oct 13, 2026

Copy link
Copy Markdown

Open in StackBlitz

rescript

npm i https://pkg.pr.new/rescript@8858

@rescript/darwin-arm64

npm i https://pkg.pr.new/@rescript/darwin-arm64@8858

@rescript/darwin-x64

npm i https://pkg.pr.new/@rescript/darwin-x64@8858

@rescript/linux-arm64

npm i https://pkg.pr.new/@rescript/linux-arm64@8858

@rescript/linux-x64

npm i https://pkg.pr.new/@rescript/linux-x64@8858

@rescript/runtime

npm i https://pkg.pr.new/@rescript/runtime@8858

@rescript/win32-x64

npm i https://pkg.pr.new/@rescript/win32-x64@8858

commit: 87ad151

@fhammerschmidt
fhammerschmidt requested a review from cknitt October 14, 2026 09:55
@fhammerschmidt

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 87ad151713

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread CHANGELOG.md
@fhammerschmidt
fhammerschmidt merged commit c8aff0a into maintenance/12.x Oct 20, 2026
26 checks passed
@fhammerschmidt
fhammerschmidt deleted the backport/8717-v12 branch October 20, 2026 14:49
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