Repository navigation
Fix a compiler crash on an @inline int constant outside the int range - #9314
Conversation
Changelog🐛 Bug fix
Semantic Diff1 commit · Full page ✨ Fix a compiler crash on an
|
|
@codex review |
Why:
The built-in PPX converted the literal with Int32.of_string and did
not catch the failure, so the compiler crashed (#9299).
Diagnostic added (out-of-range @inline int):
Example:
@inline let big = 10000000000
let use = () => big
Before (diagnostic):
Fatal error: exception Failure("Int32.of_string")
After (diagnostic):
This @inline integer constant is outside the int range (-2147483648 to 2147483647).
Review: Does the same apply to @inline(...) in a signature? Yes, both places
use the same check; a fixture covers each.
Fixes #9299
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kbf3gHgjnQ6wvmo25twpTJ
Signed-off-by: Christoph Knittel <ck@cca.io>
23b425c to
fb11b55
Compare
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Hooray! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
✅ Compiler benchmarksAllocated wordsIn total: 638,080,855 → 638,081,400 (±0.00%). Generated projects: 629,808,258 → 629,812,226 (±0.00%). None of the 265 benchmarks changed by 0.1% or more. InstructionsIn total: 9,209,115,871 → 9,209,577,566 (+0.01%). None of the 33 benchmarks changed by 0.1% or more. Output sizeIn total: 25,874,506 → 25,874,868 (±0.00%). None of the 13 benchmarks changed by 0.1% or more. Pull request fb11b55 compared with base 54b923a in this run. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #9314 +/- ##
=======================================
Coverage 82.12% 82.12%
=======================================
Files 456 456
Lines 65649 65652 +3
=======================================
+ Hits 53914 53917 +3
Misses 11735 11735
🚀 New features to boost your workflow:
|
rescript
@rescript/belt
@rescript/darwin-arm64
@rescript/linux-arm64
@rescript/linux-x64
@rescript/runtime
@rescript/win32-x64
commit: |
|
Developer playground preview: https://rescript-lang.github.io/rescript/dev-playground/?version=pr-9314 |
Fixes #9299.
An
@inlineinteger literal outside the 32-bit range crashed the compiler withFailure("Int32.of_string"). It now reports an error at the literal, both for@inline let x = …and for@inline(…)in a signature:I chose an error over warning 107 plus a fallback, because the signature form has no ordinary binding to fall back to.
New tests: two super_errors fixtures, one for each form.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Kbf3gHgjnQ6wvmo25twpTJ