Repository navigation
Remove dead internal compiler code - #8731
Merged
Merged
Conversation
- Warning 24 (Bad_module_name), which is never raised. - The J.String_index JS IR node, which is never constructed. - The Pisint and Parraysets Lambda primitives, their only producers (%obj_is_int, %array_safe_set), and Primitive_array.set and E.is_type_number, which only they used. - The unused %obj_dup, %obj_field, %null_to_opt and %nullable_to_opt primitive names. - The unread Clflags fields fast, preprocessor, editor_mode and applicative_functors, and the -pp flag. -unsafe stays accepted as a no-op and is dropped from the runtime and belt configs. - The unit slot of Pexp_coerce in the current parsetree. The frozen v0 parsetree keeps it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Christoph Knittel <ck@cca.io>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Christoph Knittel <ck@cca.io>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #8731 +/- ##
==========================================
+ Coverage 79.86% 79.91% +0.05%
==========================================
Files 467 467
Lines 63357 63313 -44
==========================================
- Hits 50600 50597 -3
+ Misses 12757 12716 -41
🚀 New features to boost your workflow:
|
rescript
@rescript/belt
@rescript/darwin-arm64
@rescript/darwin-x64
@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-8731 |
cknitt
marked this pull request as ready for review
October 7, 2026 04:52
cristianoc
approved these changes
Oct 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
A sweep for obsolete code turned up compiler internals that nothing produces or reads anymore, mostly OCaml-era leftovers. This PR removes the ones that are provably dead and have no user-visible effect. Larger, user-facing removals (deprecated Stdlib/Belt APIs, obsolete FFI attributes) are left for separate PRs.
What's removed
Bad_module_name): declared, numbered and documented, but never raised. As with the earlier dead warnings (Remove dead and unreachable error and warning variants #8459), the number stays unused and is noted intests/ERROR_VARIANTS.md.J.String_index: a JS IR node that is never constructed. Its printer, analyzer and visitor cases go with it, along with thecodePointAtliteral only it used.PisintandParraysetsLambda primitives: their only producers were the%obj_is_intand%array_safe_setprimitive names, which nothing uses. Also removed: their codegen, thePisintsimplification inLambda.if_,E.is_type_number, and the runtimePrimitive_array.set, whose only caller was theParraysetscodegen.%obj_dup,%obj_field(already marked "FIXME: Deprecated"),%null_to_optand%nullable_to_opt(duplicates of the internal#forms). Other unused names that belong to otherwise-used families (typed comparisons, BigInt ops) are kept on purpose.Clflagsfields:fast,preprocessor,editor_mode, andapplicative_functors(always true). The-ppflag, which only setpreprocessor, is removed.-unsafeonly setfast, but it stays accepted as an explicit no-op so existingcompiler-flagskeep working. It is dropped from the runtime and belt configs.unitslot ofPexp_coerce: an OCaml leftover ((e : t1 :> t2)) that was always(). Removed from the current parsetree only; the frozenparsetree0.mland the v0 mapping keep the PPX wire format unchanged.Testing
make testandmake test-syntaxpass, including the ast-mapping round-trip tests. No compiled JS output in the test suites changed.🤖 Generated with Claude Code