From 7926bee860f2a1965297ff82b250da10275dbf6a Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Thu, 11 Jun 2026 11:01:52 +0000 Subject: [PATCH 001/214] dce: tooling to run reanalyze dead-code analysis on the compiler MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds scripts/dce/run-dce.sh + README to run reanalyze DCE over the compiler's own OCaml source. The vendored rescript-tools reanalyze can't do this: the compiler's OCaml is built by host OCaml 5.3 (cmt magic Caml1999I035), while the vendored ml library only reads the 4.06-era ReScript cmt format, so it dies with Cmi_format.Error. Instead we build the standalone reanalyze against host compiler-libs, using the OCaml-5.3 support from rescript-lang/reanalyze#203 (pinned, not yet merged). It works end-to-end and produces a full report. Raw output is currently dominated by entry-point false positives (dune emits only .cmti for the bsc main, and jsoo isn't built in the default profile), so making it actionable needs root/entry-point fixes — documented in the README along with the lowest-noise starting categories (redundant/unused optional args) and the CI-gating proposal. --- .gitignore | 3 ++ scripts/dce/README.md | 92 ++++++++++++++++++++++++++++++++++++++++++ scripts/dce/run-dce.sh | 52 ++++++++++++++++++++++++ 3 files changed, 147 insertions(+) create mode 100644 scripts/dce/README.md create mode 100755 scripts/dce/run-dce.sh diff --git a/.gitignore b/.gitignore index ba748abd224..d58419eeeee 100644 --- a/.gitignore +++ b/.gitignore @@ -108,3 +108,6 @@ package.tgz # AI Agents .claude/settings.local.json + +# reanalyze DCE report output +_dce/ diff --git a/scripts/dce/README.md b/scripts/dce/README.md new file mode 100644 index 00000000000..2e389fd1c20 --- /dev/null +++ b/scripts/dce/README.md @@ -0,0 +1,92 @@ +# Compiler dead-code analysis (reanalyze DCE) + +Tooling to run reanalyze's dead-code-elimination (DCE) over the **compiler's own +OCaml source**, to find removable dead code. This is the native-OCaml analog of +the `tests/analysis_tests/tests-reanalyze` suite (which analyzes ReScript code). + +## Quick start + +```bash +scripts/dce/run-dce.sh # writes _dce/report.txt +``` + +Requires the host OCaml switch (5.3) with `dune` available (`eval $(opam env)`). +The script fetches + builds a pinned standalone reanalyze on first run (cached in +`~/.cache/rescript-dce`). + +## Why the vendored `rescript-tools reanalyze` does NOT work here + +The compiler's OCaml is compiled by the **host OCaml (5.3)** via dune, producing +`.cmt`/`.cmi` in the **5.3 format** (`Caml1999I035`). The vendored +`rescript-tools reanalyze` links the ReScript `ml` library, which only understands +the old **4.06-era** ReScript cmt format (used for `.res` → `.cmt`). Pointed at the +compiler's own cmts it fails immediately with `Fatal error: Cmi_format.Error`. + +So we use the **standalone** reanalyze (`rescript-lang/reanalyze`), built against +the host `compiler-libs.common`. OCaml 5.3 support comes from +[reanalyze#203](https://github.com/rescript-lang/reanalyze/pull/203) (branch +`ocaml-5-3`), **not yet merged** — the runner pins its commit. + +## Status: it works + +Running DCE over all 529 dune-built cmts produces a full report. Category counts +from a baseline run (`-dce-cmt _build/default`): + +| Category | Count | +|---|---| +| Dead Value | ~2740 | +| Dead Type | ~386 | +| Redundant Optional Argument | ~212 | +| Dead Module | ~203 | +| Unused Argument | ~169 | +| Dead Value With Side Effects | ~108 | +| (of which) variant cases "never constructed" | ~278 | + +## The big caveat: entry-point false positives + +The raw numbers are dominated by false positives. reanalyze DCE is a whole-program +reachability analysis anchored at **roots** (entry points). The compiler's true +entry points are the executable mains — and **dune emits only `.cmti` (no `.cmt` +body) for the `bsc` main**, while the playground (`jsoo`) main isn't built in the +default profile at all. With the entry-point bodies missing, everything reachable +only from them looks dead. Concrete example: `Bs_version` is flagged a "dead +module" even though `compiler/bsc/rescript_compiler_main.ml` and +`compiler/jsoo/jsoo_playground_main.ml` use it. + +**To make this actionable, the next step is fixing roots**, via some combination of: +- getting dune to emit `.cmt` for the executable mains (so their call sites are + analyzed), and/or +- declaring entry points live with `-live-paths` / `-live-names`, and/or +- `@live`/`@dead` source annotations (precedent: ~38 already exist in + `compiler/gentype` and `compiler/syntax`), plus `-suppress` for whole subtrees. + +## Lowest-noise categories to start from + +These depend on **call-site** analysis within the set, so they're far less +sensitive to the missing-roots problem and are the best first targets: + +- **Redundant Optional Argument** — optional arg *always supplied* at every call, + e.g. `transl_apply`'s `~inlined`/`~transformed_jsx` (`compiler/ml/translcore.ml`), + `Typ.poly`'s `~loc` (`compiler/ml/ast_helper`). Can be made mandatory. +- **Unused Argument** — optional arg *never used* in the body, e.g. + `type_open_`'s `~used_slot` (`compiler/ml/typemod.ml`), + `disjoint_union`'s `~eq`/`~print` (`compiler/ext/identifiable.ml`). + +## Relationship to the manual "unreachable OCaml variant" survey + +Complementary, with a subtle boundary: + +- reanalyze **does** detect "variant case which is never constructed" (~278 found), + overlapping the manual survey — but with false positives when the only + construction site sits outside the analyzed cmt set. +- reanalyze **misses** variants that *are* constructed but only inside **unreachable + code**. Example: `Longident.Lapply` is "constructed" in `ctype.ml`'s `lid_of_path` + (a branch that never runs), so reanalyze sees it as live and does not flag it — + yet it is genuinely dead. That class still needs the manual reachability reasoning. + +## CI integration (proposed, not yet wired) + +Once roots are fixed and a clean baseline exists, gate CI on **new** dead code: +run `run-dce.sh`, diff against a checked-in baseline, fail on additions. Open +question: how to depend on the external unmerged reanalyze#203 (pin a commit, vendor +it, or wait for merge). diff --git a/scripts/dce/run-dce.sh b/scripts/dce/run-dce.sh new file mode 100755 index 00000000000..99f085d5d46 --- /dev/null +++ b/scripts/dce/run-dce.sh @@ -0,0 +1,52 @@ +#!/bin/bash +# Run reanalyze dead-code-elimination (DCE) over the compiler's OWN OCaml source. +# +# WHY A SEPARATE TOOL: the compiler's OCaml is built by the host OCaml (5.3) via +# dune, producing 5.3-format .cmt/.cmi. The vendored `rescript-tools reanalyze` +# links the ReScript `ml` library, which only understands the old (4.06-era) +# ReScript cmt format used for .res -> .cmt, so it CANNOT read the compiler's own +# cmts (fails with Cmi_format.Error). We therefore use the STANDALONE reanalyze +# built against the host compiler-libs. OCaml 5.3 support comes from +# rescript-lang/reanalyze#203 (branch `ocaml-5-3`), which is not yet merged, so we +# pin its commit here. +# +# Usage: scripts/dce/run-dce.sh [output-file] +# Output defaults to _dce/report.txt +set -euo pipefail + +REPO_ROOT="$(cd "$(dirname "$0")/../.." && pwd)" +cd "$REPO_ROOT" + +# Pinned standalone reanalyze with OCaml 5.3 support (PR #203). +REANALYZE_REPO="https://github.com/rescript-lang/reanalyze.git" +REANALYZE_REF="${REANALYZE_REF:-1327343}" # head of branch ocaml-5-3 at time of writing +REANALYZE_SRC="${REANALYZE_SRC:-$HOME/.cache/rescript-dce/reanalyze}" + +OUT="${1:-_dce/report.txt}" +mkdir -p "$(dirname "$OUT")" + +# 1. Fetch + build the standalone reanalyze (cached). +if [ ! -x "$REANALYZE_SRC/_build/default/src/Reanalyze.exe" ]; then + echo "==> Fetching standalone reanalyze ($REANALYZE_REF)" + rm -rf "$REANALYZE_SRC" + git clone --quiet "$REANALYZE_REPO" "$REANALYZE_SRC" + git -C "$REANALYZE_SRC" checkout --quiet "$REANALYZE_REF" + echo "==> Building reanalyze against $(ocaml -version)" + (cd "$REANALYZE_SRC" && dune build 2>&1 | tail -5) +fi +BIN="$REANALYZE_SRC/_build/default/src/Reanalyze.exe" + +# 2. Build the compiler so dune emits fresh .cmt/.cmti. +echo "==> dune build (producing .cmt files)" +dune build + +# 3. Run DCE over the whole dune build tree (compiler + tools + analysis + +# executables). All are host-OCaml 5.3 cmts; the ReScript runtime (4.06 cmts) +# lives outside _build/default so it is not picked up. +echo "==> Running DCE -> $OUT" +"$BIN" -dce-cmt _build/default > "$OUT" 2>&1 || true + +echo "==> Done. Summary:" +grep -oE "Warning [A-Za-z ]+" "$OUT" | sort | uniq -c | sort -rn || true +echo " never-constructed variants: $(grep -c 'never constructed' "$OUT" || echo 0)" +echo "Full report: $OUT" From d5e2cc143e2e82a24f5dcb2c3be234e5b0057173 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Thu, 11 Jun 2026 11:15:06 +0000 Subject: [PATCH 002/214] dce: use @check for entry-point cmts; document #203 reliability blocker Two findings from triaging the DCE output: 1. Roots: a plain `dune build` emits only .cmti for modules with an .mli (incl the bsc main), so reanalyze missed the entry-point bodies and over-reported. Switch the runner to `dune build @check`, which emits impl .cmt for every module. Fixes the Bs_version-class false positives (Dead Value ~2740->2130, Dead Module ~203->146). 2. Blocker: even with roots fixed, reanalyze#203 flags obviously-live core modules as dead (Ast_helper has 510 in-tree refs; Lam_compile, Js_dump, Lam_convert likewise). Per the PR, its 5.3 value-dependency tracking is derived 'just based on the type' in cmt_infos and is incomplete (rescript-lang/reanalyze#202). So cross-reference-based categories aren't trustworthy yet. Documented in the README. --- scripts/dce/README.md | 77 +++++++++++++++++++++++++----------------- scripts/dce/run-dce.sh | 10 ++++-- 2 files changed, 53 insertions(+), 34 deletions(-) diff --git a/scripts/dce/README.md b/scripts/dce/README.md index 2e389fd1c20..08dcb03fcdf 100644 --- a/scripts/dce/README.md +++ b/scripts/dce/README.md @@ -27,38 +27,53 @@ the host `compiler-libs.common`. OCaml 5.3 support comes from [reanalyze#203](https://github.com/rescript-lang/reanalyze/pull/203) (branch `ocaml-5-3`), **not yet merged** — the runner pins its commit. -## Status: it works - -Running DCE over all 529 dune-built cmts produces a full report. Category counts -from a baseline run (`-dce-cmt _build/default`): - -| Category | Count | -|---|---| -| Dead Value | ~2740 | -| Dead Type | ~386 | -| Redundant Optional Argument | ~212 | -| Dead Module | ~203 | -| Unused Argument | ~169 | -| Dead Value With Side Effects | ~108 | -| (of which) variant cases "never constructed" | ~278 | - -## The big caveat: entry-point false positives - -The raw numbers are dominated by false positives. reanalyze DCE is a whole-program -reachability analysis anchored at **roots** (entry points). The compiler's true -entry points are the executable mains — and **dune emits only `.cmti` (no `.cmt` -body) for the `bsc` main**, while the playground (`jsoo`) main isn't built in the -default profile at all. With the entry-point bodies missing, everything reachable -only from them looks dead. Concrete example: `Bs_version` is flagged a "dead -module" even though `compiler/bsc/rescript_compiler_main.ml` and -`compiler/jsoo/jsoo_playground_main.ml` use it. - -**To make this actionable, the next step is fixing roots**, via some combination of: -- getting dune to emit `.cmt` for the executable mains (so their call sites are - analyzed), and/or -- declaring entry points live with `-live-paths` / `-live-names`, and/or +## Status: it RUNS, but the output is NOT yet trustworthy + +The tooling runs end-to-end and produces a full report over all dune-built cmts. +That is the mechanical milestone. **But the results cannot currently be acted on**, +for two stacked reasons: + +### 1. (Fixed) Entry-point roots — use `dune build @check` + +reanalyze DCE is a whole-program reachability analysis anchored at **roots** (entry +points = the executable mains). A plain `dune build` does native compilation and +emits only `.cmti` (no impl `.cmt`) for modules with an `.mli` — including the `bsc` +main — so reanalyze never sees the entry-point bodies and over-reports. The runner +now uses `dune build @check`, which typecheck-builds everything and emits the impl +`.cmt` for all modules. This fixed the `Bs_version`-class false positives and cut +Dead Value ~2740 → ~2130, Dead Module ~203 → ~146. + +Residual root gap: the playground `jsoo` main is `enabled_if profile=browser` with +`(modes js wasm)` (no bytecode `.cmt`), and the dune comment says not to build it by +default (slow). So code used only by the playground still shows as dead. + +### 2. (BLOCKER) reanalyze#203's 5.3 dependency tracking is incomplete + +Even with roots fixed, the report flags **obviously-live core modules as dead** — +e.g. `Ast_helper` (510 references in-tree), `Lam_compile`, `Js_dump`, `Lam_convert`. +The cause is stated in the PR itself: reanalyze#203 derives value dependencies +*"just based on the type of what's available in the new `Cmt_format.cmt_infos`"* — +a **tentative, incomplete** method that does not capture the real use edges in 5.3 +cmts. As a result the cross-reference-based categories (Dead Value / Dead Module / +Dead Type / "never constructed") are unreliable: there are real positives buried in +there, but you can't tell which without manually re-verifying every one, which +defeats the purpose. + +Local, call-site-based categories fare better — e.g. `transl_apply`'s `~inlined` is +correctly reported as always-supplied — but they rely on the same reference tracking, +so they're only trustworthy when a function has few, simple call sites. + +**Conclusion:** the real blocker is upstream. Completing reanalyze#203's value- +dependency extraction for OCaml 5.3 cmts (issue rescript-lang/reanalyze#202) is the +prerequisite for this to find dead code reliably. Until then, treat the report as a +lead generator that requires per-item manual verification, not a worklist. + +## Making it actionable (once #203's dependency tracking is solid) + +- declare entry points live with `-live-paths` / `-live-names`, - `@live`/`@dead` source annotations (precedent: ~38 already exist in - `compiler/gentype` and `compiler/syntax`), plus `-suppress` for whole subtrees. + `compiler/gentype` and `compiler/syntax`), plus `-suppress` for whole subtrees, +- handle the `jsoo` root gap (annotate live, or a check-only browser-profile build). ## Lowest-noise categories to start from diff --git a/scripts/dce/run-dce.sh b/scripts/dce/run-dce.sh index 99f085d5d46..93800e52f6a 100755 --- a/scripts/dce/run-dce.sh +++ b/scripts/dce/run-dce.sh @@ -36,9 +36,13 @@ if [ ! -x "$REANALYZE_SRC/_build/default/src/Reanalyze.exe" ]; then fi BIN="$REANALYZE_SRC/_build/default/src/Reanalyze.exe" -# 2. Build the compiler so dune emits fresh .cmt/.cmti. -echo "==> dune build (producing .cmt files)" -dune build +# 2. Typecheck-build so dune emits fresh .cmt for EVERY module, including the +# executable mains (bsc, res_cli). A plain `dune build` does native compilation +# and emits only `.cmti` for modules that have an `.mli` (e.g. the bsc main), +# leaving reanalyze blind to the entry-point bodies and over-reporting dead code. +# `@check` is typecheck-only and emits the impl `.cmt` for all of them. +echo "==> dune build @check (producing .cmt files incl. entry points)" +dune build @check # 3. Run DCE over the whole dune build tree (compiler + tools + analysis + # executables). All are host-OCaml 5.3 cmts; the ReScript runtime (4.06 cmts) From 4183326365127d28bb8d7c03ce5275e5b1fda980 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Thu, 11 Jun 2026 11:33:04 +0000 Subject: [PATCH 003/214] dce: document the precise root cause of reanalyze#203's false positives Investigated why obviously-live modules (Ast_helper, Lam_compile, Js_dump) are flagged dead. reanalyze's DCE is location-keyed, and OCaml 5.3 broke that on two fronts: cmt_declaration_dependencies is uid-based and carries few edges, and the dominant typedtree-walk reference source relies on Texp_ident val_loc that no longer matches declaration registration cross-module. Confirmed by experiment (local reanalyze branch): a global uid->decl pre-pass is a necessary foundation but insufficient; resolving references via val_uid alone regresses (2129->2526 dead values) because declarations are still keyed by the old location. The real fix keys both declarations and references by uid - a core refactor, not a patch. --- scripts/dce/README.md | 34 ++++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/scripts/dce/README.md b/scripts/dce/README.md index 08dcb03fcdf..68dcb4b43ba 100644 --- a/scripts/dce/README.md +++ b/scripts/dce/README.md @@ -63,10 +63,36 @@ Local, call-site-based categories fare better — e.g. `transl_apply`'s `~inline correctly reported as always-supplied — but they rely on the same reference tracking, so they're only trustworthy when a function has few, simple call sites. -**Conclusion:** the real blocker is upstream. Completing reanalyze#203's value- -dependency extraction for OCaml 5.3 cmts (issue rescript-lang/reanalyze#202) is the -prerequisite for this to find dead code reliably. Until then, treat the report as a -lead generator that requires per-item manual verification, not a worklist. +#### Root cause (investigated) and why the fix is non-trivial + +reanalyze's DCE is **location-keyed**: declarations are registered by source +position, and a use is connected to a declaration when the use's recorded "target +location" equals the declaration's. OCaml 5.3 broke this on two fronts: + +1. `cmt_value_dependencies` (direct location-based use→def edges) was replaced by + `cmt_declaration_dependencies`, which identifies declarations by `Shape.Uid`. A + cmt's `cmt_uid_to_decl` only maps the uids it *defines*, so cross-module uids + can't be resolved locally. (#203 also only carries a small subset of edges here — + e.g. `typecore.cmt` exposes ~35 — so this is not the main reference source anyway.) +2. The dominant reference source is the **typedtree walk** (`DeadValue.collectExpr`, + `Texp_ident` → `val_loc`). In 5.3 the `val_loc` on a cross-module reference's + `value_description` no longer matches where the declaration is registered, so the + use→decl edge is dropped → widely-used modules look dead. + +**Experiments (in a local reanalyze fix branch):** +- Added a global, order-independent `Shape.Uid → declaration` table (pre-pass over + all cmts) and resolved `cmt_declaration_dependencies` against it. Correct and + necessary foundation, but ~no effect (that channel carries few edges). +- Then resolved `Texp_ident` references via the value's `val_uid` through that table + instead of `val_loc`. This **regressed** (Dead Value 2129 → 2526), because + declarations are still registered at their old location key, so moving only the + *reference* side just relocates the mismatch. + +**Conclusion:** the fix is a real refactor, not a patch — reanalyze's DCE core must +key declarations *and* references by the same canonical identity (uid-based) so the +two sides agree. Best done upstream on reanalyze#203 (issue #202), ideally with its +author. Until then, treat the report as a lead generator needing per-item manual +verification, not a worklist. ## Making it actionable (once #203's dependency tracking is solid) From 6adae89596a506485fe0d37705291c50135e3976 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 10:58:54 +0000 Subject: [PATCH 004/214] dce: add baseline report --- _dce/report.txt | 17298 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 17298 insertions(+) create mode 100644 _dce/report.txt diff --git a/_dce/report.txt b/_dce/report.txt new file mode 100644 index 00000000000..b7d25e73c63 --- /dev/null +++ b/_dce/report.txt @@ -0,0 +1,17298 @@ + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/bsc/rescript_compiler_main.ml", line 55, characters 0-1591 + optional argument kind of function +process_file is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/cmt_viewer.ml", line 19, characters 0-4249 + optional argument filter of function +dump is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_implementation.mli", line 50, characters 0-131 + optional argument outputprefix of function +implementation is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_implementation.mli", line 27, characters 0-126 + optional argument outputprefix of function +interface is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/identifiable.ml", line 111, characters 2-544 + optional argument eq of function Make.Tbl.T_map.+disjoint_union is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/identifiable.ml", line 111, characters 2-544 + optional argument print of function Make.Tbl.T_map.+disjoint_union is never used + + Warning Incorrect Annotation + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/syntax/src/res_multi_printer.mli", line 3, characters 0-75 + +print is annotated @dead but is live + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_array_tests.ml", line 32, characters 11-69 + optional argument cmp of function +=~ is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_array_tests.ml", line 32, characters 11-69 + optional argument msg of function +=~ is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_array_tests.ml", line 32, characters 11-69 + optional argument pp_diff of function +=~ is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_array_tests.ml", line 3, characters 0-31 + optional argument cmp of function +=~ is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_array_tests.ml", line 3, characters 0-31 + optional argument msg of function +=~ is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_array_tests.ml", line 3, characters 0-31 + optional argument pp_diff of function +=~ is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_array_tests.ml", line 3, characters 0-31 + optional argument printer of function +=~ is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_hash_stubs_test.ml", line 3, characters 0-31 + optional argument cmp of function +=~ is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_hash_stubs_test.ml", line 3, characters 0-31 + optional argument msg of function +=~ is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_hash_stubs_test.ml", line 3, characters 0-31 + optional argument pp_diff of function +=~ is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_hash_stubs_test.ml", line 3, characters 0-31 + optional argument printer of function +=~ is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_hashtbl_tests.ml", line 3, characters 0-53 + optional argument cmp of function +=~ is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_hashtbl_tests.ml", line 3, characters 0-53 + optional argument msg of function +=~ is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_hashtbl_tests.ml", line 3, characters 0-53 + optional argument pp_diff of function +=~ is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_jsx_loc_tests.ml", line 2, characters 0-37 + optional argument cmp of function +assert_equal is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_jsx_loc_tests.ml", line 2, characters 0-37 + optional argument msg of function +assert_equal is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_jsx_loc_tests.ml", line 2, characters 0-37 + optional argument pp_diff of function +assert_equal is never used + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_jsx_loc_tests.ml", line 2, characters 0-37 + optional argument printer of function +assert_equal is always supplied (1 calls) + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_list_test.ml", line 93, characters 11-42 + optional argument cmp of function +=~ is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_list_test.ml", line 93, characters 11-42 + optional argument msg of function +=~ is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_list_test.ml", line 93, characters 11-42 + optional argument pp_diff of function +=~ is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_list_test.ml", line 93, characters 11-42 + optional argument printer of function +=~ is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_list_test.ml", line 62, characters 11-51 + optional argument cmp of function +=~ is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_list_test.ml", line 62, characters 11-51 + optional argument msg of function +=~ is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_list_test.ml", line 62, characters 11-51 + optional argument pp_diff of function +=~ is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_list_test.ml", line 31, characters 11-68 + optional argument cmp of function +=~ is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_list_test.ml", line 31, characters 11-68 + optional argument msg of function +=~ is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_list_test.ml", line 31, characters 11-68 + optional argument pp_diff of function +=~ is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_list_test.ml", line 20, characters 11-68 + optional argument cmp of function +=~ is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_list_test.ml", line 20, characters 11-68 + optional argument msg of function +=~ is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_list_test.ml", line 20, characters 11-68 + optional argument pp_diff of function +=~ is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_map_tests.ml", line 3, characters 0-31 + optional argument cmp of function +=~ is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_map_tests.ml", line 3, characters 0-31 + optional argument msg of function +=~ is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_map_tests.ml", line 3, characters 0-31 + optional argument pp_diff of function +=~ is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_map_tests.ml", line 3, characters 0-31 + optional argument printer of function +=~ is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_string_tests.ml", line 349, characters 11-66 + optional argument cmp of function +=~ is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_string_tests.ml", line 349, characters 11-66 + optional argument msg of function +=~ is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_string_tests.ml", line 349, characters 11-66 + optional argument pp_diff of function +=~ is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_string_tests.ml", line 338, characters 11-64 + optional argument cmp of function +=~ is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_string_tests.ml", line 338, characters 11-64 + optional argument msg of function +=~ is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_string_tests.ml", line 338, characters 11-64 + optional argument pp_diff of function +=~ is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_string_tests.ml", line 329, characters 11-181 + optional argument cmp of function +=~ is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_string_tests.ml", line 329, characters 11-181 + optional argument msg of function +=~ is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_string_tests.ml", line 329, characters 11-181 + optional argument pp_diff of function +=~ is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_string_tests.ml", line 308, characters 11-64 + optional argument cmp of function +=~ is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_string_tests.ml", line 308, characters 11-64 + optional argument msg of function +=~ is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_string_tests.ml", line 308, characters 11-64 + optional argument pp_diff of function +=~ is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_string_tests.ml", line 131, characters 11-92 + optional argument cmp of function +=~ is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_string_tests.ml", line 131, characters 11-92 + optional argument msg of function +=~ is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_string_tests.ml", line 131, characters 11-92 + optional argument pp_diff of function +=~ is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_string_tests.ml", line 7, characters 0-58 + optional argument cmp of function +string_eq is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_string_tests.ml", line 7, characters 0-58 + optional argument msg of function +string_eq is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_string_tests.ml", line 7, characters 0-58 + optional argument pp_diff of function +string_eq is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_string_tests.ml", line 3, characters 0-53 + optional argument cmp of function +=~ is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_string_tests.ml", line 3, characters 0-53 + optional argument msg of function +=~ is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_string_tests.ml", line 3, characters 0-53 + optional argument pp_diff of function +=~ is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_utf8_test.ml", line 6, characters 0-31 + optional argument cmp of function +=~ is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_utf8_test.ml", line 6, characters 0-31 + optional argument msg of function +=~ is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_utf8_test.ml", line 6, characters 0-31 + optional argument pp_diff of function +=~ is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_utf8_test.ml", line 6, characters 0-31 + optional argument printer of function +=~ is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_util_tests.ml", line 3, characters 0-53 + optional argument cmp of function +=~ is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_util_tests.ml", line 3, characters 0-53 + optional argument msg of function +=~ is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_util_tests.ml", line 3, characters 0-53 + optional argument pp_diff of function +=~ is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_implementation.ml", line 157, characters 0-517 + optional argument outputprefix of function +implementation is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_implementation.ml", line 70, characters 0-502 + optional argument outputprefix of function +interface is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_tests_util.ml", line 7, characters 0-423 + optional argument msg of function +assert_raise_any is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reanalyze.ml", line 199, characters 0-11133 + optional argument file_stats of function +run_analysis is never used + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/cmd_ppx_apply.ml", line 120, characters 0-241 + optional argument restore of function +apply_rewriters is always supplied (4 calls) + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typemod.mli", line 43, characters 0-163 + optional argument used_slot of function +type_open_ is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/completion_back_end.ml", line 1595, characters 2-50 + optional argument additional_text_edits of function +create is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/completion_back_end.ml", line 1595, characters 2-50 + optional argument data of function +create is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/completion_back_end.ml", line 1595, characters 2-50 + optional argument detail of function +create is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/completion_back_end.ml", line 1595, characters 2-50 + optional argument filter_text of function +create is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/completion_back_end.ml", line 1595, characters 2-50 + optional argument synthetic of function +create is never used + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/translcore.ml", line 991, characters 0-2785 + optional argument inlined of function +transl_apply is always supplied (2 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/translcore.ml", line 991, characters 0-2785 + optional argument transformed_jsx of function +transl_apply is always supplied (2 calls) + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typemod.ml", line 88, characters 0-346 + optional argument used_slot of function +type_open_ is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_derive_js_mapper.ml", line 136, characters 0-30 + optional argument attrs of function +app2 is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_derive_js_mapper.ml", line 136, characters 0-30 + optional argument loc of function +app2 is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_derive_js_mapper.ml", line 134, characters 0-30 + optional argument attrs of function +app1 is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_derive_js_mapper.ml", line 134, characters 0-30 + optional argument loc of function +app1 is never used + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 344, characters 2-178 + optional argument attrs of function Te.+constructor is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 344, characters 2-178 + optional argument loc of function Te.+constructor is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 335, characters 2-246 + optional argument attrs of function Te.+mk is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 335, characters 2-246 + optional argument params of function Te.+mk is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 335, characters 2-246 + optional argument priv of function Te.+mk is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 323, characters 2-210 + optional argument attrs of function Type.+field is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 323, characters 2-210 + optional argument loc of function Type.+field is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 323, characters 2-210 + optional argument mut of function Type.+field is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 313, characters 2-226 + optional argument args of function Type.+constructor is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 313, characters 2-226 + optional argument attrs of function Type.+constructor is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 313, characters 2-226 + optional argument loc of function Type.+constructor is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 300, characters 2-372 + optional argument attrs of function Type.+mk is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 300, characters 2-372 + optional argument cstrs of function Type.+mk is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 300, characters 2-372 + optional argument kind of function Type.+mk is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 300, characters 2-372 + optional argument loc of function Type.+mk is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 300, characters 2-372 + optional argument params of function Type.+mk is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 300, characters 2-372 + optional argument priv of function Type.+mk is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 295, characters 2-131 + optional argument attrs of function Vb.+mk is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 295, characters 2-131 + optional argument loc of function Vb.+mk is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 290, characters 2-119 + optional argument attrs of function Incl.+mk is always supplied (2 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 290, characters 2-119 + optional argument loc of function Incl.+mk is always supplied (2 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 280, characters 2-193 + optional argument attrs of function Opn.+mk is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 280, characters 2-193 + optional argument loc of function Opn.+mk is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 280, characters 2-193 + optional argument override of function Opn.+mk is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 275, characters 2-134 + optional argument attrs of function Mb.+mk is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 275, characters 2-134 + optional argument loc of function Mb.+mk is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 270, characters 2-137 + optional argument attrs of function Mtd.+mk is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 270, characters 2-137 + optional argument loc of function Mtd.+mk is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 265, characters 2-132 + optional argument attrs of function Md.+mk is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 265, characters 2-132 + optional argument loc of function Md.+mk is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 254, characters 2-204 + optional argument attrs of function Val.+mk is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 254, characters 2-204 + optional argument loc of function Val.+mk is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 254, characters 2-204 + optional argument prim of function Val.+mk is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 250, characters 2-51 + optional argument loc of function Str.+attribute is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 249, characters 2-74 + optional argument attrs of function Str.+extension is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 249, characters 2-74 + optional argument loc of function Str.+extension is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 248, characters 2-48 + optional argument loc of function Str.+include_ is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 247, characters 2-42 + optional argument loc of function Str.+open_ is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 246, characters 2-47 + optional argument loc of function Str.+modtype is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 245, characters 2-52 + optional argument loc of function Str.+rec_module is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 244, characters 2-46 + optional argument loc of function Str.+module_ is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 243, characters 2-52 + optional argument loc of function Str.+exception_ is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 242, characters 2-53 + optional argument loc of function Str.+type_extension is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 241, characters 2-63 + optional argument loc of function Str.+type_ is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 240, characters 2-51 + optional argument loc of function Str.+primitive is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 239, characters 2-50 + optional argument loc of function Str.+value is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 232, characters 2-51 + optional argument loc of function Sig.+attribute is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 231, characters 2-74 + optional argument attrs of function Sig.+extension is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 231, characters 2-74 + optional argument loc of function Sig.+extension is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 229, characters 2-48 + optional argument loc of function Sig.+include_ is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 228, characters 2-42 + optional argument loc of function Sig.+open_ is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 227, characters 2-47 + optional argument loc of function Sig.+modtype is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 226, characters 2-52 + optional argument loc of function Sig.+rec_module is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 225, characters 2-46 + optional argument loc of function Sig.+module_ is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 224, characters 2-52 + optional argument loc of function Sig.+exception_ is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 223, characters 2-53 + optional argument loc of function Sig.+type_extension is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 222, characters 2-63 + optional argument loc of function Sig.+type_ is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 221, characters 2-43 + optional argument loc of function Sig.+value is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 215, characters 2-65 + optional argument attrs of function Mod.+extension is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 215, characters 2-65 + optional argument loc of function Mod.+extension is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 214, characters 2-59 + optional argument attrs of function Mod.+unpack is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 214, characters 2-59 + optional argument loc of function Mod.+unpack is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 213, characters 2-79 + optional argument attrs of function Mod.+constraint_ is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 213, characters 2-79 + optional argument loc of function Mod.+constraint_ is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 212, characters 2-68 + optional argument attrs of function Mod.+apply is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 212, characters 2-68 + optional argument loc of function Mod.+apply is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 210, characters 2-98 + optional argument attrs of function Mod.+functor_ is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 210, characters 2-98 + optional argument loc of function Mod.+functor_ is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 209, characters 2-65 + optional argument attrs of function Mod.+structure is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 209, characters 2-65 + optional argument loc of function Mod.+structure is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 208, characters 2-57 + optional argument attrs of function Mod.+ident is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 208, characters 2-57 + optional argument loc of function Mod.+ident is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 200, characters 2-65 + optional argument attrs of function Mty.+extension is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 200, characters 2-65 + optional argument loc of function Mty.+extension is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 199, characters 2-60 + optional argument attrs of function Mty.+typeof_ is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 199, characters 2-60 + optional argument loc of function Mty.+typeof_ is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 198, characters 2-63 + optional argument attrs of function Mty.+with_ is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 198, characters 2-63 + optional argument loc of function Mty.+with_ is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 197, characters 2-74 + optional argument attrs of function Mty.+functor_ is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 197, characters 2-74 + optional argument loc of function Mty.+functor_ is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 196, characters 2-65 + optional argument attrs of function Mty.+signature is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 196, characters 2-65 + optional argument loc of function Mty.+signature is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 195, characters 2-57 + optional argument attrs of function Mty.+alias is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 195, characters 2-57 + optional argument loc of function Mty.+alias is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 194, characters 2-57 + optional argument attrs of function Mty.+ident is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 194, characters 2-57 + optional argument loc of function Mty.+ident is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 184, characters 2-65 + optional argument attrs of function Exp.+extension is always supplied (3 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 184, characters 2-65 + optional argument loc of function Exp.+extension is always supplied (3 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 183, characters 2-68 + optional argument attrs of function Exp.+open_ is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 183, characters 2-68 + optional argument loc of function Exp.+open_ is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 182, characters 2-55 + optional argument attrs of function Exp.+pack is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 182, characters 2-55 + optional argument loc of function Exp.+pack is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 181, characters 2-68 + optional argument attrs of function Exp.+newtype is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 181, characters 2-68 + optional argument loc of function Exp.+newtype is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 178, characters 2-60 + optional argument attrs of function Exp.+assert_ is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 178, characters 2-60 + optional argument loc of function Exp.+assert_ is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 177, characters 2-78 + optional argument attrs of function Exp.+letexception is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 177, characters 2-78 + optional argument loc of function Exp.+letexception is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 176, characters 2-77 + optional argument attrs of function Exp.+letmodule is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 176, characters 2-77 + optional argument loc of function Exp.+letmodule is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 172, characters 2-62 + optional argument attrs of function Exp.+send is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 172, characters 2-62 + optional argument loc of function Exp.+send is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 171, characters 2-70 + optional argument attrs of function Exp.+coerce is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 171, characters 2-70 + optional argument loc of function Exp.+coerce is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 170, characters 2-75 + optional argument attrs of function Exp.+constraint_ is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 170, characters 2-75 + optional argument loc of function Exp.+constraint_ is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 169, characters 2-76 + optional argument attrs of function Exp.+for_ is always supplied (3 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 169, characters 2-76 + optional argument loc of function Exp.+for_ is always supplied (3 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 168, characters 2-65 + optional argument attrs of function Exp.+while_ is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 168, characters 2-65 + optional argument loc of function Exp.+while_ is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 167, characters 2-70 + optional argument attrs of function Exp.+sequence is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 167, characters 2-70 + optional argument loc of function Exp.+sequence is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 166, characters 2-79 + optional argument attrs of function Exp.+ifthenelse is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 166, characters 2-79 + optional argument loc of function Exp.+ifthenelse is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 165, characters 2-57 + optional argument attrs of function Exp.+array is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 165, characters 2-57 + optional argument loc of function Exp.+array is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 164, characters 2-75 + optional argument attrs of function Exp.+setfield is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 164, characters 2-75 + optional argument loc of function Exp.+setfield is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 163, characters 2-64 + optional argument attrs of function Exp.+field is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 163, characters 2-64 + optional argument loc of function Exp.+field is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 162, characters 2-66 + optional argument attrs of function Exp.+record is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 162, characters 2-66 + optional argument loc of function Exp.+record is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 161, characters 2-68 + optional argument attrs of function Exp.+variant is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 161, characters 2-68 + optional argument loc of function Exp.+variant is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 159, characters 2-57 + optional argument attrs of function Exp.+tuple is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 159, characters 2-57 + optional argument loc of function Exp.+tuple is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 158, characters 2-61 + optional argument attrs of function Exp.+try_ is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 158, characters 2-61 + optional argument loc of function Exp.+try_ is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 157, characters 2-65 + optional argument attrs of function Exp.+match_ is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 157, characters 2-65 + optional argument loc of function Exp.+match_ is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 156, characters 2-64 + optional argument attrs of function Exp.+apply is always supplied (3 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 156, characters 2-64 + optional argument loc of function Exp.+apply is always supplied (3 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 154, characters 2-71 + optional argument attrs of function Exp.+fun_ is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 154, characters 2-71 + optional argument loc of function Exp.+fun_ is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 153, characters 2-66 + optional argument attrs of function Exp.+let_ is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 153, characters 2-66 + optional argument loc of function Exp.+let_ is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 143, characters 2-65 + optional argument attrs of function Pat.+extension is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 143, characters 2-65 + optional argument loc of function Pat.+extension is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 142, characters 2-66 + optional argument attrs of function Pat.+exception_ is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 142, characters 2-66 + optional argument loc of function Pat.+exception_ is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 141, characters 2-63 + optional argument attrs of function Pat.+open_ is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 141, characters 2-63 + optional argument loc of function Pat.+open_ is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 140, characters 2-59 + optional argument attrs of function Pat.+unpack is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 140, characters 2-59 + optional argument loc of function Pat.+unpack is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 138, characters 2-56 + optional argument attrs of function Pat.+type_ is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 138, characters 2-56 + optional argument loc of function Pat.+type_ is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 137, characters 2-75 + optional argument attrs of function Pat.+constraint_ is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 137, characters 2-75 + optional argument loc of function Pat.+constraint_ is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 136, characters 2-59 + optional argument attrs of function Pat.+or_ is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 136, characters 2-59 + optional argument loc of function Pat.+or_ is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 135, characters 2-57 + optional argument attrs of function Pat.+array is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 135, characters 2-57 + optional argument loc of function Pat.+array is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 134, characters 2-66 + optional argument attrs of function Pat.+record is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 134, characters 2-66 + optional argument loc of function Pat.+record is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 133, characters 2-68 + optional argument attrs of function Pat.+variant is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 133, characters 2-68 + optional argument loc of function Pat.+variant is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 132, characters 2-72 + optional argument attrs of function Pat.+construct is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 132, characters 2-72 + optional argument loc of function Pat.+construct is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 131, characters 2-57 + optional argument attrs of function Pat.+tuple is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 131, characters 2-57 + optional argument loc of function Pat.+tuple is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 130, characters 2-70 + optional argument attrs of function Pat.+interval is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 130, characters 2-70 + optional argument loc of function Pat.+interval is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 129, characters 2-63 + optional argument attrs of function Pat.+constant is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 129, characters 2-63 + optional argument loc of function Pat.+constant is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 128, characters 2-64 + optional argument attrs of function Pat.+alias is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 128, characters 2-64 + optional argument loc of function Pat.+alias is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 127, characters 2-53 + optional argument attrs of function Pat.+var is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 127, characters 2-53 + optional argument loc of function Pat.+var is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 126, characters 2-50 + optional argument attrs of function Pat.+any is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 126, characters 2-50 + optional argument loc of function Pat.+any is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 65, characters 2-65 + optional argument attrs of function Typ.+extension is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 65, characters 2-65 + optional argument loc of function Typ.+extension is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 64, characters 2-68 + optional argument attrs of function Typ.+package is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 64, characters 2-68 + optional argument loc of function Typ.+package is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 63, characters 2-62 + optional argument loc of function Typ.+poly is always supplied (2 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 62, characters 2-73 + optional argument loc of function Typ.+variant is always supplied (2 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 61, characters 2-64 + optional argument attrs of function Typ.+alias is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 61, characters 2-64 + optional argument loc of function Typ.+alias is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 60, characters 2-67 + optional argument attrs of function Typ.+object_ is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 60, characters 2-67 + optional argument loc of function Typ.+object_ is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 59, characters 2-66 + optional argument loc of function Typ.+constr is always supplied (2 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 58, characters 2-57 + optional argument attrs of function Typ.+tuple is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 58, characters 2-57 + optional argument loc of function Typ.+tuple is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 57, characters 2-69 + optional argument attrs of function Typ.+arrow is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 57, characters 2-69 + optional argument loc of function Typ.+arrow is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 56, characters 2-53 + optional argument attrs of function Typ.+var is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 56, characters 2-53 + optional argument loc of function Typ.+var is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 55, characters 2-50 + optional argument attrs of function Typ.+any is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 55, characters 2-50 + optional argument loc of function Typ.+any is always supplied (1 calls) + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/bsc_args.mli", line 47, characters 0-139 + optional argument finish of function +parse_exn is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/type_utils.ml", line 1277, characters 0-1082 + optional argument pos_of_dot of function +filter_pipeable_functions is never used + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/type_utils.ml", line 1277, characters 0-1082 + optional argument synthetic of function +filter_pipeable_functions is always supplied (4 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/type_utils.ml", line 1277, characters 0-1082 + optional argument target_type_id of function +filter_pipeable_functions is always supplied (4 calls) + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/type_utils.ml", line 588, characters 2-51 + optional argument print_opening_debug of function +extract_type is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/type_utils.ml", line 588, characters 2-51 + optional argument type_arg_context_from_type_manifest of function +extract_type is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/type_utils.ml", line 179, characters 0-2146 + optional argument type_arg_context of function +instantiate_type2 is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.ml", line 37, characters 0-182 + optional argument comment of function +block is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/bsc_args.ml", line 99, characters 0-1158 + optional argument finish of function +parse_exn is never used + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/syntax/src/res_driver.ml", line 211, characters 0-399 + optional argument ignore_parse_errors of function +parse_interface is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/syntax/src/res_driver.ml", line 200, characters 0-409 + optional argument ignore_parse_errors of function +parse_implementation is always supplied (1 calls) + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 316, characters 0-71 + optional argument comment of function +array is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 314, characters 0-68 + optional argument comment of function +new_ is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 46, characters 0-46 + optional argument comment of function +js_global is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_external_mk.mli", line 45, characters 0-298 + optional argument local_fun_name of function +local_external_obj is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_external_mk.mli", line 45, characters 0-298 + optional argument local_module_name of function +local_external_obj is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_external_mk.mli", line 45, characters 0-298 + optional argument pval_attributes of function +local_external_obj is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_external_mk.mli", line 25, characters 0-265 + optional argument local_fun_name of function +local_external_apply is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_external_mk.mli", line 25, characters 0-265 + optional argument local_module_name of function +local_external_apply is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_external_mk.mli", line 25, characters 0-265 + optional argument pval_attributes of function +local_external_apply is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typecore.ml", line 4621, characters 0-76 + optional argument unif of function +super_report_unification_error is never used + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typecore.ml", line 1743, characters 0-231 + optional argument lev of function +check_unused is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typecore.ml", line 1714, characters 0-492 + optional argument explode of function +partial_pred is always supplied (2 calls) + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typecore.ml", line 1150, characters 2-61 + optional argument from_type of function Constructor.+unbound_name_error is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typecore.ml", line 972, characters 2-55 + optional argument from_type of function Label.+unbound_name_error is never used + + Warning Incorrect Annotation + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/syntax/src/res_io.mli", line 7, characters 0-82 + +write_file is annotated @dead but is live + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 370, characters 0-74 + optional argument comment of function +float is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 343, characters 0-108 + optional argument comment of function +bigint is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 215, characters 0-80 + optional argument comment of function +new_ is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 168, characters 0-74 + optional argument comment of function +array is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 82, characters 0-317 + optional argument comment of function +runtime_var_dot is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 62, characters 0-74 + optional argument comment of function +js_global is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_external_mk.ml", line 62, characters 0-1047 + optional argument local_fun_name of function +local_external_obj is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_external_mk.ml", line 62, characters 0-1047 + optional argument local_module_name of function +local_external_obj is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_external_mk.ml", line 62, characters 0-1047 + optional argument pval_attributes of function +local_external_obj is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_external_mk.ml", line 25, characters 0-1123 + optional argument local_fun_name of function +local_external_apply is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_external_mk.ml", line 25, characters 0-1123 + optional argument local_module_name of function +local_external_apply is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_external_mk.ml", line 25, characters 0-1123 + optional argument pval_attributes of function +local_external_apply is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/syntax/src/res_core.ml", line 5923, characters 0-1468 + optional argument current_type_name_path of function +parse_spread_tail_classified is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/syntax/src/res_core.ml", line 5923, characters 0-1468 + optional argument inline_types_context of function +parse_spread_tail_classified is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_compatible.mli", line 74, characters 0-130 + optional argument async of function +fun_ is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_compatible.mli", line 74, characters 0-130 + optional argument attrs of function +fun_ is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_compatible.mli", line 74, characters 0-130 + optional argument loc of function +fun_ is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_compatible.mli", line 61, characters 0-179 + optional argument attrs of function +apply_labels is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_compatible.mli", line 44, characters 0-110 + optional argument attrs of function +app2 is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_compatible.mli", line 38, characters 0-99 + optional argument attrs of function +apply_simple is never used + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/parmatch.ml", line 2047, characters 0-2615 + optional argument pred of function +do_check_partial is always supplied (1 calls) + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/parmatch.ml", line 950, characters 0-927 + optional argument always of function +pats_of_type is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_compatible.ml", line 121, characters 0-438 + optional argument attrs of function +apply_labels is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_compatible.ml", line 90, characters 0-319 + optional argument async of function +fun_ is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_compatible.ml", line 90, characters 0-319 + optional argument attrs of function +fun_ is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_compatible.ml", line 90, characters 0-319 + optional argument loc of function +fun_ is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_compatible.ml", line 62, characters 0-319 + optional argument attrs of function +app2 is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_compatible.ml", line 33, characters 0-377 + optional argument attrs of function +apply_simple is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/pprintast.ml", line 220, characters 0-346 + optional argument first of function +paren is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/pprintast.ml", line 220, characters 0-346 + optional argument last of function +paren is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typetexp.mli", line 102, characters 0-91 + optional argument from_type of function +unbound_label_error is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typetexp.mli", line 100, characters 0-97 + optional argument from_type of function +unbound_constructor_error is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/shared_types.ml", line 862, characters 2-570 + optional argument data of function Completion.+create is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/shared_types.ml", line 862, characters 2-570 + optional argument filter_text of function Completion.+create is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typetexp.ml", line 173, characters 0-141 + optional argument from_type of function +unbound_label_error is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typetexp.ml", line 168, characters 0-160 + optional argument from_type of function +unbound_constructor_error is never used + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/utils.ml", line 247, characters 0-555 + optional argument allow_uident of function +print_maybe_exotic_ident is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_ident.ml", line 84, characters 0-597 + optional argument op of function +convert is always supplied (1 calls) + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/printtyp.mli", line 84, characters 0-238 + optional argument print_extra_info of function +super_report_unification_error is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/printtyp.mli", line 84, characters 0-238 + optional argument unif of function +super_report_unification_error is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/printtyp.mli", line 75, characters 0-163 + optional argument unif of function +report_unification_error is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/printtyp.ml", line 1563, characters 0-200 + optional argument print_extra_info of function +super_report_unification_error is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/printtyp.ml", line 1563, characters 0-200 + optional argument unif of function +super_report_unification_error is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/printtyp.ml", line 1503, characters 0-146 + optional argument unif of function +report_unification_error is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/printtyp.ml", line 960, characters 0-106 + optional argument printing_context of function +typexp is never used + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/printtyp.ml", line 950, characters 0-310 + optional argument printing_context of function +tree_of_constraints is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/printtyp.ml", line 911, characters 0-1065 + optional argument printing_context of function +tree_of_constructor is always supplied (1 calls) + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.mli", line 322, characters 0-62 + optional argument env of function +free_variables is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 3563, characters 0-97 + optional argument ctx of function +subtype_error is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 475, characters 0-98 + optional argument env of function +free_variables is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 116, characters 0-90 + optional argument loc of function +lookup_modtype is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 110, characters 0-63 + optional argument loc of function +lookup_type is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 105, characters 0-112 + optional argument loc of function +lookup_all_labels is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 99, characters 0-124 + optional argument loc of function +lookup_all_constructors is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 97, characters 0-89 + optional argument loc of function +lookup_constructor is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 95, characters 0-86 + optional argument loc of function +lookup_value is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 1268, characters 0-295 + optional argument loc of function +lookup_all_labels is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 1234, characters 0-313 + optional argument loc of function +lookup_all_constructors is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 1222, characters 0-206 + optional argument loc of function +lookup_constructor is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 1206, characters 0-137 + optional argument loc of function +lookup_type is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 1201, characters 0-138 + optional argument loc of function +lookup_value is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 1145, characters 0-84 + optional argument loc of function +lookup_modtype is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 1104, characters 0-663 + optional argument loc of function +lookup_all_simple is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 1092, characters 0-391 + optional argument loc of function +lookup is never used + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_async.ml", line 7, characters 0-320 + optional argument loc of function +add_promise_type is always supplied (1 calls) + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/btype.mli", line 37, characters 0-49 + optional argument name of function +newgenvar is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/btype.ml", line 50, characters 0-45 + optional argument name of function +newgenvar is never used + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper.mli", line 72, characters 2-75 + optional argument loc of function Typ.+poly is always supplied (6 calls) + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper.mli", line 59, characters 2-77 + optional argument attrs of function Typ.+arrows is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper.mli", line 41, characters 2-43 + optional argument suffix of function Const.+int is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper.mli", line 39, characters 2-64 + optional argument quotation_delimiter of function Const.+string is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/asttypes.ml", line 62, characters 0-175 + optional argument loc of function +to_arg_label is never used + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper.ml", line 73, characters 2-62 + optional argument loc of function Typ.+poly is always supplied (1 calls) + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper.ml", line 59, characters 2-341 + optional argument attrs of function Typ.+arrows is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper.ml", line 47, characters 2-76 + optional argument quotation_delimiter of function Const.+string is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper.ml", line 41, characters 2-55 + optional argument suffix of function Const.+int is never used + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/location.mli", line 106, characters 0-108 + optional argument custom_intro of function +report_error is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/location.mli", line 106, characters 0-108 + optional argument src of function +report_error is always supplied (1 calls) + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/location.mli", line 85, characters 0-128 + optional argument if_highlight of function +raise_errorf is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/location.mli", line 85, characters 0-128 + optional argument sub of function +raise_errorf is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/location.mli", line 78, characters 0-125 + optional argument if_highlight of function +errorf is never used + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/location.mli", line 78, characters 0-125 + optional argument loc of function +errorf is always supplied (3 calls) + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/location.ml", line 297, characters 0-177 + optional argument if_highlight of function +raise_errorf is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/location.ml", line 297, characters 0-177 + optional argument sub of function +raise_errorf is never used + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/location.ml", line 255, characters 0-108 + optional argument custom_intro of function +report_error is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/location.ml", line 255, characters 0-108 + optional argument src of function +report_error is always supplied (1 calls) + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/location.ml", line 205, characters 0-167 + optional argument if_highlight of function +errorf is never used + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/location.ml", line 205, characters 0-167 + optional argument loc of function +errorf is always supplied (3 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/location.ml", line 183, characters 0-326 + optional argument before of function +pp_ksprintf is always supplied (2 calls) + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 18, characters 0-24 + +remove is never used + <-- line 18 + let remove k = (k, None) [@@dead "+remove"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 25, characters 0-232 + +merge_entries is never used + <-- line 25 + Hashtbl.fold (fun k v acc -> (k, v) :: acc) tbl [] [@@dead "+merge_entries"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 74, characters 0-223 + +count_changes is never used + <-- line 74 + (!adds, !removes) [@@dead "+count_changes"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 111, characters 2-261 + Registry.+register is never used + <-- line 111 + info [@@dead "Registry.+register"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 440, characters 2-35 + Scheduler.+wave_count is never used + <-- line 440 + let wave_count () = !wave_counter [@@dead "Scheduler.+wave_count"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 441, characters 2-45 + Scheduler.+reset_wave_count is never used + <-- line 441 + let reset_wave_count () = wave_counter := 0 [@@dead "Scheduler.+reset_wave_count"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 460, characters 0-21 + +level is never used + <-- line 460 + let level t = t.level [@@dead "+level"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 461, characters 0-19 + +name is never used + <-- line 461 + let name t = t.name [@@dead "+name"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 473, characters 2-648 + +process is never used + <-- line 473 + List.iter (fun h -> h delta) !subscribers)) [@@dead "+process"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 490, characters 2-71 + +_info is never used + <-- line 490 + let _info = Registry.register ~name ~level:0 ~process ~stats:my_stats [@@dead "+_info"] in + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 537, characters 2-82 + +merge_fn is never used + <-- line 537 + | None -> fun _ v -> v [@@dead "+merge_fn"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 555, characters 2-614 + +recompute_target is never used + <-- line 555 + Some (k2, Some merged) [@@dead "+recompute_target"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 576, characters 2-358 + +remove_source is never used + <-- line 576 + target_keys [@@dead "+remove_source"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 608, characters 2-550 + +process_entry is never used + <-- line 608 + all_affected [@@dead "+process_entry"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 629, characters 2-1165 + +process is never used + <-- line 629 + List.iter (fun h -> h delta) !subscribers)) [@@dead "+process"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 656, characters 2-82 + +_info is never used + <-- line 656 + Registry.register ~name ~level:my_level ~process ~stats:my_stats [@@dead "+_info"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 699, characters 2-82 + +merge_fn is never used + <-- line 699 + | None -> fun _ v -> v [@@dead "+merge_fn"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 721, characters 2-614 + +recompute_target is never used + <-- line 721 + Some (k3, Some merged) [@@dead "+recompute_target"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 801, characters 2-462 + +remove_left_entry is never used + <-- line 801 + affected [@@dead "+remove_left_entry"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 816, characters 2-2770 + +process is never used + <-- line 816 + List.iter (fun h -> h delta) !subscribers) [@@dead "+process"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 895, characters 2-82 + +_info is never used + <-- line 895 + Registry.register ~name ~level:my_level ~process ~stats:my_stats [@@dead "+_info"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 950, characters 2-403 + +recompute_target is never used + <-- line 950 + Some (k, Some merged) [@@dead "+recompute_target"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 964, characters 2-2260 + +process is never used + <-- line 964 + List.iter (fun h -> h delta) !subscribers) [@@dead "+process"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 1030, characters 2-82 + +_info is never used + <-- line 1030 + Registry.register ~name ~level:my_level ~process ~stats:my_stats [@@dead "+_info"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 1088, characters 2-524 + +emit_output is never used + <-- line 1088 + List.iter (fun h -> h delta) !subscribers) [@@dead "+emit_output"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 1100, characters 2-1019 + +process is never used + <-- line 1100 + emit_output output_entries [@@dead "+process"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 1130, characters 2-82 + +_info is never used + <-- line 1130 + Registry.register ~name ~level:my_level ~process ~stats:my_stats [@@dead "+_info"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.mli", line 21, characters 0-33 + +remove is never used + <-- line 21 + val remove : 'k -> 'k * 'v option [@@dead "+remove"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.mli", line 24, characters 0-62 + +delta_to_entries is never used + <-- line 24 + val delta_to_entries : ('k, 'v) delta -> ('k * 'v option) list [@@dead "+delta_to_entries"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.mli", line 48, characters 0-32 + +create_stats is never used + <-- line 48 + val create_stats : unit -> stats [@@dead "+create_stats"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.mli", line 52, characters 0-319 + reactive.Registry is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.mli", line 56, characters 2-26 + Registry.+clear is never used + <-- line 56 + val clear : unit -> unit [@@dead "Registry.+clear"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.mli", line 59, characters 2-33 + Registry.+to_mermaid is never used + <-- line 59 + val to_mermaid : unit -> string [@@dead "Registry.+to_mermaid"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.mli", line 62, characters 2-32 + Registry.+print_stats is never used + <-- line 62 + val print_stats : unit -> unit [@@dead "Registry.+print_stats"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.mli", line 68, characters 0-403 + reactive.Scheduler is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.mli", line 69, characters 2-30 + Scheduler.+propagate is never used + <-- line 69 + val propagate : unit -> unit [@@dead "Scheduler.+propagate"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.mli", line 73, characters 2-35 + Scheduler.+is_propagating is never used + <-- line 73 + val is_propagating : unit -> bool [@@dead "Scheduler.+is_propagating"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.mli", line 76, characters 2-30 + Scheduler.+wave_count is never used + <-- line 76 + val wave_count : unit -> int [@@dead "Scheduler.+wave_count"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.mli", line 79, characters 2-37 + Scheduler.+reset_wave_count is never used + <-- line 79 + val reset_wave_count : unit -> unit [@@dead "Scheduler.+reset_wave_count"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.mli", line 100, characters 0-29 + +level is never used + <-- line 100 + val level : ('k, 'v) t -> int [@@dead "+level"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.mli", line 101, characters 0-31 + +name is never used + <-- line 101 + val name : ('k, 'v) t -> string [@@dead "+name"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive_file_collection.ml", line 43, characters 0-416 + +process_if_changed is never used + <-- line 43 + true [@@dead "+process_if_changed"] (* changed *) + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive_file_collection.ml", line 56, characters 0-94 + +process_files is never used + <-- line 56 + List.iter (fun path -> ignore (process_if_changed t path)) paths [@@dead "+process_files"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive_file_collection.ml", line 81, characters 0-91 + +remove is never used + <-- line 81 + emit t (Reactive.Remove path) [@@dead "+remove"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive_file_collection.ml", line 99, characters 0-44 + +clear is never used + <-- line 99 + let clear t = Hashtbl.clear t.internal.cache [@@dead "+clear"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive_file_collection.ml", line 102, characters 0-60 + +invalidate is never used + <-- line 102 + let invalidate t path = Hashtbl.remove t.internal.cache path [@@dead "+invalidate"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive_file_collection.ml", line 104, characters 0-111 + +get is never used + <-- line 104 + | None -> None [@@dead "+get"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive_file_collection.ml", line 110, characters 0-43 + +length is never used + <-- line 110 + let length t = Reactive.length t.collection [@@dead "+length"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive_file_collection.mli", line 42, characters 0-55 + +process_files is never used + <-- line 42 + val process_files : ('raw, 'v) t -> string list -> unit [@@dead "+process_files"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive_file_collection.mli", line 51, characters 0-55 + +process_if_changed is never used + <-- line 51 + val process_if_changed : ('raw, 'v) t -> string -> bool [@@dead "+process_if_changed"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive_file_collection.mli", line 54, characters 0-43 + +remove is never used + <-- line 54 + val remove : ('raw, 'v) t -> string -> unit [@@dead "+remove"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive_file_collection.mli", line 63, characters 0-47 + +invalidate is never used + <-- line 63 + val invalidate : ('raw, 'v) t -> string -> unit [@@dead "+invalidate"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive_file_collection.mli", line 64, characters 0-32 + +clear is never used + <-- line 64 + val clear : ('raw, 'v) t -> unit [@@dead "+clear"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive_file_collection.mli", line 68, characters 0-45 + +get is never used + <-- line 68 + val get : ('raw, 'v) t -> string -> 'v option [@@dead "+get"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive_file_collection.mli", line 70, characters 0-32 + +length is never used + <-- line 70 + val length : ('raw, 'v) t -> int [@@dead "+length"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive_fixpoint.ml", line 16, characters 0-674 + +analyze_edge_change is never used + <-- line 16 + (removed_targets, has_new_edge) [@@dead "+analyze_edge_change"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive_fixpoint.ml", line 106, characters 2-1492 + Metrics.+update is never used + <-- line 106 + max totals.max_rederived_nodes rederived_nodes) [@@dead "Metrics.+update"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive_fixpoint.ml", line 189, characters 2-87 + Invariants.+assert_ is never used + <-- line 189 + if enabled && not condition then failwith message [@@dead "Invariants.+assert_"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive_fixpoint.ml", line 192, characters 2-142 + Invariants.+copy_set is never used + <-- line 192 + out [@@dead "Invariants.+copy_set"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive_fixpoint.ml", line 197, characters 2-177 + Invariants.+set_equal is never used + <-- line 197 + !ok [@@dead "Invariants.+set_equal"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive_fixpoint.ml", line 204, characters 2-673 + Invariants.+assert_edge_changes_consistent is never used + <-- line 204 + edge_changes [@@dead "Invariants.+assert_edge_changes_consistent"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive_fixpoint.ml", line 220, characters 2-736 + Invariants.+assert_deleted_nodes_closed is never used + <-- line 220 + deleted_nodes [@@dead "Invariants.+assert_deleted_nodes_closed"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive_fixpoint.ml", line 239, characters 2-428 + Invariants.+assert_current_minus_deleted is never used + <-- line 239 + deleted") [@@dead "Invariants.+assert_current_minus_deleted"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive_fixpoint.ml", line 249, characters 2-442 + Invariants.+assert_no_supported_deleted_left is never used + <-- line 249 + deleted_nodes [@@dead "Invariants.+assert_no_supported_deleted_left"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive_fixpoint.ml", line 261, characters 2-698 + Invariants.+assert_removal_output_matches is never used + <-- line 261 + "ReactiveFixpoint.apply invariant failed: removal output mismatch") [@@dead "Invariants.+assert_removal_output_matches"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive_fixpoint.ml", line 277, characters 2-2048 + Invariants.+assert_final_fixpoint_and_delta is never used + <-- line 277 + (Hashtbl.length actual_removes))) [@@dead "Invariants.+assert_final_fixpoint_and_delta"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive_fixpoint.ml", line 368, characters 0-291 + +has_live_predecessor is never used + <-- line 368 + with Found_live_pred -> true) [@@dead "+has_live_predecessor"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive_fixpoint.ml", line 422, characters 0-7005 + +apply is never used + <-- line 422 + !output_entries [@@dead "+apply"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive_fixpoint.mli", line 36, characters 0-134 + +apply is never used + <-- line 36 + ('k * unit option) list [@@dead "+apply"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/analysis_result.ml", line 11, characters 0-62 + +add_issue is never used + <-- line 11 + let add_issue result issue = {issues = issue :: result.issues} [@@dead "+add_issue"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/analysis_result.ml", line 18, characters 0-50 + +issue_count is never used + <-- line 18 + let issue_count result = List.length result.issues [@@dead "+issue_count"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/analysis_result.mli", line 12, characters 0-33 + +add_issue is never used + <-- line 12 + val add_issue : t -> Issue.t -> t [@@dead "+add_issue"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/analysis_result.mli", line 21, characters 0-26 + +issue_count is never used + <-- line 21 + val issue_count : t -> int [@@dead "+issue_count"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/arnold.ml", line 33, characters 2-134 + Function_args.+compare_arg is never used + <-- line 33 + if n <> 0 then n else compare a1.function_name a2.function_name [@@dead "Function_args.+compare_arg"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/arnold.ml", line 37, characters 2-217 + Function_args.+compare is never used + <-- line 37 + if n <> 0 then n else compare l1 l2 [@@dead "Function_args.+compare"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/arnold.ml", line 74, characters 2-170 + Function_call.+compare is never used + <-- line 74 + else Function_args.compare x1.function_args x2.function_args [@@dead "Function_call.+compare"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/collect_annotations.ml", line 93, characters 13-571 + +_process_inline_records is never used + <-- line 93 + | Cstr_tuple _ -> () [@@dead "+_process_inline_records"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/cross_file_items_store.mli", line 18, characters 0-89 + +iter_optional_arg_calls is never used + <-- line 18 + t -> (Cross_file_items.optional_arg_call -> unit) -> unit [@@dead "+iter_optional_arg_calls"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/cross_file_items_store.mli", line 22, characters 0-77 + +iter_function_refs is never used + <-- line 22 + val iter_function_refs : t -> (Cross_file_items.function_ref -> unit) -> unit [@@dead "+iter_function_refs"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/dead_code.ml", line 1, characters 0-0 + +dead_code is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/dead_code.ml", line 4, characters 0-54 + +process_cmt is never used + <-- line 4 + let process_cmt = Dce_file_processing.process_cmt_file [@@dead "+process_cmt"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/dead_common.ml", line 19, characters 2-43 + Config.+warn_on_circular_dependencies is never used + <-- line 19 + let warn_on_circular_dependencies = false [@@dead "Config.+warn_on_circular_dependencies"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/dead_common.ml", line 475, characters 0-5529 + +solve_dead_reactive is never used + <-- line 475 + Analysis_result.add_issues Analysis_result.empty all_issues [@@dead "+solve_dead_reactive"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/dead_exception.ml", line 3, characters 0-93 + +dead_exception.Path_map is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/dead_exception.ml", line 6, characters 2-30 + Path_map.+compare is never used + <-- line 6 + let compare = Stdlib.compare [@@dead "Path_map.+compare"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/dead_type.ml", line 45, characters 8-376 + +_handle_inline_records is never used + <-- line 45 + | Cstr_tuple _ -> () [@@dead "+_handle_inline_records"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/dead_type.ml", line 71, characters 0-93 + +dead_type.Path_map is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/dead_type.ml", line 74, characters 2-30 + Path_map.+compare is never used + <-- line 74 + let compare = Stdlib.compare [@@dead "Path_map.+compare"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/decl.ml", line 57, characters 0-759 + +compare_using_dependencies is never used + <-- line 57 + (position2, lnum1, bol1, cnum1, kind2) [@@dead "+compare_using_dependencies"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/declarations.ml", line 38, characters 0-55 + +create_from_hashtbl is never used + <-- line 38 + let create_from_hashtbl (h : Decl.t Pos_hash.t) : t = h [@@dead "+create_from_hashtbl"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/declarations.ml", line 48, characters 0-38 + +length is never used + <-- line 48 + let length (t : t) = Pos_hash.length t [@@dead "+length"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/declarations.mli", line 33, characters 0-48 + +create_from_hashtbl is never used + <-- line 33 + val create_from_hashtbl : Decl.t Pos_hash.t -> t [@@dead "+create_from_hashtbl"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/declarations.mli", line 42, characters 0-21 + +length is never used + <-- line 42 + val length : t -> int [@@dead "+length"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/exn.ml", line 3, characters 0-28 + +compare is never used + <-- line 3 + let compare = String.compare [@@dead "+compare"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/exn.ml", line 7, characters 0-31 + +end_of_file is never used + <-- line 7 + let end_of_file = "End_of_file" [@@dead "+end_of_file"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/exn.ml", line 8, characters 0-17 + +exit is never used + <-- line 8 + let exit = "exit" [@@dead "+exit"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/exn.ml", line 14, characters 0-27 + +sys_error is never used + <-- line 14 + let sys_error = "Sys_error" [@@dead "+sys_error"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/exn.mli", line 3, characters 0-27 + +compare is never used + <-- line 3 + val compare : t -> t -> int [@@dead "+compare"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/exn.mli", line 7, characters 0-19 + +end_of_file is never used + <-- line 7 + val end_of_file : t [@@dead "+end_of_file"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/exn.mli", line 8, characters 0-12 + +exit is never used + <-- line 8 + val exit : t [@@dead "+exit"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/exn.mli", line 16, characters 0-17 + +sys_error is never used + <-- line 16 + val sys_error : t [@@dead "+sys_error"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/file_annotations.ml", line 41, characters 0-61 + +create_from_hashtbl is never used + <-- line 41 + let create_from_hashtbl (h : annotated_as Pos_hash.t) : t = h [@@dead "+create_from_hashtbl"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/file_annotations.ml", line 57, characters 0-38 + +length is never used + <-- line 57 + let length (t : t) = Pos_hash.length t [@@dead "+length"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/file_annotations.ml", line 59, characters 0-38 + +iter is never used + <-- line 59 + let iter f (t : t) = Pos_hash.iter f t [@@dead "+iter"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/file_annotations.mli", line 35, characters 0-54 + +create_from_hashtbl is never used + <-- line 35 + val create_from_hashtbl : annotated_as Pos_hash.t -> t [@@dead "+create_from_hashtbl"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/file_annotations.mli", line 43, characters 0-21 + +length is never used + <-- line 43 + val length : t -> int [@@dead "+length"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/file_annotations.mli", line 44, characters 0-65 + +iter is never used + <-- line 44 + val iter : (Lexing.position -> annotated_as -> unit) -> t -> unit [@@dead "+iter"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/file_deps.ml", line 6, characters 0-129 + +file_deps.File_hash is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/file_deps.ml", line 9, characters 2-35 + File_hash.+hash is never used + <-- line 9 + let hash (x : t) = Hashtbl.hash x [@@dead "File_hash.+hash"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/file_deps.ml", line 10, characters 2-29 + File_hash.+equal is never used + <-- line 10 + let equal (x : t) y = x = y [@@dead "File_hash.+equal"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/file_deps.ml", line 55, characters 0-265 + +freeze_builder is never used + <-- line 55 + {files = b.files; deps = b.deps} [@@dead "+freeze_builder"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/file_deps.ml", line 61, characters 0-207 + +merge_all is never used + <-- line 61 + freeze_builder merged_builder [@@dead "+merge_all"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/file_deps.ml", line 76, characters 0-43 + +create is never used + <-- line 76 + let create ~files ~deps : t = {files; deps} [@@dead "+create"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/file_deps.ml", line 80, characters 0-31 + +get_files is never used + <-- line 80 + let get_files (t : t) = t.files [@@dead "+get_files"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/file_deps.ml", line 82, characters 0-114 + +get_deps is never used + <-- line 82 + | None -> File_set.empty [@@dead "+get_deps"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/file_deps.ml", line 87, characters 0-49 + +iter_deps is never used + <-- line 87 + let iter_deps (t : t) f = File_hash.iter f t.deps [@@dead "+iter_deps"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/file_deps.ml", line 89, characters 0-56 + +file_exists is never used + <-- line 89 + let file_exists (t : t) file = File_hash.mem t.deps file [@@dead "+file_exists"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/file_deps.ml", line 91, characters 0-51 + +files_count is never used + <-- line 91 + let files_count (t : t) = File_set.cardinal t.files [@@dead "+files_count"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/file_deps.ml", line 93, characters 0-48 + +deps_count is never used + <-- line 93 + let deps_count (t : t) = File_hash.length t.deps [@@dead "+deps_count"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/file_deps.ml", line 97, characters 0-2717 + +iter_files_from_roots_to_leaves is never used + <-- line 97 + else set |> File_set.iter (fun file_name -> iter_fun file_name)) [@@dead "+iter_files_from_roots_to_leaves"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/file_deps.mli", line 31, characters 0-33 + +freeze_builder is never used + <-- line 31 + val freeze_builder : builder -> t [@@dead "+freeze_builder"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/file_deps.mli", line 35, characters 0-33 + +merge_all is never used + <-- line 35 + val merge_all : builder list -> t [@@dead "+merge_all"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/file_deps.mli", line 51, characters 0-65 + +create is never used + <-- line 51 + val create : files:File_set.t -> deps:File_set.t File_hash.t -> t [@@dead "+create"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/file_deps.mli", line 56, characters 0-31 + +get_files is never used + <-- line 56 + val get_files : t -> File_set.t [@@dead "+get_files"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/file_deps.mli", line 59, characters 0-40 + +get_deps is never used + <-- line 59 + val get_deps : t -> string -> File_set.t [@@dead "+get_deps"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/file_deps.mli", line 62, characters 0-59 + +iter_deps is never used + <-- line 62 + val iter_deps : t -> (string -> File_set.t -> unit) -> unit [@@dead "+iter_deps"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/file_deps.mli", line 65, characters 0-37 + +file_exists is never used + <-- line 65 + val file_exists : t -> string -> bool [@@dead "+file_exists"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/file_deps.mli", line 68, characters 0-26 + +files_count is never used + <-- line 68 + val files_count : t -> int [@@dead "+files_count"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/file_deps.mli", line 71, characters 0-25 + +deps_count is never used + <-- line 71 + val deps_count : t -> int [@@dead "+deps_count"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/file_deps.mli", line 76, characters 0-67 + +iter_files_from_roots_to_leaves is never used + <-- line 76 + val iter_files_from_roots_to_leaves : t -> (string -> unit) -> unit [@@dead "+iter_files_from_roots_to_leaves"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/file_hash.ml", line 1, characters 0-0 + +file_hash is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/file_hash.ml", line 6, characters 2-35 + +hash is never used + <-- line 6 + let hash (x : t) = Hashtbl.hash x [@@dead "+hash"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/file_hash.ml", line 7, characters 2-29 + +equal is never used + <-- line 7 + let equal (x : t) y = x = y [@@dead "+equal"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/issue.ml", line 32, characters 2-33 + description.Circular is a variant case which is never constructed + <-- line 32 + | Circular of {message: string} [@dead "description.Circular"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/liveness.ml", line 259, characters 0-113 + +is_live_forward is never used + <-- line 259 + Pos_hash.mem live pos [@@dead "+is_live_forward"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/liveness.mli", line 33, characters 0-76 + +is_live_forward is never used + <-- line 33 + val is_live_forward : live:live_reason Pos_hash.t -> Lexing.position -> bool [@@dead "+is_live_forward"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/loc_set.ml", line 1, characters 0-0 + +loc_set is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/loc_set.ml", line 4, characters 2-23 + +compare is never used + <-- line 4 + let compare = compare [@@dead "+compare"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/name.ml", line 3, characters 0-28 + +compare is never used + <-- line 3 + let compare = String.compare [@@dead "+compare"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/name.mli", line 3, characters 0-27 + +compare is never used + <-- line 3 + val compare : t -> t -> int [@@dead "+compare"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/optional_args.ml", line 40, characters 0-48 + +iter_unused is never used + <-- line 40 + let iter_unused f x = String_set.iter f x.unused [@@dead "+iter_unused"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/optional_args.ml", line 41, characters 0-79 + +iter_always_used is never used + <-- line 41 + let iter_always_used f x = String_set.iter (fun s -> f s x.count) x.always_used [@@dead "+iter_always_used"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/pos_hash.ml", line 1, characters 0-0 + +pos_hash is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/pos_hash.ml", line 7, characters 2-106 + +hash is never used + <-- line 7 + Hashtbl.hash (x.Lexing.pos_cnum, s) [@@dead "+hash"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/pos_hash.ml", line 11, characters 2-29 + +equal is never used + <-- line 11 + let equal (x : t) y = x = y [@@dead "+equal"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/pos_set.ml", line 1, characters 0-0 + +pos_set is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/pos_set.ml", line 7, characters 2-23 + +compare is never used + <-- line 7 + let compare = compare [@@dead "+compare"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reactive_analysis.ml", line 135, characters 0-72 + +length is never used + <-- line 135 + let length (collection : t) = Reactive_file_collection.length collection [@@dead "+length"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reactive_exception_refs.ml", line 13, characters 2-55 + t.exception_decls is a record label never used to read a value + <-- line 13 + exception_decls: (Dce_path.t, Location.t) Reactive.t; [@dead "t.exception_decls"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reactive_exception_refs.ml", line 75, characters 0-252 + +add_to_refs_builder is never used + <-- line 75 + t.resolved_refs [@@dead "+add_to_refs_builder"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reactive_exception_refs.ml", line 84, characters 0-418 + +add_to_file_deps_builder is never used + <-- line 84 + t.resolved_refs [@@dead "+add_to_file_deps_builder"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reactive_exception_refs.mli", line 35, characters 2-55 + t.exception_decls is a record label never used to read a value + <-- line 35 + exception_decls: (Dce_path.t, Location.t) Reactive.t; [@dead "t.exception_decls"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reactive_exception_refs.mli", line 55, characters 0-62 + +add_to_refs_builder is never used + <-- line 55 + val add_to_refs_builder : t -> refs:References.builder -> unit [@@dead "+add_to_refs_builder"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reactive_exception_refs.mli", line 58, characters 0-71 + +add_to_file_deps_builder is never used + <-- line 58 + val add_to_file_deps_builder : t -> file_deps:File_deps.builder -> unit [@@dead "+add_to_file_deps_builder"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reactive_merge.ml", line 159, characters 0-199 + +freeze_decls is never used + <-- line 159 + Declarations.create_from_hashtbl result [@@dead "+freeze_decls"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reactive_merge.ml", line 165, characters 0-217 + +freeze_annotations is never used + <-- line 165 + File_annotations.create_from_hashtbl result [@@dead "+freeze_annotations"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reactive_merge.ml", line 172, characters 0-1474 + +freeze_refs is never used + <-- line 172 + References.create ~value_refs_from ~type_refs_from [@@dead "+freeze_refs"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reactive_merge.ml", line 224, characters 0-630 + +collect_cross_file_items is never used + <-- line 224 + } [@@dead "+collect_cross_file_items"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reactive_merge.ml", line 243, characters 0-1044 + +freeze_file_deps is never used + <-- line 243 + File_deps.create ~files ~deps [@@dead "+freeze_file_deps"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reactive_merge.mli", line 51, characters 0-38 + +freeze_decls is never used + <-- line 51 + val freeze_decls : t -> Declarations.t [@@dead "+freeze_decls"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reactive_merge.mli", line 54, characters 0-48 + +freeze_annotations is never used + <-- line 54 + val freeze_annotations : t -> File_annotations.t [@@dead "+freeze_annotations"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reactive_merge.mli", line 57, characters 0-35 + +freeze_refs is never used + <-- line 57 + val freeze_refs : t -> References.t [@@dead "+freeze_refs"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reactive_merge.mli", line 60, characters 0-54 + +collect_cross_file_items is never used + <-- line 60 + val collect_cross_file_items : t -> Cross_file_items.t [@@dead "+collect_cross_file_items"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reactive_merge.mli", line 63, characters 0-39 + +freeze_file_deps is never used + <-- line 63 + val freeze_file_deps : t -> File_deps.t [@@dead "+freeze_file_deps"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reactive_solver.ml", line 30, characters 2-75 + t.annotations is a record label never used to read a value + <-- line 30 + annotations: (Lexing.position, File_annotations.annotated_as) Reactive.t; [@dead "t.annotations"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reactive_solver.ml", line 44, characters 2-23 + t.config is a record label never used to read a value + <-- line 44 + config: Dce_config.t; [@dead "t.config"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reactive_type_deps.ml", line 14, characters 2-27 + decl_info.pos_end is a record label never used to read a value + <-- line 14 + pos_end: Lexing.position; [@dead "decl_info.pos_end"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reactive_type_deps.ml", line 36, characters 2-56 + t.decl_by_path is a record label never used to read a value + <-- line 36 + decl_by_path: (Dce_path.t, decl_info list) Reactive.t; [@dead "t.decl_by_path"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reactive_type_deps.ml", line 38, characters 2-58 + t.same_path_refs is a record label never used to read a value + <-- line 38 + same_path_refs: (Lexing.position, Pos_set.t) Reactive.t; [@dead "t.same_path_refs"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reactive_type_deps.ml", line 39, characters 2-59 + t.cross_file_refs is a record label never used to read a value + <-- line 39 + cross_file_refs: (Lexing.position, Pos_set.t) Reactive.t; [@dead "t.cross_file_refs"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reactive_type_deps.ml", line 41, characters 2-67 + t.impl_to_intf_refs_path2 is a record label never used to read a value + <-- line 41 + impl_to_intf_refs_path2: (Lexing.position, Pos_set.t) Reactive.t; [@dead "t.impl_to_intf_refs_path2"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reactive_type_deps.ml", line 42, characters 2-61 + t.intf_to_impl_refs is a record label never used to read a value + <-- line 42 + intf_to_impl_refs: (Lexing.position, Pos_set.t) Reactive.t; [@dead "t.intf_to_impl_refs"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reactive_type_deps.ml", line 242, characters 0-251 + +add_to_refs_builder is never used + <-- line 242 + t.all_type_refs [@@dead "+add_to_refs_builder"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reactive_type_deps.mli", line 33, characters 2-56 + t.decl_by_path is a record label never used to read a value + <-- line 33 + decl_by_path: (Dce_path.t, decl_info list) Reactive.t; [@dead "t.decl_by_path"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reactive_type_deps.mli", line 35, characters 2-58 + t.same_path_refs is a record label never used to read a value + <-- line 35 + same_path_refs: (Lexing.position, Pos_set.t) Reactive.t; [@dead "t.same_path_refs"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reactive_type_deps.mli", line 36, characters 2-59 + t.cross_file_refs is a record label never used to read a value + <-- line 36 + cross_file_refs: (Lexing.position, Pos_set.t) Reactive.t; [@dead "t.cross_file_refs"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reactive_type_deps.mli", line 38, characters 2-67 + t.impl_to_intf_refs_path2 is a record label never used to read a value + <-- line 38 + impl_to_intf_refs_path2: (Lexing.position, Pos_set.t) Reactive.t; [@dead "t.impl_to_intf_refs_path2"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reactive_type_deps.mli", line 39, characters 2-61 + t.intf_to_impl_refs is a record label never used to read a value + <-- line 39 + intf_to_impl_refs: (Lexing.position, Pos_set.t) Reactive.t; [@dead "t.intf_to_impl_refs"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reactive_type_deps.mli", line 47, characters 2-27 + decl_info.pos_end is a record label never used to read a value + <-- line 47 + pos_end: Lexing.position; [@dead "decl_info.pos_end"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reactive_type_deps.mli", line 68, characters 0-62 + +add_to_refs_builder is never used + <-- line 68 + val add_to_refs_builder : t -> refs:References.builder -> unit [@@dead "+add_to_refs_builder"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reanalyze_server.ml", line 74, characters 2-79 + Server.+let* is never used + <-- line 74 + | Error _ as e -> e [@@dead "Server.+let*"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reanalyze_server.ml", line 108, characters 4-46 + Server.server_state.parse_argv is a record label never used to read a value + <-- line 108 + parse_argv: string array -> string option; [@dead "Server.server_state.parse_argv"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/references.ml", line 47, characters 0-269 + +merge_all is never used + <-- line 47 + } [@@dead "+merge_all"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/references.ml", line 77, characters 0-85 + +create is never used + <-- line 77 + {value_refs_from; type_refs_from} [@@dead "+create"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/references.ml", line 85, characters 0-70 + +value_refs_from_length is never used + <-- line 85 + let value_refs_from_length (t : t) = Pos_hash.length t.value_refs_from [@@dead "+value_refs_from_length"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/references.ml", line 86, characters 0-68 + +type_refs_from_length is never used + <-- line 86 + let type_refs_from_length (t : t) = Pos_hash.length t.type_refs_from [@@dead "+type_refs_from_length"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/references.mli", line 35, characters 0-33 + +merge_all is never used + <-- line 35 + val merge_all : builder list -> t [@@dead "+merge_all"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/references.mli", line 49, characters 0-99 + +create is never used + <-- line 49 + t [@@dead "+create"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/references.mli", line 65, characters 0-37 + +value_refs_from_length is never used + <-- line 65 + val value_refs_from_length : t -> int [@@dead "+value_refs_from_length"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/references.mli", line 66, characters 0-36 + +type_refs_from_length is never used + <-- line 66 + val type_refs_from_length : t -> int [@@dead "+type_refs_from_length"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/run_config.ml", line 44, characters 2-12 + snapshot.dce is a record label never used to read a value + <-- line 44 + dce: bool; [@dead "snapshot.dce"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/run_config.ml", line 45, characters 2-19 + snapshot.exception_ is a record label never used to read a value + <-- line 45 + exception_: bool; [@dead "snapshot.exception_"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/run_config.ml", line 46, characters 2-24 + snapshot.suppress is a record label never used to read a value + <-- line 46 + suppress: string list; [@dead "snapshot.suppress"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/run_config.ml", line 47, characters 2-20 + snapshot.termination is a record label never used to read a value + <-- line 47 + termination: bool; [@dead "snapshot.termination"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/run_config.ml", line 48, characters 2-19 + snapshot.transitive is a record label never used to read a value + <-- line 48 + transitive: bool; [@dead "snapshot.transitive"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/run_config.ml", line 49, characters 2-26 + snapshot.unsuppress is a record label never used to read a value + <-- line 49 + unsuppress: string list; [@dead "snapshot.unsuppress"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/cmt_viewer.ml", line 1, characters 0-598 + +filter_by_cursor is never used + <-- line 1 + line_in && col_in [@@dead "+filter_by_cursor"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/cmt_viewer.ml", line 17, characters 14-35 + filter.Cursor is a variant case which is never constructed + <-- line 17 + type filter = Cursor of (int * int) [@dead "filter.Cursor"] | Loc of Loc.t + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/cmt_viewer.ml", line 17, characters 36-50 + filter.Loc is a variant case which is never constructed + <-- line 17 + type filter = Cursor of (int * int) [@dead "filter.Cursor"] | Loc of Loc.t [@dead "filter.Loc"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/completion_back_end.ml", line 903, characters 0-252 + +completions_get_type_env is never used + <-- line 903 + | _ -> None [@@dead "+completions_get_type_env"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/debug.ml", line 5, characters 0-92 + +log is never used + <-- line 5 + | Off -> () [@@dead "+log"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/process_cmt.ml", line 421, characters 0-247 + +for_tree_module_type is never used + <-- line 421 + | _ -> None [@@dead "+for_tree_module_type"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/semantic_tokens.ml", line 94, characters 2-136 + Token.+array_to_json_string is never used + <-- line 94 + "[" ^ String.concat "," items ^ "]" [@@dead "Token.+array_to_json_string"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/shared_types.ml", line 29, characters 2-365 + Module_path.+to_path_with_prefix is never used + <-- line 29 + prefix :: loop module_path [] [@@dead "Module_path.+to_path_with_prefix"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/shared_types.ml", line 313, characters 2-29 + Query_env.+to_string is never used + <-- line 313 + val to_string : t -> string [@@dead "Query_env.+to_string"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/shared_types.ml", line 322, characters 2-97 + Query_env.+to_string is never used + <-- line 322 + file.module_name :: List.rev path_rev |> String.concat "." [@@dead "Query_env.+to_string"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/shared_types.ml", line 502, characters 0-149 + +shared_types.Location_set is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/shared_types.ml", line 505, characters 2-43 + Location_set.+compare is never used + <-- line 505 + let compare loc1 loc2 = compare loc2 loc1 [@@dead "Location_set.+compare"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/shared_types.ml", line 537, characters 2-30 + package.rescript_version is a record label never used to read a value + <-- line 537 + rescript_version: int * int; [@dead "package.rescript_version"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/shared_types.ml", line 855, characters 4-46 + Completion.t.type_arg_context is a record label never used to read a value + <-- line 855 + type_arg_context: type_arg_context option; [@dead "Completion.t.type_arg_context"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/shared_types.ml", line 856, characters 4-40 + Completion.t.data is a record label never used to read a value + <-- line 856 + data: (string * string) list option; [@dead "Completion.t.data"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/type_utils.ml", line 980, characters 0-153 + +unwrap_completion_type_if_option is never used + <-- line 980 + | _ -> t [@@dead "+unwrap_completion_type_if_option"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/common/bs_loc.ml", line 31, characters 0-28 + +is_ghost is never used + <-- line 31 + let is_ghost x = x.loc_ghost [@@dead "+is_ghost"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/common/bs_loc.ml", line 33, characters 0-210 + +merge is never used + <-- line 33 + {loc_start; loc_end; loc_ghost = false} [@@dead "+merge"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/common/bs_loc.mli", line 32, characters 0-23 + +merge is never used + <-- line 32 + val merge : t -> t -> t [@@dead "+merge"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/common/bs_version.ml", line 25, characters 0-62 + +header is never used + <-- line 25 + let header = "// Generated by ReScript, PLEASE EDIT WITH CARE" [@@dead "+header"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/common/bs_version.mli", line 27, characters 0-19 + +header is never used + <-- line 27 + val header : string [@@dead "+header"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/common/ext_log.ml", line 1, characters 0-0 + +ext_log is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/common/ext_log.ml", line 28, characters 0-386 + +dwarn is never used + <-- line 28 + else Format.ifprintf Format.err_formatter ("WARN: " ^^ f ^^ "@.") [@@dead "+dwarn"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/common/ext_log.mli", line 1, characters 0-0 + ext_log is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/common/ext_log.mli", line 35, characters 0-59 + +dwarn is never used + <-- line 35 + val dwarn : ?__POS__:string * int * int * int -> 'a logging [@@dead "+dwarn"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/common/js_config.ml", line 43, characters 0-49 + +get_check_div_by_zero is never used + <-- line 43 + let get_check_div_by_zero () = !check_div_by_zero [@@dead "+get_check_div_by_zero"] + + Warning Dead Value With Side Effects + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/common/js_config.ml", line 55, characters 0-24 + +js_stdout is never used and could have side effects + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/common/js_config.mli", line 60, characters 0-40 + +get_check_div_by_zero is never used + <-- line 60 + val get_check_div_by_zero : unit -> bool [@@dead "+get_check_div_by_zero"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/common/js_config.mli", line 87, characters 0-24 + +js_stdout is never used + <-- line 87 + val js_stdout : bool ref [@@dead "+js_stdout"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/j.ml", line 78, characters 65-78 + delim.DBackQuotes is a variant case which is never constructed + <-- line 78 + and delim = External_arg_spec.delim = DNone | DStarJ | DNoQuotes | DBackQuotes [@dead "delim.DBackQuotes"] + + Warning Dead Value With Side Effects + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_analyzer.ml", line 70, characters 0-29 + +obj is never used and could have side effects + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_analyzer.ml", line 72, characters 0-99 + +clean_up is never used + <-- line 72 + init.defined_idents <- Set_ident.empty [@@dead "+clean_up"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_analyzer.ml", line 76, characters 0-131 + +free_variables_of_statement is never used + <-- line 76 + Set_ident.diff init.used_idents init.defined_idents [@@dead "+free_variables_of_statement"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_analyzer.ml", line 81, characters 0-133 + +free_variables_of_expression is never used + <-- line 81 + Set_ident.diff init.used_idents init.defined_idents [@@dead "+free_variables_of_expression"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_analyzer.ml", line 164, characters 0-2369 + +eq_expression is never used + <-- line 164 + | Spread _ -> false [@@dead "+eq_expression"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_analyzer.ml", line 237, characters 0-75 + +eq_expression_list is never used + <-- line 237 + and eq_expression_list xs ys = Ext_list.for_all2_no_exn xs ys eq_expression [@@dead "+eq_expression_list"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_analyzer.ml", line 239, characters 0-90 + +eq_block is never used + <-- line 239 + Ext_list.for_all2_no_exn xs ys eq_statement [@@dead "+eq_block"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_analyzer.ml", line 242, characters 0-594 + +eq_statement is never used + <-- line 242 + false [@@dead "+eq_statement"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_analyzer.ml", line 263, characters 0-235 + +rev_flatten_seq is never used + <-- line 263 + aux [] x [@@dead "+rev_flatten_seq"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_analyzer.ml", line 275, characters 0-454 + +rev_toplevel_flatten is never used + <-- line 275 + aux [] block [@@dead "+rev_toplevel_flatten"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_analyzer.ml", line 304, characters 0-198 + +is_okay_to_duplicate is never used + <-- line 304 + | _ -> false [@@dead "+is_okay_to_duplicate"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_analyzer.mli", line 30, characters 0-60 + +free_variables_of_statement is never used + <-- line 30 + val free_variables_of_statement : J.statement -> Set_ident.t [@@dead "+free_variables_of_statement"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_analyzer.mli", line 32, characters 0-62 + +free_variables_of_expression is never used + <-- line 32 + val free_variables_of_expression : J.expression -> Set_ident.t [@@dead "+free_variables_of_expression"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_analyzer.mli", line 37, characters 0-52 + +no_side_effect_expression is never used + <-- line 37 + val no_side_effect_expression : J.expression -> bool [@@dead "+no_side_effect_expression"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_analyzer.mli", line 56, characters 0-56 + +eq_expression is never used + <-- line 56 + val eq_expression : J.expression -> J.expression -> bool [@@dead "+eq_expression"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_analyzer.mli", line 58, characters 0-53 + +eq_statement is never used + <-- line 58 + val eq_statement : J.statement -> J.statement -> bool [@@dead "+eq_statement"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_analyzer.mli", line 60, characters 0-41 + +eq_block is never used + <-- line 60 + val eq_block : J.block -> J.block -> bool [@@dead "+eq_block"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_analyzer.mli", line 62, characters 0-45 + +rev_flatten_seq is never used + <-- line 62 + val rev_flatten_seq : J.expression -> J.block [@@dead "+rev_flatten_seq"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_analyzer.mli", line 64, characters 0-45 + +rev_toplevel_flatten is never used + <-- line 64 + val rev_toplevel_flatten : J.block -> J.block [@@dead "+rev_toplevel_flatten"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_analyzer.mli", line 73, characters 0-47 + +is_okay_to_duplicate is never used + <-- line 73 + val is_okay_to_duplicate : J.expression -> bool [@@dead "+is_okay_to_duplicate"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_arr.ml", line 1, characters 0-0 + +js_arr is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_arr.ml", line 27, characters 0-56 + +set_array is never used + <-- line 27 + let set_array e e0 e1 = E.assign (E.array_index e e0) e1 [@@dead "+set_array"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_arr.ml", line 29, characters 0-39 + +ref_array is never used + <-- line 29 + let ref_array e e0 = E.array_index e e0 [@@dead "+ref_array"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_arr.mli", line 1, characters 0-0 + js_arr is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_arr.mli", line 25, characters 0-76 + +set_array is never used + <-- line 25 + val set_array : J.expression -> J.expression -> J.expression -> J.expression [@@dead "+set_array"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_arr.mli", line 27, characters 0-60 + +ref_array is never used + <-- line 27 + val ref_array : J.expression -> J.expression -> J.expression [@@dead "+ref_array"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_ast_util.ml", line 1, characters 0-0 + +js_ast_util is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_ast_util.ml", line 29, characters 0-256 + +named_expression is never used + <-- line 29 + Some (obj_code, obj) [@@dead "+named_expression"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_ast_util.mli", line 1, characters 0-0 + js_ast_util is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_ast_util.mli", line 25, characters 0-69 + +named_expression is never used + <-- line 25 + val named_expression : J.expression -> (J.statement * Ident.t) option [@@dead "+named_expression"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_block_runtime.ml", line 1, characters 0-0 + +js_block_runtime is a dead module as all its items are dead. + + Warning Dead Value With Side Effects + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_block_runtime.ml", line 25, characters 0-64 + +option_id is never used and could have side effects + + Warning Dead Value With Side Effects + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_block_runtime.ml", line 27, characters 0-62 + +curry_id is never used and could have side effects + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_block_runtime.ml", line 29, characters 0-201 + +check_additional_id is never used + <-- line 29 + | _ -> None [@@dead "+check_additional_id"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_block_runtime.mli", line 1, characters 0-0 + js_block_runtime is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_block_runtime.mli", line 25, characters 0-56 + +check_additional_id is never used + <-- line 25 + val check_additional_id : J.expression -> Ident.t option [@@dead "+check_additional_id"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_call_info.ml", line 38, characters 0-75 + +dummy is never used + <-- line 38 + let dummy = {arity = NA; call_info = Call_na; call_transformed_jsx = false} [@@dead "+dummy"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_call_info.ml", line 43, characters 0-86 + +ml_full_call is never used + <-- line 43 + {arity = Full; call_info = Call_ml; call_transformed_jsx = false} [@@dead "+ml_full_call"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_call_info.ml", line 46, characters 0-112 + +na_full_call is never used + <-- line 46 + {arity = Full; call_info = Call_na; call_transformed_jsx = transformed_jsx} [@@dead "+na_full_call"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_call_info.mli", line 40, characters 0-13 + +dummy is never used + <-- line 40 + val dummy : t [@@dead "+dummy"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_call_info.mli", line 44, characters 0-20 + +ml_full_call is never used + <-- line 44 + val ml_full_call : t [@@dead "+ml_full_call"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_call_info.mli", line 46, characters 0-28 + +na_full_call is never used + <-- line 46 + val na_full_call : bool -> t [@@dead "+na_full_call"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_cmj_format.ml", line 38, characters 0-35 + +single_na is never used + <-- line 38 + let single_na = Single Lam_arity.na [@@dead "+single_na"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_cmj_format.ml", line 55, characters 0-357 + +make is never used + <-- line 55 + } [@@dead "+make"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_cmj_format.ml", line 72, characters 2-31 + +_digest is never used + <-- line 72 + let _digest = Digest.input ic [@@dead "+_digest"] in + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_cmj_format.ml", line 77, characters 0-173 + +from_file_with_digest is never used + <-- line 77 + (v, digest) [@@dead "+from_file_with_digest"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_cmj_format.ml", line 84, characters 0-63 + +from_string is never used + <-- line 84 + let from_string s : t = Marshal.from_string s Ext_digest.length [@@dead "+from_string"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_cmj_format.ml", line 86, characters 0-238 + +for_sure_not_changed is never used + <-- line 86 + else false [@@dead "+for_sure_not_changed"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_cmj_format.ml", line 97, characters 0-315 + +to_file is never used + <-- line 97 + close_out oc) [@@dead "+to_file"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_cmj_format.ml", line 107, characters 0-61 + +key_comp is never used + <-- line 107 + let key_comp (a : string) b = Map_string.compare_key a b.name [@@dead "+key_comp"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_cmj_format.ml", line 109, characters 0-86 + +not_found is never used + <-- line 109 + {name = key; arity = single_na; persistent_closed_lambda = None} [@@dead "+not_found"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_cmj_format.ml", line 112, characters 0-320 + +get_result is never used + <-- line 112 + else {mid_val with persistent_closed_lambda = None} [@@dead "+get_result"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_cmj_format.ml", line 123, characters 0-658 + +binary_search_aux is never used + <-- line 123 + else binary_search_aux arr mid hi key [@@dead "+binary_search_aux"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_cmj_format.ml", line 142, characters 0-435 + +binary_search is never used + <-- line 142 + if c2 > 0 then not_found key else binary_search_aux sorted 0 (len - 1) key [@@dead "+binary_search"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_cmj_format.ml", line 157, characters 0-121 + +query_by_name is never used + <-- line 157 + binary_search values name [@@dead "+query_by_name"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_cmj_format.mli", line 70, characters 0-139 + +make is never used + <-- line 70 + t [@@dead "+make"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_cmj_format.mli", line 77, characters 0-50 + +query_by_name is never used + <-- line 77 + val query_by_name : t -> string -> keyed_cmj_value [@@dead "+query_by_name"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_cmj_format.mli", line 79, characters 0-21 + +single_na is never used + <-- line 79 + val single_na : arity [@@dead "+single_na"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_cmj_format.mli", line 83, characters 0-50 + +from_file_with_digest is never used + <-- line 83 + val from_file_with_digest : string -> t * Digest.t [@@dead "+from_file_with_digest"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_cmj_format.mli", line 85, characters 0-29 + +from_string is never used + <-- line 85 + val from_string : string -> t [@@dead "+from_string"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_cmj_format.mli", line 90, characters 0-54 + +to_file is never used + <-- line 90 + val to_file : string -> check_exists:bool -> t -> unit [@@dead "+to_file"] + + Warning Dead Value With Side Effects + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_cmj_load.ml", line 59, characters 0-39 + +load_unit is never used and could have side effects + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_cmj_load.mli", line 1, characters 0-0 + js_cmj_load is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_cmj_load.mli", line 29, characters 0-59 + +load_unit is never used + <-- line 29 + val load_unit : (string -> Js_cmj_format.cmj_load_info) ref [@@dead "+load_unit"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump.ml", line 1715, characters 0-213 + +string_of_block is never used + <-- line 1715 + Buffer.contents buffer [@@dead "+string_of_block"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump.mli", line 1, characters 0-0 + js_dump is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump.mli", line 23, characters 0-80 + +statements is never used + <-- line 23 + val statements : bool -> Ext_pp_scope.t -> Ext_pp.t -> J.block -> Ext_pp_scope.t [@@dead "+statements"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump.mli", line 28, characters 0-39 + +string_of_block is never used + <-- line 28 + val string_of_block : J.block -> string [@@dead "+string_of_block"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump.mli", line 31, characters 0-49 + +string_of_expression is never used + <-- line 31 + val string_of_expression : J.expression -> string [@@dead "+string_of_expression"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_import_export.ml", line 30, characters 0-38 + +es_module is never used + <-- line 30 + let es_module = ("__esModule", "true") [@@dead "+es_module"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_import_export.ml", line 33, characters 0-171 + +rev_iter_inter is never used + <-- line 33 + f a [@@dead "+rev_iter_inter"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_import_export.ml", line 44, characters 0-840 + +exports is never used + <-- line 44 + outer_cxt [@@dead "+exports"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_import_export.ml", line 72, characters 0-977 + +esmodule_export is never used + <-- line 72 + outer_cxt [@@dead "+esmodule_export"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_import_export.ml", line 103, characters 0-740 + +requires is never used + <-- line 103 + outer_cxt [@@dead "+requires"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_import_export.ml", line 125, characters 0-736 + +dump_import_attributes is never used + <-- line 125 + idx := !idx + 1)) [@@dead "+dump_import_attributes"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_import_export.ml", line 148, characters 0-1123 + +imports is never used + <-- line 148 + outer_cxt [@@dead "+imports"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_import_export.mli", line 27, characters 0-74 + +exports is never used + <-- line 27 + val exports : Ext_pp_scope.t -> Ext_pp.t -> Ident.t list -> Ext_pp_scope.t [@@dead "+exports"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_import_export.mli", line 29, characters 0-84 + +esmodule_export is never used + <-- line 29 + Ext_pp_scope.t -> Ext_pp.t -> Ident.t list -> Ext_pp_scope.t [@@dead "+esmodule_export"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_import_export.mli", line 32, characters 0-113 + +requires is never used + <-- line 32 + Ext_pp_scope.t [@@dead "+requires"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_import_export.mli", line 39, characters 0-146 + +imports is never used + <-- line 39 + Ext_pp_scope.t [@@dead "+imports"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_lit.ml", line 41, characters 0-23 + +require is never used + <-- line 41 + let require = "require" [@@dead "+require"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_lit.ml", line 43, characters 0-21 + +import is never used + <-- line 43 + let import = "import" [@@dead "+import"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_lit.ml", line 45, characters 0-17 + +from is never used + <-- line 45 + let from = "from" [@@dead "+from"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_lit.ml", line 47, characters 0-14 + +as_ is never used + <-- line 47 + let as_ = "as" [@@dead "+as_"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_lit.ml", line 49, characters 0-21 + +export is never used + <-- line 49 + let export = "export" [@@dead "+export"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_lit.ml", line 51, characters 0-14 + +star is never used + <-- line 51 + let star = "*" [@@dead "+star"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_lit.ml", line 57, characters 0-23 + +exports is never used + <-- line 57 + let exports = "exports" [@@dead "+exports"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_lit.ml", line 77, characters 0-19 + +array is never used + <-- line 77 + let array = "Array" [@@dead "+array"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_lit.ml", line 81, characters 0-19 + +plusplus is never used + <-- line 81 + let plusplus = "++" [@@dead "+plusplus"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_lit.ml", line 83, characters 0-21 + +minusminus is never used + <-- line 83 + let minusminus = "--" [@@dead "+minusminus"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_lit.ml", line 109, characters 0-17 + +json is never used + <-- line 109 + let json = "JSON" [@@dead "+json"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_lit.ml", line 111, characters 0-27 + +stringify is never used + <-- line 111 + let stringify = "stringify" [@@dead "+stringify"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_lit.ml", line 113, characters 0-23 + +console is never used + <-- line 113 + let console = "console" [@@dead "+console"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_lit.ml", line 115, characters 0-21 + +define is never used + <-- line 115 + let define = "define" [@@dead "+define"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_lit.ml", line 123, characters 0-38 + +strict_directive is never used + <-- line 123 + let strict_directive = "'use strict';" [@@dead "+strict_directive"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_lit.ml", line 133, characters 0-17 + +bind is never used + <-- line 133 + let bind = "bind" [@@dead "+bind"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_lit.ml", line 135, characters 0-17 + +math is never used + <-- line 135 + let math = "Math" [@@dead "+math"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_lit.ml", line 143, characters 0-25 + +string_cap is never used + <-- line 143 + let string_cap = "String" [@@dead "+string_cap"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_lit.ml", line 145, characters 0-34 + +from_charcode is never used + <-- line 145 + let from_charcode = "fromCharCode" [@@dead "+from_charcode"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_lit.ml", line 155, characters 0-12 + +gt is never used + <-- line 155 + let gt = ">" [@@dead "+gt"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_lit.ml", line 162, characters 0-28 + +caml_block_create is never used + <-- line 162 + let caml_block_create = "__" [@@dead "+caml_block_create"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_lit.ml", line 166, characters 0-30 + +block_poly_var is never used + <-- line 166 + let block_poly_var = "polyVar" [@@dead "+block_poly_var"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_lit.ml", line 168, characters 0-29 + +block_variant is never used + <-- line 168 + let block_variant = "variant" [@@dead "+block_variant"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_lit.ml", line 170, characters 0-42 + +block_simple_variant is never used + <-- line 170 + let block_simple_variant = "simpleVariant" [@@dead "+block_simple_variant"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_program.ml", line 1, characters 0-0 + +js_dump_program is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_program.ml", line 28, characters 0-142 + +empty_explanation is never used + <-- line 28 + unused code got optimized away. */\n" [@@dead "+empty_explanation"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_program.ml", line 32, characters 0-123 + +program_is_empty is never used + <-- line 32 + | _ -> false [@@dead "+program_is_empty"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_program.ml", line 37, characters 0-154 + +deps_program_is_empty is never used + <-- line 37 + | _ -> false [@@dead "+deps_program_is_empty"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_program.ml", line 42, characters 0-314 + +extract_block_comments is never used + <-- line 42 + | _ -> (acc, x) [@@dead "+extract_block_comments"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_program.ml", line 56, characters 0-189 + +extract_file_comments is never used + <-- line 56 + (comments, {x with program = {x.program with block = new_block}}) [@@dead "+extract_file_comments"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_program.ml", line 60, characters 0-162 + +program is never used + <-- line 60 + Js_dump_import_export.exports cxt f x.exports [@@dead "+program"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_program.ml", line 65, characters 0-97 + +dump_program is never used + <-- line 65 + ignore (program (P.from_channel oc) Ext_pp_scope.empty x) [@@dead "+dump_program"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_program.ml", line 68, characters 0-106 + +is_default is never used + <-- line 68 + | _ -> false [@@dead "+is_default"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_program.ml", line 73, characters 0-559 + +commonjs_program is never used + <-- line 73 + program f cxt x.program [@@dead "+commonjs_program"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_program.ml", line 90, characters 0-768 + +esmodule_program is never used + <-- line 90 + Js_dump_import_export.esmodule_export cxt f x.program.exports [@@dead "+esmodule_program"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_program.ml", line 110, characters 0-1055 + +pp_deps_program is never used + <-- line 110 + P.flush f () [@@dead "+pp_deps_program"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_program.ml", line 141, characters 0-124 + +dump_deps_program is never used + <-- line 141 + pp_deps_program ~output_prefix kind x (P.from_channel oc) [@@dead "+dump_deps_program"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_program.mli", line 1, characters 0-0 + js_dump_program is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_program.mli", line 25, characters 0-51 + +dump_program is never used + <-- line 25 + val dump_program : J.program -> out_channel -> unit [@@dead "+dump_program"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_program.mli", line 28, characters 0-124 + +pp_deps_program is never used + <-- line 28 + unit [@@dead "+pp_deps_program"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_program.mli", line 35, characters 0-129 + +dump_deps_program is never used + <-- line 35 + unit [@@dead "+dump_deps_program"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 25, characters 0-58 + +no_side_effect is never used + <-- line 25 + let no_side_effect = Js_analyzer.no_side_effect_expression [@@dead "+no_side_effect"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 36, characters 0-632 + +remove_pure_sub_exp is never used + <-- line 36 + | _ -> Some x [@@dead "+remove_pure_sub_exp"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 52, characters 0-58 + +is_pure_sub_exp is never used + <-- line 52 + and is_pure_sub_exp (x : t) = remove_pure_sub_exp x = None [@@dead "+is_pure_sub_exp"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 73, characters 0-83 + +flat_call is never used + <-- line 73 + {expression_desc = FlatCall (e0, es); comment} [@@dead "+flat_call"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 76, characters 0-164 + +tagged_template is never used + <-- line 76 + } [@@dead "+tagged_template"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 96, characters 0-189 + +ml_var_dot is never used + <-- line 96 + } [@@dead "+ml_var_dot"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 109, characters 0-367 + +external_var_field is never used + <-- line 109 + } [@@dead "+external_var_field"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 124, characters 0-390 + +external_var is never used + <-- line 124 + } [@@dead "+external_var"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 140, characters 0-176 + +ml_module_as_var is never used + <-- line 140 + } [@@dead "+ml_module_as_var"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 152, characters 0-169 + +pure_runtime_call is never used + <-- line 152 + args [@@dead "+pure_runtime_call"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 157, characters 0-73 + +runtime_ref is never used + <-- line 157 + let runtime_ref module_name fn_name = runtime_var_dot module_name fn_name [@@dead "+runtime_ref"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 162, characters 0-134 + +raw_js_code is never used + <-- line 162 + } [@@dead "+raw_js_code"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 169, characters 0-23 + +some_comment is never used + <-- line 169 + let some_comment = None [@@dead "+some_comment"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 171, characters 0-109 + +optional_block is never used + <-- line 171 + {expression_desc = Optional_block (e, false); comment = some_comment} [@@dead "+optional_block"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 174, characters 0-109 + +optional_not_nest_block is never used + <-- line 174 + {expression_desc = Optional_block (e, true); comment = None} [@@dead "+optional_not_nest_block"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 180, characters 0-104 + +dot is never used + <-- line 180 + {expression_desc = Static_index (e0, e1, None); comment} [@@dead "+dot"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 183, characters 0-421 + +module_access is never used + <-- line 183 + | _ -> {expression_desc = Static_index (e, name, Some pos); comment = None} [@@dead "+module_access"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 193, characters 0-189 + +make_block is never used + <-- line 193 + {expression_desc = Caml_block (es, mutable_flag, tag, tag_info); comment} [@@dead "+make_block"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 200, characters 0-301 + +typeof is never used + <-- line 200 + | _ -> {expression_desc = Typeof e; comment} [@@dead "+typeof"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 208, characters 0-103 + +instanceof is never used + <-- line 208 + {expression_desc = Bin (InstanceOf, e0, e1); comment} [@@dead "+instanceof"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 211, characters 0-157 + +is_array is never used + <-- line 211 + {expression_desc = Call (f, [e0], Js_call_info.ml_full_call); comment = None} [@@dead "+is_array"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 217, characters 0-77 + +unit is never used + <-- line 217 + let unit : t = {expression_desc = Undefined {is_unit = true}; comment = None} [@@dead "+unit"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 238, characters 0-444 + +ocaml_fun is never used + <-- line 238 + } [@@dead "+ocaml_fun"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 257, characters 0-365 + +method_ is never used + <-- line 257 + } [@@dead "+method_"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 275, characters 0-465 + +dummy_obj is never used + <-- line 275 + | Blk_some | Blk_some_not_nested -> assert false [@@dead "+dummy_obj"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 291, characters 0-622 + +seq is never used + <-- line 291 + | _ -> {expression_desc = Seq (e0, e1); comment} [@@dead "+seq"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 306, characters 0-73 + +fuse_to_seq is never used + <-- line 306 + let fuse_to_seq x xs = if xs = [] then x else Ext_list.fold_left xs x seq [@@dead "+fuse_to_seq"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 346, characters 0-127 + +zero_bigint_literal is never used + <-- line 346 + } [@@dead "+zero_bigint_literal"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 372, characters 0-88 + +zero_float_lit is never used + <-- line 372 + {expression_desc = Number (Float {f = "0."}); comment = None} [@@dead "+zero_float_lit"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 375, characters 0-94 + +float_mod is never used + <-- line 375 + {comment; expression_desc = Bin (Mod, e1, e2)} [@@dead "+float_mod"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 378, characters 0-422 + +array_index is never used + <-- line 378 + | _ -> {expression_desc = Array_index (e0, e1); comment} [@@dead "+array_index"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 388, characters 0-447 + +array_index_by_int is never used + <-- line 388 + | _ -> {expression_desc = Array_index (e, int ?comment pos); comment = None} [@@dead "+array_index_by_int"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 399, characters 0-489 + +record_access is never used + <-- line 399 + | _ -> {expression_desc = Static_index (e, name, Some pos); comment = None} [@@dead "+record_access"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 412, characters 0-40 + +inline_record_access is never used + <-- line 412 + let inline_record_access = record_access [@@dead "+inline_record_access"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 414, characters 0-99 + +variant_access is never used + <-- line 414 + inline_record_access e ("_" ^ Int32.to_string pos) pos [@@dead "+variant_access"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 417, characters 0-178 + +cons_access is never used + <-- line 417 + pos [@@dead "+cons_access"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 425, characters 0-297 + +poly_var_tag_access is never used + <-- line 425 + } [@@dead "+poly_var_tag_access"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 437, characters 0-304 + +poly_var_value_access is never used + <-- line 437 + } [@@dead "+poly_var_value_access"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 449, characters 0-665 + +extension_access is never used + <-- line 449 + {expression_desc = Static_index (e, name, Some pos); comment = None} [@@dead "+extension_access"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 471, characters 0-487 + +string_index is never used + <-- line 471 + | _ -> {expression_desc = String_index (e0, e1); comment} [@@dead "+string_index"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 484, characters 0-77 + +assign is never used + <-- line 484 + let assign ?comment e0 e1 : t = {expression_desc = Bin (Eq, e0, e1); comment} [@@dead "+assign"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 486, characters 0-419 + +assign_by_exp is never used + <-- line 486 + | _ -> assign {expression_desc = Array_index (e, index); comment = None} value [@@dead "+assign_by_exp"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 501, characters 0-99 + +assign_by_int is never used + <-- line 501 + assign_by_exp e0 (int ?comment index) value [@@dead "+assign_by_int"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 504, characters 0-447 + +record_assign is never used + <-- line 504 + value [@@dead "+record_assign"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 522, characters 0-457 + +extension_assign is never used + <-- line 522 + value [@@dead "+extension_assign"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 542, characters 0-277 + +array_length is never used + <-- line 542 + | _ -> {expression_desc = Length (e, Array); comment} [@@dead "+array_length"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 549, characters 0-242 + +string_length is never used + <-- line 549 + | _ -> {expression_desc = Length (e, String); comment} [@@dead "+string_length"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 555, characters 0-304 + +function_length is never used + <-- line 555 + | _ -> {expression_desc = Length (e, Function); comment} [@@dead "+function_length"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 568, characters 0-1023 + +string_append is never used + <-- line 568 + | _, _ -> {comment; expression_desc = String_append (e, el)} [@@dead "+string_append"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 589, characters 0-94 + +obj is never used + <-- line 589 + {expression_desc = Object (dup, properties); comment} [@@dead "+obj"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 592, characters 0-304 + +str_equal is never used + <-- line 592 + else None [@@dead "+str_equal"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 602, characters 0-824 + +triple_equal is never used + <-- line 602 + | _ -> {expression_desc = Bin (EqEqEq, e0, e1); comment} [@@dead "+triple_equal"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 623, characters 0-493 + +bin is never used + <-- line 623 + | _ -> {expression_desc = Bin (op, e0, e1); comment} [@@dead "+bin"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 657, characters 0-17 + +debug is never used + <-- line 657 + let debug = false [@@dead "+debug"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 673, characters 0-634 + +push_negation is never used + <-- line 673 + | _ -> None [@@dead "+push_negation"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 690, characters 0-27 + +simplify_max_depth is never used + <-- line 690 + let simplify_max_depth = 10 [@@dead "+simplify_max_depth"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 732, characters 0-12453 + +simplify_and_ is never used + <-- line 732 + res [@@dead "+simplify_and_"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1041, characters 0-174 + +simplify_and_force is never used + <-- line 1041 + | x -> x [@@dead "+simplify_and_force"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1066, characters 0-818 + +simplify_or_ is never used + <-- line 1066 + res [@@dead "+simplify_or_"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1095, characters 0-171 + +simplify_or_force is never used + <-- line 1095 + | x -> x [@@dead "+simplify_or_force"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1100, characters 0-133 + +simplify_and is never used + <-- line 1100 + else None [@@dead "+simplify_and"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1104, characters 0-131 + +simplify_or is never used + <-- line 1104 + else None [@@dead "+simplify_or"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1108, characters 0-751 + +and_ is never used + <-- line 1108 + | None -> {expression_desc = Bin (And, e1, e2); comment}) [@@dead "+and_"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1128, characters 0-516 + +or_ is never used + <-- line 1128 + | None -> {expression_desc = Bin (Or, e1, e2); comment}) [@@dead "+or_"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1142, characters 0-87 + +in_ is never used + <-- line 1142 + {expression_desc = In (prop, obj); comment = None} [@@dead "+in_"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1145, characters 0-685 + +not is never used + <-- line 1145 + | None -> {expression_desc = Js_not e; comment = None}) [@@dead "+not"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1161, characters 0-124 + +not_empty_branch is never used + <-- line 1161 + | _ -> true [@@dead "+not_empty_branch"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1166, characters 0-1851 + +econd is never used + <-- line 1166 + | _ -> default () [@@dead "+econd"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1215, characters 0-1526 + +float_equal is never used + <-- line 1215 + | _ -> {expression_desc = Bin (EqEqEq, e0, e1); comment} [@@dead "+float_equal"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1253, characters 0-27 + +int_equal is never used + <-- line 1253 + let int_equal = float_equal [@@dead "+int_equal"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1278, characters 0-636 + +emit_check is never used + <-- line 1278 + | Expr x -> x [@@dead "+emit_check"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1298, characters 0-199 + +is_a_literal_case is never used + <-- line 1298 + emit_check check [@@dead "+is_a_literal_case"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1305, characters 0-175 + +is_int_tag is never used + <-- line 1305 + emit_check check [@@dead "+is_int_tag"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1317, characters 0-106 + +tag is never used + <-- line 1317 + {expression_desc = Caml_block_tag (e, name); comment} [@@dead "+tag"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1333, characters 0-726 + +int32_bor is never used + <-- line 1333 + | _ -> {comment; expression_desc = Bin (Bor, e1, e2)} [@@dead "+int32_bor"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1351, characters 0-97 + +to_int32 is never used + <-- line 1351 + int32_bor ?comment e zero_int_literal [@@dead "+to_int32"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1355, characters 0-434 + +string_comp is never used + <-- line 1355 + | _ -> bin ?comment (Lam_compile_util.jsop_of_comp cmp) e0 e1 [@@dead "+string_comp"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1364, characters 0-80 + +string_equal is never used + <-- line 1364 + let string_equal ?comment (e0 : t) (e1 : t) : t = string_comp Ceq ?comment e0 e1 [@@dead "+string_equal"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1366, characters 0-91 + +is_type_number is never used + <-- line 1366 + string_equal ?comment (typeof e) (str "number") [@@dead "+is_type_number"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1369, characters 0-91 + +is_type_string is never used + <-- line 1369 + string_equal ?comment (typeof e) (str "string") [@@dead "+is_type_string"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1372, characters 0-71 + +is_type_object is never used + <-- line 1372 + let is_type_object (e : t) : t = string_equal (typeof e) (str "object") [@@dead "+is_type_object"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1374, characters 0-94 + +obj_length is never used + <-- line 1374 + to_int32 {expression_desc = Length (e, Caml_block); comment} [@@dead "+obj_length"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1377, characters 0-186 + +compare_int_aux is never used + <-- line 1377 + | Cge -> l >= r [@@dead "+compare_int_aux"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1386, characters 0-990 + +int_comp is never used + <-- line 1386 + | _ -> bin ?comment (Lam_compile_util.jsop_of_comp cmp) e0 e1 [@@dead "+int_comp"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1414, characters 0-901 + +bool_comp is never used + <-- line 1414 + | _, _ -> bin ?comment (Lam_compile_util.jsop_of_comp cmp) e0 e1 [@@dead "+bool_comp"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1441, characters 0-92 + +float_comp is never used + <-- line 1441 + bin ?comment (Lam_compile_util.jsop_of_comp cmp) e0 e1 [@@dead "+float_comp"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1444, characters 0-89 + +js_comp is never used + <-- line 1444 + bin ?comment (Lam_compile_util.jsop_of_comp cmp) e0 e1 [@@dead "+js_comp"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1447, characters 0-555 + +int32_lsr is never used + <-- line 1447 + | _, _ -> {comment; expression_desc = Bin (Lsr, e1, e2)} [@@dead "+int32_lsr"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1463, characters 0-1966 + +is_out is never used + <-- line 1463 + | _, _ -> int_comp ?comment Cgt e range [@@dead "+is_out"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1517, characters 0-1244 + +float_add is never used + <-- line 1517 + | _ -> {comment; expression_desc = Bin (Plus, e1, e2)} [@@dead "+float_add"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1547, characters 0-241 + +float_minus is never used + <-- line 1547 + | _ -> {comment; expression_desc = Bin (Minus, e1, e2)} [@@dead "+float_minus"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1553, characters 0-65 + +unchecked_int32_add is never used + <-- line 1553 + let unchecked_int32_add ?comment e1 e2 = float_add ?comment e1 e2 [@@dead "+unchecked_int32_add"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1554, characters 0-66 + +int32_add is never used + <-- line 1554 + let int32_add ?comment e1 e2 = to_int32 (float_add ?comment e1 e2) [@@dead "+int32_add"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1556, characters 0-91 + +offset is never used + <-- line 1556 + if offset = 0 then e1 else int32_add e1 (small_int offset) [@@dead "+offset"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1559, characters 0-87 + +int32_minus is never used + <-- line 1559 + to_int32 (float_minus ?comment e1 e2) [@@dead "+int32_minus"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1562, characters 0-86 + +unchecked_int32_minus is never used + <-- line 1562 + float_minus ?comment e1 e2 [@@dead "+unchecked_int32_minus"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1565, characters 0-53 + +float_div is never used + <-- line 1565 + let float_div ?comment e1 e2 = bin ?comment Div e1 e2 [@@dead "+float_div"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1566, characters 0-53 + +float_pow is never used + <-- line 1566 + let float_pow ?comment e1 e2 = bin ?comment Pow e1 e2 [@@dead "+float_pow"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1567, characters 0-62 + +float_notequal is never used + <-- line 1567 + let float_notequal ?comment e1 e2 = bin ?comment NotEqEq e1 e2 [@@dead "+float_notequal"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1569, characters 0-94 + +int32_asr is never used + <-- line 1569 + {comment; expression_desc = Bin (Asr, e1, e2)} [@@dead "+int32_asr"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1573, characters 0-482 + +int32_div is never used + <-- line 1573 + else to_int32 (float_div ?comment e1 e2) [@@dead "+int32_div"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1584, characters 0-316 + +int32_mod is never used + <-- line 1584 + else {comment; expression_desc = Bin (Mod, e1, e2)} [@@dead "+int32_mod"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1592, characters 0-53 + +float_mul is never used + <-- line 1592 + let float_mul ?comment e1 e2 = bin ?comment Mul e1 e2 [@@dead "+float_mul"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1594, characters 0-316 + +int32_lsl is never used + <-- line 1594 + | _ -> {comment; expression_desc = Bin (Lsl, e1, e2)} [@@dead "+int32_lsl"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1601, characters 0-253 + +is_pos_pow is never used + <-- line 1601 + try aux 0 n with E -> -1 [@@dead "+is_pos_pow"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1611, characters 0-702 + +int32_mul is never used + <-- line 1611 + | _ -> to_int32 (float_mul ?comment e1 e2) [@@dead "+int32_mul"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1627, characters 0-104 + +unchecked_int32_mul is never used + <-- line 1627 + {comment; expression_desc = Bin (Mul, e1, e2)} [@@dead "+unchecked_int32_mul"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1630, characters 0-179 + +int_bnot is never used + <-- line 1630 + | _ -> {comment; expression_desc = Js_bnot e} [@@dead "+int_bnot"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1635, characters 0-251 + +int32_pow is never used + <-- line 1635 + | _ -> to_int32 (float_pow ?comment e1 e2) [@@dead "+int32_pow"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1641, characters 0-445 + +int32_bxor is never used + <-- line 1641 + | _ -> {comment; expression_desc = Bin (Bxor, e1, e2)} [@@dead "+int32_bxor"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1651, characters 0-384 + +int32_band is never used + <-- line 1651 + | _ -> {comment; expression_desc = Bin (Band, e1, e2)} [@@dead "+int32_band"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1665, characters 0-67 + +bigint_op is never used + <-- line 1665 + let bigint_op ?comment op (e1 : t) (e2 : t) = bin ?comment op e1 e2 [@@dead "+bigint_op"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1667, characters 0-992 + +bigint_comp is never used + <-- line 1667 + | _ -> bin ?comment (Lam_compile_util.jsop_of_comp cmp) e0 e1 [@@dead "+bigint_comp"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1694, characters 0-159 + +bigint_div is never used + <-- line 1694 + else bigint_op ?comment Div e0 e1 [@@dead "+bigint_div"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1698, characters 0-160 + +bigint_mod is never used + <-- line 1698 + else bigint_op ?comment Mod e0 e1 [@@dead "+bigint_mod"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1705, characters 0-596 + +of_block is never used + <-- line 1705 + [] [@@dead "+of_block"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1729, characters 0-58 + +is_null is never used + <-- line 1729 + let is_null ?comment (x : t) = triple_equal ?comment x nil [@@dead "+is_null"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1730, characters 0-59 + +is_undef is never used + <-- line 1730 + let is_undef ?comment x = triple_equal ?comment x undefined [@@dead "+is_undef"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1732, characters 0-117 + +is_null_undefined_constant is never used + <-- line 1732 + | _ -> false [@@dead "+is_null_undefined_constant"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1737, characters 0-216 + +is_null_undefined is never used + <-- line 1737 + | _ -> {comment; expression_desc = Is_null_or_undefined x} [@@dead "+is_null_undefined"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1743, characters 0-605 + +eq_null_undefined_boolean is never used + <-- line 1743 + | _ -> {expression_desc = Bin (EqEqEq, a, b); comment} [@@dead "+eq_null_undefined_boolean"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1758, characters 0-605 + +neq_null_undefined_boolean is never used + <-- line 1758 + | _ -> {expression_desc = Bin (NotEqEq, a, b); comment} [@@dead "+neq_null_undefined_boolean"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1773, characters 0-106 + +make_exception is never used + <-- line 1773 + pure_runtime_call Primitive_modules.exceptions Literals.create [str s] [@@dead "+make_exception"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1776, characters 0-173 + +variadic_args is never used + <-- line 1776 + | arg :: args -> arg :: variadic_args args [@@dead "+variadic_args"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 42, characters 0-39 + +remove_pure_sub_exp is never used + <-- line 42 + val remove_pure_sub_exp : t -> t option [@@dead "+remove_pure_sub_exp"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 48, characters 0-62 + +runtime_var_dot is never used + <-- line 48 + val runtime_var_dot : ?comment:string -> string -> string -> t [@@dead "+runtime_var_dot"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 52, characters 0-84 + +ml_var_dot is never used + <-- line 52 + ?comment:string -> ?dynamic_import:bool -> Ident.t -> string -> t [@@dead "+ml_var_dot"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 57, characters 0-185 + +external_var_field is never used + <-- line 57 + t [@@dead "+external_var_field"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 69, characters 0-143 + +external_var is never used + <-- line 69 + t [@@dead "+external_var"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 76, characters 0-78 + +ml_module_as_var is never used + <-- line 76 + val ml_module_as_var : ?comment:string -> ?dynamic_import:bool -> Ident.t -> t [@@dead "+ml_module_as_var"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 87, characters 0-112 + +pure_runtime_call is never used + <-- line 87 + t [@@dead "+pure_runtime_call"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 96, characters 0-39 + +runtime_ref is never used + <-- line 96 + val runtime_ref : string -> string -> t [@@dead "+runtime_ref"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 100, characters 0-187 + +ocaml_fun is never used + <-- line 100 + t [@@dead "+ocaml_fun"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 111, characters 0-139 + +method_ is never used + <-- line 111 + t [@@dead "+method_"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 120, characters 0-47 + +econd is never used + <-- line 120 + val econd : ?comment:string -> t -> t -> t -> t [@@dead "+econd"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 122, characters 0-49 + +int is never used + <-- line 122 + val int : ?comment:string -> ?c:int -> int32 -> t [@@dead "+int"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 124, characters 0-24 + +small_int is never used + <-- line 124 + val small_int : int -> t [@@dead "+small_int"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 126, characters 0-51 + +bigint is never used + <-- line 126 + val bigint : ?comment:string -> bool -> string -> t [@@dead "+bigint"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 128, characters 0-42 + +float is never used + <-- line 128 + val float : ?comment:string -> string -> t [@@dead "+float"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 132, characters 0-24 + +zero_int_literal is never used + <-- line 132 + val zero_int_literal : t [@@dead "+zero_int_literal"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 135, characters 0-22 + +zero_float_lit is never used + <-- line 135 + val zero_float_lit : t [@@dead "+zero_float_lit"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 137, characters 0-27 + +zero_bigint_literal is never used + <-- line 137 + val zero_bigint_literal : t [@@dead "+zero_bigint_literal"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 139, characters 0-43 + +is_out is never used + <-- line 139 + val is_out : ?comment:string -> t -> t -> t [@@dead "+is_out"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 144, characters 0-45 + +dot is never used + <-- line 144 + val dot : ?comment:string -> t -> string -> t [@@dead "+dot"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 146, characters 0-45 + +module_access is never used + <-- line 146 + val module_access : t -> string -> int32 -> t [@@dead "+module_access"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 148, characters 0-44 + +array_length is never used + <-- line 148 + val array_length : ?comment:string -> t -> t [@@dead "+array_length"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 150, characters 0-45 + +string_length is never used + <-- line 150 + val string_length : ?comment:string -> t -> t [@@dead "+string_length"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 152, characters 0-47 + +function_length is never used + <-- line 152 + val function_length : ?comment:string -> t -> t [@@dead "+function_length"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 154, characters 0-50 + +string_append is never used + <-- line 154 + val string_append : ?comment:string -> t -> t -> t [@@dead "+string_append"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 167, characters 0-49 + +string_index is never used + <-- line 167 + val string_index : ?comment:string -> t -> t -> t [@@dead "+string_index"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 169, characters 0-48 + +array_index is never used + <-- line 169 + val array_index : ?comment:string -> t -> t -> t [@@dead "+array_index"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 171, characters 0-61 + +array_index_by_int is never used + <-- line 171 + val array_index_by_int : ?comment:string -> t -> Int32.t -> t [@@dead "+array_index_by_int"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 173, characters 0-47 + +record_access is never used + <-- line 173 + val record_access : t -> string -> Int32.t -> t [@@dead "+record_access"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 175, characters 0-54 + +inline_record_access is never used + <-- line 175 + val inline_record_access : t -> string -> Int32.t -> t [@@dead "+inline_record_access"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 177, characters 0-36 + +variant_access is never used + <-- line 177 + val variant_access : t -> int32 -> t [@@dead "+variant_access"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 179, characters 0-33 + +cons_access is never used + <-- line 179 + val cons_access : t -> int32 -> t [@@dead "+cons_access"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 181, characters 0-57 + +extension_access is never used + <-- line 181 + val extension_access : t -> string option -> Int32.t -> t [@@dead "+extension_access"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 183, characters 0-50 + +record_assign is never used + <-- line 183 + val record_assign : t -> int32 -> string -> t -> t [@@dead "+record_assign"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 185, characters 0-32 + +poly_var_tag_access is never used + <-- line 185 + val poly_var_tag_access : t -> t [@@dead "+poly_var_tag_access"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 187, characters 0-34 + +poly_var_value_access is never used + <-- line 187 + val poly_var_value_access : t -> t [@@dead "+poly_var_value_access"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 189, characters 0-53 + +extension_assign is never used + <-- line 189 + val extension_assign : t -> int32 -> string -> t -> t [@@dead "+extension_assign"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 191, characters 0-59 + +assign_by_int is never used + <-- line 191 + val assign_by_int : ?comment:string -> t -> int32 -> t -> t [@@dead "+assign_by_int"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 199, characters 0-36 + +assign_by_exp is never used + <-- line 199 + val assign_by_exp : t -> t -> t -> t [@@dead "+assign_by_exp"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 201, characters 0-43 + +assign is never used + <-- line 201 + val assign : ?comment:string -> t -> t -> t [@@dead "+assign"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 205, characters 0-62 + +emit_check is never used + <-- line 205 + val emit_check : t Ast_untagged_variants.Dynamic_checks.t -> t [@@dead "+emit_check"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 207, characters 0-49 + +triple_equal is never used + <-- line 207 + val triple_equal : ?comment:string -> t -> t -> t [@@dead "+triple_equal"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 210, characters 0-48 + +float_equal is never used + <-- line 210 + val float_equal : ?comment:string -> t -> t -> t [@@dead "+float_equal"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 212, characters 0-46 + +int_equal is never used + <-- line 212 + val int_equal : ?comment:string -> t -> t -> t [@@dead "+int_equal"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 214, characters 0-40 + +int_bnot is never used + <-- line 214 + val int_bnot : ?comment:string -> t -> t [@@dead "+int_bnot"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 216, characters 0-49 + +string_equal is never used + <-- line 216 + val string_equal : ?comment:string -> t -> t -> t [@@dead "+string_equal"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 218, characters 0-62 + +eq_null_undefined_boolean is never used + <-- line 218 + val eq_null_undefined_boolean : ?comment:string -> t -> t -> t [@@dead "+eq_null_undefined_boolean"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 220, characters 0-63 + +neq_null_undefined_boolean is never used + <-- line 220 + val neq_null_undefined_boolean : ?comment:string -> t -> t -> t [@@dead "+neq_null_undefined_boolean"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 222, characters 0-46 + +is_type_number is never used + <-- line 222 + val is_type_number : ?comment:string -> t -> t [@@dead "+is_type_number"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 224, characters 0-71 + +is_int_tag is never used + <-- line 224 + val is_int_tag : ?has_null_undefined_other:bool * bool * bool -> t -> t [@@dead "+is_int_tag"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 226, characters 0-144 + +is_a_literal_case is never used + <-- line 226 + t [@@dead "+is_a_literal_case"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 232, characters 0-46 + +is_type_string is never used + <-- line 232 + val is_type_string : ?comment:string -> t -> t [@@dead "+is_type_string"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 234, characters 0-27 + +is_type_object is never used + <-- line 234 + val is_type_object : t -> t [@@dead "+is_type_object"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 236, characters 0-38 + +typeof is never used + <-- line 236 + val typeof : ?comment:string -> t -> t [@@dead "+typeof"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 237, characters 0-47 + +instanceof is never used + <-- line 237 + val instanceof : ?comment:string -> t -> t -> t [@@dead "+instanceof"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 238, characters 0-21 + +is_array is never used + <-- line 238 + val is_array : t -> t [@@dead "+is_array"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 240, characters 0-40 + +to_int32 is never used + <-- line 240 + val to_int32 : ?comment:string -> t -> t [@@dead "+to_int32"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 242, characters 0-56 + +unchecked_int32_add is never used + <-- line 242 + val unchecked_int32_add : ?comment:string -> t -> t -> t [@@dead "+unchecked_int32_add"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 244, characters 0-46 + +int32_add is never used + <-- line 244 + val int32_add : ?comment:string -> t -> t -> t [@@dead "+int32_add"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 246, characters 0-26 + +offset is never used + <-- line 246 + val offset : t -> int -> t [@@dead "+offset"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 248, characters 0-58 + +unchecked_int32_minus is never used + <-- line 248 + val unchecked_int32_minus : ?comment:string -> t -> t -> t [@@dead "+unchecked_int32_minus"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 250, characters 0-48 + +int32_minus is never used + <-- line 250 + val int32_minus : ?comment:string -> t -> t -> t [@@dead "+int32_minus"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 252, characters 0-46 + +int32_mul is never used + <-- line 252 + val int32_mul : ?comment:string -> t -> t -> t [@@dead "+int32_mul"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 254, characters 0-56 + +unchecked_int32_mul is never used + <-- line 254 + val unchecked_int32_mul : ?comment:string -> t -> t -> t [@@dead "+unchecked_int32_mul"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 256, characters 0-62 + +int32_div is never used + <-- line 256 + val int32_div : checked:bool -> ?comment:string -> t -> t -> t [@@dead "+int32_div"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 258, characters 0-62 + +int32_mod is never used + <-- line 258 + val int32_mod : checked:bool -> ?comment:string -> t -> t -> t [@@dead "+int32_mod"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 260, characters 0-46 + +int32_pow is never used + <-- line 260 + val int32_pow : ?comment:string -> t -> t -> t [@@dead "+int32_pow"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 262, characters 0-46 + +int32_lsl is never used + <-- line 262 + val int32_lsl : ?comment:string -> t -> t -> t [@@dead "+int32_lsl"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 264, characters 0-46 + +int32_lsr is never used + <-- line 264 + val int32_lsr : ?comment:string -> t -> t -> t [@@dead "+int32_lsr"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 266, characters 0-46 + +int32_asr is never used + <-- line 266 + val int32_asr : ?comment:string -> t -> t -> t [@@dead "+int32_asr"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 268, characters 0-47 + +int32_bxor is never used + <-- line 268 + val int32_bxor : ?comment:string -> t -> t -> t [@@dead "+int32_bxor"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 270, characters 0-47 + +int32_band is never used + <-- line 270 + val int32_band : ?comment:string -> t -> t -> t [@@dead "+int32_band"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 272, characters 0-46 + +int32_bor is never used + <-- line 272 + val int32_bor : ?comment:string -> t -> t -> t [@@dead "+int32_bor"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 274, characters 0-46 + +float_add is never used + <-- line 274 + val float_add : ?comment:string -> t -> t -> t [@@dead "+float_add"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 276, characters 0-48 + +float_minus is never used + <-- line 276 + val float_minus : ?comment:string -> t -> t -> t [@@dead "+float_minus"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 278, characters 0-46 + +float_mul is never used + <-- line 278 + val float_mul : ?comment:string -> t -> t -> t [@@dead "+float_mul"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 280, characters 0-46 + +float_div is never used + <-- line 280 + val float_div : ?comment:string -> t -> t -> t [@@dead "+float_div"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 282, characters 0-51 + +float_notequal is never used + <-- line 282 + val float_notequal : ?comment:string -> t -> t -> t [@@dead "+float_notequal"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 284, characters 0-46 + +float_mod is never used + <-- line 284 + val float_mod : ?comment:string -> t -> t -> t [@@dead "+float_mod"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 286, characters 0-46 + +float_pow is never used + <-- line 286 + val float_pow : ?comment:string -> t -> t -> t [@@dead "+float_pow"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 288, characters 0-70 + +int_comp is never used + <-- line 288 + val int_comp : Lam_compat.comparison -> ?comment:string -> t -> t -> t [@@dead "+int_comp"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 290, characters 0-71 + +bool_comp is never used + <-- line 290 + val bool_comp : Lam_compat.comparison -> ?comment:string -> t -> t -> t [@@dead "+bool_comp"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 292, characters 0-73 + +string_comp is never used + <-- line 292 + val string_comp : Lam_compat.comparison -> ?comment:string -> t -> t -> t [@@dead "+string_comp"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 294, characters 0-72 + +float_comp is never used + <-- line 294 + val float_comp : Lam_compat.comparison -> ?comment:string -> t -> t -> t [@@dead "+float_comp"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 296, characters 0-61 + +bigint_op is never used + <-- line 296 + val bigint_op : ?comment:string -> Js_op.binop -> t -> t -> t [@@dead "+bigint_op"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 298, characters 0-73 + +bigint_comp is never used + <-- line 298 + val bigint_comp : Lam_compat.comparison -> ?comment:string -> t -> t -> t [@@dead "+bigint_comp"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 300, characters 0-63 + +bigint_div is never used + <-- line 300 + val bigint_div : checked:bool -> ?comment:string -> t -> t -> t [@@dead "+bigint_div"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 302, characters 0-63 + +bigint_mod is never used + <-- line 302 + val bigint_mod : checked:bool -> ?comment:string -> t -> t -> t [@@dead "+bigint_mod"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 304, characters 0-69 + +js_comp is never used + <-- line 304 + val js_comp : Lam_compat.comparison -> ?comment:string -> t -> t -> t [@@dead "+js_comp"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 306, characters 0-16 + +not is never used + <-- line 306 + val not : t -> t [@@dead "+not"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 308, characters 0-69 + +call is never used + <-- line 308 + val call : ?comment:string -> info:Js_call_info.t -> t -> t list -> t [@@dead "+call"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 310, characters 0-46 + +flat_call is never used + <-- line 310 + val flat_call : ?comment:string -> t -> t -> t [@@dead "+flat_call"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 312, characters 0-67 + +tagged_template is never used + <-- line 312 + val tagged_template : ?comment:string -> t -> t list -> t list -> t [@@dead "+tagged_template"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 318, characters 0-49 + +optional_block is never used + <-- line 318 + val optional_block : J.expression -> J.expression [@@dead "+optional_block"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 320, characters 0-58 + +optional_not_nest_block is never used + <-- line 320 + val optional_not_nest_block : J.expression -> J.expression [@@dead "+optional_not_nest_block"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 322, characters 0-147 + +make_block is never used + <-- line 322 + t [@@dead "+make_block"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 332, characters 0-40 + +seq is never used + <-- line 332 + val seq : ?comment:string -> t -> t -> t [@@dead "+seq"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 334, characters 0-34 + +fuse_to_seq is never used + <-- line 334 + val fuse_to_seq : t -> t list -> t [@@dead "+fuse_to_seq"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 336, characters 0-69 + +obj is never used + <-- line 336 + val obj : ?comment:string -> ?dup:J.expression -> J.property_map -> t [@@dead "+obj"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 338, characters 0-13 + +true_ is never used + <-- line 338 + val true_ : t [@@dead "+true_"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 340, characters 0-14 + +false_ is never used + <-- line 340 + val false_ : t [@@dead "+false_"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 342, characters 0-20 + +bool is never used + <-- line 342 + val bool : bool -> t [@@dead "+bool"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 344, characters 0-12 + +unit is never used + <-- line 344 + val unit : t [@@dead "+unit"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 347, characters 0-17 + +undefined is never used + <-- line 347 + val undefined : t [@@dead "+undefined"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 349, characters 0-62 + +tag is never used + <-- line 349 + val tag : ?comment:string -> ?name:string -> J.expression -> t [@@dead "+tag"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 356, characters 0-53 + +obj_length is never used + <-- line 356 + val obj_length : ?comment:string -> J.expression -> t [@@dead "+obj_length"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 358, characters 0-41 + +and_ is never used + <-- line 358 + val and_ : ?comment:string -> t -> t -> t [@@dead "+and_"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 360, characters 0-40 + +or_ is never used + <-- line 360 + val or_ : ?comment:string -> t -> t -> t [@@dead "+or_"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 362, characters 0-21 + +in_ is never used + <-- line 362 + val in_ : t -> t -> t [@@dead "+in_"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 366, characters 0-54 + +dummy_obj is never used + <-- line 366 + val dummy_obj : ?comment:string -> Lam_tag_info.t -> t [@@dead "+dummy_obj"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 369, characters 0-74 + +of_block is never used + <-- line 369 + val of_block : ?comment:string -> ?e:J.expression -> J.statement list -> t [@@dead "+of_block"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 372, characters 0-73 + +raw_js_code is never used + <-- line 372 + val raw_js_code : ?comment:string -> Js_raw_info.code_info -> string -> t [@@dead "+raw_js_code"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 374, characters 0-11 + +nil is never used + <-- line 374 + val nil : t [@@dead "+nil"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 376, characters 0-39 + +is_null is never used + <-- line 376 + val is_null : ?comment:string -> t -> t [@@dead "+is_null"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 378, characters 0-40 + +is_undef is never used + <-- line 378 + val is_undef : ?comment:string -> t -> t [@@dead "+is_undef"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 380, characters 0-53 + +is_null_undefined_constant is never used + <-- line 380 + val is_null_undefined_constant : J.expression -> bool [@@dead "+is_null_undefined_constant"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 382, characters 0-49 + +is_null_undefined is never used + <-- line 382 + val is_null_undefined : ?comment:string -> t -> t [@@dead "+is_null_undefined"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 384, characters 0-32 + +make_exception is never used + <-- line 384 + val make_exception : string -> t [@@dead "+make_exception"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 386, characters 0-36 + +variadic_args is never used + <-- line 386 + val variadic_args : t list -> t list [@@dead "+variadic_args"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_fold_basic.ml", line 1, characters 0-0 + +js_fold_basic is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_fold_basic.ml", line 25, characters 0-56 + +add_lam_module_ident is never used + <-- line 25 + let add_lam_module_ident = Lam_module_ident.Hash_set.add [@@dead "+add_lam_module_ident"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_fold_basic.ml", line 27, characters 0-45 + +create is never used + <-- line 27 + let create = Lam_module_ident.Hash_set.create [@@dead "+create"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_fold_basic.ml", line 29, characters 0-32 + +super is never used + <-- line 29 + let super = Js_record_iter.super [@@dead "+super"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_fold_basic.ml", line 31, characters 0-411 + +count_hard_dependencies is never used + <-- line 31 + } [@@dead "+count_hard_dependencies"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_fold_basic.ml", line 45, characters 0-178 + +calculate_hard_dependencies is never used + <-- line 45 + hard_dependencies [@@dead "+calculate_hard_dependencies"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_fold_basic.mli", line 1, characters 0-0 + js_fold_basic is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_fold_basic.mli", line 29, characters 0-72 + +calculate_hard_dependencies is never used + <-- line 29 + val calculate_hard_dependencies : J.block -> Lam_module_ident.Hash_set.t [@@dead "+calculate_hard_dependencies"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_fun_env.ml", line 52, characters 0-243 + +make is never used + <-- line 52 + } [@@dead "+make"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_fun_env.ml", line 62, characters 0-134 + +no_tailcall is never used + <-- line 62 + | Immutable_mask arr -> Array.to_list arr [@@dead "+no_tailcall"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_fun_env.ml", line 67, characters 0-45 + +mark_unused is never used + <-- line 67 + let mark_unused t i = t.used_mask.(i) <- true [@@dead "+mark_unused"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_fun_env.ml", line 79, characters 0-233 + +get_mutable_params is never used + <-- line 79 + Ext_list.filter_mapi params (fun p i -> if not xs.(i) then Some p else None) [@@dead "+get_mutable_params"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_fun_env.ml", line 87, characters 0-143 + +set_unbounded is never used + <-- line 87 + env.unbounded <- v [@@dead "+set_unbounded"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_fun_env.mli", line 31, characters 0-49 + +make is never used + <-- line 31 + val make : ?immutable_mask:bool array -> int -> t [@@dead "+make"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_fun_env.mli", line 33, characters 0-32 + +no_tailcall is never used + <-- line 33 + val no_tailcall : t -> bool list [@@dead "+no_tailcall"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_fun_env.mli", line 37, characters 0-44 + +set_unbounded is never used + <-- line 37 + val set_unbounded : t -> Set_ident.t -> unit [@@dead "+set_unbounded"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_fun_env.mli", line 41, characters 0-34 + +mark_unused is never used + <-- line 41 + val mark_unused : t -> int -> unit [@@dead "+mark_unused"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_fun_env.mli", line 45, characters 0-58 + +get_mutable_params is never used + <-- line 45 + val get_mutable_params : Ident.t list -> t -> Ident.t list [@@dead "+get_mutable_params"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_name_of_module_id.mli", line 1, characters 0-0 + js_name_of_module_id is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_name_of_module_id.mli", line 33, characters 0-117 + +string_of_module_id is never used + <-- line 33 + string [@@dead "+string_of_module_id"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_array.ml", line 1, characters 0-0 + +js_of_lam_array is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_array.ml", line 28, characters 0-40 + +make_array is never used + <-- line 28 + let make_array mt args = E.array mt args [@@dead "+make_array"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_array.ml", line 30, characters 0-56 + +set_array is never used + <-- line 30 + let set_array e e0 e1 = E.assign (E.array_index e e0) e1 [@@dead "+set_array"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_array.ml", line 32, characters 0-39 + +ref_array is never used + <-- line 32 + let ref_array e e0 = E.array_index e e0 [@@dead "+ref_array"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_array.mli", line 1, characters 0-0 + js_of_lam_array is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_array.mli", line 27, characters 0-68 + +make_array is never used + <-- line 27 + val make_array : J.mutable_flag -> J.expression list -> J.expression [@@dead "+make_array"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_array.mli", line 30, characters 0-76 + +set_array is never used + <-- line 30 + val set_array : J.expression -> J.expression -> J.expression -> J.expression [@@dead "+set_array"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_array.mli", line 32, characters 0-60 + +ref_array is never used + <-- line 32 + val ref_array : J.expression -> J.expression -> J.expression [@@dead "+ref_array"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_block.ml", line 1, characters 0-0 + +js_of_lam_block is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_block.ml", line 30, characters 0-141 + +make_block is never used + <-- line 30 + | _ -> E.make_block tag tag_info args mutable_flag [@@dead "+make_block"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_block.ml", line 34, characters 0-646 + +field is never used + <-- line 34 + | Fld_module {name} -> E.module_access e name i [@@dead "+field"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_block.ml", line 48, characters 0-40 + +field_by_exp is never used + <-- line 48 + let field_by_exp e i = E.array_index e i [@@dead "+field_by_exp"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_block.ml", line 50, characters 0-247 + +set_field is never used + <-- line 50 + E.record_assign e i name e0 [@@dead "+set_field"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_block.ml", line 57, characters 0-72 + +set_field_by_exp is never used + <-- line 57 + let set_field_by_exp self index value = E.assign_by_exp self index value [@@dead "+set_field_by_exp"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_block.mli", line 1, characters 0-0 + js_of_lam_block is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_block.mli", line 27, characters 0-116 + +make_block is never used + <-- line 27 + J.expression [@@dead "+make_block"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_block.mli", line 34, characters 0-78 + +field is never used + <-- line 34 + val field : Lam_compat.field_dbg_info -> J.expression -> int32 -> J.expression [@@dead "+field"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_block.mli", line 36, characters 0-63 + +field_by_exp is never used + <-- line 36 + val field_by_exp : J.expression -> J.expression -> J.expression [@@dead "+field_by_exp"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_block.mli", line 38, characters 0-112 + +set_field is never used + <-- line 38 + J.expression [@@dead "+set_field"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_block.mli", line 45, characters 0-85 + +set_field_by_exp is never used + <-- line 45 + J.expression -> J.expression -> J.expression -> J.expression [@@dead "+set_field_by_exp"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.ml", line 1, characters 0-0 + +js_of_lam_option is a dead module as all its items are dead. + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.ml", line 27, characters 26-42 + option_unwrap_time.Static_unwrapped is a variant case which is never constructed + <-- line 27 + type option_unwrap_time = Static_unwrapped [@dead "option_unwrap_time.Static_unwrapped"] | Runtime_maybe_unwrapped + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.ml", line 27, characters 43-68 + option_unwrap_time.Runtime_maybe_unwrapped is a variant case which is never constructed + <-- line 27 + type option_unwrap_time = Static_unwrapped [@dead "option_unwrap_time.Static_unwrapped"] | Runtime_maybe_unwrapped [@dead "option_unwrap_time.Runtime_maybe_unwrapped"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.ml", line 37, characters 0-37 + +none is never used + <-- line 37 + let none : J.expression = E.undefined [@@dead "+none"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.ml", line 39, characters 0-102 + +is_none_static is never used + <-- line 39 + | _ -> false [@@dead "+is_none_static"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.ml", line 44, characters 0-226 + +is_not_none is never used + <-- line 44 + | _ -> E.not (E.triple_equal e none) [@@dead "+is_not_none"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.ml", line 67, characters 0-177 + +val_from_option is never used + <-- line 67 + | _ -> E.runtime_call Primitive_modules.option "valFromOption" [arg] [@@dead "+val_from_option"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.ml", line 72, characters 0-496 + +get_default_undefined_from_optional is never used + <-- line 72 + else E.runtime_call Primitive_modules.option "valFromOption" [arg] [@@dead "+get_default_undefined_from_optional"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.ml", line 84, characters 0-327 + +option_unwrap is never used + <-- line 84 + | _ -> E.runtime_call Primitive_modules.option "unwrapPolyVar" [arg] [@@dead "+option_unwrap"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.ml", line 93, characters 0-265 + +destruct_optional is never used + <-- line 93 + | _ -> not_sure () [@@dead "+destruct_optional"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.ml", line 102, characters 0-27 + +some is never used + <-- line 102 + let some = E.optional_block [@@dead "+some"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.ml", line 104, characters 0-55 + +null_to_opt is never used + <-- line 104 + let null_to_opt e = E.econd (E.is_null e) none (some e) [@@dead "+null_to_opt"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.ml", line 106, characters 0-57 + +undef_to_opt is never used + <-- line 106 + let undef_to_opt e = E.econd (E.is_undef e) none (some e) [@@dead "+undef_to_opt"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.ml", line 108, characters 0-71 + +null_undef_to_opt is never used + <-- line 108 + let null_undef_to_opt e = E.econd (E.is_null_undefined e) none (some e) [@@dead "+null_undef_to_opt"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.mli", line 1, characters 0-0 + js_of_lam_option is a dead module as all its items are dead. + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.mli", line 25, characters 26-42 + option_unwrap_time.Static_unwrapped is a variant case which is never constructed + <-- line 25 + type option_unwrap_time = Static_unwrapped [@dead "option_unwrap_time.Static_unwrapped"] | Runtime_maybe_unwrapped + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.mli", line 25, characters 43-68 + option_unwrap_time.Runtime_maybe_unwrapped is a variant case which is never constructed + <-- line 25 + type option_unwrap_time = Static_unwrapped [@dead "option_unwrap_time.Static_unwrapped"] | Runtime_maybe_unwrapped [@dead "option_unwrap_time.Runtime_maybe_unwrapped"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.mli", line 27, characters 0-50 + +val_from_option is never used + <-- line 27 + val val_from_option : J.expression -> J.expression [@@dead "+val_from_option"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.mli", line 30, characters 0-70 + +get_default_undefined_from_optional is never used + <-- line 30 + val get_default_undefined_from_optional : J.expression -> J.expression [@@dead "+get_default_undefined_from_optional"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.mli", line 33, characters 0-48 + +option_unwrap is never used + <-- line 33 + val option_unwrap : J.expression -> J.expression [@@dead "+option_unwrap"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.mli", line 37, characters 0-135 + +destruct_optional is never used + <-- line 37 + 'a [@@dead "+destruct_optional"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.mli", line 44, characters 0-39 + +some is never used + <-- line 44 + val some : J.expression -> J.expression [@@dead "+some"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.mli", line 46, characters 0-46 + +is_not_none is never used + <-- line 46 + val is_not_none : J.expression -> J.expression [@@dead "+is_not_none"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.mli", line 48, characters 0-46 + +null_to_opt is never used + <-- line 48 + val null_to_opt : J.expression -> J.expression [@@dead "+null_to_opt"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.mli", line 50, characters 0-47 + +undef_to_opt is never used + <-- line 50 + val undef_to_opt : J.expression -> J.expression [@@dead "+undef_to_opt"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.mli", line 52, characters 0-52 + +null_undef_to_opt is never used + <-- line 52 + val null_undef_to_opt : J.expression -> J.expression [@@dead "+null_undef_to_opt"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_string.ml", line 1, characters 0-0 + +js_of_lam_string is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_string.ml", line 32, characters 0-57 + +const_char is never used + <-- line 32 + let const_char (i : int) = E.int ~c:i (Int32.of_int @@ i) [@@dead "+const_char"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_string.ml", line 35, characters 0-41 + +ref_string is never used + <-- line 35 + let ref_string e e1 = E.string_index e e1 [@@dead "+ref_string"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_string.mli", line 1, characters 0-0 + js_of_lam_string is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_string.mli", line 31, characters 0-61 + +ref_string is never used + <-- line 31 + val ref_string : J.expression -> J.expression -> J.expression [@@dead "+ref_string"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_string.mli", line 33, characters 0-36 + +const_char is never used + <-- line 33 + val const_char : int -> J.expression [@@dead "+const_char"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_variant.ml", line 28, characters 22-29 + arg_expression.Splice0 is a variant case which is never constructed + <-- line 28 + type arg_expression = Splice0 [@dead "arg_expression.Splice0"] | Splice1 of E.t | Splice2 of E.t * E.t + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_variant.ml", line 28, characters 30-46 + arg_expression.Splice1 is a variant case which is never constructed + <-- line 28 + type arg_expression = Splice0 [@dead "arg_expression.Splice0"] | Splice1 of E.t [@dead "arg_expression.Splice1"] | Splice2 of E.t * E.t + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_variant.ml", line 31, characters 0-717 + +eval is never used + <-- line 31 + ] [@@dead "+eval"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_variant.ml", line 63, characters 0-1262 + +eval_as_event is never used + <-- line 63 + E.poly_var_value_access arg ) [@@dead "+eval_as_event"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_variant.ml", line 100, characters 0-734 + +eval_as_int is never used + <-- line 100 + ] [@@dead "+eval_as_int"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_variant.ml", line 121, characters 0-184 + +eval_as_unwrap is never used + <-- line 121 + | _ -> E.poly_var_value_access arg [@@dead "+eval_as_unwrap"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_variant.mli", line 28, characters 2-11 + arg_expression.Splice0 is a variant case which is never constructed + <-- line 28 + | Splice0 [@dead "arg_expression.Splice0"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_variant.mli", line 29, characters 2-27 + arg_expression.Splice1 is a variant case which is never constructed + <-- line 29 + | Splice1 of J.expression [@dead "arg_expression.Splice1"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_variant.mli", line 32, characters 0-65 + +eval is never used + <-- line 32 + val eval : J.expression -> (string * string) list -> J.expression [@@dead "+eval"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_variant.mli", line 34, characters 0-85 + +eval_as_event is never used + <-- line 34 + J.expression -> (string * string) list option -> arg_expression [@@dead "+eval_as_event"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_variant.mli", line 37, characters 0-69 + +eval_as_int is never used + <-- line 37 + val eval_as_int : J.expression -> (string * int) list -> J.expression [@@dead "+eval_as_int"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_variant.mli", line 39, characters 0-49 + +eval_as_unwrap is never used + <-- line 39 + val eval_as_unwrap : J.expression -> J.expression [@@dead "+eval_as_unwrap"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op.ml", line 41, characters 2-8 + binop.Bnot is a variant case which is never constructed + <-- line 41 + | Bnot [@dead "binop.Bnot"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op.ml", line 92, characters 2-7 + int_op.Bor is a variant case which is never constructed + <-- line 92 + | Bor [@dead "int_op.Bor"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op.ml", line 93, characters 2-8 + int_op.Bxor is a variant case which is never constructed + <-- line 93 + | Bxor [@dead "int_op.Bxor"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op.ml", line 94, characters 2-8 + int_op.Band is a variant case which is never constructed + <-- line 94 + | Band [@dead "int_op.Band"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op.ml", line 95, characters 2-7 + int_op.Lsl is a variant case which is never constructed + <-- line 95 + | Lsl [@dead "int_op.Lsl"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op.ml", line 96, characters 2-7 + int_op.Lsr is a variant case which is never constructed + <-- line 96 + | Lsr [@dead "int_op.Lsr"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op.ml", line 97, characters 2-7 + int_op.Asr is a variant case which is never constructed + <-- line 97 + | Asr [@dead "int_op.Asr"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op.ml", line 98, characters 2-8 + int_op.Plus is a variant case which is never constructed + <-- line 98 + | Plus [@dead "int_op.Plus"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op.ml", line 102, characters 2-9 + int_op.Minus is a variant case which is never constructed + <-- line 102 + | Minus [@dead "int_op.Minus"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op.ml", line 104, characters 2-7 + int_op.Mul is a variant case which is never constructed + <-- line 104 + | Mul [@dead "int_op.Mul"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op.ml", line 106, characters 2-7 + int_op.Div is a variant case which is never constructed + <-- line 106 + | Div [@dead "int_op.Div"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op.ml", line 108, characters 2-7 + int_op.Mod is a variant case which is never constructed + <-- line 108 + | Mod [@dead "int_op.Mod"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op.ml", line 110, characters 2-7 + int_op.Pow is a variant case which is never constructed + <-- line 110 + | Pow [@dead "int_op.Pow"] (* x ** y | 0 *) + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op.ml", line 119, characters 13-16 + level.Log is a variant case which is never constructed + <-- line 119 + type level = Log [@dead "level.Log"] | Info | Warn | Error + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op.ml", line 119, characters 17-23 + level.Info is a variant case which is never constructed + <-- line 119 + type level = Log [@dead "level.Log"] | Info [@dead "level.Info"] | Warn | Error + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op.ml", line 119, characters 24-30 + level.Warn is a variant case which is never constructed + <-- line 119 + type level = Log [@dead "level.Log"] | Info [@dead "level.Info"] | Warn [@dead "level.Warn"] | Error + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op.ml", line 119, characters 31-38 + level.Error is a variant case which is never constructed + <-- line 119 + type level = Log [@dead "level.Log"] | Info [@dead "level.Info"] | Warn [@dead "level.Warn"] | Error [@dead "level.Error"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op.ml", line 130, characters 38-44 + property.Strict is a variant case which is never constructed + <-- line 130 + type property = Lam_compat.let_kind = Strict [@dead "property.Strict"] | Alias | StrictOpt | Variable + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op.ml", line 130, characters 45-52 + property.Alias is a variant case which is never constructed + <-- line 130 + type property = Lam_compat.let_kind = Strict [@dead "property.Strict"] | Alias [@dead "property.Alias"] | StrictOpt | Variable + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op.ml", line 130, characters 53-64 + property.StrictOpt is a variant case which is never constructed + <-- line 130 + type property = Lam_compat.let_kind = Strict [@dead "property.Strict"] | Alias [@dead "property.Alias"] | StrictOpt [@dead "property.StrictOpt"] | Variable + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op.ml", line 130, characters 65-75 + property.Variable is a variant case which is never constructed + <-- line 130 + type property = Lam_compat.let_kind = Strict [@dead "property.Strict"] | Alias [@dead "property.Alias"] | StrictOpt [@dead "property.StrictOpt"] | Variable [@dead "property.Variable"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op.ml", line 134, characters 17-23 + access.Getter is a variant case which is never constructed + <-- line 134 + type 'a access = Getter [@dead "access.Getter"] | Setter + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op.ml", line 134, characters 24-32 + access.Setter is a variant case which is never constructed + <-- line 134 + type 'a access = Getter [@dead "access.Getter"] | Setter [@dead "access.Setter"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op.ml", line 162, characters 22-37 + recursive_info.SingleRecursive is a variant case which is never constructed + <-- line 162 + type recursive_info = SingleRecursive [@dead "recursive_info.SingleRecursive"] | NonRecursie | NA + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op.ml", line 162, characters 38-51 + recursive_info.NonRecursie is a variant case which is never constructed + <-- line 162 + type recursive_info = SingleRecursive [@dead "recursive_info.SingleRecursive"] | NonRecursie [@dead "recursive_info.NonRecursie"] | NA + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op.ml", line 162, characters 52-56 + recursive_info.NA is a variant case which is never constructed + <-- line 162 + type recursive_info = SingleRecursive [@dead "recursive_info.SingleRecursive"] | NonRecursie [@dead "recursive_info.NonRecursie"] | NA [@dead "recursive_info.NA"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op.ml", line 197, characters 36-43 + length_object.Bytes is a variant case which is never constructed + <-- line 197 + type length_object = Array | String | Bytes [@dead "length_object.Bytes"] | Function | Caml_block + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op_util.ml", line 46, characters 0-247 + +op_int_prec is never used + <-- line 46 + | Pow -> (13, 14, 12) [@@dead "+op_int_prec"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op_util.ml", line 82, characters 0-242 + +op_int_str is never used + <-- line 82 + | Pow -> "**" [@@dead "+op_int_str"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op_util.ml", line 97, characters 0-305 + +str_of_used_stats is never used + <-- line 97 + | NA -> "NA" [@@dead "+str_of_used_stats"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op_util.ml", line 108, characters 0-249 + +update_used_stats is never used + <-- line 108 + ident_info.used_stats <- used_stats [@@dead "+update_used_stats"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op_util.ml", line 114, characters 0-174 + +same_str_opt is never used + <-- line 114 + | None, Some _ | Some _, None -> false [@@dead "+same_str_opt"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op_util.ml", line 120, characters 0-576 + +same_vident is never used + <-- line 120 + | Id _, Qualified _ | Qualified _, Id _ -> false [@@dead "+same_vident"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op_util.ml", line 135, characters 0-139 + +of_lam_mutable_flag is never used + <-- line 135 + | Mutable -> Mutable [@@dead "+of_lam_mutable_flag"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op_util.mli", line 31, characters 0-49 + +op_int_prec is never used + <-- line 31 + val op_int_prec : Js_op.int_op -> int * int * int [@@dead "+op_int_prec"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op_util.mli", line 33, characters 0-39 + +op_int_str is never used + <-- line 33 + val op_int_str : Js_op.int_op -> string [@@dead "+op_int_str"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op_util.mli", line 35, characters 0-50 + +str_of_used_stats is never used + <-- line 35 + val str_of_used_stats : Js_op.used_stats -> string [@@dead "+str_of_used_stats"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op_util.mli", line 37, characters 0-64 + +update_used_stats is never used + <-- line 37 + val update_used_stats : J.ident_info -> Js_op.used_stats -> unit [@@dead "+update_used_stats"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op_util.mli", line 39, characters 0-46 + +same_vident is never used + <-- line 39 + val same_vident : J.vident -> J.vident -> bool [@@dead "+same_vident"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op_util.mli", line 41, characters 0-69 + +of_lam_mutable_flag is never used + <-- line 41 + val of_lam_mutable_flag : Asttypes.mutable_flag -> Js_op.mutable_flag [@@dead "+of_lam_mutable_flag"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_output.ml", line 35, characters 0-84 + +make is never used + <-- line 35 + {block; value; output_finished} [@@dead "+make"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_output.ml", line 38, characters 0-63 + +dummy is never used + <-- line 38 + let dummy = {value = None; block = []; output_finished = Dummy} [@@dead "+dummy"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_output.ml", line 42, characters 0-536 + +output_of_expression is never used + <-- line 42 + | NeedValue _ -> {block = []; value = Some exp; output_finished = False} [@@dead "+output_of_expression"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_output.ml", line 54, characters 0-494 + +output_of_block_and_expression is never used + <-- line 54 + | NeedValue _ -> make block ~value:exp [@@dead "+output_of_block_and_expression"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_output.ml", line 65, characters 0-197 + +block_with_opt_expr is never used + <-- line 65 + | Some x -> block @ [S.exp x] [@@dead "+block_with_opt_expr"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_output.ml", line 71, characters 0-196 + +opt_expr_with_block is never used + <-- line 71 + | Some x -> S.exp x :: block [@@dead "+opt_expr_with_block"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_output.ml", line 77, characters 0-143 + +unnest_block is never used + <-- line 77 + | _ -> block [@@dead "+unnest_block"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_output.ml", line 82, characters 0-213 + +output_as_block is never used + <-- line 82 + if output_finished = True then block else block_with_opt_expr block opt [@@dead "+output_as_block"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_output.ml", line 88, characters 0-455 + +to_break_block is never used + <-- line 88 + | {value = Some _ as opt; _} -> (block_with_opt_expr block opt, true) [@@dead "+to_break_block"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_output.ml", line 117, characters 0-1083 + +append_output is never used + <-- line 117 + ?value:opt_e2 ~output_finished [@@dead "+append_output"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_output.ml", line 141, characters 0-96 + +concat is never used + <-- line 141 + Ext_list.fold_right xs dummy (fun x acc -> append_output x acc) [@@dead "+concat"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_output.ml", line 144, characters 0-61 + +to_string is never used + <-- line 144 + let to_string x = Js_dump.string_of_block (output_as_block x) [@@dead "+to_string"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_output.mli", line 41, characters 0-75 + +make is never used + <-- line 41 + val make : ?value:J.expression -> ?output_finished:finished -> J.block -> t [@@dead "+make"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_output.mli", line 43, characters 0-34 + +output_as_block is never used + <-- line 43 + val output_as_block : t -> J.block [@@dead "+output_as_block"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_output.mli", line 45, characters 0-40 + +to_break_block is never used + <-- line 45 + val to_break_block : t -> J.block * bool [@@dead "+to_break_block"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_output.mli", line 61, characters 0-31 + +append_output is never used + <-- line 61 + val append_output : t -> t -> t [@@dead "+append_output"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_output.mli", line 63, characters 0-13 + +dummy is never used + <-- line 63 + val dummy : t [@@dead "+dummy"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_output.mli", line 65, characters 0-142 + +output_of_expression is never used + <-- line 65 + t [@@dead "+output_of_expression"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_output.mli", line 72, characters 0-103 + +output_of_block_and_expression is never used + <-- line 72 + Lam_compile_context.continuation -> J.block -> J.expression -> t [@@dead "+output_of_block_and_expression"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_output.mli", line 77, characters 0-24 + +concat is never used + <-- line 77 + val concat : t list -> t [@@dead "+concat"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_output.mli", line 79, characters 0-27 + +to_string is never used + <-- line 79 + val to_string : t -> string [@@dead "+to_string"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_packages_info.ml", line 31, characters 0-143 + +compatible is never used + <-- line 31 + | Esmodule -> dep = Esmodule [@@dead "+compatible"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_packages_info.ml", line 41, characters 0-28 + +// is never used + <-- line 41 + let ( // ) = Filename.concat [@@dead "+//"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_packages_info.ml", line 44, characters 0-114 + +runtime_dir_of_module_system is never used + <-- line 44 + | Esmodule -> "es6" [@@dead "+runtime_dir_of_module_system"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_packages_info.ml", line 49, characters 0-133 + +runtime_package_path is never used + <-- line 49 + Runtime_package.name // "lib" // runtime_dir_of_module_system ms // js_file [@@dead "+runtime_package_path"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_packages_info.ml", line 56, characters 0-250 + +same_package_by_name is never used + <-- line 56 + | Pkg_empty | Pkg_runtime -> false) [@@dead "+same_package_by_name"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_packages_info.ml", line 65, characters 0-53 + +is_runtime_package is never used + <-- line 65 + let is_runtime_package (x : t) = x.name = Pkg_runtime [@@dead "+is_runtime_package"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_packages_info.ml", line 67, characters 0-55 + +iter is never used + <-- line 67 + let iter (x : t) cb = Ext_list.iter x.module_systems cb [@@dead "+iter"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_packages_info.ml", line 69, characters 0-53 + +map is never used + <-- line 69 + let map (x : t) cb = Ext_list.map x.module_systems cb [@@dead "+map"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_packages_info.ml", line 91, characters 0-120 + +string_of_module_system is never used + <-- line 91 + | Esmodule -> "ESModule" [@@dead "+string_of_module_system"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_packages_info.ml", line 102, characters 0-190 + +dump_package_info is never used + <-- line 102 + Format.fprintf fmt "@[%s@ %s@ %s@]" (string_of_module_system ms) name suffix [@@dead "+dump_package_info"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_packages_info.ml", line 106, characters 0-217 + +dump_package_name is never used + <-- line 106 + | Pkg_runtime -> Format.pp_print_string fmt "@runtime" [@@dead "+dump_package_name"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_packages_info.ml", line 112, characters 0-268 + +dump_packages_info is never used + <-- line 112 + ls [@@dead "+dump_packages_info"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_packages_info.ml", line 121, characters 2-19 + package_found_info.rel_path is a record label never used to read a value + <-- line 121 + rel_path: string; [@dead "package_found_info.rel_path"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_packages_info.ml", line 122, characters 2-23 + package_found_info.pkg_rel_path is a record label never used to read a value + <-- line 122 + pkg_rel_path: string; [@dead "package_found_info.pkg_rel_path"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_packages_info.ml", line 123, characters 2-17 + package_found_info.suffix is a record label never used to read a value + <-- line 123 + suffix: string; [@dead "package_found_info.suffix"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_packages_info.ml", line 133, characters 0-884 + +query_package_infos is never used + <-- line 133 + | None -> Package_not_found) [@@dead "+query_package_infos"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_packages_info.ml", line 159, characters 0-228 + +get_js_path is never used + <-- line 159 + | None -> assert false [@@dead "+get_js_path"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_packages_info.ml", line 170, characters 0-121 + +get_output_dir is never used + <-- line 170 + Filename.concat package_dir (get_js_path info module_system) [@@dead "+get_output_dir"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_packages_info.mli", line 27, characters 0-58 + +runtime_dir_of_module_system is never used + <-- line 27 + val runtime_dir_of_module_system : module_system -> string [@@dead "+runtime_dir_of_module_system"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_packages_info.mli", line 29, characters 0-60 + +runtime_package_path is never used + <-- line 29 + val runtime_package_path : module_system -> string -> string [@@dead "+runtime_package_path"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_packages_info.mli", line 37, characters 0-34 + +is_runtime_package is never used + <-- line 37 + val is_runtime_package : t -> bool [@@dead "+is_runtime_package"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_packages_info.mli", line 39, characters 0-41 + +same_package_by_name is never used + <-- line 39 + val same_package_by_name : t -> t -> bool [@@dead "+same_package_by_name"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_packages_info.mli", line 41, characters 0-46 + +iter is never used + <-- line 41 + val iter : t -> (package_info -> unit) -> unit [@@dead "+iter"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_packages_info.mli", line 43, characters 0-46 + +map is never used + <-- line 43 + val map : t -> (package_info -> 'a) -> 'a list [@@dead "+map"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_packages_info.mli", line 51, characters 0-54 + +dump_packages_info is never used + <-- line 51 + val dump_packages_info : Format.formatter -> t -> unit [@@dead "+dump_packages_info"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_packages_info.mli", line 59, characters 2-19 + package_found_info.rel_path is a record label never used to read a value + <-- line 59 + rel_path: string; [@dead "package_found_info.rel_path"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_packages_info.mli", line 60, characters 2-23 + package_found_info.pkg_rel_path is a record label never used to read a value + <-- line 60 + pkg_rel_path: string; [@dead "package_found_info.pkg_rel_path"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_packages_info.mli", line 61, characters 2-17 + package_found_info.suffix is a record label never used to read a value + <-- line 61 + suffix: string; [@dead "package_found_info.suffix"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_packages_info.mli", line 69, characters 0-71 + +get_output_dir is never used + <-- line 69 + val get_output_dir : t -> package_dir:string -> module_system -> string [@@dead "+get_output_dir"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_packages_info.mli", line 71, characters 0-58 + +query_package_infos is never used + <-- line 71 + val query_package_infos : t -> module_system -> info_query [@@dead "+query_package_infos"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_packages_state.ml", line 47, characters 0-41 + +get_packages_info is never used + <-- line 47 + let get_packages_info () = !packages_info [@@dead "+get_packages_info"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_packages_state.mli", line 31, characters 0-50 + +get_packages_info is never used + <-- line 31 + val get_packages_info : unit -> Js_packages_info.t [@@dead "+get_packages_info"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_debug.mli", line 1, characters 0-0 + js_pass_debug is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_debug.mli", line 25, characters 0-43 + +dump is never used + <-- line 25 + val dump : string -> J.program -> J.program [@@dead "+dump"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_external_shadow.ml", line 1, characters 0-0 + +js_pass_external_shadow is a dead module as all its items are dead. + + Warning Dead Value With Side Effects + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_external_shadow.ml", line 29, characters 0-42 + +global_this is never used and could have side effects + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_external_shadow.ml", line 32, characters 0-136 + +is_lexical_binding_kind is never used + <-- line 32 + | Variable -> false [@@dead "+is_lexical_binding_kind"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_external_shadow.ml", line 38, characters 0-183 + +should_rewrite_binding is never used + <-- line 38 + && not (Js_reserved_map.is_js_global ident.name) [@@dead "+should_rewrite_binding"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_external_shadow.ml", line 43, characters 0-455 + +rewrite_shadowed_global_in_expr is never used + <-- line 43 + self.expression self expr [@@dead "+rewrite_shadowed_global_in_expr"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_external_shadow.ml", line 59, characters 0-1533 + +program is never used + <-- line 59 + self.program self js [@@dead "+program"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_external_shadow.mli", line 1, characters 0-0 + js_pass_external_shadow is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_external_shadow.mli", line 26, characters 0-36 + +program is never used + <-- line 26 + val program : J.program -> J.program [@@dead "+program"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_flatten.ml", line 1, characters 0-0 + +js_pass_flatten is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_flatten.ml", line 35, characters 0-31 + +super is never used + <-- line 35 + let super = Js_record_map.super [@@dead "+super"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_flatten.ml", line 37, characters 0-2690 + +flatten_map is never used + <-- line 37 + } [@@dead "+flatten_map"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_flatten.ml", line 113, characters 0-63 + +program is never used + <-- line 113 + let program (x : J.program) = flatten_map.program flatten_map x [@@dead "+program"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_flatten.mli", line 1, characters 0-0 + js_pass_flatten is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_flatten.mli", line 36, characters 0-36 + +program is never used + <-- line 36 + val program : J.program -> J.program [@@dead "+program"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_flatten_and_mark_dead.ml", line 30, characters 0-32 + +super is never used + <-- line 30 + let super = Js_record_iter.super [@@dead "+super"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_flatten_and_mark_dead.ml", line 32, characters 0-2329 + +mark_dead_code is never used + <-- line 32 + js [@@dead "+mark_dead_code"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_flatten_and_mark_dead.ml", line 148, characters 0-31 + +super is never used + <-- line 148 + let super = Js_record_map.super [@@dead "+super"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_flatten_and_mark_dead.ml", line 150, characters 0-111 + +add_substitue is never used + <-- line 150 + Hash_ident.replace substitution ident e [@@dead "+add_substitue"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_flatten_and_mark_dead.ml", line 153, characters 0-4332 + +subst_map is never used + <-- line 153 + } [@@dead "+subst_map"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_flatten_and_mark_dead.ml", line 267, characters 0-131 + +program is never used + <-- line 267 + mark_dead_code js [@@dead "+program"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_flatten_and_mark_dead.mli", line 1, characters 0-0 + js_pass_flatten_and_mark_dead is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_flatten_and_mark_dead.mli", line 27, characters 0-36 + +program is never used + <-- line 27 + val program : J.program -> J.program [@@dead "+program"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_get_used.ml", line 1, characters 0-0 + +js_pass_get_used is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_get_used.ml", line 25, characters 0-71 + +add_use is never used + <-- line 25 + let add_use stats id = Hash_ident.add_or_update stats id 1 ~update:succ [@@dead "+add_use"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_get_used.ml", line 27, characters 0-785 + +post_process_stats is never used + <-- line 27 + defined_idents [@@dead "+post_process_stats"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_get_used.ml", line 53, characters 0-32 + +super is never used + <-- line 53 + let super = Js_record_iter.super [@@dead "+super"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_get_used.ml", line 55, characters 0-468 + +count_collects is never used + <-- line 55 + } [@@dead "+count_collects"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_get_used.ml", line 69, characters 0-401 + +get_stats is never used + <-- line 69 + post_process_stats my_export_set defined_idents stats [@@dead "+get_stats"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_get_used.mli", line 1, characters 0-0 + js_pass_get_used is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_get_used.mli", line 25, characters 0-64 + +get_stats is never used + <-- line 25 + val get_stats : J.program -> J.variable_declaration Hash_ident.t [@@dead "+get_stats"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_scope.ml", line 103, characters 0-238 + +init_state is never used + <-- line 103 + } [@@dead "+init_state"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_scope.ml", line 113, characters 0-88 + +with_in_loop is never used + <-- line 113 + if b = st.in_loop then st else {st with in_loop = b} [@@dead "+with_in_loop"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_scope.ml", line 116, characters 0-191 + +add_loop_mutable_variable is never used + <-- line 116 + } [@@dead "+add_loop_mutable_variable"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_scope.ml", line 123, characters 0-106 + +add_mutable_variable is never used + <-- line 123 + {st with mutable_values = Set_ident.add st.mutable_values id} [@@dead "+add_mutable_variable"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_scope.ml", line 126, characters 0-103 + +add_defined_ident is never used + <-- line 126 + {st with defined_idents = Set_ident.add st.defined_idents id} [@@dead "+add_defined_ident"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_scope.ml", line 129, characters 0-94 + +add_used_ident is never used + <-- line 129 + {st with used_idents = Set_ident.add st.used_idents id} [@@dead "+add_used_ident"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_scope.ml", line 132, characters 0-32 + +super is never used + <-- line 132 + let super = Js_record_fold.super [@@dead "+super"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_scope.ml", line 134, characters 0-7195 + +record_scope_pass is never used + <-- line 134 + } [@@dead "+record_scope_pass"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_scope.ml", line 326, characters 0-103 + +program is never used + <-- line 326 + .loop_mutable_values [@@dead "+program"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_scope.mli", line 1, characters 0-0 + js_pass_scope is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_scope.mli", line 27, characters 0-38 + +program is never used + <-- line 27 + val program : J.program -> Set_ident.t [@@dead "+program"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_tailcall_inline.ml", line 1, characters 0-0 + +js_pass_tailcall_inline is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_tailcall_inline.ml", line 38, characters 0-31 + +super is never used + <-- line 38 + let super = Js_record_map.super [@@dead "+super"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_tailcall_inline.ml", line 40, characters 0-123 + +substitue_variables is never used + <-- line 40 + {super with ident = (fun _ id -> Map_ident.find_default map id id)} [@@dead "+substitue_variables"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_tailcall_inline.ml", line 60, characters 0-889 + +inline_call is never used + <-- line 60 + obj.block obj block [@@dead "+inline_call"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_tailcall_inline.ml", line 106, characters 0-31 + +super is never used + <-- line 106 + let super = Js_record_map.super [@@dead "+super"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_tailcall_inline.ml", line 108, characters 0-4623 + +subst is never used + <-- line 108 + } [@@dead "+subst"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_tailcall_inline.ml", line 236, characters 0-200 + +tailcall_inline is never used + <-- line 236 + obj.program obj program [@@dead "+tailcall_inline"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_tailcall_inline.mli", line 1, characters 0-0 + js_pass_tailcall_inline is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_tailcall_inline.mli", line 38, characters 0-44 + +tailcall_inline is never used + <-- line 38 + val tailcall_inline : J.program -> J.program [@@dead "+tailcall_inline"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_fold.ml", line 27, characters 0-32 + +unknown is never used + <-- line 27 + let[@inline] unknown _ st _ = st [@@dead "+unknown"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_fold.ml", line 29, characters 0-93 + +option is never used + <-- line 29 + | Some v -> sub self st v [@@dead "+option"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_fold.ml", line 34, characters 0-125 + +list is never used + <-- line 34 + list sub self st xs [@@dead "+list"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_fold.ml", line 56, characters 0-40 + +ident is never used + <-- line 56 + let ident : 'a. ('a, ident) fn = unknown [@@dead "+ident"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_fold.ml", line 58, characters 0-124 + +module_id is never used + <-- line 58 + st [@@dead "+module_id"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_fold.ml", line 63, characters 0-109 + +required_modules is never used + <-- line 63 + fun _self st arg -> list _self.module_id _self st arg [@@dead "+required_modules"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_fold.ml", line 66, characters 0-202 + +vident is never used + <-- line 66 + st [@@dead "+vident"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_fold.ml", line 75, characters 0-92 + +exception_ident is never used + <-- line 75 + fun _self arg -> _self.ident _self arg [@@dead "+exception_ident"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_fold.ml", line 78, characters 0-79 + +for_ident is never used + <-- line 78 + let for_ident : 'a. ('a, for_ident) fn = fun _self arg -> _self.ident _self arg [@@dead "+for_ident"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_fold.ml", line 80, characters 0-56 + +for_direction is never used + <-- line 80 + let for_direction : 'a. ('a, for_direction) fn = unknown [@@dead "+for_direction"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_fold.ml", line 82, characters 0-181 + +property_map is never used + <-- line 82 + _self st arg [@@dead "+property_map"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_fold.ml", line 90, characters 0-56 + +length_object is never used + <-- line 90 + let length_object : 'a. ('a, length_object) fn = unknown [@@dead "+length_object"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_fold.ml", line 92, characters 0-3130 + +expression_desc is never used + <-- line 92 + st [@@dead "+expression_desc"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_fold.ml", line 200, characters 0-107 + +for_ident_expression is never used + <-- line 200 + fun _self arg -> _self.expression _self arg [@@dead "+for_ident_expression"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_fold.ml", line 203, characters 0-113 + +finish_ident_expression is never used + <-- line 203 + fun _self arg -> _self.expression _self arg [@@dead "+finish_ident_expression"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_fold.ml", line 206, characters 0-160 + +case_clause is never used + <-- line 206 + st [@@dead "+case_clause"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_fold.ml", line 211, characters 0-120 + +string_clause is never used + <-- line 211 + st [@@dead "+string_clause"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_fold.ml", line 216, characters 0-114 + +int_clause is never used + <-- line 216 + st [@@dead "+int_clause"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_fold.ml", line 221, characters 0-2128 + +statement_desc is never used + <-- line 221 + | Debugger -> st [@@dead "+statement_desc"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_fold.ml", line 290, characters 0-146 + +expression is never used + <-- line 290 + st [@@dead "+expression"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_fold.ml", line 295, characters 0-142 + +statement is never used + <-- line 295 + st [@@dead "+statement"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_fold.ml", line 300, characters 0-235 + +variable_declaration is never used + <-- line 300 + st [@@dead "+variable_declaration"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_fold.ml", line 306, characters 0-87 + +block is never used + <-- line 306 + fun _self st arg -> list _self.statement _self st arg [@@dead "+block"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_fold.ml", line 309, characters 0-144 + +program is never used + <-- line 309 + st [@@dead "+program"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_fold.ml", line 314, characters 0-203 + +deps_program is never used + <-- line 314 + st [@@dead "+deps_program"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_fold.ml", line 320, characters 0-188 + +super is never used + <-- line 320 + } [@@dead "+super"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_iter.ml", line 61, characters 0-93 + +required_modules is never used + <-- line 61 + fun _self arg -> list _self.module_id _self arg [@@dead "+required_modules"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_iter.ml", line 229, characters 0-156 + +deps_program is never used + <-- line 229 + required_modules _self _x1 [@@dead "+deps_program"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_map.ml", line 27, characters 0-28 + +unknown is never used + <-- line 27 + let[@inline] unknown _ x = x [@@dead "+unknown"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_map.ml", line 29, characters 0-96 + +option is never used + <-- line 29 + | Some v -> Some (sub self v) [@@dead "+option"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_map.ml", line 34, characters 0-120 + +list is never used + <-- line 34 + v :: list sub self xs [@@dead "+list"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_map.ml", line 56, characters 0-30 + +ident is never used + <-- line 56 + let ident : ident fn = unknown [@@dead "+ident"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_map.ml", line 58, characters 0-173 + +module_id is never used + <-- line 58 + {id = _x0; kind = _x1; dynamic_import = _x2} [@@dead "+module_id"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_map.ml", line 63, characters 0-93 + +required_modules is never used + <-- line 63 + fun _self arg -> list _self.module_id _self arg [@@dead "+required_modules"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_map.ml", line 66, characters 0-207 + +vident is never used + <-- line 66 + Qualified (_x0, _x1) [@@dead "+vident"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_map.ml", line 75, characters 0-82 + +exception_ident is never used + <-- line 75 + fun _self arg -> _self.ident _self arg [@@dead "+exception_ident"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_map.ml", line 78, characters 0-69 + +for_ident is never used + <-- line 78 + let for_ident : for_ident fn = fun _self arg -> _self.ident _self arg [@@dead "+for_ident"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_map.ml", line 80, characters 0-46 + +for_direction is never used + <-- line 80 + let for_direction : for_direction fn = unknown [@@dead "+for_direction"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_map.ml", line 82, characters 0-168 + +property_map is never used + <-- line 82 + _self arg [@@dead "+property_map"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_map.ml", line 90, characters 0-46 + +length_object is never used + <-- line 90 + let length_object : length_object fn = unknown [@@dead "+length_object"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_map.ml", line 92, characters 0-3481 + +expression_desc is never used + <-- line 92 + Spread _x0 [@@dead "+expression_desc"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_map.ml", line 198, characters 0-97 + +for_ident_expression is never used + <-- line 198 + fun _self arg -> _self.expression _self arg [@@dead "+for_ident_expression"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_map.ml", line 201, characters 0-103 + +finish_ident_expression is never used + <-- line 201 + fun _self arg -> _self.expression _self arg [@@dead "+finish_ident_expression"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_map.ml", line 204, characters 0-197 + +case_clause is never used + <-- line 204 + {switch_body = _x0; should_break = _x1; comment = _x2} [@@dead "+case_clause"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_map.ml", line 209, characters 0-113 + +string_clause is never used + <-- line 209 + (_x0, _x1) [@@dead "+string_clause"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_map.ml", line 214, characters 0-107 + +int_clause is never used + <-- line 214 + (_x0, _x1) [@@dead "+int_clause"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_map.ml", line 219, characters 0-2310 + +statement_desc is never used + <-- line 219 + | Debugger as v -> v [@@dead "+statement_desc"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_map.ml", line 288, characters 0-167 + +expression is never used + <-- line 288 + {expression_desc = _x0; comment = _x1} [@@dead "+expression"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_map.ml", line 293, characters 0-162 + +statement is never used + <-- line 293 + {statement_desc = _x0; comment = _x1} [@@dead "+statement"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_map.ml", line 298, characters 0-276 + +variable_declaration is never used + <-- line 298 + {ident = _x0; value = _x1; property = _x2; ident_info = _x3} [@@dead "+variable_declaration"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_map.ml", line 304, characters 0-70 + +block is never used + <-- line 304 + let block : block fn = fun _self arg -> list _self.statement _self arg [@@dead "+block"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_map.ml", line 306, characters 0-173 + +program is never used + <-- line 306 + {block = _x0; exports = _x1; export_set = _x2} [@@dead "+program"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_map.ml", line 311, characters 0-233 + +deps_program is never used + <-- line 311 + {program = _x0; modules = _x1; side_effect = _x2} [@@dead "+deps_program"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_map.ml", line 317, characters 0-181 + +super is never used + <-- line 317 + } [@@dead "+super"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_shake.ml", line 1, characters 0-0 + +js_shake is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_shake.ml", line 27, characters 0-1290 + +get_initial_exports is never used + <-- line 27 + (result, Set_ident.(diff result export_set)) [@@dead "+get_initial_exports"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_shake.ml", line 62, characters 0-1801 + +shake_program is never used + <-- line 62 + {program with block = shake_block program.block program.export_set} [@@dead "+shake_program"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_shake.mli", line 1, characters 0-0 + js_shake is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_shake.mli", line 30, characters 0-42 + +shake_program is never used + <-- line 30 + val shake_program : J.program -> J.program [@@dead "+shake_program"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.ml", line 29, characters 0-69 + +return_stmt is never used + <-- line 29 + let return_stmt ?comment e : t = {statement_desc = Return e; comment} [@@dead "+return_stmt"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.ml", line 34, characters 0-67 + +throw_stmt is never used + <-- line 34 + let throw_stmt ?comment v : t = {statement_desc = Throw v; comment} [@@dead "+throw_stmt"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.ml", line 55, characters 0-320 + +declare_variable is never used + <-- line 55 + } [@@dead "+declare_variable"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.ml", line 67, characters 0-483 + +define_variable is never used + <-- line 67 + } [@@dead "+define_variable"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.ml", line 91, characters 0-1408 + +int_switch is never used + <-- line 91 + | None -> {statement_desc = J.Int_switch (e, clauses, default); comment}) [@@dead "+int_switch"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.ml", line 136, characters 0-1581 + +string_switch is never used + <-- line 136 + | None -> {statement_desc = String_switch (e, clauses, default); comment}) [@@dead "+string_switch"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.ml", line 186, characters 0-273 + +block_last_is_return_throw_or_continue is never used + <-- line 186 + | _ :: rest -> block_last_is_return_throw_or_continue rest [@@dead "+block_last_is_return_throw_or_continue"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.ml", line 233, characters 0-3141 + +if_ is never used + <-- line 233 + | false, Some (kind, id) -> block (declare_variable ~kind id :: [if_block]) [@@dead "+if_"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.ml", line 314, characters 0-90 + +assign is never used + <-- line 314 + {statement_desc = J.Exp (E.assign (E.var id) e); comment} [@@dead "+assign"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.ml", line 317, characters 0-108 + +while_ is never used + <-- line 317 + {statement_desc = While (label, e, st); comment} [@@dead "+while_"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.ml", line 320, characters 0-245 + +for_ is never used + <-- line 320 + } [@@dead "+for_"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.ml", line 329, characters 0-141 + +for_of is never used + <-- line 329 + {statement_desc = ForOf (label, id, iterable_expression, b); comment} [@@dead "+for_of"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.ml", line 332, characters 0-152 + +for_await_of is never used + <-- line 332 + {statement_desc = ForAwaitOf (label, id, iterable_expression, b); comment} [@@dead "+for_await_of"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.ml", line 335, characters 0-101 + +try_ is never used + <-- line 335 + {statement_desc = Try (body, with_, finally); comment} [@@dead "+try_"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.ml", line 338, characters 0-73 + +break_ is never used + <-- line 338 + let break_ ?label () : t = {statement_desc = Break label; comment = None} [@@dead "+break_"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.ml", line 340, characters 0-79 + +continue_ is never used + <-- line 340 + let continue_ ?label () : t = {statement_desc = Continue label; comment = None} [@@dead "+continue_"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.ml", line 342, characters 0-75 + +debugger_block is never used + <-- line 342 + let debugger_block : t list = [{statement_desc = Debugger; comment = None}] [@@dead "+debugger_block"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.mli", line 33, characters 0-53 + +throw_stmt is never used + <-- line 33 + val throw_stmt : ?comment:string -> J.expression -> t [@@dead "+throw_stmt"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.mli", line 35, characters 0-262 + +if_ is never used + <-- line 35 + t [@@dead "+if_"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.mli", line 46, characters 0-43 + +block is never used + <-- line 46 + val block : ?comment:string -> J.block -> t [@@dead "+block"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.mli", line 52, characters 0-161 + +int_switch is never used + <-- line 52 + t [@@dead "+int_switch"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.mli", line 75, characters 0-191 + +string_switch is never used + <-- line 75 + t [@@dead "+string_switch"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.mli", line 83, characters 0-120 + +declare_variable is never used + <-- line 83 + t [@@dead "+declare_variable"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.mli", line 92, characters 0-137 + +define_variable is never used + <-- line 92 + t [@@dead "+define_variable"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.mli", line 107, characters 0-60 + +assign is never used + <-- line 107 + val assign : ?comment:string -> J.ident -> J.expression -> t [@@dead "+assign"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.mli", line 133, characters 0-78 + +while_ is never used + <-- line 133 + val while_ : ?comment:string -> ?label:J.label -> J.expression -> J.block -> t [@@dead "+while_"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.mli", line 135, characters 0-172 + +for_ is never used + <-- line 135 + t [@@dead "+for_"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.mli", line 145, characters 0-91 + +for_of is never used + <-- line 145 + ?comment:string -> ?label:J.label -> J.expression -> J.ident -> J.block -> t [@@dead "+for_of"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.mli", line 148, characters 0-97 + +for_await_of is never used + <-- line 148 + ?comment:string -> ?label:J.label -> J.expression -> J.ident -> J.block -> t [@@dead "+for_await_of"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.mli", line 151, characters 0-100 + +try_ is never used + <-- line 151 + t [@@dead "+try_"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.mli", line 160, characters 0-54 + +return_stmt is never used + <-- line 160 + val return_stmt : ?comment:string -> J.expression -> t [@@dead "+return_stmt"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.mli", line 173, characters 0-40 + +break_ is never used + <-- line 173 + val break_ : ?label:J.label -> unit -> t [@@dead "+break_"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.mli", line 175, characters 0-43 + +continue_ is never used + <-- line 175 + val continue_ : ?label:J.label -> unit -> t [@@dead "+continue_"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.mli", line 177, characters 0-27 + +debugger_block is never used + <-- line 177 + val debugger_block : t list [@@dead "+debugger_block"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 117, characters 0-1453 + +lam.X is a dead module as all its items are dead. + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 119, characters 4-25 + X.lambda_switch.sw_consts_full is a record label never used to read a value + <-- line 119 + sw_consts_full: bool; [@dead "X.lambda_switch.sw_consts_full"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 120, characters 4-30 + X.lambda_switch.sw_consts is a record label never used to read a value + <-- line 120 + sw_consts: (int * t) list; [@dead "X.lambda_switch.sw_consts"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 121, characters 4-25 + X.lambda_switch.sw_blocks_full is a record label never used to read a value + <-- line 121 + sw_blocks_full: bool; [@dead "X.lambda_switch.sw_blocks_full"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 122, characters 4-30 + X.lambda_switch.sw_blocks is a record label never used to read a value + <-- line 122 + sw_blocks: (int * t) list; [@dead "X.lambda_switch.sw_blocks"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 123, characters 4-28 + X.lambda_switch.sw_failaction is a record label never used to read a value + <-- line 123 + sw_failaction: t option; [@dead "X.lambda_switch.sw_failaction"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 124, characters 4-56 + X.lambda_switch.sw_names is a record label never used to read a value + <-- line 124 + sw_names: Ast_untagged_variants.switch_names option; [@dead "X.lambda_switch.sw_names"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 128, characters 4-31 + X.prim_info.primitive is a record label never used to read a value + <-- line 128 + primitive: Lam_primitive.t; [@dead "X.prim_info.primitive"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 129, characters 4-17 + X.prim_info.args is a record label never used to read a value + <-- line 129 + args: t list; [@dead "X.prim_info.args"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 130, characters 4-20 + X.prim_info.loc is a record label never used to read a value + <-- line 130 + loc: Location.t; [@dead "X.prim_info.loc"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 134, characters 4-15 + X.apply.ap_func is a record label never used to read a value + <-- line 134 + ap_func: t; [@dead "X.apply.ap_func"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 135, characters 4-20 + X.apply.ap_args is a record label never used to read a value + <-- line 135 + ap_args: t list; [@dead "X.apply.ap_args"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 136, characters 4-21 + X.apply.ap_info is a record label never used to read a value + <-- line 136 + ap_info: ap_info; [@dead "X.apply.ap_info"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 137, characters 4-29 + X.apply.ap_transformed_jsx is a record label never used to read a value + <-- line 137 + ap_transformed_jsx: bool; [@dead "X.apply.ap_transformed_jsx"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 141, characters 4-15 + X.lfunction.arity is a record label never used to read a value + <-- line 141 + arity: int; [@dead "X.lfunction.arity"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 142, characters 4-23 + X.lfunction.params is a record label never used to read a value + <-- line 142 + params: ident list; [@dead "X.lfunction.params"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 143, characters 4-12 + X.lfunction.body is a record label never used to read a value + <-- line 143 + body: t; [@dead "X.lfunction.body"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 144, characters 4-36 + X.lfunction.attr is a record label never used to read a value + <-- line 144 + attr: Lambda.function_attribute; [@dead "X.lfunction.attr"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 148, characters 4-19 + X.t.Lvar is a variant case which is never constructed + <-- line 148 + | Lvar of ident [@dead "X.t.Lvar"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 149, characters 4-36 + X.t.Lglobal_module is a variant case which is never constructed + <-- line 149 + | Lglobal_module of ident * bool [@dead "X.t.Lglobal_module"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 150, characters 4-30 + X.t.Lconst is a variant case which is never constructed + <-- line 150 + | Lconst of Lam_constant.t [@dead "X.t.Lconst"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 151, characters 4-21 + X.t.Lapply is a variant case which is never constructed + <-- line 151 + | Lapply of apply [@dead "X.t.Lapply"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 152, characters 4-28 + X.t.Lfunction is a variant case which is never constructed + <-- line 152 + | Lfunction of lfunction [@dead "X.t.Lfunction"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 153, characters 4-49 + X.t.Llet is a variant case which is never constructed + <-- line 153 + | Llet of Lam_compat.let_kind * ident * t * t [@dead "X.t.Llet"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 154, characters 4-37 + X.t.Lletrec is a variant case which is never constructed + <-- line 154 + | Lletrec of (ident * t) list * t [@dead "X.t.Lletrec"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 155, characters 4-24 + X.t.Lprim is a variant case which is never constructed + <-- line 155 + | Lprim of prim_info [@dead "X.t.Lprim"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 156, characters 4-34 + X.t.Lswitch is a variant case which is never constructed + <-- line 156 + | Lswitch of t * lambda_switch [@dead "X.t.Lswitch"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 157, characters 4-55 + X.t.Lstringswitch is a variant case which is never constructed + <-- line 157 + | Lstringswitch of t * (string * t) list * t option [@dead "X.t.Lstringswitch"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 158, characters 4-34 + X.t.Lstaticraise is a variant case which is never constructed + <-- line 158 + | Lstaticraise of int * t list [@dead "X.t.Lstaticraise"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 159, characters 4-48 + X.t.Lstaticcatch is a variant case which is never constructed + <-- line 159 + | Lstaticcatch of t * (int * ident list) * t [@dead "X.t.Lstaticcatch"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 160, characters 4-31 + X.t.Ltrywith is a variant case which is never constructed + <-- line 160 + | Ltrywith of t * ident * t [@dead "X.t.Ltrywith"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 161, characters 4-30 + X.t.Lifthenelse is a variant case which is never constructed + <-- line 161 + | Lifthenelse of t * t * t [@dead "X.t.Lifthenelse"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 162, characters 4-24 + X.t.Lsequence is a variant case which is never constructed + <-- line 162 + | Lsequence of t * t [@dead "X.t.Lsequence"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 163, characters 4-12 + X.t.Lbreak is a variant case which is never constructed + <-- line 163 + | Lbreak [@dead "X.t.Lbreak"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 164, characters 4-15 + X.t.Lcontinue is a variant case which is never constructed + <-- line 164 + | Lcontinue [@dead "X.t.Lcontinue"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 165, characters 4-21 + X.t.Lwhile is a variant case which is never constructed + <-- line 165 + | Lwhile of t * t [@dead "X.t.Lwhile"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 166, characters 4-57 + X.t.Lfor is a variant case which is never constructed + <-- line 166 + | Lfor of ident * t * t * Asttypes.direction_flag * t [@dead "X.t.Lfor"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 167, characters 4-30 + X.t.Lfor_of is a variant case which is never constructed + <-- line 167 + | Lfor_of of ident * t * t [@dead "X.t.Lfor_of"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 168, characters 4-36 + X.t.Lfor_await_of is a variant case which is never constructed + <-- line 168 + | Lfor_await_of of ident * t * t [@dead "X.t.Lfor_await_of"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 169, characters 4-26 + X.t.Lassign is a variant case which is never constructed + <-- line 169 + | Lassign of ident * t [@dead "X.t.Lassign"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 177, characters 0-2614 + +inner_map is never used + <-- line 177 + Lassign (id, e) [@@dead "+inner_map"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 295, characters 0-513 + +is_eta_conversion_exn is never used + <-- line 295 + | _, _, _ -> raise_notrace Not_simple_form [@@dead "+is_eta_conversion_exn"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 310, characters 0-2145 + +apply is never used + <-- line 310 + | _ -> Lapply {ap_func = fn; ap_args = args; ap_info; ap_transformed_jsx} [@@dead "+apply"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 365, characters 0-1950 + +eq_approx is never used + <-- line 365 + false [@@dead "+eq_approx"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 429, characters 0-148 + +eq_option is never used + <-- line 429 + | None -> false) [@@dead "+eq_option"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 437, characters 0-69 + +eq_approx_list is never used + <-- line 437 + and eq_approx_list ls ls1 = Ext_list.for_all2_no_exn ls ls1 eq_approx [@@dead "+eq_approx_list"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 439, characters 0-596 + +switch is never used + <-- line 439 + | _ -> Lswitch (lam, lam_switch) [@@dead "+switch"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 453, characters 0-217 + +stringswitch is never used + <-- line 453 + | _ -> Lstringswitch (lam, cases, default) [@@dead "+stringswitch"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 459, characters 0-36 + +true_ is never used + <-- line 459 + let true_ : t = Lconst Const_js_true [@@dead "+true_"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 460, characters 0-38 + +false_ is never used + <-- line 460 + let false_ : t = Lconst Const_js_false [@@dead "+false_"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 461, characters 0-59 + +unit is never used + <-- line 461 + let unit : t = Lconst (Const_js_undefined {is_unit = true}) [@@dead "+unit"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 462, characters 0-22 + +break is never used + <-- line 462 + let break : t = Lbreak [@@dead "+break"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 463, characters 0-28 + +continue is never used + <-- line 463 + let continue : t = Lcontinue [@@dead "+continue"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 465, characters 0-253 + +seq is never used + <-- line 465 + | _ -> Lsequence (a, b) [@@dead "+seq"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 473, characters 0-24 + +var is never used + <-- line 473 + let var id : t = Lvar id [@@dead "+var"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 474, characters 0-86 + +global_module is never used + <-- line 474 + Lglobal_module (id, dynamic_import) [@@dead "+global_module"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 476, characters 0-28 + +const is never used + <-- line 476 + let const ct : t = Lconst ct [@@dead "+const"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 478, characters 0-86 + +function_ is never used + <-- line 478 + Lfunction {arity; params; body; attr} [@@dead "+function_"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 481, characters 0-54 + +let_ is never used + <-- line 481 + let let_ kind id e body : t = Llet (kind, id, e, body) [@@dead "+let_"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 482, characters 0-55 + +letrec is never used + <-- line 482 + let letrec bindings body : t = Lletrec (bindings, body) [@@dead "+letrec"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 483, characters 0-34 + +while_ is never used + <-- line 483 + let while_ a b : t = Lwhile (a, b) [@@dead "+while_"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 484, characters 0-59 + +try_ is never used + <-- line 484 + let try_ body id handler : t = Ltrywith (body, id, handler) [@@dead "+try_"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 485, characters 0-55 + +for_ is never used + <-- line 485 + let for_ v e1 e2 dir e3 : t = Lfor (v, e1, e2, dir, e3) [@@dead "+for_"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 486, characters 0-44 + +for_of is never used + <-- line 486 + let for_of v e1 e2 : t = Lfor_of (v, e1, e2) [@@dead "+for_of"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 487, characters 0-56 + +for_await_of is never used + <-- line 487 + let for_await_of v e1 e2 : t = Lfor_await_of (v, e1, e2) [@@dead "+for_await_of"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 488, characters 0-35 + +assign is never used + <-- line 488 + let assign v l : t = Lassign (v, l) [@@dead "+assign"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 489, characters 0-50 + +staticcatch is never used + <-- line 489 + let staticcatch a b c : t = Lstaticcatch (a, b, c) [@@dead "+staticcatch"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 490, characters 0-45 + +staticraise is never used + <-- line 490 + let staticraise a b : t = Lstaticraise (a, b) [@@dead "+staticraise"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 492, characters 0-286 + +lam.Lift is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 493, characters 2-56 + Lift.+int is never used + <-- line 493 + let int i : t = Lconst (Const_int {i; comment = None}) [@@dead "Lift.+int"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 498, characters 2-42 + Lift.+bool is never used + <-- line 498 + let bool b = if b then true_ else false_ [@@dead "Lift.+bool"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 500, characters 2-60 + Lift.+string is never used + <-- line 500 + let string s : t = Lconst (Const_string {s; delim = None}) [@@dead "Lift.+string"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 502, characters 2-40 + Lift.+char is never used + <-- line 502 + let char b : t = Lconst (Const_char b) [@@dead "Lift.+char"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 505, characters 0-4192 + +prim is never used + <-- line 505 + | _ -> default ()) [@@dead "+prim"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 610, characters 0-177 + +not_ is never used + <-- line 610 + | _ -> prim ~primitive:Pnot ~args:[x] loc [@@dead "+not_"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 616, characters 0-308 + +has_boolean_type is never used + <-- line 616 + | _ -> None [@@dead "+has_boolean_type"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 632, characters 0-233 + +complete_range is never used + <-- line 632 + && complete_range rest ~start:(start + 1) ~finish [@@dead "+complete_range"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 639, characters 0-384 + +eval_const_as_bool is never used + <-- line 639 + | Const_some b -> eval_const_as_bool b [@@dead "+eval_const_as_bool"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 651, characters 0-2862 + +if_ is never used + <-- line 651 + | _ -> Lifthenelse (a, b, c))) [@@dead "+if_"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 733, characters 0-30 + +sequor is never used + <-- line 733 + let sequor l r = if_ l true_ r [@@dead "+sequor"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 736, characters 0-32 + +sequand is never used + <-- line 736 + let sequand l r = if_ l r false_ [@@dead "+sequand"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 738, characters 0-369 + +result_wrap is never used + <-- line 738 + | Return_unset | Return_identity -> result [@@dead "+result_wrap"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 746, characters 0-352 + +handle_bs_non_obj_ffi is never used + <-- line 746 + ~args loc) [@@dead "+handle_bs_non_obj_ffi"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 94, characters 0-34 + +inner_map is never used + <-- line 94 + val inner_map : t -> (t -> t) -> t [@@dead "+inner_map"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 96, characters 0-230 + +handle_bs_non_obj_ffi is never used + <-- line 96 + t [@@dead "+handle_bs_non_obj_ffi"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 109, characters 0-20 + +var is never used + <-- line 109 + val var : ident -> t [@@dead "+var"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 112, characters 0-54 + +global_module is never used + <-- line 112 + val global_module : ?dynamic_import:bool -> ident -> t [@@dead "+global_module"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 114, characters 0-31 + +const is never used + <-- line 114 + val const : Lam_constant.t -> t [@@dead "+const"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 116, characters 0-67 + +apply is never used + <-- line 116 + val apply : ?ap_transformed_jsx:bool -> t -> t list -> ap_info -> t [@@dead "+apply"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 118, characters 0-105 + +function_ is never used + <-- line 118 + t [@@dead "+function_"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 125, characters 0-54 + +let_ is never used + <-- line 125 + val let_ : Lam_compat.let_kind -> ident -> t -> t -> t [@@dead "+let_"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 127, characters 0-39 + +letrec is never used + <-- line 127 + val letrec : (ident * t) list -> t -> t [@@dead "+letrec"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 129, characters 0-26 + +if_ is never used + <-- line 129 + val if_ : t -> t -> t -> t [@@dead "+if_"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 132, characters 0-36 + +switch is never used + <-- line 132 + val switch : t -> lambda_switch -> t [@@dead "+switch"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 135, characters 0-58 + +stringswitch is never used + <-- line 135 + val stringswitch : t -> (string * t) list -> t option -> t [@@dead "+stringswitch"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 139, characters 0-14 + +false_ is never used + <-- line 139 + val false_ : t [@@dead "+false_"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 141, characters 0-12 + +unit is never used + <-- line 141 + val unit : t [@@dead "+unit"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 143, characters 0-24 + +sequor is never used + <-- line 143 + val sequor : t -> t -> t [@@dead "+sequor"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 146, characters 0-25 + +sequand is never used + <-- line 146 + val sequand : t -> t -> t [@@dead "+sequand"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 149, characters 0-31 + +not_ is never used + <-- line 149 + val not_ : Location.t -> t -> t [@@dead "+not_"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 152, characters 0-21 + +seq is never used + <-- line 152 + val seq : t -> t -> t [@@dead "+seq"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 155, characters 0-13 + +break is never used + <-- line 155 + val break : t [@@dead "+break"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 157, characters 0-16 + +continue is never used + <-- line 157 + val continue : t [@@dead "+continue"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 159, characters 0-24 + +while_ is never used + <-- line 159 + val while_ : t -> t -> t [@@dead "+while_"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 162, characters 0-31 + +try_ is never used + <-- line 162 + val try_ : t -> ident -> t -> t [@@dead "+try_"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 164, characters 0-28 + +assign is never used + <-- line 164 + val assign : ident -> t -> t [@@dead "+assign"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 166, characters 0-70 + +prim is never used + <-- line 166 + val prim : primitive:Lam_primitive.t -> args:t list -> Location.t -> t [@@dead "+prim"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 169, characters 0-49 + +staticcatch is never used + <-- line 169 + val staticcatch : t -> int * ident list -> t -> t [@@dead "+staticcatch"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 171, characters 0-36 + +staticraise is never used + <-- line 171 + val staticraise : int -> t list -> t [@@dead "+staticraise"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 173, characters 0-63 + +for_ is never used + <-- line 173 + val for_ : ident -> t -> t -> Asttypes.direction_flag -> t -> t [@@dead "+for_"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 175, characters 0-33 + +for_of is never used + <-- line 175 + val for_of : ident -> t -> t -> t [@@dead "+for_of"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 177, characters 0-39 + +for_await_of is never used + <-- line 177 + val for_await_of : ident -> t -> t -> t [@@dead "+for_await_of"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 181, characters 0-30 + +eq_approx is never used + <-- line 181 + val eq_approx : t -> t -> bool [@@dead "+eq_approx"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_analysis.ml", line 1, characters 0-0 + +lam_analysis is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_analysis.ml", line 26, characters 0-139 + +not_zero_constant is never used + <-- line 26 + | _ -> false [@@dead "+not_zero_constant"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_analysis.ml", line 32, characters 0-4220 + +no_side_effects is never used + <-- line 32 + | Lapply _ -> false [@@dead "+no_side_effects"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_analysis.ml", line 143, characters 0-51 + +really_big is never used + <-- line 143 + let really_big () = raise_notrace Too_big_to_inline [@@dead "+really_big"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_analysis.ml", line 147, characters 0-1563 + +size is never used + <-- line 147 + with Too_big_to_inline -> 1000 [@@dead "+size"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_analysis.ml", line 193, characters 0-381 + +size_constant is never used + <-- line 193 + Ext_list.fold_left str 0 (fun acc x -> acc + size_constant x) [@@dead "+size_constant"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_analysis.ml", line 204, characters 0-97 + +size_lams is never used + <-- line 204 + Ext_list.fold_left lams acc (fun acc l -> acc + size l) [@@dead "+size_lams"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_analysis.ml", line 207, characters 0-138 + +args_all_const is never used + <-- line 207 + | _ -> false) [@@dead "+args_all_const"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_analysis.ml", line 213, characters 0-24 + +exit_inline_size is never used + <-- line 213 + let exit_inline_size = 7 [@@dead "+exit_inline_size"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_analysis.ml", line 215, characters 0-25 + +small_inline_size is never used + <-- line 215 + let small_inline_size = 5 [@@dead "+small_inline_size"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_analysis.ml", line 226, characters 0-674 + +destruct_pattern is never used + <-- line 226 + | _ -> false [@@dead "+destruct_pattern"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_analysis.ml", line 248, characters 0-122 + +lfunction_can_be_inlined is never used + <-- line 248 + (not lfunction.attr.async) && lfunction.attr.directive = None [@@dead "+lfunction_can_be_inlined"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_analysis.ml", line 252, characters 0-379 + +ok_to_inline_fun_when_app is never used + <-- line 252 + || (args_all_const args && s < 10 && no_side_effects body)) [@@dead "+ok_to_inline_fun_when_app"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_analysis.ml", line 267, characters 0-248 + +safe_to_inline is never used + <-- line 267 + | _ -> false [@@dead "+safe_to_inline"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_analysis.mli", line 1, characters 0-0 + lam_analysis is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_analysis.mli", line 27, characters 0-35 + +no_side_effects is never used + <-- line 27 + val no_side_effects : Lam.t -> bool [@@dead "+no_side_effects"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_analysis.mli", line 30, characters 0-23 + +size is never used + <-- line 30 + val size : Lam.t -> int [@@dead "+size"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_analysis.mli", line 32, characters 0-52 + +lfunction_can_be_inlined is never used + <-- line 32 + val lfunction_can_be_inlined : Lam.lfunction -> bool [@@dead "+lfunction_can_be_inlined"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_analysis.mli", line 34, characters 0-67 + +ok_to_inline_fun_when_app is never used + <-- line 34 + val ok_to_inline_fun_when_app : Lam.lfunction -> Lam.t list -> bool [@@dead "+ok_to_inline_fun_when_app"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_analysis.mli", line 36, characters 0-27 + +small_inline_size is never used + <-- line 36 + val small_inline_size : int [@@dead "+small_inline_size"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_analysis.mli", line 38, characters 0-26 + +exit_inline_size is never used + <-- line 38 + val exit_inline_size : int [@@dead "+exit_inline_size"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_analysis.mli", line 40, characters 0-34 + +safe_to_inline is never used + <-- line 40 + val safe_to_inline : Lam.t -> bool [@@dead "+safe_to_inline"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity.ml", line 35, characters 0-228 + +equal is never used + <-- line 35 + | Arity_na -> false) [@@dead "+equal"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity.ml", line 44, characters 0-23 + +pp is never used + <-- line 44 + let pp = Format.fprintf [@@dead "+pp"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity.ml", line 46, characters 0-323 + +print is never used + <-- line 46 + pp fmt "]@]" [@@dead "+print"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity.ml", line 59, characters 0-210 + +print_arities_tbl is never used + <-- line 59 + arities_tbl () [@@dead "+print_arities_tbl"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity.ml", line 65, characters 0-144 + +merge is never used + <-- line 65 + | Arity_info (xs, tail) -> Arity_info (n :: xs, tail) [@@dead "+merge"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity.ml", line 70, characters 0-52 + +non_function_arity_info is never used + <-- line 70 + let non_function_arity_info = Arity_info ([], false) [@@dead "+non_function_arity_info"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity.ml", line 72, characters 0-44 + +raise_arity_info is never used + <-- line 72 + let raise_arity_info = Arity_info ([], true) [@@dead "+raise_arity_info"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity.ml", line 74, characters 0-17 + +na is never used + <-- line 74 + let na = Arity_na [@@dead "+na"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity.ml", line 76, characters 0-40 + +info is never used + <-- line 76 + let info args b1 = Arity_info (args, b1) [@@dead "+info"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity.ml", line 78, characters 0-100 + +first_arity_na is never used + <-- line 78 + | _ -> false [@@dead "+first_arity_na"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity.ml", line 83, characters 0-123 + +get_first_arity is never used + <-- line 83 + | Arity_info (x :: _, _) -> Some x [@@dead "+get_first_arity"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity.ml", line 88, characters 0-90 + +extract_arity is never used + <-- line 88 + | Arity_info (xs, _) -> xs [@@dead "+extract_arity"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity.ml", line 95, characters 0-451 + +merge_arities_aux is never used + <-- line 95 + | _, _ -> info (List.rev acc) false [@@dead "+merge_arities_aux"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity.ml", line 104, characters 0-62 + +merge_arities is never used + <-- line 104 + let merge_arities xs ys t t2 = merge_arities_aux [] xs ys t t2 [@@dead "+merge_arities"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity.mli", line 35, characters 0-26 + +equal is never used + <-- line 35 + val equal : t -> t -> bool [@@dead "+equal"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity.mli", line 37, characters 0-41 + +print is never used + <-- line 37 + val print : Format.formatter -> t -> unit [@@dead "+print"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity.mli", line 39, characters 0-78 + +print_arities_tbl is never used + <-- line 39 + val print_arities_tbl : Format.formatter -> (Ident.t, t ref) Hashtbl.t -> unit [@@dead "+print_arities_tbl"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity.mli", line 41, characters 0-25 + +merge is never used + <-- line 41 + val merge : int -> t -> t [@@dead "+merge"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity.mli", line 43, characters 0-31 + +non_function_arity_info is never used + <-- line 43 + val non_function_arity_info : t [@@dead "+non_function_arity_info"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity.mli", line 45, characters 0-24 + +raise_arity_info is never used + <-- line 45 + val raise_arity_info : t [@@dead "+raise_arity_info"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity.mli", line 47, characters 0-10 + +na is never used + <-- line 47 + val na : t [@@dead "+na"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity.mli", line 49, characters 0-32 + +info is never used + <-- line 49 + val info : int list -> bool -> t [@@dead "+info"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity.mli", line 51, characters 0-30 + +first_arity_na is never used + <-- line 51 + val first_arity_na : t -> bool [@@dead "+first_arity_na"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity.mli", line 53, characters 0-37 + +get_first_arity is never used + <-- line 53 + val get_first_arity : t -> int option [@@dead "+get_first_arity"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity.mli", line 55, characters 0-33 + +extract_arity is never used + <-- line 55 + val extract_arity : t -> int list [@@dead "+extract_arity"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity.mli", line 58, characters 0-61 + +merge_arities is never used + <-- line 58 + val merge_arities : int list -> int list -> bool -> bool -> t [@@dead "+merge_arities"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity_analysis.ml", line 1, characters 0-0 + +lam_arity_analysis is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity_analysis.ml", line 25, characters 0-305 + +arity_of_var is never used + <-- line 25 + | Some _ | None -> Lam_arity.na [@@dead "+arity_of_var"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity_analysis.ml", line 38, characters 0-3438 + +get_arity is never used + <-- line 38 + Lam_arity.non_function_arity_info [@@dead "+get_arity"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity_analysis.ml", line 136, characters 0-490 + +all_lambdas is never used + <-- line 136 + | [] -> Lam_arity.na [@@dead "+all_lambdas"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity_analysis.mli", line 1, characters 0-0 + lam_arity_analysis is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity_analysis.mli", line 27, characters 0-51 + +get_arity is never used + <-- line 27 + val get_arity : Lam_stats.t -> Lam.t -> Lam_arity.t [@@dead "+get_arity"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_beta_reduce.ml", line 1, characters 0-0 + +lam_beta_reduce is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_beta_reduce.ml", line 47, characters 0-1174 + +propagate_beta_reduce is never used + <-- line 47 + Lam_util.refine_let ~kind:Strict param arg l) [@@dead "+propagate_beta_reduce"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_beta_reduce.ml", line 76, characters 0-1728 + +propagate_beta_reduce_with_map is never used + <-- line 76 + Lam_util.refine_let ~kind:Strict param arg l) [@@dead "+propagate_beta_reduce_with_map"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_beta_reduce.ml", line 117, characters 0-256 + +no_names_beta_reduce is never used + <-- line 117 + Lam_util.refine_let ~kind:Strict param arg l) [@@dead "+no_names_beta_reduce"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_beta_reduce.mli", line 1, characters 0-0 + lam_beta_reduce is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_beta_reduce.mli", line 27, characters 0-71 + +no_names_beta_reduce is never used + <-- line 27 + val no_names_beta_reduce : Ident.t list -> Lam.t -> Lam.t list -> Lam.t [@@dead "+no_names_beta_reduce"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_beta_reduce.mli", line 45, characters 0-89 + +propagate_beta_reduce is never used + <-- line 45 + Lam_stats.t -> Ident.t list -> Lam.t -> Lam.t list -> Lam.t [@@dead "+propagate_beta_reduce"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_beta_reduce.mli", line 48, characters 0-143 + +propagate_beta_reduce_with_map is never used + <-- line 48 + Lam.t [@@dead "+propagate_beta_reduce_with_map"] + + Warning Dead Value With Side Effects + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_beta_reduce_util.ml", line 36, characters 0-54 + +param_hash is never used and could have side effects + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_beta_reduce_util.ml", line 52, characters 0-2324 + +simple_beta_reduce is never used + <-- line 52 + | _ -> None [@@dead "+simple_beta_reduce"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_beta_reduce_util.mli", line 1, characters 0-0 + lam_beta_reduce_util is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_beta_reduce_util.mli", line 25, characters 0-76 + +simple_beta_reduce is never used + <-- line 25 + val simple_beta_reduce : Ident.t list -> Lam.t -> Lam.t list -> Lam.t option [@@dead "+simple_beta_reduce"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_bounded_vars.ml", line 1, characters 0-0 + +lam_bounded_vars is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_bounded_vars.ml", line 64, characters 0-3339 + +rewrite is never used + <-- line 64 + aux lam [@@dead "+rewrite"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_bounded_vars.mli", line 1, characters 0-0 + lam_bounded_vars is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_bounded_vars.mli", line 25, characters 0-50 + +rewrite is never used + <-- line 25 + val rewrite : Lam.t Hash_ident.t -> Lam.t -> Lam.t [@@dead "+rewrite"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_check.ml", line 1, characters 0-0 + +lam_check is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_check.ml", line 30, characters 0-4704 + +check is never used + <-- line 30 + lam [@@dead "+check"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_check.mli", line 1, characters 0-0 + lam_check is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_check.mli", line 25, characters 0-36 + +check is never used + <-- line 25 + val check : string -> Lam.t -> Lam.t [@@dead "+check"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_closure.ml", line 1, characters 0-0 + +lam_closure is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_closure.ml", line 29, characters 0-276 + +adjust is never used + <-- line 29 + Lam_var_stats.update stat pos) [@@dead "+adjust"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_closure.ml", line 39, characters 0-155 + +param_map_of_list is never used + <-- line 39 + Map_ident.add acc l Lam_var_stats.fresh_stats) [@@dead "+param_map_of_list"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_closure.ml", line 44, characters 0-33 + +sink_pos is never used + <-- line 44 + let sink_pos = Lam_var_stats.sink [@@dead "+sink_pos"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_closure.ml", line 54, characters 0-3268 + +free_variables is never used + <-- line 54 + !fv [@@dead "+free_variables"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_closure.ml", line 157, characters 0-124 + +is_closed is never used + <-- line 157 + (fun k _ -> Ident.global k) [@@dead "+is_closed"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_closure.ml", line 161, characters 0-321 + +is_closed_with_map is never used + <-- line 161 + (old_count = new_count, param_map) [@@dead "+is_closed_with_map"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_closure.mli", line 1, characters 0-0 + lam_closure is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_closure.mli", line 30, characters 0-29 + +is_closed is never used + <-- line 30 + val is_closed : Lam.t -> bool [@@dead "+is_closed"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_closure.mli", line 32, characters 0-105 + +is_closed_with_map is never used + <-- line 32 + Set_ident.t -> Ident.t list -> Lam.t -> bool * Lam_var_stats.stats Map_ident.t [@@dead "+is_closed_with_map"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_closure.mli", line 36, characters 0-119 + +free_variables is never used + <-- line 36 + Lam_var_stats.stats Map_ident.t [@@dead "+free_variables"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_coercion.ml", line 82, characters 0-3547 + +handle_exports is never used + <-- line 82 + {result with export_map; groups = Lam_dce.remove export_list coerced_input} [@@dead "+handle_exports"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_coercion.ml", line 179, characters 0-411 + +flatten is never used + <-- line 179 + | x -> (x, acc) [@@dead "+flatten"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_coercion.ml", line 196, characters 0-518 + +coerce_and_group_big_lambda is never used + <-- line 196 + assert false [@@dead "+coerce_and_group_big_lambda"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_coercion.mli", line 32, characters 0-73 + +coerce_and_group_big_lambda is never used + <-- line 32 + val coerce_and_group_big_lambda : Lam_stats.t -> Lam.t -> t * Lam_stats.t [@@dead "+coerce_and_group_big_lambda"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.ml", line 27, characters 0-191 + +eq_comparison is never used + <-- line 27 + | Cneq -> p1 = Cneq [@@dead "+eq_comparison"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.ml", line 36, characters 0-178 + +cmp_int32 is never used + <-- line 36 + | Cge -> a >= b [@@dead "+cmp_int32"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.ml", line 45, characters 0-178 + +cmp_float is never used + <-- line 45 + | Cge -> a >= b [@@dead "+cmp_float"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.ml", line 54, characters 0-174 + +cmp_int is never used + <-- line 54 + | Cge -> a >= b [@@dead "+cmp_int"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.ml", line 66, characters 2-69 + field_dbg_info.Fld_record is a variant case which is never constructed + <-- line 66 + | Fld_record of {name: string; mutable_flag: Asttypes.mutable_flag} [@dead "field_dbg_info.Fld_record"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.ml", line 67, characters 2-32 + field_dbg_info.Fld_module is a variant case which is never constructed + <-- line 67 + | Fld_module of {name: string} [@dead "field_dbg_info.Fld_module"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.ml", line 68, characters 2-39 + field_dbg_info.Fld_record_inline is a variant case which is never constructed + <-- line 68 + | Fld_record_inline of {name: string} [@dead "field_dbg_info.Fld_record_inline"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.ml", line 69, characters 2-42 + field_dbg_info.Fld_record_extension is a variant case which is never constructed + <-- line 69 + | Fld_record_extension of {name: string} [@dead "field_dbg_info.Fld_record_extension"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.ml", line 70, characters 2-13 + field_dbg_info.Fld_tuple is a variant case which is never constructed + <-- line 70 + | Fld_tuple [@dead "field_dbg_info.Fld_tuple"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.ml", line 71, characters 2-20 + field_dbg_info.Fld_poly_var_tag is a variant case which is never constructed + <-- line 71 + | Fld_poly_var_tag [@dead "field_dbg_info.Fld_poly_var_tag"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.ml", line 72, characters 2-24 + field_dbg_info.Fld_poly_var_content is a variant case which is never constructed + <-- line 72 + | Fld_poly_var_content [@dead "field_dbg_info.Fld_poly_var_content"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.ml", line 73, characters 2-17 + field_dbg_info.Fld_extension is a variant case which is never constructed + <-- line 73 + | Fld_extension [@dead "field_dbg_info.Fld_extension"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.ml", line 74, characters 2-15 + field_dbg_info.Fld_variant is a variant case which is never constructed + <-- line 74 + | Fld_variant [@dead "field_dbg_info.Fld_variant"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.ml", line 75, characters 2-12 + field_dbg_info.Fld_cons is a variant case which is never constructed + <-- line 75 + | Fld_cons [@dead "field_dbg_info.Fld_cons"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.ml", line 91, characters 2-38 + set_field_dbg_info.Fld_record_extension_set is a variant case which is never constructed + <-- line 91 + | Fld_record_extension_set of string [@dead "set_field_dbg_info.Fld_record_extension_set"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.mli", line 30, characters 2-69 + field_dbg_info.Fld_record is a variant case which is never constructed + <-- line 30 + | Fld_record of {name: string; mutable_flag: Asttypes.mutable_flag} [@dead "field_dbg_info.Fld_record"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.mli", line 31, characters 2-32 + field_dbg_info.Fld_module is a variant case which is never constructed + <-- line 31 + | Fld_module of {name: string} [@dead "field_dbg_info.Fld_module"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.mli", line 32, characters 2-39 + field_dbg_info.Fld_record_inline is a variant case which is never constructed + <-- line 32 + | Fld_record_inline of {name: string} [@dead "field_dbg_info.Fld_record_inline"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.mli", line 33, characters 2-42 + field_dbg_info.Fld_record_extension is a variant case which is never constructed + <-- line 33 + | Fld_record_extension of {name: string} [@dead "field_dbg_info.Fld_record_extension"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.mli", line 34, characters 2-13 + field_dbg_info.Fld_tuple is a variant case which is never constructed + <-- line 34 + | Fld_tuple [@dead "field_dbg_info.Fld_tuple"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.mli", line 35, characters 2-20 + field_dbg_info.Fld_poly_var_tag is a variant case which is never constructed + <-- line 35 + | Fld_poly_var_tag [@dead "field_dbg_info.Fld_poly_var_tag"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.mli", line 36, characters 2-24 + field_dbg_info.Fld_poly_var_content is a variant case which is never constructed + <-- line 36 + | Fld_poly_var_content [@dead "field_dbg_info.Fld_poly_var_content"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.mli", line 37, characters 2-17 + field_dbg_info.Fld_extension is a variant case which is never constructed + <-- line 37 + | Fld_extension [@dead "field_dbg_info.Fld_extension"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.mli", line 38, characters 2-15 + field_dbg_info.Fld_variant is a variant case which is never constructed + <-- line 38 + | Fld_variant [@dead "field_dbg_info.Fld_variant"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.mli", line 39, characters 2-12 + field_dbg_info.Fld_cons is a variant case which is never constructed + <-- line 39 + | Fld_cons [@dead "field_dbg_info.Fld_cons"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.mli", line 46, characters 2-38 + set_field_dbg_info.Fld_record_extension_set is a variant case which is never constructed + <-- line 46 + | Fld_record_extension_set of string [@dead "set_field_dbg_info.Fld_record_extension_set"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.mli", line 48, characters 0-52 + +cmp_int32 is never used + <-- line 48 + val cmp_int32 : comparison -> int32 -> int32 -> bool [@@dead "+cmp_int32"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.mli", line 50, characters 0-52 + +cmp_float is never used + <-- line 50 + val cmp_float : comparison -> float -> float -> bool [@@dead "+cmp_float"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.mli", line 52, characters 0-46 + +cmp_int is never used + <-- line 52 + val cmp_int : comparison -> int -> int -> bool [@@dead "+cmp_int"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.mli", line 54, characters 0-52 + +eq_comparison is never used + <-- line 54 + val eq_comparison : comparison -> comparison -> bool [@@dead "+eq_comparison"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile.ml", line 28, characters 0-167 + +args_either_function_or_const is never used + <-- line 28 + | _ -> false) [@@dead "+args_either_function_or_const"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile.ml", line 34, characters 0-363 + +call_info_of_ap_status is never used + <-- line 34 + | App_na -> {arity = NA; call_info = Call_ml; call_transformed_jsx} [@@dead "+call_info_of_ap_status"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile.ml", line 42, characters 0-1264 + +apply_with_arity_aux is never used + <-- line 42 + E.call ~info:Js_call_info.dummy fn args [@@dead "+apply_with_arity_aux"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile.ml", line 77, characters 0-93 + +apply_with_arity is never used + <-- line 77 + apply_with_arity_aux fn arity args (List.length args) [@@dead "+apply_with_arity"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile.ml", line 80, characters 0-249 + +change_tail_type_in_try is never used + <-- line 80 + | Not_tail | Maybe_tail_is_return Tail_in_try -> x [@@dead "+change_tail_type_in_try"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile.ml", line 86, characters 0-268 + +in_staticcatch is never used + <-- line 86 + | _ -> x [@@dead "+in_staticcatch"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile.ml", line 104, characters 0-492 + +flat_catches is never used + <-- line 104 + | _ -> (acc, x) [@@dead "+flat_catches"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile.ml", line 116, characters 0-106 + +flatten_nested_caches is never used + <-- line 116 + flat_catches [] x [@@dead "+flatten_nested_caches"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile.ml", line 120, characters 0-200 + +morph_declare_to_assign is never used + <-- line 120 + | _ -> k cxt None [@@dead "+morph_declare_to_assign"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile.ml", line 126, characters 0-242 + +group_apply is never used + <-- line 126 + (fun group -> Ext_list.map_last group callback) [@@dead "+group_apply"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile.ml", line 139, characters 0-143 + +default_action is never used + <-- line 139 + | Some x -> if saturated then Complete else Default x [@@dead "+default_action"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile.ml", line 144, characters 0-152 + +get_const_tag is never used + <-- line 144 + | Some {consts} -> Some consts.(i) [@@dead "+get_const_tag"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile.ml", line 149, characters 0-148 + +get_block is never used + <-- line 149 + | Some {blocks} -> Some blocks.(i) [@@dead "+get_block"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile.ml", line 154, characters 0-332 + +get_tag_name is never used + <-- line 154 + | _ -> Js_dump_lit.tag) [@@dead "+get_tag_name"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile.ml", line 166, characters 0-312 + +get_block_cases is never used + <-- line 166 + !res [@@dead "+get_block_cases"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile.ml", line 176, characters 0-322 + +get_literal_cases is never used + <-- line 176 + !res [@@dead "+get_literal_cases"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile.ml", line 186, characters 0-434 + +has_null_undefined_other is never used + <-- line 186 + (!null, !undefined, !other) [@@dead "+has_null_undefined_other"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile.ml", line 199, characters 0-32 + +no_effects_const is never used + <-- line 199 + let no_effects_const = lazy true [@@dead "+no_effects_const"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile.ml", line 234, characters 0-70707 + +compile is never used + <-- line 234 + (compile_recursive_lets, compile_lambda) [@@dead "+compile"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile.ml", line 1970, characters 0-71 + +compile_recursive_lets is never used + <-- line 1970 + let compile_recursive_lets ~output_prefix = fst (compile output_prefix) [@@dead "+compile_recursive_lets"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile.ml", line 1971, characters 0-63 + +compile_lambda is never used + <-- line 1971 + let compile_lambda ~output_prefix = snd (compile output_prefix) [@@dead "+compile_lambda"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile.mli", line 1, characters 0-0 + lam_compile is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile.mli", line 27, characters 0-123 + +compile_recursive_lets is never used + <-- line 27 + Js_output.t [@@dead "+compile_recursive_lets"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile.mli", line 33, characters 0-92 + +compile_lambda is never used + <-- line 33 + output_prefix:string -> Lam_compile_context.t -> Lam.t -> Js_output.t [@@dead "+compile_lambda"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_const.ml", line 1, characters 0-0 + +lam_compile_const is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_const.ml", line 28, characters 0-180 + +is_some_none_aux is never used + <-- line 28 + | _ -> -1 [@@dead "+is_some_none_aux"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_const.ml", line 34, characters 0-108 + +nested_some_none is never used + <-- line 34 + if n = 0 then none else nested_some_none (n - 1) (E.optional_block none) [@@dead "+nested_some_none"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_const.ml", line 37, characters 0-268 + +translate_some is never used + <-- line 37 + (E.optional_block (translate (Const_js_undefined {is_unit = false}))) [@@dead "+translate_some"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_const.ml", line 44, characters 0-1124 + +translate is never used + <-- line 44 + (Ext_list.map xs translate) [@@dead "+translate"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_const.ml", line 79, characters 0-162 + +translate_arg_cst is never used + <-- line 79 + | Arg_string_lit (s, delim) -> E.str s ~delim [@@dead "+translate_arg_cst"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_const.mli", line 1, characters 0-0 + lam_compile_const is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_const.mli", line 27, characters 0-46 + +translate is never used + <-- line 27 + val translate : Lam_constant.t -> J.expression [@@dead "+translate"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_const.mli", line 29, characters 0-61 + +translate_arg_cst is never used + <-- line 29 + val translate_arg_cst : External_arg_spec.cst -> J.expression [@@dead "+translate_arg_cst"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_context.ml", line 69, characters 0-228 + +continuation_is_return is never used + <-- line 69 + | EffectCall Not_tail | NeedValue Not_tail | Declare _ | Assign _ -> false [@@dead "+continuation_is_return"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_context.ml", line 84, characters 0-41 + +empty_handler_map is never used + <-- line 84 + let empty_handler_map = Handler_map.empty [@@dead "+empty_handler_map"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_context.ml", line 86, characters 0-69 + +enter_switch is never used + <-- line 86 + let enter_switch cxt = {cxt with switch_depth = cxt.switch_depth + 1} [@@dead "+enter_switch"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_context.ml", line 88, characters 0-110 + +push_loop is never used + <-- line 88 + ({cxt with loop_stack = frame :: cxt.loop_stack}, frame) [@@dead "+push_loop"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_context.ml", line 92, characters 0-358 + +ensure_loop_label is never used + <-- line 92 + label [@@dead "+ensure_loop_label"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_context.ml", line 105, characters 0-119 + +no_static_raise_in_handler is never used + <-- line 105 + not (Lam_exit_code.has_exit_code x.handler (fun _code -> true)) [@@dead "+no_static_raise_in_handler"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_context.ml", line 114, characters 0-436 + +add_jmps is never used + <-- line 114 + (map, List.rev handlers) [@@dead "+add_jmps"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_context.ml", line 125, characters 0-274 + +add_pseudo_jmp is never used + <-- line 125 + code_table.handler ) [@@dead "+add_pseudo_jmp"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_context.ml", line 132, characters 0-53 + +find_exn is never used + <-- line 132 + let find_exn cxt i = Map_int.find_exn cxt.jmp_table i [@@dead "+find_exn"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_context.mli", line 69, characters 0-49 + +continuation_is_return is never used + <-- line 69 + val continuation_is_return : continuation -> bool [@@dead "+continuation_is_return"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_context.mli", line 80, characters 0-33 + +empty_handler_map is never used + <-- line 80 + val empty_handler_map : jmp_table [@@dead "+empty_handler_map"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_context.mli", line 81, characters 0-25 + +enter_switch is never used + <-- line 81 + val enter_switch : t -> t [@@dead "+enter_switch"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_context.mli", line 82, characters 0-35 + +push_loop is never used + <-- line 82 + val push_loop : t -> t * loop_frame [@@dead "+push_loop"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_context.mli", line 83, characters 0-50 + +ensure_loop_label is never used + <-- line 83 + val ensure_loop_label : t -> loop_frame -> J.label [@@dead "+ensure_loop_label"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_context.mli", line 87, characters 0-48 + +no_static_raise_in_handler is never used + <-- line 87 + val no_static_raise_in_handler : handler -> bool [@@dead "+no_static_raise_in_handler"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_context.mli", line 89, characters 0-93 + +add_jmps is never used + <-- line 89 + jmp_table -> Ident.t -> handler list -> jmp_table * (jbl_label * Lam.t) list [@@dead "+add_jmps"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_context.mli", line 92, characters 0-73 + +add_pseudo_jmp is never used + <-- line 92 + val add_pseudo_jmp : jmp_table -> Ident.t -> handler -> jmp_table * Lam.t [@@dead "+add_pseudo_jmp"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_context.mli", line 94, characters 0-38 + +find_exn is never used + <-- line 94 + val find_exn : t -> jbl_label -> value [@@dead "+find_exn"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_env.ml", line 33, characters 2-15 + ident_info.name is a record label never used to read a value + <-- line 33 + name: string; [@dead "ident_info.name"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_env.ml", line 34, characters 2-29 + ident_info.arity is a record label never used to read a value + <-- line 34 + arity: Js_cmj_format.arity; [@dead "ident_info.arity"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_env.ml", line 35, characters 2-41 + ident_info.persistent_closed_lambda is a record label never used to read a value + <-- line 35 + persistent_closed_lambda: Lam.t option; [@dead "ident_info.persistent_closed_lambda"] + + Warning Dead Value With Side Effects + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_env.ml", line 48, characters 0-49 + ++> is never used and could have side effects + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_env.ml", line 62, characters 0-800 + +add_js_module is never used + <-- line 62 + | Some old_key -> old_key.id [@@dead "+add_js_module"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_env.ml", line 87, characters 0-521 + +query_external_id_info is never used + <-- line 87 + Js_cmj_format.query_by_name cmj_table name [@@dead "+query_external_id_info"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_env.ml", line 101, characters 0-732 + +get_package_path_from_cmj is never used + <-- line 101 + (cmj_load_info.package_path, cmj_table.package_spec, cmj_table.case) [@@dead "+get_package_path_from_cmj"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_env.ml", line 121, characters 0-39 + +add is never used + <-- line 121 + let add = Lam_module_ident.Hash_set.add [@@dead "+add"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_env.ml", line 124, characters 0-471 + +is_pure_module is never used + <-- line 124 + | Some External -> false) [@@dead "+is_pure_module"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_env.ml", line 139, characters 0-332 + +populate_required_modules is never used + <-- line 139 + if not (is_pure_module id) then add hard_dependencies id) [@@dead "+populate_required_modules"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_env.mli", line 29, characters 0-178 + +add_js_module is never used + <-- line 29 + Ident.t [@@dead "+add_js_module"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_env.mli", line 67, characters 0-105 + +query_external_id_info is never used + <-- line 67 + ?dynamic_import:bool -> Ident.t -> string -> Js_cmj_format.keyed_cmj_value [@@dead "+query_external_id_info"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_env.mli", line 74, characters 0-47 + +is_pure_module is never used + <-- line 74 + val is_pure_module : Lam_module_ident.t -> bool [@@dead "+is_pure_module"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_env.mli", line 76, characters 0-107 + +get_package_path_from_cmj is never used + <-- line 76 + Lam_module_ident.t -> string * Js_packages_info.t * Ext_js_file_kind.case [@@dead "+get_package_path_from_cmj"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_env.mli", line 84, characters 0-100 + +populate_required_modules is never used + <-- line 84 + Lam_module_ident.Hash_set.t -> Lam_module_ident.Hash_set.t -> unit [@@dead "+populate_required_modules"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_external_call.ml", line 40, characters 0-316 + +external_var is never used + <-- line 40 + E.external_var ?import_attributes ~external_name:bundle id [@@dead "+external_var"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_external_call.ml", line 60, characters 2-24 + arg_expression.Splice2 is a variant case which is never constructed + <-- line 60 + | Splice2 of E.t * E.t [@dead "arg_expression.Splice2"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_external_call.ml", line 62, characters 0-115 + +append_list is never used + <-- line 62 + | Splice2 (a, b) -> a :: b :: xs [@@dead "+append_list"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_external_call.ml", line 90, characters 0-1788 + +ocaml_to_js_eff is never used + <-- line 90 + | Nothing -> (Splice1 arg, []) [@@dead "+ocaml_to_js_eff"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_external_call.ml", line 136, characters 0-25 + +empty_pair is never used + <-- line 136 + let empty_pair = ([], []) [@@dead "+empty_pair"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_external_call.ml", line 138, characters 0-74 + +add_eff is never used + <-- line 138 + | Some v -> E.seq v e [@@dead "+add_eff"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_external_call.ml", line 147, characters 0-812 + +keep_non_undefined_args is never used + <-- line 147 + else args [@@dead "+keep_non_undefined_args"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_external_call.ml", line 175, characters 0-900 + +assemble_args_no_splice is never used + <-- line 175 + Some (E.fuse_to_seq x xs) ) [@@dead "+assemble_args_no_splice"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_external_call.ml", line 200, characters 0-1074 + +assemble_args_has_splice is never used + <-- line 200 + !dynamic ) [@@dead "+assemble_args_has_splice"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_external_call.ml", line 231, characters 0-1224 + +translate_scoped_module_val is never used + <-- line 231 + Ext_list.fold_left (Ext_list.append_one rest fn) start E.dot) [@@dead "+translate_scoped_module_val"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_external_call.ml", line 265, characters 0-131 + +translate_scoped_access is never used + <-- line 265 + | x :: xs -> Ext_list.fold_left xs (E.dot obj x) E.dot [@@dead "+translate_scoped_access"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_external_call.ml", line 270, characters 0-6197 + +translate_ffi is never used + <-- line 270 + | _ -> assert false) [@@dead "+translate_ffi"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_external_call.mli", line 1, characters 0-0 + lam_compile_external_call is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_external_call.mli", line 25, characters 0-177 + +ocaml_to_js_eff is never used + <-- line 25 + Js_of_lam_variant.arg_expression * J.expression list [@@dead "+ocaml_to_js_eff"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_external_call.mli", line 32, characters 0-204 + +translate_ffi is never used + <-- line 32 + J.expression [@@dead "+translate_ffi"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_external_obj.ml", line 1, characters 0-0 + +lam_compile_external_obj is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_external_obj.ml", line 40, characters 0-5076 + +assemble_obj_args is never used + <-- line 40 + var_v ) [@@dead "+assemble_obj_args"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_external_obj.mli", line 1, characters 0-0 + lam_compile_external_obj is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_external_obj.mli", line 33, characters 0-101 + +assemble_obj_args is never used + <-- line 33 + External_arg_spec.obj_params -> J.expression list -> J.block * J.expression [@@dead "+assemble_obj_args"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_primitive.ml", line 1, characters 0-0 + +lam_compile_primitive is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_primitive.ml", line 30, characters 0-256 + +ensure_value_unit is never used + <-- line 30 + | EffectCall Not_tail -> e [@@dead "+ensure_value_unit"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_primitive.ml", line 39, characters 0-220 + +module_of_expression is never used + <-- line 39 + | _ -> [] [@@dead "+module_of_expression"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_primitive.ml", line 45, characters 0-396 + +get_module_system is never used + <-- line 45 + | _ -> Commonjs [@@dead "+get_module_system"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_primitive.ml", line 57, characters 0-96 + +call_info is never used + <-- line 57 + {Js_call_info.arity = Full; call_info = Call_na; call_transformed_jsx = false} [@@dead "+call_info"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_primitive.ml", line 60, characters 0-86 + +import_of_path is never used + <-- line 60 + E.call ~info:call_info (E.js_global "import") [E.str path] [@@dead "+import_of_path"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_primitive.ml", line 63, characters 0-276 + +wrap_then is never used + <-- line 63 + ] [@@dead "+wrap_then"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_primitive.ml", line 71, characters 0-19216 + +translate is never used + <-- line 71 + | _ -> assert false) [@@dead "+translate"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_primitive.mli", line 1, characters 0-0 + lam_compile_primitive is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_primitive.mli", line 31, characters 0-129 + +translate is never used + <-- line 31 + J.expression [@@dead "+translate"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_util.ml", line 1, characters 0-0 + +lam_compile_util is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_util.ml", line 25, characters 0-189 + +jsop_of_comp is never used + <-- line 25 + | Cge -> Ge [@@dead "+jsop_of_comp"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_util.ml", line 34, characters 0-215 + +runtime_of_comp is never used + <-- line 34 + | Cge -> "greaterequal" [@@dead "+runtime_of_comp"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_util.mli", line 1, characters 0-0 + lam_compile_util is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_util.mli", line 27, characters 0-55 + +jsop_of_comp is never used + <-- line 27 + val jsop_of_comp : Lam_compat.comparison -> Js_op.binop [@@dead "+jsop_of_comp"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_util.mli", line 29, characters 0-53 + +runtime_of_comp is never used + <-- line 29 + val runtime_of_comp : Lam_compat.comparison -> string [@@dead "+runtime_of_comp"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_constant_convert.ml", line 1, characters 0-0 + +lam_constant_convert is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_constant_convert.ml", line 25, characters 0-2504 + +convert_constant is never used + <-- line 25 + | _ -> assert false)) [@@dead "+convert_constant"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_constant_convert.mli", line 1, characters 0-0 + lam_constant_convert is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_constant_convert.mli", line 25, characters 0-67 + +convert_constant is never used + <-- line 25 + val convert_constant : Lambda.structured_constant -> Lam_constant.t [@@dead "+convert_constant"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_convert.ml", line 1, characters 0-0 + +lam_convert is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_convert.ml", line 25, characters 0-118 + +caml_id_field_info is never used + <-- line 25 + Fld_record {name = Literals.exception_id; mutable_flag = Immutable} [@@dead "+caml_id_field_info"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_convert.ml", line 28, characters 0-66 + +lam_caml_id is never used + <-- line 28 + let lam_caml_id : Lam_primitive.t = Pfield (0, caml_id_field_info) [@@dead "+lam_caml_id"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_convert.ml", line 29, characters 0-19 + +prim is never used + <-- line 29 + let prim = Lam.prim [@@dead "+prim"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_convert.ml", line 31, characters 0-88 + +lam_extension_id is never used + <-- line 31 + prim ~primitive:lam_caml_id ~args:[head] loc [@@dead "+lam_extension_id"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_convert.ml", line 63, characters 0-1890 + +exception_id_destructed is never used + <-- line 63 + hit l [@@dead "+exception_id_destructed"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_convert.ml", line 109, characters 0-39 + +abs_int is never used + <-- line 109 + let abs_int x = if x < 0 then -x else x [@@dead "+abs_int"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_convert.ml", line 110, characters 0-44 + +no_over_flow is never used + <-- line 110 + let no_over_flow x = abs_int x < 0x1fff_ffff [@@dead "+no_over_flow"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_convert.ml", line 112, characters 0-103 + +lam_is_var is never used + <-- line 112 + | _ -> false [@@dead "+lam_is_var"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_convert.ml", line 120, characters 0-686 + +happens_to_be_diff is never used + <-- line 120 + | _ -> None [@@dead "+happens_to_be_diff"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_convert.ml", line 148, characters 0-17 + +seq is never used + <-- line 148 + let seq = Lam.seq [@@dead "+seq"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_convert.ml", line 150, characters 0-19 + +unit is never used + <-- line 150 + let unit = Lam.unit [@@dead "+unit"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_convert.ml", line 152, characters 0-8412 + +lam_prim is never used + <-- line 152 + | Pjs_fn_method -> prim ~primitive:Pjs_fn_method ~args loc [@@dead "+lam_prim"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_convert.ml", line 323, characters 0-46 + +may_depend is never used + <-- line 323 + let may_depend = Lam_module_ident.Hash_set.add [@@dead "+may_depend"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_convert.ml", line 325, characters 0-773 + +rename_optional_parameters is never used + <-- line 325 + | _ -> (map, body) [@@dead "+rename_optional_parameters"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_convert.ml", line 351, characters 0-11492 + +convert is never used + <-- line 351 + (convert_aux lam, may_depends) [@@dead "+convert"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_convert.mli", line 1, characters 0-0 + lam_convert is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_convert.mli", line 28, characters 0-83 + +convert is never used + <-- line 28 + Set_ident.t -> Lambda.lambda -> Lam.t * Lam_module_ident.Hash_set.t [@@dead "+convert"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_dce.ml", line 1, characters 0-0 + +lam_dce is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_dce.ml", line 25, characters 0-559 + +transitive_closure is never used + <-- line 25 + visited [@@dead "+transitive_closure"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_dce.ml", line 40, characters 0-1710 + +remove is never used + <-- line 40 + |> List.rev [@@dead "+remove"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_dce.mli", line 1, characters 0-0 + lam_dce is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_dce.mli", line 28, characters 0-65 + +remove is never used + <-- line 28 + val remove : Ident.t list -> Lam_group.t list -> Lam_group.t list [@@dead "+remove"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_eta_conversion.ml", line 1, characters 0-0 + +lam_eta_conversion is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_eta_conversion.ml", line 37, characters 0-1630 + +transform_under_supply is never used + <-- line 37 + | _, _ -> assert false [@@dead "+transform_under_supply"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_eta_conversion.ml", line 111, characters 0-6326 + +unsafe_adjust_to_arity is never used + <-- line 111 + else transform_under_supply to_ ap_info fn [] [@@dead "+unsafe_adjust_to_arity"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_eta_conversion.mli", line 1, characters 0-0 + lam_eta_conversion is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_eta_conversion.mli", line 31, characters 0-79 + +transform_under_supply is never used + <-- line 31 + val transform_under_supply : int -> Lam.ap_info -> Lam.t -> Lam.t list -> Lam.t [@@dead "+transform_under_supply"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_eta_conversion.mli", line 33, characters 0-83 + +unsafe_adjust_to_arity is never used + <-- line 33 + Location.t -> to_:int -> ?from:int -> Lam.t -> Lam.t [@@dead "+unsafe_adjust_to_arity"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_exit_code.ml", line 1, characters 0-0 + +lam_exit_code is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_exit_code.ml", line 25, characters 0-262 + +has_exit_code is never used + <-- line 25 + aux lam [@@dead "+has_exit_code"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_exit_code.ml", line 35, characters 0-150 + +has_exit is never used + <-- line 35 + | _ -> Lam_iter.inner_exists lam has_exit [@@dead "+has_exit"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_exit_code.mli", line 1, characters 0-0 + lam_exit_code is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_exit_code.mli", line 25, characters 0-50 + +has_exit_code is never used + <-- line 25 + val has_exit_code : Lam.t -> (int -> bool) -> bool [@@dead "+has_exit_code"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_exit_code.mli", line 27, characters 0-28 + +has_exit is never used + <-- line 27 + val has_exit : Lam.t -> bool [@@dead "+has_exit"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_exit_count.ml", line 1, characters 0-0 + +lam_exit_count is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_exit_count.ml", line 28, characters 0-71 + +count_exit is never used + <-- line 28 + let count_exit (exits : collection) i = Hash_int.find_default exits i 0 [@@dead "+count_exit"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_exit_count.ml", line 30, characters 0-86 + +incr_exit is never used + <-- line 30 + Hash_int.add_or_update exits i 1 ~update:succ [@@dead "+incr_exit"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_exit_count.ml", line 51, characters 0-1738 + +count_helper is never used + <-- line 51 + exits [@@dead "+count_helper"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_exit_count.mli", line 1, characters 0-0 + lam_exit_count is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_exit_count.mli", line 27, characters 0-38 + +count_helper is never used + <-- line 27 + val count_helper : Lam.t -> collection [@@dead "+count_helper"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_exit_count.mli", line 29, characters 0-41 + +count_exit is never used + <-- line 29 + val count_exit : collection -> int -> int [@@dead "+count_exit"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_free_variables.ml", line 1, characters 0-0 + +lam_free_variables is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_free_variables.ml", line 25, characters 0-2129 + +pass_free_variables is never used + <-- line 25 + !fv [@@dead "+pass_free_variables"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_free_variables.mli", line 1, characters 0-0 + lam_free_variables is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_free_variables.mli", line 25, characters 0-46 + +pass_free_variables is never used + <-- line 25 + val pass_free_variables : Lam.t -> Set_ident.t [@@dead "+pass_free_variables"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_group.ml", line 31, characters 0-192 + +single is never used + <-- line 31 + | _ -> Single (kind, id, body) [@@dead "+single"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_group.ml", line 36, characters 0-110 + +nop_cons is never used + <-- line 36 + | _ -> Nop x :: acc [@@dead "+nop_cons"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_group.ml", line 43, characters 0-139 + +str_of_kind is never used + <-- line 43 + | Variable -> "v" [@@dead "+str_of_kind"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_group.ml", line 50, characters 0-394 + +pp_group is never used + <-- line 50 + | Nop lam -> Lam_print.lambda fmt lam [@@dead "+pp_group"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_group.mli", line 32, characters 0-44 + +pp_group is never used + <-- line 32 + val pp_group : Format.formatter -> t -> unit [@@dead "+pp_group"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_group.mli", line 34, characters 0-57 + +single is never used + <-- line 34 + val single : Lam_compat.let_kind -> Ident.t -> Lam.t -> t [@@dead "+single"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_group.mli", line 36, characters 0-40 + +nop_cons is never used + <-- line 36 + val nop_cons : Lam.t -> t list -> t list [@@dead "+nop_cons"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_hit.ml", line 1, characters 0-0 + +lam_hit is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_hit.ml", line 27, characters 0-1539 + +hit_variables is never used + <-- line 27 + hit l [@@dead "+hit_variables"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_hit.ml", line 64, characters 0-1531 + +hit_variable is never used + <-- line 64 + hit l [@@dead "+hit_variable"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_hit.mli", line 1, characters 0-0 + lam_hit is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_hit.mli", line 25, characters 0-48 + +hit_variables is never used + <-- line 25 + val hit_variables : Set_ident.t -> Lam.t -> bool [@@dead "+hit_variables"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_hit.mli", line 27, characters 0-43 + +hit_variable is never used + <-- line 27 + val hit_variable : Ident.t -> Lam.t -> bool [@@dead "+hit_variable"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_id_kind.ml", line 34, characters 15-17 + element.NA is a variant case which is never constructed + <-- line 34 + type element = NA [@dead "element.NA"] | SimpleForm of Lam.t + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_id_kind.ml", line 34, characters 18-39 + element.SimpleForm is a variant case which is never constructed + <-- line 34 + type element = NA [@dead "element.NA"] | SimpleForm of Lam.t [@dead "element.SimpleForm"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_id_kind.ml", line 36, characters 22-31 + boxed_nullable.Undefined is a variant case which is never constructed + <-- line 36 + type boxed_nullable = Undefined [@dead "boxed_nullable.Undefined"] | Null | Null_undefined + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_id_kind.ml", line 41, characters 2-35 + t.ImmutableBlock is a variant case which is never constructed + <-- line 41 + | ImmutableBlock of element array [@dead "t.ImmutableBlock"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_id_kind.ml", line 42, characters 2-33 + t.MutableBlock is a variant case which is never constructed + <-- line 42 + | MutableBlock of element array [@dead "t.MutableBlock"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_id_kind.ml", line 52, characters 2-13 + t.Exception is a variant case which is never constructed + <-- line 52 + | Exception [@dead "t.Exception"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_id_kind.ml", line 61, characters 0-23 + +pp is never used + <-- line 61 + let pp = Format.fprintf [@@dead "+pp"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_id_kind.ml", line 63, characters 0-590 + +print is never used + <-- line 63 + | NA -> pp fmt "NA" [@@dead "+print"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_id_kind.mli", line 34, characters 15-17 + element.NA is a variant case which is never constructed + <-- line 34 + type element = NA [@dead "element.NA"] | SimpleForm of Lam.t + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_id_kind.mli", line 34, characters 18-39 + element.SimpleForm is a variant case which is never constructed + <-- line 34 + type element = NA [@dead "element.NA"] | SimpleForm of Lam.t [@dead "element.SimpleForm"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_id_kind.mli", line 36, characters 22-31 + boxed_nullable.Undefined is a variant case which is never constructed + <-- line 36 + type boxed_nullable = Undefined [@dead "boxed_nullable.Undefined"] | Null | Null_undefined + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_id_kind.mli", line 53, characters 2-35 + t.ImmutableBlock is a variant case which is never constructed + <-- line 53 + | ImmutableBlock of element array [@dead "t.ImmutableBlock"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_id_kind.mli", line 54, characters 2-33 + t.MutableBlock is a variant case which is never constructed + <-- line 54 + | MutableBlock of element array [@dead "t.MutableBlock"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_id_kind.mli", line 61, characters 2-13 + t.Exception is a variant case which is never constructed + <-- line 61 + | Exception [@dead "t.Exception"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_id_kind.mli", line 70, characters 0-41 + +print is never used + <-- line 70 + val print : Format.formatter -> t -> unit [@@dead "+print"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_iter.ml", line 1, characters 0-0 + +lam_iter is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_iter.ml", line 29, characters 0-1404 + +inner_iter is never used + <-- line 29 + | Lassign (_id, e) -> f e [@@dead "+inner_iter"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_iter.ml", line 91, characters 0-1352 + +inner_exists is never used + <-- line 91 + | Lassign (_id, e) -> f e [@@dead "+inner_exists"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_iter.mli", line 1, characters 0-0 + lam_iter is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_iter.mli", line 25, characters 0-49 + +inner_iter is never used + <-- line 25 + val inner_iter : Lam.t -> (Lam.t -> unit) -> unit [@@dead "+inner_iter"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_iter.mli", line 27, characters 0-51 + +inner_exists is never used + <-- line 27 + val inner_exists : Lam.t -> (Lam.t -> bool) -> bool [@@dead "+inner_exists"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_module_ident.ml", line 25, characters 55-75 + t.dynamic_import is a record label never used to read a value + <-- line 25 + type t = J.module_id = {id: Ident.t; kind: Js_op.kind; dynamic_import: bool [@dead "t.dynamic_import"] } + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_module_ident.ml", line 27, characters 0-15 + +id is never used + <-- line 27 + let id x = x.id [@@dead "+id"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_module_ident.ml", line 29, characters 0-72 + +of_ml is never used + <-- line 29 + let of_ml ?(dynamic_import = false) id = {id; kind = Ml; dynamic_import} [@@dead "+of_ml"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_module_ident.ml", line 31, characters 0-64 + +of_runtime is never used + <-- line 31 + let of_runtime id = {id; kind = Runtime; dynamic_import = false} [@@dead "+of_runtime"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_module_ident.ml", line 33, characters 0-106 + +name is never used + <-- line 33 + | External {name = v} -> v [@@dead "+name"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_module_ident.ml", line 38, characters 0-1115 + +lam_module_ident.Cmp is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_module_ident.ml", line 41, characters 2-317 + Cmp.+equal is never used + <-- line 41 + | Ml | Runtime -> Ext_ident.equal x.id y.id [@@dead "Cmp.+equal"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_module_ident.ml", line 63, characters 2-266 + Cmp.+hash is never used + <-- line 63 + Bs_hash_stubs.hash_stamp_and_name x_id.stamp x_id.name [@@dead "Cmp.+hash"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_module_ident.mli", line 31, characters 2-23 + t.dynamic_import is a record label never used to read a value + <-- line 31 + dynamic_import: bool; [@dead "t.dynamic_import"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_module_ident.mli", line 34, characters 0-21 + +id is never used + <-- line 34 + val id : t -> Ident.t [@@dead "+id"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_module_ident.mli", line 36, characters 0-22 + +name is never used + <-- line 36 + val name : t -> string [@@dead "+name"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_module_ident.mli", line 38, characters 0-48 + +of_ml is never used + <-- line 38 + val of_ml : ?dynamic_import:bool -> Ident.t -> t [@@dead "+of_ml"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_module_ident.mli", line 40, characters 0-29 + +of_runtime is never used + <-- line 40 + val of_runtime : Ident.t -> t [@@dead "+of_runtime"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_alpha_conversion.ml", line 1, characters 0-0 + +lam_pass_alpha_conversion is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_alpha_conversion.ml", line 25, characters 0-4205 + +alpha_conversion is never used + <-- line 25 + simpl lam [@@dead "+alpha_conversion"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_alpha_conversion.mli", line 1, characters 0-0 + lam_pass_alpha_conversion is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_alpha_conversion.mli", line 27, characters 0-52 + +alpha_conversion is never used + <-- line 27 + val alpha_conversion : Lam_stats.t -> Lam.t -> Lam.t [@@dead "+alpha_conversion"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_collect.ml", line 1, characters 0-0 + +lam_pass_collect is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_collect.ml", line 34, characters 0-184 + +annotate is never used + <-- line 34 + (FunctionId {arity; lambda = Some (lambda, rec_flag)}) [@@dead "+annotate"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_collect.ml", line 57, characters 0-3678 + +collect_info is never used + <-- line 57 + collect lam [@@dead "+collect_info"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_collect.mli", line 1, characters 0-0 + lam_pass_collect is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_collect.mli", line 71, characters 0-47 + +collect_info is never used + <-- line 71 + val collect_info : Lam_stats.t -> Lam.t -> unit [@@dead "+collect_info"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_count.ml", line 30, characters 0-49 + +dummy_info is never used + <-- line 30 + let dummy_info () = {times = 0; captured = false} [@@dead "+dummy_info"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_count.ml", line 33, characters 0-177 + +absorb_info is never used + <-- line 33 + if captured then x.captured <- true [@@dead "+absorb_info"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_count.ml", line 39, characters 0-94 + +pp_info is never used + <-- line 39 + Format.fprintf fmt "(:%d)" x.captured x.times [@@dead "+pp_info"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_count.ml", line 42, characters 0-123 + +pp_occ_tbl is never used + <-- line 42 + Format.fprintf fmt "@[%a@ %a@]@." Ident.print k pp_info v) [@@dead "+pp_occ_tbl"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_count.ml", line 59, characters 0-5126 + +collect_occurs is never used + <-- line 59 + occ [@@dead "+collect_occurs"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_count.mli", line 26, characters 0-34 + +dummy_info is never used + <-- line 26 + val dummy_info : unit -> used_info [@@dead "+dummy_info"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_count.mli", line 28, characters 0-37 + +collect_occurs is never used + <-- line 28 + val collect_occurs : Lam.t -> occ_tbl [@@dead "+collect_occurs"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_count.mli", line 30, characters 0-52 + +pp_occ_tbl is never used + <-- line 30 + val pp_occ_tbl : Format.formatter -> occ_tbl -> unit [@@dead "+pp_occ_tbl"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_deep_flatten.ml", line 1, characters 0-0 + +lam_pass_deep_flatten is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_deep_flatten.ml", line 29, characters 0-343 + +eliminate_tuple is never used + <-- line 29 + | _ -> if Lam_hit.hit_variable id lam then None else Some (acc, lam) [@@dead "+eliminate_tuple"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_deep_flatten.ml", line 103, characters 0-323 + +lambda_of_groups is never used + <-- line 103 + | Recursive bindings -> Lam.letrec bindings acc) [@@dead "+lambda_of_groups"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_deep_flatten.ml", line 117, characters 0-6033 + +deep_flatten is never used + <-- line 117 + aux lam [@@dead "+deep_flatten"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_deep_flatten.mli", line 1, characters 0-0 + lam_pass_deep_flatten is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_deep_flatten.mli", line 25, characters 0-33 + +deep_flatten is never used + <-- line 25 + val deep_flatten : Lam.t -> Lam.t [@@dead "+deep_flatten"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_eliminate_ref.ml", line 1, characters 0-0 + +lam_pass_eliminate_ref is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_eliminate_ref.ml", line 16, characters 0-3600 + +eliminate_ref is never used + <-- line 16 + | Lassign (v, e) -> Lam.assign v (eliminate_ref id e) [@@dead "+eliminate_ref"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_eliminate_ref.mli", line 1, characters 0-0 + lam_pass_eliminate_ref is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_eliminate_ref.mli", line 27, characters 0-45 + +eliminate_ref is never used + <-- line 27 + val eliminate_ref : Ident.t -> Lam.t -> Lam.t [@@dead "+eliminate_ref"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_exits.ml", line 22, characters 0-65 + +no_list is never used + <-- line 22 + let rec no_list args = Ext_list.for_all args no_bounded_variables [@@dead "+no_list"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_exits.ml", line 24, characters 0-109 + +no_list_snd is never used + <-- line 24 + fun args -> Ext_list.for_all_snd args no_bounded_variables [@@dead "+no_list_snd"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_exits.ml", line 27, characters 0-83 + +no_opt is never used + <-- line 27 + | Some a -> no_bounded_variables a [@@dead "+no_opt"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_exits.ml", line 32, characters 0-1253 + +no_bounded_variables is never used + <-- line 32 + | Lletrec (decl, body) -> decl = [] && no_bounded_variables body [@@dead "+no_bounded_variables"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_exits.ml", line 90, characters 0-43 + +to_lam is never used + <-- line 90 + | Id x -> x [@@dead "+to_lam"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_exits.ml", line 155, characters 0-3643 + +subst_helper is never used + <-- line 155 + simplif lam [@@dead "+subst_helper"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_exits.ml", line 247, characters 0-157 + +simplify_exits is never used + <-- line 247 + subst_helper (Hash_int.create 17) (Lam_exit_count.count_exit exits) lam [@@dead "+simplify_exits"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_exits.mli", line 1, characters 0-0 + lam_pass_exits is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_exits.mli", line 18, characters 0-35 + +simplify_exits is never used + <-- line 18 + val simplify_exits : Lam.t -> Lam.t [@@dead "+simplify_exits"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_lets_dce.ml", line 1, characters 0-0 + +lam_pass_lets_dce is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_lets_dce.ml", line 14, characters 0-8159 + +lets_helper is never used + <-- line 14 + simplif lam [@@dead "+lets_helper"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_lets_dce.ml", line 212, characters 0-185 + +apply_lets is never used + <-- line 212 + lets_helper count_var lambda [@@dead "+apply_lets"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_lets_dce.ml", line 220, characters 0-185 + +simplify_lets is never used + <-- line 220 + apply_lets occ lam [@@dead "+simplify_lets"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_lets_dce.mli", line 1, characters 0-0 + lam_pass_lets_dce is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_lets_dce.mli", line 14, characters 0-34 + +simplify_lets is never used + <-- line 14 + val simplify_lets : Lam.t -> Lam.t [@@dead "+simplify_lets"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_remove_alias.ml", line 27, characters 0-692 + +id_is_for_sure_true_in_boolean is never used + <-- line 27 + Eval_unknown [@@dead "+id_is_for_sure_true_in_boolean"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_remove_alias.ml", line 44, characters 0-185 + +is_const_some is never used + <-- line 44 + | _ -> false [@@dead "+is_const_some"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_remove_alias.ml", line 50, characters 0-9886 + +simplify_alias is never used + <-- line 50 + simpl lam [@@dead "+simplify_alias"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_remove_alias.mli", line 1, characters 0-0 + lam_pass_remove_alias is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_remove_alias.mli", line 38, characters 0-50 + +simplify_alias is never used + <-- line 38 + val simplify_alias : Lam_stats.t -> Lam.t -> Lam.t [@@dead "+simplify_alias"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_primitive.ml", line 30, characters 2-18 + record_representation.Record_regular is a variant case which is never constructed + <-- line 30 + | Record_regular [@dead "record_representation.Record_regular"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_primitive.ml", line 31, characters 2-66 + record_representation.Record_inlined is a variant case which is never constructed + <-- line 31 + | Record_inlined of {tag: int; name: string; num_nonconsts: int} [@dead "record_representation.Record_inlined"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_primitive.ml", line 33, characters 2-20 + record_representation.Record_extension is a variant case which is never constructed + <-- line 33 + | Record_extension [@dead "record_representation.Record_extension"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_primitive.ml", line 153, characters 2-21 + t.Pjs_runtime_apply is a variant case which is never constructed + <-- line 153 + | Pjs_runtime_apply [@dead "t.Pjs_runtime_apply"] (* [f; [...]] *) + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_primitive.ml", line 187, characters 0-99 + +eq_field_dbg_info is never used + <-- line 187 + x = y [@@dead "+eq_field_dbg_info"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_primitive.ml", line 192, characters 0-111 + +eq_set_field_dbg_info is never used + <-- line 192 + x = y [@@dead "+eq_set_field_dbg_info"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_primitive.ml", line 197, characters 0-46 + +eq_tag_info is never used + <-- line 197 + let eq_tag_info (x : Lam_tag_info.t) y = x = y [@@dead "+eq_tag_info"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_primitive.ml", line 199, characters 0-4149 + +eq_primitive_approx is never used + <-- line 199 + | Praw_js_code _ -> false [@@dead "+eq_primitive_approx"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_primitive.mli", line 28, characters 2-18 + record_representation.Record_regular is a variant case which is never constructed + <-- line 28 + | Record_regular [@dead "record_representation.Record_regular"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_primitive.mli", line 29, characters 2-66 + record_representation.Record_inlined is a variant case which is never constructed + <-- line 29 + | Record_inlined of {tag: int; name: string; num_nonconsts: int} [@dead "record_representation.Record_inlined"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_primitive.mli", line 31, characters 2-20 + record_representation.Record_extension is a variant case which is never constructed + <-- line 31 + | Record_extension [@dead "record_representation.Record_extension"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_primitive.mli", line 147, characters 2-21 + t.Pjs_runtime_apply is a variant case which is never constructed + <-- line 147 + | Pjs_runtime_apply [@dead "t.Pjs_runtime_apply"] (* [f; [...]] *) + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_primitive.mli", line 177, characters 0-40 + +eq_primitive_approx is never used + <-- line 177 + val eq_primitive_approx : t -> t -> bool [@@dead "+eq_primitive_approx"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_print.ml", line 484, characters 0-343 + +serialize is never used + <-- line 484 + Format.set_margin old [@@dead "+serialize"] + + Warning Dead Value With Side Effects + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_print.ml", line 495, characters 0-50 + +lambda_to_string is never used and could have side effects + + Warning Dead Value With Side Effects + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_print.ml", line 497, characters 0-56 + +primitive_to_string is never used and could have side effects + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_print.mli", line 1, characters 0-0 + lam_print is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_print.mli", line 25, characters 0-46 + +lambda is never used + <-- line 25 + val lambda : Format.formatter -> Lam.t -> unit [@@dead "+lambda"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_print.mli", line 27, characters 0-59 + +primitive is never used + <-- line 27 + val primitive : Format.formatter -> Lam_primitive.t -> unit [@@dead "+primitive"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_print.mli", line 29, characters 0-39 + +serialize is never used + <-- line 29 + val serialize : string -> Lam.t -> unit [@@dead "+serialize"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_print.mli", line 31, characters 0-38 + +lambda_to_string is never used + <-- line 31 + val lambda_to_string : Lam.t -> string [@@dead "+lambda_to_string"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_print.mli", line 33, characters 0-51 + +primitive_to_string is never used + <-- line 33 + val primitive_to_string : Lam_primitive.t -> string [@@dead "+primitive_to_string"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_scc.ml", line 1, characters 0-0 + +lam_scc is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_scc.ml", line 31, characters 0-1560 + +hit_mask is never used + <-- line 31 + hit l [@@dead "+hit_mask"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_scc.ml", line 71, characters 0-932 + +preprocess_deps is never used + <-- line 71 + (domain, int_mapping, node_vec) [@@dead "+preprocess_deps"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_scc.ml", line 91, characters 0-93 + +is_function_bind is never used + <-- line 91 + | _ -> false [@@dead "+is_function_bind"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_scc.ml", line 96, characters 0-347 + +sort_single_binding_group is never used + <-- line 96 + group [@@dead "+sort_single_binding_group"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_scc.ml", line 109, characters 0-745 + +scc_bindings is never used + <-- line 109 + clusters [] [@@dead "+scc_bindings"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_scc.ml", line 133, characters 0-1025 + +scc is never used + <-- line 133 + clusters body [@@dead "+scc"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_scc.mli", line 1, characters 0-0 + lam_scc is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_scc.mli", line 27, characters 0-44 + +scc_bindings is never used + <-- line 27 + val scc_bindings : bindings -> bindings list [@@dead "+scc_bindings"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_scc.mli", line 29, characters 0-45 + +scc is never used + <-- line 29 + val scc : bindings -> Lam.t -> Lam.t -> Lam.t [@@dead "+scc"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_stats.ml", line 53, characters 0-23 + +pp is never used + <-- line 53 + let pp = Format.fprintf [@@dead "+pp"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_stats.ml", line 58, characters 0-151 + +pp_ident_tbl is never used + <-- line 58 + pp fmt "@[%a -> %a@]@." Ident.print k Lam_id_kind.print v) [@@dead "+pp_ident_tbl"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_stats.ml", line 62, characters 0-207 + +print is never used + <-- line 62 + v.exports [@@dead "+print"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_stats.ml", line 68, characters 0-162 + +make is never used + <-- line 68 + } [@@dead "+make"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_stats.mli", line 41, characters 0-41 + +print is never used + <-- line 41 + val print : Format.formatter -> t -> unit [@@dead "+print"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_stats.mli", line 43, characters 0-75 + +make is never used + <-- line 43 + val make : export_idents:Ident.t list -> export_ident_sets:Set_ident.t -> t [@@dead "+make"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_stats_export.ml", line 1, characters 0-0 + +lam_stats_export is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_stats_export.ml", line 30, characters 0-39 + +single_na is never used + <-- line 30 + let single_na = Js_cmj_format.single_na [@@dead "+single_na"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_stats_export.ml", line 32, characters 0-3023 + +values_of_export is never used + <-- line 32 + Map_string.add acc x.name cmj_value) [@@dead "+values_of_export"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_stats_export.ml", line 111, characters 0-330 + +get_dependent_module_effect is never used + <-- line 111 + else maybe_pure [@@dead "+get_dependent_module_effect"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_stats_export.ml", line 131, characters 0-245 + +export_to_cmj is never used + <-- line 131 + ~case [@@dead "+export_to_cmj"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_stats_export.mli", line 1, characters 0-0 + lam_stats_export is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_stats_export.mli", line 25, characters 0-93 + +get_dependent_module_effect is never used + <-- line 25 + string option -> Lam_module_ident.t list -> string option [@@dead "+get_dependent_module_effect"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_stats_export.mli", line 28, characters 0-131 + +export_to_cmj is never used + <-- line 28 + Js_cmj_format.t [@@dead "+export_to_cmj"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_subst.ml", line 1, characters 0-0 + +lam_subst is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_subst.ml", line 31, characters 0-2245 + +subst is never used + <-- line 31 + subst_aux lam [@@dead "+subst"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_subst.mli", line 1, characters 0-0 + lam_subst is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_subst.mli", line 31, characters 0-47 + +subst is never used + <-- line 31 + val subst : Lam.t Map_ident.t -> Lam.t -> Lam.t [@@dead "+subst"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_util.mli", line 1, characters 0-0 + lam_util is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_util.mli", line 25, characters 0-54 + +kind_of_lambda_block is never used + <-- line 25 + val kind_of_lambda_block : Lam.t list -> Lam_id_kind.t [@@dead "+kind_of_lambda_block"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_util.mli", line 27, characters 0-126 + +field_flatten_get is never used + <-- line 27 + Lam.t [@@dead "+field_flatten_get"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_util.mli", line 52, characters 0-88 + +alias_ident_or_global is never used + <-- line 52 + Lam_stats.t -> Ident.t -> Ident.t -> Lam_id_kind.t -> unit [@@dead "+alias_ident_or_global"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_util.mli", line 55, characters 0-79 + +refine_let is never used + <-- line 55 + val refine_let : kind:Lam_compat.let_kind -> Ident.t -> Lam.t -> Lam.t -> Lam.t [@@dead "+refine_let"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_util.mli", line 57, characters 0-34 + +dump is never used + <-- line 57 + val dump : string -> Lam.t -> unit [@@dead "+dump"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_util.mli", line 60, characters 0-32 + +not_function is never used + <-- line 60 + val not_function : Lam.t -> bool [@@dead "+not_function"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_util.mli", line 62, characters 0-31 + +is_function is never used + <-- line 62 + val is_function : Lam.t -> bool [@@dead "+is_function"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_var_stats.ml", line 26, characters 0-18 + +loop_use is never used + <-- line 26 + let loop_use = 100 [@@dead "+loop_use"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_var_stats.ml", line 42, characters 0-49 + +fresh_stats is never used + <-- line 42 + let fresh_stats : stats = {top = true; times = 0} [@@dead "+fresh_stats"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_var_stats.ml", line 44, characters 0-56 + +sink_stats is never used + <-- line 44 + let sink_stats : stats = {top = false; times = loop_use} [@@dead "+sink_stats"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_var_stats.ml", line 47, characters 0-102 + +top_and_used_zero_or_one is never used + <-- line 47 + | _ -> false [@@dead "+top_and_used_zero_or_one"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_var_stats.ml", line 58, characters 0-183 + +update is never used + <-- line 58 + | Sink -> sink_stats [@@dead "+update"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_var_stats.ml", line 64, characters 0-26 + +sink is never used + <-- line 64 + let sink : position = Sink [@@dead "+sink"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_var_stats.ml", line 66, characters 0-32 + +fresh_env is never used + <-- line 66 + let fresh_env : position = Begin [@@dead "+fresh_env"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_var_stats.ml", line 69, characters 0-147 + +new_position_after_lam is never used + <-- line 69 + else Not_begin [@@dead "+new_position_after_lam"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_var_stats.mli", line 1, characters 0-0 + lam_var_stats is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_var_stats.mli", line 27, characters 0-23 + +fresh_stats is never used + <-- line 27 + val fresh_stats : stats [@@dead "+fresh_stats"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_var_stats.mli", line 29, characters 0-44 + +top_and_used_zero_or_one is never used + <-- line 29 + val top_and_used_zero_or_one : stats -> bool [@@dead "+top_and_used_zero_or_one"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_var_stats.mli", line 33, characters 0-19 + +sink is never used + <-- line 33 + val sink : position [@@dead "+sink"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_var_stats.mli", line 35, characters 0-24 + +fresh_env is never used + <-- line 35 + val fresh_env : position [@@dead "+fresh_env"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_var_stats.mli", line 37, characters 0-58 + +new_position_after_lam is never used + <-- line 37 + val new_position_after_lam : Lam.t -> position -> position [@@dead "+new_position_after_lam"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_var_stats.mli", line 39, characters 0-39 + +update is never used + <-- line 39 + val update : stats -> position -> stats [@@dead "+update"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/polyvar_pattern_match.ml", line 33, characters 0-106 + +polyvar_pattern_match.Coll is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/polyvar_pattern_match.ml", line 36, characters 2-26 + Coll.+equal is never used + <-- line 36 + let equal = Stdlib.( = ) [@@dead "Coll.+equal"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/polyvar_pattern_match.ml", line 38, characters 2-25 + Coll.+hash is never used + <-- line 38 + let hash = Hashtbl.hash [@@dead "Coll.+hash"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/depends/binary_ast.mli", line 29, characters 0-25 + +magic_sep_char is never used + <-- line 29 + val magic_sep_char : char [@@dead "+magic_sep_char"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/depends/bs_exception.ml", line 27, characters 2-26 + error.Js_not_found is a variant case which is never constructed + <-- line 27 + | Js_not_found of string [@dead "error.Js_not_found"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/depends/bs_exception.ml", line 28, characters 2-36 + error.Bs_cyclic_depends is a variant case which is never constructed + <-- line 28 + | Bs_cyclic_depends of string list [@dead "error.Bs_cyclic_depends"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/depends/bs_exception.ml", line 29, characters 2-43 + error.Bs_duplicated_module is a variant case which is never constructed + <-- line 29 + | Bs_duplicated_module of string * string [@dead "error.Bs_duplicated_module"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/depends/bs_exception.ml", line 31, characters 2-34 + error.Bs_package_not_found is a variant case which is never constructed + <-- line 31 + | Bs_package_not_found of string [@dead "error.Bs_package_not_found"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/depends/bs_exception.ml", line 32, characters 2-31 + error.Bs_main_not_exist is a variant case which is never constructed + <-- line 32 + | Bs_main_not_exist of string [@dead "error.Bs_main_not_exist"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/depends/bs_exception.ml", line 33, characters 2-29 + error.Bs_invalid_path is a variant case which is never constructed + <-- line 33 + | Bs_invalid_path of string [@dead "error.Bs_invalid_path"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/depends/bs_exception.ml", line 34, characters 2-35 + error.Missing_ml_dependency is a variant case which is never constructed + <-- line 34 + | Missing_ml_dependency of string [@dead "error.Missing_ml_dependency"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/depends/bs_exception.ml", line 35, characters 2-52 + error.Dependency_script_module_dependent_not is a variant case which is never constructed + <-- line 35 + | Dependency_script_module_dependent_not of string [@dead "error.Dependency_script_module_dependent_not"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/depends/bs_exception.mli", line 27, characters 2-26 + error.Js_not_found is a variant case which is never constructed + <-- line 27 + | Js_not_found of string [@dead "error.Js_not_found"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/depends/bs_exception.mli", line 28, characters 2-36 + error.Bs_cyclic_depends is a variant case which is never constructed + <-- line 28 + | Bs_cyclic_depends of string list [@dead "error.Bs_cyclic_depends"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/depends/bs_exception.mli", line 29, characters 2-43 + error.Bs_duplicated_module is a variant case which is never constructed + <-- line 29 + | Bs_duplicated_module of string * string [@dead "error.Bs_duplicated_module"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/depends/bs_exception.mli", line 31, characters 2-34 + error.Bs_package_not_found is a variant case which is never constructed + <-- line 31 + | Bs_package_not_found of string [@dead "error.Bs_package_not_found"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/depends/bs_exception.mli", line 32, characters 2-31 + error.Bs_main_not_exist is a variant case which is never constructed + <-- line 32 + | Bs_main_not_exist of string [@dead "error.Bs_main_not_exist"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/depends/bs_exception.mli", line 33, characters 2-29 + error.Bs_invalid_path is a variant case which is never constructed + <-- line 33 + | Bs_invalid_path of string [@dead "error.Bs_invalid_path"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/depends/bs_exception.mli", line 34, characters 2-35 + error.Missing_ml_dependency is a variant case which is never constructed + <-- line 34 + | Missing_ml_dependency of string [@dead "error.Missing_ml_dependency"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/depends/bs_exception.mli", line 35, characters 2-52 + error.Dependency_script_module_dependent_not is a variant case which is never constructed + <-- line 35 + | Dependency_script_module_dependent_not of string [@dead "error.Dependency_script_module_dependent_not"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/bsc_args.ml", line 29, characters 2-28 + string_action.String_set is a variant case which is never constructed + <-- line 29 + | String_set of string ref [@dead "string_action.String_set"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/bsc_args.ml", line 35, characters 2-28 + unit_action.Unit_lazy is a variant case which is never constructed + <-- line 35 + | Unit_lazy of unit lazy_t [@dead "unit_action.Unit_lazy"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/bsc_args.ml", line 39, characters 12-22 + spec.Unit_dummy is a variant case which is never constructed + <-- line 39 + type spec = Unit_dummy [@dead "spec.Unit_dummy"] | Unit of unit_action | String of string_action + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/bsc_args.mli", line 29, characters 2-28 + string_action.String_set is a variant case which is never constructed + <-- line 29 + | String_set of string ref [@dead "string_action.String_set"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/bsc_args.mli", line 35, characters 2-28 + unit_action.Unit_lazy is a variant case which is never constructed + <-- line 35 + | Unit_lazy of unit lazy_t [@dead "unit_action.Unit_lazy"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/bsc_args.mli", line 39, characters 12-22 + spec.Unit_dummy is a variant case which is never constructed + <-- line 39 + type spec = Unit_dummy [@dead "spec.Unit_dummy"] | Unit of unit_action | String of string_action + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/config.ml", line 7, characters 0-37 + +cmt_magic_number is never used + <-- line 7 + and cmt_magic_number = "Caml1999T022" [@@dead "+cmt_magic_number"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/config.mli", line 30, characters 0-29 + +cmt_magic_number is never used + <-- line 30 + val cmt_magic_number : string [@@dead "+cmt_magic_number"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.ml", line 29, characters 0-200 + +reverse_range is never used + <-- line 29 + done [@@dead "+reverse_range"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.ml", line 38, characters 0-59 + +reverse_in_place is never used + <-- line 38 + let reverse_in_place a = reverse_range a 0 (Array.length a) [@@dead "+reverse_in_place"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.ml", line 63, characters 0-241 + +filter is never used + <-- line 63 + aux [] 0 [@@dead "+filter"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.ml", line 73, characters 0-295 + +filter_map is never used + <-- line 73 + aux [] 0 [@@dead "+filter_map"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.ml", line 85, characters 0-303 + +filter_mapi is never used + <-- line 85 + aux [] 0 [@@dead "+filter_mapi"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.ml", line 97, characters 0-126 + +range is never used + <-- line 97 + else Array.init (to_ - from + 1) (fun i -> i + from) [@@dead "+range"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.ml", line 101, characters 0-171 + +map2i is never used + <-- line 101 + else Array.mapi (fun i a -> f i a (Array.unsafe_get b i)) a [@@dead "+map2i"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.ml", line 122, characters 0-60 + +to_list_map is never used + <-- line 122 + let to_list_map a f = tolist_aux a f (Array.length a - 1) [] [@@dead "+to_list_map"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.ml", line 186, characters 0-194 + +rfind_with_index is never used + <-- line 186 + aux (len - 1) [@@dead "+rfind_with_index"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.ml", line 223, characters 0-39 + +is_empty is never used + <-- line 223 + let is_empty arr = Array.length arr = 0 [@@dead "+is_empty"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.ml", line 270, characters 0-96 + +get_or is never used + <-- line 270 + if i >= 0 && i < Array.length arr then Array.unsafe_get arr i else cb () [@@dead "+get_or"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.mli", line 25, characters 0-50 + +reverse_range is never used + <-- line 25 + val reverse_range : 'a array -> int -> int -> unit [@@dead "+reverse_range"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.mli", line 28, characters 0-39 + +reverse_in_place is never used + <-- line 28 + val reverse_in_place : 'a array -> unit [@@dead "+reverse_in_place"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.mli", line 34, characters 0-49 + +filter is never used + <-- line 34 + val filter : 'a array -> ('a -> bool) -> 'a array [@@dead "+filter"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.mli", line 36, characters 0-58 + +filter_map is never used + <-- line 36 + val filter_map : 'a array -> ('a -> 'b option) -> 'b array [@@dead "+filter_map"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.mli", line 38, characters 0-66 + +filter_mapi is never used + <-- line 38 + val filter_mapi : 'a array -> (int -> 'a -> 'b option) -> 'b array [@@dead "+filter_mapi"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.mli", line 40, characters 0-35 + +range is never used + <-- line 40 + val range : int -> int -> int array [@@dead "+range"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.mli", line 42, characters 0-71 + +map2i is never used + <-- line 42 + val map2i : (int -> 'a -> 'b -> 'c) -> 'a array -> 'b array -> 'c array [@@dead "+map2i"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.mli", line 46, characters 0-58 + +to_list_map is never used + <-- line 46 + val to_list_map : 'a array -> ('a -> 'b option) -> 'b list [@@dead "+to_list_map"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.mli", line 52, characters 0-66 + +rfind_with_index is never used + <-- line 52 + val rfind_with_index : 'a array -> ('a -> 'b -> bool) -> 'b -> int [@@dead "+rfind_with_index"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.mli", line 60, characters 0-31 + +is_empty is never used + <-- line 60 + val is_empty : 'a array -> bool [@@dead "+is_empty"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.mli", line 72, characters 0-50 + +get_or is never used + <-- line 72 + val get_or : 'a array -> int -> (unit -> 'a) -> 'a [@@dead "+get_or"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_buffer.ml", line 44, characters 0-29 + +clear is never used + <-- line 44 + let clear b = b.position <- 0 [@@dead "+clear"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_buffer.ml", line 128, characters 0-50 + +digest is never used + <-- line 128 + let digest b = unsafe_string b.buffer 0 b.position [@@dead "+digest"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_buffer.ml", line 146, characters 0-199 + +add_int_1 is never used + <-- line 146 + b.position <- pos + 1 [@@dead "+add_int_1"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_buffer.ml", line 153, characters 0-328 + +add_int_2 is never used + <-- line 153 + b.position <- pos + 2 [@@dead "+add_int_2"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_buffer.ml", line 163, characters 0-423 + +add_int_3 is never used + <-- line 163 + b.position <- pos + 3 [@@dead "+add_int_3"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_buffer.ml", line 175, characters 0-518 + +add_int_4 is never used + <-- line 175 + b.position <- pos + 4 [@@dead "+add_int_4"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_buffer.mli", line 50, characters 0-21 + +clear is never used + <-- line 50 + val clear : t -> unit [@@dead "+clear"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_buffer.mli", line 86, characters 0-26 + +digest is never used + <-- line 86 + val digest : t -> Digest.t [@@dead "+digest"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_buffer.mli", line 90, characters 0-32 + +add_int_1 is never used + <-- line 90 + val add_int_1 : t -> int -> unit [@@dead "+add_int_1"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_buffer.mli", line 92, characters 0-32 + +add_int_2 is never used + <-- line 92 + val add_int_2 : t -> int -> unit [@@dead "+add_int_2"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_buffer.mli", line 94, characters 0-32 + +add_int_3 is never used + <-- line 94 + val add_int_3 : t -> int -> unit [@@dead "+add_int_3"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_buffer.mli", line 96, characters 0-32 + +add_int_4 is never used + <-- line 96 + val add_int_4 : t -> int -> unit [@@dead "+add_int_4"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_char.ml", line 34, characters 0-114 + +is_lower_case is never used + <-- line 34 + || (c >= '\248' && c <= '\254') [@@dead "+is_lower_case"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_char.mli", line 29, characters 0-32 + +is_lower_case is never used + <-- line 29 + val is_lower_case : char -> bool [@@dead "+is_lower_case"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_digest.ml", line 27, characters 0-19 + +hex_length is never used + <-- line 27 + let hex_length = 32 [@@dead "+hex_length"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_digest.mli", line 27, characters 0-20 + +hex_length is never used + <-- line 27 + val hex_length : int [@@dead "+hex_length"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_filename.ml", line 31, characters 0-259 + +chop_extension_maybe is never used + <-- line 31 + search_dot (String.length name - 1) [@@dead "+chop_extension_maybe"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_filename.ml", line 89, characters 20-40 + module_info.module_name is a record label never used to read a value + <-- line 89 + type module_info = {module_name: string; [@dead "module_info.module_name"] case: bool} + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_filename.ml", line 89, characters 41-51 + module_info.case is a record label never used to read a value + <-- line 89 + type module_info = {module_name: string; [@dead "module_info.module_name"] case: bool [@dead "module_info.case"] } + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_filename.mli", line 36, characters 0-43 + +chop_extension_maybe is never used + <-- line 36 + val chop_extension_maybe : string -> string [@@dead "+chop_extension_maybe"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_filename.mli", line 48, characters 20-40 + module_info.module_name is a record label never used to read a value + <-- line 48 + type module_info = {module_name: string; [@dead "module_info.module_name"] case: bool} + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_filename.mli", line 48, characters 41-51 + module_info.case is a record label never used to read a value + <-- line 48 + type module_info = {module_name: string; [@dead "module_info.module_name"] case: bool [@dead "module_info.case"] } + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_fmt.ml", line 1, characters 0-0 + +ext_fmt is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_fmt.ml", line 1, characters 0-235 + +with_file_as_pp is never used + <-- line 1 + v) [@@dead "+with_file_as_pp"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_fmt.ml", line 8, characters 0-74 + +failwithf is never used + <-- line 8 + let failwithf ~loc fmt = Format.ksprintf (fun s -> failwith (loc ^ s)) fmt [@@dead "+failwithf"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_fmt.ml", line 10, characters 0-54 + +invalid_argf is never used + <-- line 10 + let invalid_argf fmt = Format.ksprintf invalid_arg fmt [@@dead "+invalid_argf"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_ident.ml", line 35, characters 0-30 + +js_object_flag is never used + <-- line 35 + let js_object_flag = 0b100_000 [@@dead "+js_object_flag"] (* javascript object flags *) + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_ident.ml", line 39, characters 0-63 + +is_js_or_global is never used + <-- line 39 + let is_js_or_global (i : Ident.t) = i.flags land (8 lor 1) <> 0 [@@dead "+is_js_or_global"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_ident.ml", line 41, characters 0-65 + +is_js_object is never used + <-- line 41 + let is_js_object (i : Ident.t) = i.flags land js_object_flag <> 0 [@@dead "+is_js_object"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_ident.ml", line 43, characters 0-72 + +make_js_object is never used + <-- line 43 + let make_js_object (i : Ident.t) = i.flags <- i.flags lor js_object_flag [@@dead "+make_js_object"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_ident.ml", line 53, characters 0-54 + +create_tmp is never used + <-- line 53 + let create_tmp ?(name = Literals.tmp) () = create name [@@dead "+create_tmp"] + + Warning Dead Value With Side Effects + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_ident.ml", line 55, characters 0-67 + +js_module_table is never used and could have side effects + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_ident.ml", line 170, characters 0-31 + +make_unused is never used + <-- line 170 + let make_unused () = create "_" [@@dead "+make_unused"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_ident.ml", line 172, characters 0-48 + +reset is never used + <-- line 172 + let reset () = Hash_string.clear js_module_table [@@dead "+reset"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_ident.ml", line 178, characters 0-128 + +compare is never used + <-- line 178 + if u = 0 then Ext_string.compare x.name y.name else u [@@dead "+compare"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_ident.mli", line 29, characters 0-34 + +is_js_object is never used + <-- line 29 + val is_js_object : Ident.t -> bool [@@dead "+is_js_object"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_ident.mli", line 36, characters 0-36 + +make_js_object is never used + <-- line 36 + val make_js_object : Ident.t -> unit [@@dead "+make_js_object"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_ident.mli", line 38, characters 0-24 + +reset is never used + <-- line 38 + val reset : unit -> unit [@@dead "+reset"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_ident.mli", line 40, characters 0-48 + +create_tmp is never used + <-- line 40 + val create_tmp : ?name:string -> unit -> Ident.t [@@dead "+create_tmp"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_ident.mli", line 42, characters 0-33 + +make_unused is never used + <-- line 42 + val make_unused : unit -> Ident.t [@@dead "+make_unused"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_ident.mli", line 46, characters 0-40 + +is_uppercase_exotic is never used + <-- line 46 + val is_uppercase_exotic : string -> bool [@@dead "+is_uppercase_exotic"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_ident.mli", line 55, characters 0-37 + +is_js_or_global is never used + <-- line 55 + val is_js_or_global : Ident.t -> bool [@@dead "+is_js_or_global"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_ident.mli", line 57, characters 0-39 + +compare is never used + <-- line 57 + val compare : Ident.t -> Ident.t -> int [@@dead "+compare"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_int.ml", line 1, characters 0-0 + +ext_int is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_int.ml", line 27, characters 0-48 + +compare is never used + <-- line 27 + let compare (x : t) (y : t) = Stdlib.compare x y [@@dead "+compare"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_int.ml", line 29, characters 0-33 + +equal is never used + <-- line 29 + let equal (x : t) (y : t) = x = y [@@dead "+equal"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_int.ml", line 31, characters 0-24 + +move is never used + <-- line 31 + let move = 0x1_0000_0000 [@@dead "+move"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_int.ml", line 34, characters 0-105 + +int32_unsigned_to_int is never used + <-- line 34 + if i < 0 then i + move else i [@@dead "+int32_unsigned_to_int"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_int.ml", line 38, characters 0-346 + +int32_pow is never used + <-- line 38 + Int32.of_int truncated [@@dead "+int32_pow"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_int.mli", line 1, characters 0-0 + ext_int is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_int.mli", line 27, characters 0-27 + +compare is never used + <-- line 27 + val compare : t -> t -> int [@@dead "+compare"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_int.mli", line 29, characters 0-26 + +equal is never used + <-- line 29 + val equal : t -> t -> bool [@@dead "+equal"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_int.mli", line 31, characters 0-40 + +int32_unsigned_to_int is never used + <-- line 31 + val int32_unsigned_to_int : int32 -> int [@@dead "+int32_unsigned_to_int"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_int.mli", line 37, characters 0-39 + +int32_pow is never used + <-- line 37 + val int32_pow : int32 -> int32 -> int32 [@@dead "+int32_pow"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_io.ml", line 43, characters 0-107 + +rev_lines_of_file is never used + <-- line 43 + Ext_pervasives.finally ~clean:close_in (open_in_bin file) rev_lines_of_chann [@@dead "+rev_lines_of_file"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_io.mli", line 27, characters 0-45 + +rev_lines_of_file is never used + <-- line 27 + val rev_lines_of_file : string -> string list [@@dead "+rev_lines_of_file"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_js_file_kind.ml", line 26, characters 10-21 + t.case is a record label never used to read a value + <-- line 26 + type t = {case: case; [@dead "t.case"] suffix: string} [@@warning "-69"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_js_file_kind.ml", line 26, characters 22-36 + t.suffix is a record label never used to read a value + <-- line 26 + type t = {case: case; [@dead "t.case"] suffix: string [@dead "t.suffix"] } [@@warning "-69"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 78, characters 0-114 + +combine_array_append is never used + <-- line 78 + arr_list_combine_unsafe arr l 0 len acc f [@@dead "+combine_array_append"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 100, characters 0-343 + +map_split_opt is never used + <-- line 100 + | None -> ds )) [@@dead "+map_split_opt"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 114, characters 0-767 + +map_snd is never used + <-- line 114 + (v1, y1) :: (v2, y2) :: (v3, y3) :: (v4, y4) :: (v5, y5) :: map_snd tail f [@@dead "+map_snd"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 189, characters 0-355 + +append_aux is never used + <-- line 189 + a0 :: a1 :: a2 :: a3 :: a4 :: append_aux rest l2 [@@dead "+append_aux"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 200, characters 0-73 + +append is never used + <-- line 200 + | _ -> append_aux l1 l2 [@@dead "+append"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 205, characters 0-39 + +append_one is never used + <-- line 205 + let append_one l1 x = append_aux l1 [x] [@@dead "+append_one"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 267, characters 0-856 + +fold_right3 is never used + <-- line 267 + | _, _, _ -> invalid_arg "Ext_list.fold_right2" [@@dead "+fold_right3"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 287, characters 0-984 + +map2i is never used + <-- line 287 + | _, _ -> invalid_arg "Ext_list.map2" [@@dead "+map2i"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 357, characters 0-133 + +fold_left_with_offset is never used + <-- line 357 + | a :: l -> fold_left_with_offset l (f a accu i) (i + 1) f [@@dead "+fold_left_with_offset"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 465, characters 0-204 + +filter_mapi is never used + <-- line 465 + aux 0 xs [@@dead "+filter_mapi"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 476, characters 0-294 + +filter_map2 is never used + <-- line 476 + | _ -> invalid_arg "Ext_list.filter_map2" [@@dead "+filter_map2"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 549, characters 0-182 + +drop is never used + <-- line 549 + | _ :: tl -> drop tl (n - 1) [@@dead "+drop"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 562, characters 0-117 + +find_first_not is never used + <-- line 562 + | a :: l -> if p a then find_first_not l p else Some a [@@dead "+find_first_not"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 647, characters 0-776 + +split_map is never used + <-- line 647 + (a1 :: a2 :: a3 :: a4 :: a5 :: ass, b1 :: b2 :: b3 :: b4 :: b5 :: bss) [@@dead "+split_map"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 677, characters 0-103 + +sort_via_array is never used + <-- line 677 + Array.to_list arr [@@dead "+sort_via_array"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 687, characters 0-214 + +assoc_by_string is never used + <-- line 687 + | (k1, v1) :: rest -> if k1 = k then v1 else assoc_by_string rest k def [@@dead "+assoc_by_string"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 703, characters 0-109 + +nth_aux is never used + <-- line 703 + | a :: l -> if n = 0 then Some a else nth_aux l (n - 1) [@@dead "+nth_aux"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 708, characters 0-53 + +nth_opt is never used + <-- line 708 + let nth_opt l n = if n < 0 then None else nth_aux l n [@@dead "+nth_opt"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 710, characters 0-101 + +iter_snd is never used + <-- line 710 + iter_snd xs f [@@dead "+iter_snd"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 717, characters 0-101 + +iter_fst is never used + <-- line 717 + iter_fst xs f [@@dead "+iter_fst"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 734, characters 0-96 + +exists_snd is never used + <-- line 734 + | (_, a) :: l -> p a || exists_snd l p [@@dead "+exists_snd"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 739, characters 0-143 + +concat_append is never used + <-- line 739 + | l :: r -> append l (concat_append r xs) [@@dead "+concat_append"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 749, characters 0-140 + +reduce_from_left is never used + <-- line 749 + | _ -> invalid_arg "Ext_list.reduce_from_left" [@@dead "+reduce_from_left"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 754, characters 0-180 + +fold_left2 is never used + <-- line 754 + | _, _ -> invalid_arg "Ext_list.fold_left2" [@@dead "+fold_left2"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 760, characters 0-73 + +singleton_exn is never used + <-- line 760 + | _ -> assert false [@@dead "+singleton_exn"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 765, characters 0-122 + +mem_string is never used + <-- line 765 + | a :: l -> a = x || mem_string l x [@@dead "+mem_string"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 31, characters 0-98 + +combine_array_append is never used + <-- line 31 + 'a array -> 'b list -> ('c * 'b) list -> ('a -> 'c) -> ('c * 'b) list [@@dead "+combine_array_append"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 36, characters 0-83 + +map_split_opt is never used + <-- line 36 + 'a list -> ('a -> 'b option * 'c option) -> 'b list * 'c list [@@dead "+map_split_opt"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 43, characters 0-60 + +map_snd is never used + <-- line 43 + val map_snd : ('a * 'b) list -> ('b -> 'c) -> ('a * 'c) list [@@dead "+map_snd"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 58, characters 0-42 + +append is never used + <-- line 58 + val append : 'a list -> 'a list -> 'a list [@@dead "+append"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 60, characters 0-41 + +append_one is never used + <-- line 60 + val append_one : 'a list -> 'a -> 'a list [@@dead "+append_one"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 68, characters 0-93 + +fold_right3 is never used + <-- line 68 + 'a list -> 'b list -> 'c list -> 'd -> ('a -> 'b -> 'c -> 'd -> 'd) -> 'd [@@dead "+fold_right3"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 73, characters 0-68 + +map2i is never used + <-- line 73 + val map2i : 'a list -> 'b list -> (int -> 'a -> 'b -> 'c) -> 'c list [@@dead "+map2i"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 75, characters 0-91 + +fold_left_with_offset is never used + <-- line 75 + 'a list -> 'acc -> int -> ('a -> 'acc -> int -> 'acc) -> 'acc [@@dead "+fold_left_with_offset"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 81, characters 0-48 + +exclude is never used + <-- line 81 + val exclude : 'a list -> ('a -> bool) -> 'a list [@@dead "+exclude"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 107, characters 0-64 + +filter_mapi is never used + <-- line 107 + val filter_mapi : 'a list -> ('a -> int -> 'b option) -> 'b list [@@dead "+filter_mapi"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 109, characters 0-74 + +filter_map2 is never used + <-- line 109 + val filter_map2 : 'a list -> 'b list -> ('a -> 'b -> 'c option) -> 'c list [@@dead "+filter_map2"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 152, characters 0-36 + +drop is never used + <-- line 152 + val drop : 'a list -> int -> 'a list [@@dead "+drop"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 160, characters 0-57 + +find_first_not is never used + <-- line 160 + val find_first_not : 'a list -> ('a -> bool) -> 'a option [@@dead "+find_first_not"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 189, characters 0-63 + +split_map is never used + <-- line 189 + val split_map : 'a list -> ('a -> 'b * 'c) -> 'b list * 'c list [@@dead "+split_map"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 192, characters 0-56 + +reduce_from_left is never used + <-- line 192 + val reduce_from_left : 'a list -> ('a -> 'a -> 'a) -> 'a [@@dead "+reduce_from_left"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 195, characters 0-60 + +sort_via_array is never used + <-- line 195 + val sort_via_array : 'a list -> ('a -> 'a -> int) -> 'a list [@@dead "+sort_via_array"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 199, characters 0-69 + +assoc_by_string is never used + <-- line 199 + val assoc_by_string : (string * 'a) list -> string -> 'a option -> 'a [@@dead "+assoc_by_string"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 208, characters 0-41 + +nth_opt is never used + <-- line 208 + val nth_opt : 'a list -> int -> 'a option [@@dead "+nth_opt"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 210, characters 0-53 + +iter_snd is never used + <-- line 210 + val iter_snd : ('a * 'b) list -> ('b -> unit) -> unit [@@dead "+iter_snd"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 212, characters 0-53 + +iter_fst is never used + <-- line 212 + val iter_fst : ('a * 'b) list -> ('a -> unit) -> unit [@@dead "+iter_fst"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 218, characters 0-55 + +exists_snd is never used + <-- line 218 + val exists_snd : ('a * 'b) list -> ('b -> bool) -> bool [@@dead "+exists_snd"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 220, characters 0-54 + +concat_append is never used + <-- line 220 + val concat_append : 'a list list -> 'a list -> 'a list [@@dead "+concat_append"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 222, characters 0-73 + +fold_left2 is never used + <-- line 222 + val fold_left2 : 'a list -> 'b list -> 'c -> ('a -> 'b -> 'c -> 'c) -> 'c [@@dead "+fold_left2"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 226, characters 0-33 + +singleton_exn is never used + <-- line 226 + val singleton_exn : 'a list -> 'a [@@dead "+singleton_exn"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 228, characters 0-46 + +mem_string is never used + <-- line 228 + val mem_string : string list -> string -> bool [@@dead "+mem_string"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_obj.ml", line 103, characters 0-86 + +dump_endline is never used + <-- line 103 + print_endline (dump v) [@@dead "+dump_endline"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_obj.ml", line 107, characters 0-55 + +pp_any is never used + <-- line 107 + let pp_any fmt v = Format.fprintf fmt "@[%s@]" (dump v) [@@dead "+pp_any"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_obj.ml", line 109, characters 0-611 + +bt is never used + <-- line 109 + bt.line_number bt.start_char bt.end_char) [@@dead "+bt"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_obj.mli", line 26, characters 0-48 + +dump_endline is never used + <-- line 26 + val dump_endline : ?__LOC__:string -> 'a -> unit [@@dead "+dump_endline"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_obj.mli", line 28, characters 0-43 + +pp_any is never used + <-- line 28 + val pp_any : Format.formatter -> 'a -> unit [@@dead "+pp_any"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_obj.mli", line 30, characters 0-21 + +bt is never used + <-- line 30 + val bt : unit -> unit [@@dead "+bt"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_option.ml", line 25, characters 0-70 + +map is never used + <-- line 25 + | Some x -> Some (f x) [@@dead "+map"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_option.ml", line 35, characters 0-67 + +exists is never used + <-- line 35 + | Some x -> f x [@@dead "+exists"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_option.mli", line 27, characters 0-46 + +map is never used + <-- line 27 + val map : 'a option -> ('a -> 'b) -> 'b option [@@dead "+map"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_option.mli", line 31, characters 0-46 + +exists is never used + <-- line 31 + val exists : 'a option -> ('a -> bool) -> bool [@@dead "+exists"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_path.ml", line 33, characters 0-324 + +split_by_sep_per_os is never used + <-- line 33 + else fun x -> Ext_string.split x '/' [@@dead "+split_by_sep_per_os"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_path.ml", line 44, characters 0-882 + +node_relative_path is never used + <-- line 44 + | ys -> String.concat Literals.node_sep @@ (Literals.node_current :: ys) [@@dead "+node_relative_path"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_path.ml", line 69, characters 0-58 + +node_concat is never used + <-- line 69 + let node_concat ~dir base = dir ^ Literals.node_sep ^ base [@@dead "+node_concat"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_path.ml", line 71, characters 0-178 + +node_rebase_file is never used + <-- line 71 + file [@@dead "+node_rebase_file"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_path.ml", line 118, characters 0-285 + +package_dir is never used + <-- line 118 + cli/bsc.js." [@@dead "+package_dir"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_path.mli", line 27, characters 0-68 + +node_rebase_file is never used + <-- line 27 + val node_rebase_file : from:string -> to_:string -> string -> string [@@dead "+node_rebase_file"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_path.mli", line 36, characters 0-32 + +package_dir is never used + <-- line 36 + val package_dir : unit -> string [@@dead "+package_dir"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_pervasives.ml", line 39, characters 0-87 + +with_file_as_chan is never used + <-- line 39 + finally (open_out_bin filename) ~clean:close_out f [@@dead "+with_file_as_chan"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_pervasives.mli", line 34, characters 0-59 + +with_file_as_chan is never used + <-- line 34 + val with_file_as_chan : string -> (out_channel -> 'a) -> 'a [@@dead "+with_file_as_chan"] + + Warning Dead Value With Side Effects + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_pp.ml", line 31, characters 0-46 + +indent_length is never used and could have side effects + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_pp.ml", line 42, characters 0-217 + +from_channel is never used + <-- line 42 + } [@@dead "+from_channel"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_pp.ml", line 93, characters 0-45 + +nspace is never used + <-- line 93 + let nspace t n = string t (String.make n ' ') [@@dead "+nspace"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_pp.ml", line 166, characters 0-67 + +brace_group is never used + <-- line 166 + let brace_group st n action = group st n (fun _ -> brace st action) [@@dead "+brace_group"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_pp.mli", line 38, characters 0-23 + +indent_length is never used + <-- line 38 + val indent_length : int [@@dead "+indent_length"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_pp.mli", line 44, characters 0-29 + +nspace is never used + <-- line 44 + val nspace : t -> int -> unit [@@dead "+nspace"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_pp.mli", line 63, characters 0-48 + +brace_group is never used + <-- line 63 + val brace_group : t -> int -> (unit -> 'a) -> 'a [@@dead "+brace_group"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_pp.mli", line 75, characters 0-35 + +from_channel is never used + <-- line 75 + val from_channel : out_channel -> t [@@dead "+from_channel"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_pp_scope.ml", line 32, characters 0-172 + +print is never used + <-- line 32 + Format.fprintf fmt "}@]" [@@dead "+print"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_pp_scope.ml", line 38, characters 0-88 + +print_int_map is never used + <-- line 38 + Map_int.iter m (fun k v -> Format.fprintf fmt "%d - %d" k v) [@@dead "+print_int_map"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_pp_scope.mli", line 36, characters 0-41 + +print is never used + <-- line 36 + val print : Format.formatter -> t -> unit [@@dead "+print"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_ref.ml", line 25, characters 0-99 + +non_exn_protect is never used + <-- line 25 + res [@@dead "+non_exn_protect"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_ref.ml", line 43, characters 0-160 + +non_exn_protect2 is never used + <-- line 43 + res [@@dead "+non_exn_protect2"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_ref.ml", line 53, characters 0-226 + +protect2 is never used + <-- line 53 + raise x [@@dead "+protect2"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_ref.ml", line 68, characters 0-301 + +protect_list is never used + <-- line 68 + raise e [@@dead "+protect_list"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_ref.mli", line 29, characters 0-56 + +non_exn_protect is never used + <-- line 29 + val non_exn_protect : 'a ref -> 'a -> (unit -> 'b) -> 'b [@@dead "+non_exn_protect"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_ref.mli", line 33, characters 0-65 + +protect2 is never used + <-- line 33 + val protect2 : 'a ref -> 'b ref -> 'a -> 'b -> (unit -> 'c) -> 'c [@@dead "+protect2"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_ref.mli", line 35, characters 0-73 + +non_exn_protect2 is never used + <-- line 35 + val non_exn_protect2 : 'a ref -> 'b ref -> 'a -> 'b -> (unit -> 'c) -> 'c [@@dead "+non_exn_protect2"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_ref.mli", line 40, characters 0-59 + +protect_list is never used + <-- line 40 + val protect_list : ('a ref * 'a) list -> (unit -> 'b) -> 'b [@@dead "+protect_list"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_sys.mli", line 1, characters 0-0 + ext_sys is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_sys.mli", line 25, characters 0-40 + +is_directory_no_exn is never used + <-- line 25 + val is_directory_no_exn : string -> bool [@@dead "+is_directory_no_exn"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_sys.mli", line 27, characters 0-31 + +is_windows_or_cygwin is never used + <-- line 27 + val is_windows_or_cygwin : bool [@@dead "+is_windows_or_cygwin"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_utf8.mli", line 29, characters 0-53 + +follow is never used + <-- line 29 + val follow : string -> int -> int -> int -> int * int [@@dead "+follow"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_util.ml", line 36, characters 0-324 + +stats_to_string is never used + <-- line 36 + (Array.to_list (Array.map string_of_int bucket_histogram))) [@@dead "+stats_to_string"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_util.mli", line 27, characters 0-50 + +stats_to_string is never used + <-- line 27 + val stats_to_string : Hashtbl.statistics -> string [@@dead "+stats_to_string"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_gen.ml", line 21, characters 2-78 + bucket.Cons is a variant case which is never constructed + <-- line 21 + | Cons of {mutable key: 'a; mutable data: 'b; mutable next: ('a, 'b) bucket} [@dead "bucket.Cons"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_gen.ml", line 31, characters 0-135 + +create is never used + <-- line 31 + {initial_size = s; size = 0; data = Array.make s Empty} [@@dead "+create"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_gen.ml", line 35, characters 0-132 + +clear is never used + <-- line 35 + done [@@dead "+clear"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_gen.ml", line 42, characters 0-72 + +reset is never used + <-- line 42 + h.data <- Array.make h.initial_size Empty [@@dead "+reset"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_gen.ml", line 46, characters 0-21 + +length is never used + <-- line 46 + let length h = h.size [@@dead "+length"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_gen.ml", line 48, characters 0-907 + +resize is never used + <-- line 48 + done) [@@dead "+resize"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_gen.ml", line 76, characters 0-230 + +iter is never used + <-- line 76 + done [@@dead "+iter"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_gen.ml", line 88, characters 0-294 + +fold is never used + <-- line 88 + !accu [@@dead "+fold"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_gen.ml", line 101, characters 0-63 + +to_list is never used + <-- line 101 + let to_list h f = fold h [] (fun k data acc -> f k data :: acc) [@@dead "+to_list"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_gen.ml", line 103, characters 0-347 + +small_bucket_mem is never used + <-- line 103 + | Cons lst -> eq key lst.key || small_bucket_mem lst.next eq key)) [@@dead "+small_bucket_mem"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_gen.ml", line 118, characters 0-473 + +small_bucket_opt is never used + <-- line 118 + else small_bucket_opt eq key lst.next)) [@@dead "+small_bucket_opt"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_gen.ml", line 135, characters 0-454 + +small_bucket_key_opt is never used + <-- line 135 + if eq key k then Some k else small_bucket_key_opt eq key next)) [@@dead "+small_bucket_key_opt"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_gen.ml", line 151, characters 0-480 + +small_bucket_default is never used + <-- line 151 + else small_bucket_default eq key default lst.next)) [@@dead "+small_bucket_default"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_gen.ml", line 168, characters 0-362 + +remove_bucket is never used + <-- line 168 + else remove_bucket h i key ~prec:buck next eq_key [@@dead "+remove_bucket"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_gen.ml", line 180, characters 0-256 + +replace_bucket is never used + <-- line 180 + else replace_bucket key data slot.next eq_key [@@dead "+replace_bucket"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_set_gen.ml", line 28, characters 23-75 + bucket.Cons is a variant case which is never constructed + <-- line 28 + type 'a bucket = Empty | Cons of {mutable key: 'a; mutable next: 'a bucket} [@dead "bucket.Cons"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_set_gen.ml", line 38, characters 0-135 + +create is never used + <-- line 38 + {initial_size = s; size = 0; data = Array.make s Empty} [@@dead "+create"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_set_gen.ml", line 42, characters 0-132 + +clear is never used + <-- line 42 + done [@@dead "+clear"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_set_gen.ml", line 49, characters 0-72 + +reset is never used + <-- line 49 + h.data <- Array.make h.initial_size Empty [@@dead "+reset"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_set_gen.ml", line 53, characters 0-21 + +length is never used + <-- line 53 + let length h = h.size [@@dead "+length"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_set_gen.ml", line 55, characters 0-907 + +resize is never used + <-- line 55 + done) [@@dead "+resize"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_set_gen.ml", line 83, characters 0-223 + +iter is never used + <-- line 83 + done [@@dead "+iter"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_set_gen.ml", line 95, characters 0-287 + +fold is never used + <-- line 95 + !accu [@@dead "+fold"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_set_gen.ml", line 108, characters 0-39 + +to_list is never used + <-- line 108 + let to_list set = fold set [] List.cons [@@dead "+to_list"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_set_gen.ml", line 110, characters 0-334 + +small_bucket_mem is never used + <-- line 110 + | Cons lst -> eq key lst.key || small_bucket_mem eq key lst.next)) [@@dead "+small_bucket_mem"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_set_gen.ml", line 125, characters 0-370 + +remove_bucket is never used + <-- line 125 + else remove_bucket h i key ~prec:buck next eq_key [@@dead "+remove_bucket"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_set_poly.mli", line 29, characters 0-24 + +clear is never used + <-- line 29 + val clear : 'a t -> unit [@@dead "+clear"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_set_poly.mli", line 31, characters 0-24 + +reset is never used + <-- line 31 + val reset : 'a t -> unit [@@dead "+reset"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_set_poly.mli", line 41, characters 0-39 + +iter is never used + <-- line 41 + val iter : 'a t -> ('a -> unit) -> unit [@@dead "+iter"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_set_poly.mli", line 43, characters 0-29 + +to_list is never used + <-- line 43 + val to_list : 'a t -> 'a list [@@dead "+to_list"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ident.ml", line 44, characters 0-56 + +unique_name is never used + <-- line 44 + let unique_name i = i.name ^ "_" ^ string_of_int i.stamp [@@dead "+unique_name"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ident.ml", line 50, characters 0-35 + +equal is never used + <-- line 50 + let equal i1 i2 = i1.name = i2.name [@@dead "+equal"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ident.ml", line 72, characters 0-55 + +is_predef_exn is never used + <-- line 72 + let is_predef_exn i = i.flags land predef_exn_flag <> 0 [@@dead "+is_predef_exn"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ident.ml", line 74, characters 0-178 + +print is never used + <-- line 74 + | n -> fprintf ppf "%s/%i%s" i.name n (if global i then "g" else "") [@@dead "+print"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ident.ml", line 219, characters 0-161 + +compare is never used + <-- line 219 + if c <> 0 then c else compare x.flags y.flags [@@dead "+compare"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ident.ml", line 226, characters 0-52 + +output is never used + <-- line 226 + let output oc id = output_string oc (unique_name id) [@@dead "+output"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ident.ml", line 227, characters 0-46 + +hash is never used + <-- line 227 + let hash i = Char.code i.name.[0] lxor i.stamp [@@dead "+hash"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ident.ml", line 229, characters 0-26 + +original_equal is never used + <-- line 229 + let original_equal = equal [@@dead "+original_equal"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ident.ml", line 232, characters 2-23 + +compare is never used + <-- line 232 + let compare = compare [@@dead "+compare"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ident.ml", line 233, characters 2-21 + +output is never used + <-- line 233 + let output = output [@@dead "+output"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ident.ml", line 234, characters 2-19 + +print is never used + <-- line 234 + let print = print [@@dead "+print"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ident.ml", line 235, characters 2-17 + +hash is never used + <-- line 235 + let hash = hash [@@dead "+hash"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ident.ml", line 236, characters 2-18 + +equal is never used + <-- line 236 + let equal = same [@@dead "+equal"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ident.ml", line 238, characters 0-26 + +equal is never used + <-- line 238 + let equal = original_equal [@@dead "+equal"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ident.mli", line 32, characters 0-29 + +unique_name is never used + <-- line 32 + val unique_name : t -> string [@@dead "+unique_name"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ident.mli", line 42, characters 0-27 + +compare is never used + <-- line 42 + val compare : t -> t -> int [@@dead "+compare"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ident.mli", line 51, characters 0-29 + +is_predef_exn is never used + <-- line 51 + val is_predef_exn : t -> bool [@@dead "+is_predef_exn"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/identifiable.ml", line 20, characters 10-45 + Make.+hash is never used + <-- line 20 + include Hashtbl.HashedType with type t := t [@@dead "Make.+hash"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/identifiable.ml", line 21, characters 10-42 + Make.+compare is never used + <-- line 21 + include Map.OrderedType with type t := t [@@dead "Make.+compare"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/identifiable.ml", line 88, characters 2-106 + Pair.+compare is never used + <-- line 88 + if c <> 0 then c else B.compare b1 b2 [@@dead "Pair.+compare"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/identifiable.ml", line 93, characters 2-53 + Pair.+hash is never used + <-- line 93 + let hash (a, b) = Hashtbl.hash (A.hash a, B.hash b) [@@dead "Pair.+hash"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/identifiable.ml", line 94, characters 2-62 + Pair.+equal is never used + <-- line 94 + let equal (a1, b1) (a2, b2) = A.equal a1 a2 && B.equal b1 b2 [@@dead "Pair.+equal"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/identifiable.mli", line 29, characters 0-78 + identifiable.Pair is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/identifiable.mli", line 22, characters 10-45 + Pair.+hash is never used + <-- line 22 + include Hashtbl.HashedType with type t := t [@@dead "Pair.+hash"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/identifiable.mli", line 23, characters 10-42 + Pair.+compare is never used + <-- line 23 + include Map.OrderedType with type t := t [@@dead "Pair.+compare"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/identifiable.mli", line 25, characters 2-39 + Pair.+output is never used + <-- line 25 + val output : out_channel -> t -> unit [@@dead "Pair.+output"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/identifiable.mli", line 26, characters 2-43 + Pair.+print is never used + <-- line 26 + val print : Format.formatter -> t -> unit [@@dead "Pair.+print"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/identifiable.mli", line 106, characters 26-46 + identifiable.Make.Tbl is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/identifiable.mli", line 106, characters 26-46 + Make.Tbl.+map is never used + <-- line 106 + module Make (T : Thing) : S with type t := T.t [@@dead "Make.Tbl.+map"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/int_vec_vec.ml", line 1, characters 0-0 + +int_vec_vec is a dead module as all its items are dead. + + Warning Dead Value With Side Effects + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/int_vec_vec.ml", line 28, characters 2-29 + +null is never used and could have side effects + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/js_reserved_map.mli", line 27, characters 0-39 + +is_js_special_word is never used + <-- line 27 + val is_js_special_word : string -> bool [@@dead "+is_js_special_word"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 25, characters 0-27 + +js_array_ctor is never used + <-- line 25 + let js_array_ctor = "Array" [@@dead "+js_array_ctor"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 27, characters 0-29 + +js_type_number is never used + <-- line 27 + let js_type_number = "number" [@@dead "+js_type_number"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 29, characters 0-29 + +js_type_string is never used + <-- line 29 + let js_type_string = "string" [@@dead "+js_type_string"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 31, characters 0-29 + +js_type_object is never used + <-- line 31 + let js_type_object = "object" [@@dead "+js_type_object"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 33, characters 0-31 + +js_type_boolean is never used + <-- line 33 + let js_type_boolean = "boolean" [@@dead "+js_type_boolean"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 35, characters 0-30 + +js_undefined is never used + <-- line 35 + let js_undefined = "undefined" [@@dead "+js_undefined"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 37, characters 0-29 + +js_prop_length is never used + <-- line 37 + let js_prop_length = "length" [@@dead "+js_prop_length"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 39, characters 0-17 + +prim is never used + <-- line 39 + let prim = "prim" [@@dead "+prim"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 41, characters 0-19 + +param is never used + <-- line 41 + let param = "param" [@@dead "+param"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 43, characters 0-31 + +partial_arg is never used + <-- line 43 + let partial_arg = "partial_arg" [@@dead "+partial_arg"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 45, characters 0-15 + +tmp is never used + <-- line 45 + let tmp = "tmp" [@@dead "+tmp"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 47, characters 0-21 + +create is never used + <-- line 47 + let create = "create" [@@dead "+create"] (* {!Caml_exceptions.create}*) + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 49, characters 0-23 + +runtime is never used + <-- line 49 + let runtime = "runtime" [@@dead "+runtime"] (* runtime directory *) + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 51, characters 0-21 + +stdlib is never used + <-- line 51 + let stdlib = "stdlib" [@@dead "+stdlib"] + + Warning Dead Value With Side Effects + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 55, characters 0-51 + +setter_suffix_len is never used and could have side effects + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 57, characters 0-25 + +debugger is never used + <-- line 57 + let debugger = "debugger" [@@dead "+debugger"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 59, characters 0-21 + +fn_run is never used + <-- line 59 + let fn_run = "fn_run" [@@dead "+fn_run"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 61, characters 0-29 + +method_run is never used + <-- line 61 + let method_run = "method_run" [@@dead "+method_run"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 63, characters 0-27 + +fn_method is never used + <-- line 63 + let fn_method = "fn_method" [@@dead "+fn_method"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 65, characters 0-19 + +fn_mk is never used + <-- line 65 + let fn_mk = "fn_mk" [@@dead "+fn_mk"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 69, characters 0-33 + +node_modules is never used + <-- line 69 + let node_modules = "node_modules" [@@dead "+node_modules"] + + Warning Dead Value With Side Effects + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 71, characters 0-54 + +node_modules_length is never used and could have side effects + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 73, characters 0-33 + +package_json is never used + <-- line 73 + let package_json = "package.json" [@@dead "+package_json"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 76, characters 0-24 + +library_file is never used + <-- line 76 + let library_file = "lib" [@@dead "+library_file"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 78, characters 0-19 + +suffix_a is never used + <-- line 78 + let suffix_a = ".a" [@@dead "+suffix_a"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 82, characters 0-23 + +suffix_cmo is never used + <-- line 82 + let suffix_cmo = ".cmo" [@@dead "+suffix_cmo"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 84, characters 0-23 + +suffix_cma is never used + <-- line 84 + let suffix_cma = ".cma" [@@dead "+suffix_cma"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 88, characters 0-23 + +suffix_cmx is never used + <-- line 88 + let suffix_cmx = ".cmx" [@@dead "+suffix_cmx"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 90, characters 0-25 + +suffix_cmxa is never used + <-- line 90 + let suffix_cmxa = ".cmxa" [@@dead "+suffix_cmxa"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 92, characters 0-23 + +suffix_mll is never used + <-- line 92 + let suffix_mll = ".mll" [@@dead "+suffix_mll"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 100, characters 0-23 + +suffix_cmt is never used + <-- line 100 + let suffix_cmt = ".cmt" [@@dead "+suffix_cmt"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 102, characters 0-25 + +suffix_cmti is never used + <-- line 102 + let suffix_cmti = ".cmti" [@@dead "+suffix_cmti"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 108, characters 0-19 + +suffix_d is never used + <-- line 108 + let suffix_d = ".d" [@@dead "+suffix_d"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 112, characters 0-29 + +suffix_gen_js is never used + <-- line 112 + let suffix_gen_js = ".gen.js" [@@dead "+suffix_gen_js"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 114, characters 0-31 + +suffix_gen_tsx is never used + <-- line 114 + let suffix_gen_tsx = ".gen.tsx" [@@dead "+suffix_gen_tsx"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 116, characters 0-25 + +esmodule is never used + <-- line 116 + let esmodule = "esmodule" [@@dead "+esmodule"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 118, characters 0-25 + +commonjs is never used + <-- line 118 + let commonjs = "commonjs" [@@dead "+commonjs"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 120, characters 0-42 + +unused_attribute is never used + <-- line 120 + let unused_attribute = "Unused attribute " [@@dead "+unused_attribute"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 123, characters 0-18 + +node_sep is never used + <-- line 123 + let node_sep = "/" [@@dead "+node_sep"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 125, characters 0-22 + +node_parent is never used + <-- line 125 + let node_parent = ".." [@@dead "+node_parent"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 127, characters 0-22 + +node_current is never used + <-- line 127 + let node_current = "." [@@dead "+node_current"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 132, characters 0-40 + +sourcedirs_meta is never used + <-- line 132 + let sourcedirs_meta = ".sourcedirs.json" [@@dead "+sourcedirs_meta"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 153, characters 0-22 + +pure is never used + <-- line 153 + let pure = "@__PURE__" [@@dead "+pure"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.ml", line 32, characters 0-17 + +empty is never used + <-- line 32 + let empty = Empty [@@dead "+empty"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.ml", line 34, characters 0-226 + +map is never used + <-- line 34 + Node {x with l = l'; v = d'; r = r'} [@@dead "+map"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.ml", line 44, characters 0-236 + +mapi is never used + <-- line 44 + Node {x with l = l'; v = v'; r = r'} [@@dead "+mapi"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.ml", line 54, characters 0-60 + +calc_height is never used + <-- line 54 + let[@inline] calc_height a b = (if a >= b then a else b) + 1 [@@dead "+calc_height"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.ml", line 56, characters 0-40 + +singleton is never used + <-- line 56 + let[@inline] singleton k v = Leaf {k; v} [@@dead "+singleton"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.ml", line 58, characters 0-79 + +height is never used + <-- line 58 + | Node {h} -> h [@@dead "+height"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.ml", line 63, characters 0-57 + +unsafe_node is never used + <-- line 63 + let[@inline] unsafe_node k v l r h = Node {l; k; v; r; h} [@@dead "+unsafe_node"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.ml", line 65, characters 0-92 + +unsafe_two_elements is never used + <-- line 65 + unsafe_node k2 v2 (singleton k1 v1) empty 2 [@@dead "+unsafe_two_elements"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.ml", line 68, characters 0-101 + +unsafe_node_maybe_leaf is never used + <-- line 68 + if h = 1 then Leaf {k; v} else Node {l; k; v; r; h} [@@dead "+unsafe_node_maybe_leaf"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.ml", line 72, characters 2-9 + t.Empty is a variant case which is never constructed + <-- line 72 + | Empty [@dead "t.Empty"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.ml", line 73, characters 2-28 + t.Leaf is a variant case which is never constructed + <-- line 73 + | Leaf of {k: 'key; v: 'a} [@dead "t.Leaf"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.ml", line 74, characters 2-70 + t.Node is a variant case which is never constructed + <-- line 74 + | Node of {l: ('key, 'a) t; k: 'key; v: 'a; r: ('key, 'a) t; h: int} [@dead "t.Node"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.ml", line 76, characters 0-135 + +cardinal_aux is never used + <-- line 76 + | Node {l; r} -> cardinal_aux (cardinal_aux (acc + 1) r) l [@@dead "+cardinal_aux"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.ml", line 81, characters 0-33 + +cardinal is never used + <-- line 81 + let cardinal s = cardinal_aux 0 s [@@dead "+cardinal"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.ml", line 83, characters 0-160 + +bindings_aux is never used + <-- line 83 + | Node {l; k; v; r} -> bindings_aux ((k, v) :: bindings_aux accu r) l [@@dead "+bindings_aux"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.ml", line 88, characters 0-34 + +bindings is never used + <-- line 88 + let bindings s = bindings_aux [] s [@@dead "+bindings"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.ml", line 90, characters 0-300 + +fill_array_with_f is never used + <-- line 90 + fill_array_with_f r (inext + 1) arr f [@@dead "+fill_array_with_f"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.ml", line 101, characters 0-283 + +fill_array_aux is never used + <-- line 101 + fill_array_aux r (inext + 1) arr [@@dead "+fill_array_aux"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.ml", line 112, characters 0-289 + +to_sorted_array is never used + <-- line 112 + arr [@@dead "+to_sorted_array"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.ml", line 122, characters 0-328 + +to_sorted_array_with_f is never used + <-- line 122 + arr [@@dead "+to_sorted_array_with_f"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.ml", line 133, characters 0-132 + +keys_aux is never used + <-- line 133 + | Node {l; k; r} -> keys_aux (k :: keys_aux accu r) l [@@dead "+keys_aux"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.ml", line 138, characters 0-26 + +keys is never used + <-- line 138 + let keys s = keys_aux [] s [@@dead "+keys"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.ml", line 140, characters 0-1481 + +bal is never used + <-- line 140 + else unsafe_node_maybe_leaf x d l r (calc_height hl hr) [@@dead "+bal"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.ml", line 183, characters 0-65 + +is_empty is never used + <-- line 183 + | _ -> false [@@dead "+is_empty"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.ml", line 187, characters 0-196 + +min_binding_exn is never used + <-- line 187 + | Leaf _ | Node _ -> min_binding_exn l) [@@dead "+min_binding_exn"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.ml", line 195, characters 0-190 + +remove_min_binding is never used + <-- line 195 + | Node {l; k; v; r} -> bal (remove_min_binding l) k v r [@@dead "+remove_min_binding"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.ml", line 201, characters 0-163 + +merge is never used + <-- line 201 + bal t1 x d (remove_min_binding t2) [@@dead "+merge"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.ml", line 209, characters 0-146 + +iter is never used + <-- line 209 + iter r f [@@dead "+iter"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.ml", line 218, characters 0-144 + +fold is never used + <-- line 218 + | Node {l; k; v; r} -> fold r (f k v (fold l accu f)) f [@@dead "+fold"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.ml", line 224, characters 0-140 + +for_all is never used + <-- line 224 + | Node {l; k; v; r} -> p k v && for_all l p && for_all r p [@@dead "+for_all"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.ml", line 230, characters 0-138 + +exists is never used + <-- line 230 + | Node {l; k; v; r} -> p k v || exists l p || exists r p [@@dead "+exists"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.ml", line 244, characters 0-166 + +add_min is never used + <-- line 244 + | Node tree -> bal (add_min k v tree.l) tree.k tree.v tree.r [@@dead "+add_min"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.ml", line 249, characters 0-166 + +add_max is never used + <-- line 249 + | Node tree -> bal tree.l tree.k tree.v (add_max k v tree.r) [@@dead "+add_max"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.ml", line 257, characters 0-485 + +join is never used + <-- line 257 + else unsafe_node v d l r (calc_height lh rh)) [@@dead "+join"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.ml", line 276, characters 0-165 + +concat is never used + <-- line 276 + join t1 x d (remove_min_binding t2) [@@dead "+concat"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.ml", line 284, characters 0-99 + +concat_or_join is never used + <-- line 284 + | None -> concat t1 t2 [@@dead "+concat_or_join"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.mli", line 1, characters 0-0 + map_gen is a dead module as all its items are dead. + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.mli", line 2, characters 2-9 + t.Empty is a variant case which is never constructed + <-- line 2 + | Empty [@dead "t.Empty"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.mli", line 3, characters 2-28 + t.Leaf is a variant case which is never constructed + <-- line 3 + | Leaf of {k: 'key; v: 'a} [@dead "t.Leaf"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.mli", line 4, characters 2-70 + t.Node is a variant case which is never constructed + <-- line 4 + | Node of {l: ('key, 'a) t; k: 'key; v: 'a; r: ('key, 'a) t; h: int} [@dead "t.Node"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.mli", line 6, characters 0-32 + +cardinal is never used + <-- line 6 + val cardinal : ('a, 'b) t -> int [@@dead "+cardinal"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.mli", line 8, characters 0-43 + +bindings is never used + <-- line 8 + val bindings : ('a, 'b) t -> ('a * 'b) list [@@dead "+bindings"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.mli", line 10, characters 0-80 + +fill_array_with_f is never used + <-- line 10 + val fill_array_with_f : ('a, 'b) t -> int -> 'c array -> ('a -> 'b -> 'c) -> int [@@dead "+fill_array_with_f"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.mli", line 12, characters 0-64 + +fill_array_aux is never used + <-- line 12 + val fill_array_aux : ('a, 'b) t -> int -> ('a * 'b) array -> int [@@dead "+fill_array_aux"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.mli", line 14, characters 0-55 + +to_sorted_array is never used + <-- line 14 + val to_sorted_array : ('key, 'a) t -> ('key * 'a) array [@@dead "+to_sorted_array"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.mli", line 16, characters 0-71 + +to_sorted_array_with_f is never used + <-- line 16 + val to_sorted_array_with_f : ('a, 'b) t -> ('a -> 'b -> 'c) -> 'c array [@@dead "+to_sorted_array_with_f"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.mli", line 18, characters 0-32 + +keys is never used + <-- line 18 + val keys : ('a, 'b) t -> 'a list [@@dead "+keys"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.mli", line 20, characters 0-30 + +height is never used + <-- line 20 + val height : ('a, 'b) t -> int [@@dead "+height"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.mli", line 22, characters 0-38 + +singleton is never used + <-- line 22 + val singleton : 'a -> 'b -> ('a, 'b) t [@@dead "+singleton"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.mli", line 24, characters 0-75 + +unsafe_node is never used + <-- line 24 + val unsafe_node : 'a -> 'b -> ('a, 'b) t -> ('a, 'b) t -> int -> ('a, 'b) t [@@dead "+unsafe_node"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.mli", line 26, characters 0-60 + +unsafe_two_elements is never used + <-- line 26 + val unsafe_two_elements : 'a -> 'b -> 'a -> 'b -> ('a, 'b) t [@@dead "+unsafe_two_elements"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.mli", line 29, characters 0-60 + +bal is never used + <-- line 29 + val bal : ('a, 'b) t -> 'a -> 'b -> ('a, 'b) t -> ('a, 'b) t [@@dead "+bal"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.mli", line 31, characters 0-22 + +empty is never used + <-- line 31 + val empty : ('a, 'b) t [@@dead "+empty"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.mli", line 33, characters 0-33 + +is_empty is never used + <-- line 33 + val is_empty : ('a, 'b) t -> bool [@@dead "+is_empty"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.mli", line 35, characters 0-50 + +merge is never used + <-- line 35 + val merge : ('a, 'b) t -> ('a, 'b) t -> ('a, 'b) t [@@dead "+merge"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.mli", line 37, characters 0-51 + +iter is never used + <-- line 37 + val iter : ('a, 'b) t -> ('a -> 'b -> unit) -> unit [@@dead "+iter"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.mli", line 39, characters 0-48 + +map is never used + <-- line 39 + val map : ('a, 'b) t -> ('b -> 'c) -> ('a, 'c) t [@@dead "+map"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.mli", line 41, characters 0-55 + +mapi is never used + <-- line 41 + val mapi : ('a, 'b) t -> ('a -> 'b -> 'c) -> ('a, 'c) t [@@dead "+mapi"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.mli", line 43, characters 0-59 + +fold is never used + <-- line 43 + val fold : ('a, 'b) t -> 'c -> ('a -> 'b -> 'c -> 'c) -> 'c [@@dead "+fold"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.mli", line 45, characters 0-54 + +for_all is never used + <-- line 45 + val for_all : ('a, 'b) t -> ('a -> 'b -> bool) -> bool [@@dead "+for_all"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.mli", line 47, characters 0-53 + +exists is never used + <-- line 47 + val exists : ('a, 'b) t -> ('a -> 'b -> bool) -> bool [@@dead "+exists"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.mli", line 49, characters 0-61 + +join is never used + <-- line 49 + val join : ('a, 'b) t -> 'a -> 'b -> ('a, 'b) t -> ('a, 'b) t [@@dead "+join"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.mli", line 51, characters 0-51 + +concat is never used + <-- line 51 + val concat : ('a, 'b) t -> ('a, 'b) t -> ('a, 'b) t [@@dead "+concat"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.mli", line 53, characters 0-78 + +concat_or_join is never used + <-- line 53 + val concat_or_join : ('a, 'b) t -> 'a -> 'b option -> ('a, 'b) t -> ('a, 'b) t [@@dead "+concat_or_join"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 25, characters 0-55 + +fatal_errorf is never used + <-- line 25 + let fatal_errorf fmt = Format.kasprintf fatal_error fmt [@@dead "+fatal_errorf"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 61, characters 0-117 + +map_left_right is never used + <-- line 61 + res :: map_left_right f tl [@@dead "+map_left_right"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 67, characters 0-156 + +for_all2 is never used + <-- line 67 + | _, _ -> false [@@dead "+for_all2"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 76, characters 0-107 + +list_remove is never used + <-- line 76 + | hd :: tl -> if hd = x then tl else hd :: list_remove x tl [@@dead "+list_remove"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 92, characters 0-361 + +find_in_path is never used + <-- line 92 + try_dir path [@@dead "+find_in_path"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 104, characters 0-477 + +find_in_path_rel is never used + <-- line 104 + try_dir path [@@dead "+find_in_path_rel"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 156, characters 0-203 + +copy_file is never used + <-- line 156 + copy () [@@dead "+copy_file"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 167, characters 0-282 + +copy_file_chunk is never used + <-- line 167 + copy len [@@dead "+copy_file_chunk"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 180, characters 0-267 + +string_of_file is never used + <-- line 180 + copy () [@@dead "+string_of_file"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 192, characters 0-191 + +output_to_bin_file_directly is never used + <-- line 192 + raise e [@@dead "+output_to_bin_file_directly"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 202, characters 0-1080 + +output_to_file_via_temporary is never used + <-- line 202 + raise exn [@@dead "+output_to_file_via_temporary"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 234, characters 0-57 + +log2 is never used + <-- line 234 + let rec log2 n = if n <= 1 then 0 else 1 + log2 (n asr 1) [@@dead "+log2"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 236, characters 0-65 + +align is never used + <-- line 236 + let align n a = if n >= 0 then (n + a - 1) land -a else n land -a [@@dead "+align"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 238, characters 0-64 + +no_overflow_add is never used + <-- line 238 + let no_overflow_add a b = a lxor b lor (a lxor lnot (a + b)) < 0 [@@dead "+no_overflow_add"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 240, characters 0-64 + +no_overflow_sub is never used + <-- line 240 + let no_overflow_sub a b = a lxor lnot b lor (b lxor (a - b)) < 0 [@@dead "+no_overflow_sub"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 242, characters 0-49 + +no_overflow_mul is never used + <-- line 242 + let no_overflow_mul a b = b <> 0 && a * b / b = a [@@dead "+no_overflow_mul"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 244, characters 0-99 + +no_overflow_lsl is never used + <-- line 244 + 0 <= k && k < Sys.word_size && min_int asr k <= a && a <= max_int asr k [@@dead "+no_overflow_lsl"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 253, characters 2-55 + Int_literal_converter.+int32 is never used + <-- line 253 + let int32 s = cvt_int_aux s Int32.neg Int32.of_string [@@dead "Int_literal_converter.+int32"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 254, characters 2-55 + Int_literal_converter.+int64 is never used + <-- line 254 + let int64 s = cvt_int_aux s Int64.neg Int64.of_string [@@dead "Int_literal_converter.+int64"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 259, characters 0-361 + +chop_extensions is never used + <-- line 259 + with Not_found -> file [@@dead "+chop_extensions"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 269, characters 0-260 + +search_substring is never used + <-- line 269 + search start 0 [@@dead "+search_substring"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 278, characters 0-417 + +replace_substring is never used + <-- line 278 + String.concat after (search [] 0) [@@dead "+replace_substring"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 290, characters 0-468 + +rev_split_words is never used + <-- line 290 + split1 [] 0 [@@dead "+rev_split_words"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 312, characters 0-22 + +fst3 is never used + <-- line 312 + let fst3 (x, _, _) = x [@@dead "+fst3"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 313, characters 0-22 + +snd3 is never used + <-- line 313 + let snd3 (_, x, _) = x [@@dead "+snd3"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 314, characters 0-22 + +thd3 is never used + <-- line 314 + let thd3 (_, _, x) = x [@@dead "+thd3"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 316, characters 0-25 + +fst4 is never used + <-- line 316 + let fst4 (x, _, _, _) = x [@@dead "+fst4"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 318, characters 0-25 + +thd4 is never used + <-- line 318 + let thd4 (_, _, x, _) = x [@@dead "+thd4"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 319, characters 0-25 + +for4 is never used + <-- line 319 + let for4 (_, _, _, x) = x [@@dead "+for4"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 400, characters 0-123 + +cut_at is never used + <-- line 400 + (String.sub s 0 pos, String.sub s (pos + 1) (String.length s - pos - 1)) [@@dead "+cut_at"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 404, characters 0-83 + +misc.String_set is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 406, characters 2-23 + String_set.+compare is never used + <-- line 406 + let compare = compare [@@dead "String_set.+compare"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 408, characters 0-83 + +misc.String_map is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 410, characters 2-23 + String_map.+compare is never used + <-- line 410 + let compare = compare [@@dead "String_map.+compare"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 416, characters 15-20 + Color.color.Black is a variant case which is never constructed + <-- line 416 + type color = Black [@dead "Color.color.Black"] | Red | Green | Yellow | Blue | Magenta | Cyan | White + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 416, characters 27-34 + Color.color.Green is a variant case which is never constructed + <-- line 416 + type color = Black [@dead "Color.color.Black"] | Red | Green [@dead "Color.color.Green"] | Yellow | Blue | Magenta | Cyan | White + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 416, characters 44-50 + Color.color.Blue is a variant case which is never constructed + <-- line 416 + type color = Black [@dead "Color.color.Black"] | Red | Green [@dead "Color.color.Green"] | Yellow | Blue [@dead "Color.color.Blue"] | Magenta | Cyan | White + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 416, characters 68-75 + Color.color.White is a variant case which is never constructed + <-- line 416 + type color = Black [@dead "Color.color.Black"] | Red | Green [@dead "Color.color.Green"] | Yellow | Blue [@dead "Color.color.Blue"] | Magenta | Cyan | White [@dead "Color.color.White"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 420, characters 4-17 + Color.style.BG is a variant case which is never constructed + <-- line 420 + | BG of color [@dead "Color.style.BG"] (* background *) + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 457, characters 2-33 + Color.+get_styles is never used + <-- line 457 + let get_styles () = !cur_styles [@@dead "Color.+get_styles"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 458, characters 2-36 + Color.+set_styles is never used + <-- line 458 + let set_styles s = cur_styles := s [@@dead "Color.+set_styles"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 512, characters 17-21 + Color.setting.Auto is a variant case which is never constructed + <-- line 512 + type setting = Auto [@dead "Color.setting.Auto"] | Always | Never + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 512, characters 22-30 + Color.setting.Always is a variant case which is never constructed + <-- line 512 + type setting = Auto [@dead "Color.setting.Auto"] | Always [@dead "Color.setting.Always"] | Never + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 512, characters 31-38 + Color.setting.Never is a variant case which is never constructed + <-- line 512 + type setting = Auto [@dead "Color.setting.Auto"] | Always [@dead "Color.setting.Always"] | Never [@dead "Color.setting.Never"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 541, characters 0-824 + +delete_eol_spaces is never used + <-- line 541 + Bytes.sub_string dst 0 stop [@@dead "+delete_eol_spaces"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 576, characters 0-47 + +raise_direct_hook_exn is never used + <-- line 576 + let raise_direct_hook_exn e = raise (HookExn e) [@@dead "+raise_direct_hook_exn"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 19, characters 0-65 + +fatal_errorf is never used + <-- line 19 + val fatal_errorf : ('a, Format.formatter, unit, 'b) format4 -> 'a [@@dead "+fatal_errorf"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 27, characters 0-53 + +map_left_right is never used + <-- line 27 + val map_left_right : ('a -> 'b) -> 'a list -> 'b list [@@dead "+map_left_right"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 30, characters 0-63 + +for_all2 is never used + <-- line 30 + val for_all2 : ('a -> 'b -> bool) -> 'a list -> 'b list -> bool [@@dead "+for_all2"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 39, characters 0-42 + +list_remove is never used + <-- line 39 + val list_remove : 'a -> 'a list -> 'a list [@@dead "+list_remove"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 56, characters 0-50 + +find_in_path is never used + <-- line 56 + val find_in_path : string list -> string -> string [@@dead "+find_in_path"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 59, characters 0-54 + +find_in_path_rel is never used + <-- line 59 + val find_in_path_rel : string list -> string -> string [@@dead "+find_in_path_rel"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 78, characters 0-49 + +copy_file is never used + <-- line 78 + val copy_file : in_channel -> out_channel -> unit [@@dead "+copy_file"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 82, characters 0-62 + +copy_file_chunk is never used + <-- line 82 + val copy_file_chunk : in_channel -> out_channel -> int -> unit [@@dead "+copy_file_chunk"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 87, characters 0-41 + +string_of_file is never used + <-- line 87 + val string_of_file : in_channel -> string [@@dead "+string_of_file"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 91, characters 0-79 + +output_to_bin_file_directly is never used + <-- line 91 + val output_to_bin_file_directly : string -> (string -> out_channel -> 'a) -> 'a [@@dead "+output_to_bin_file_directly"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 93, characters 0-106 + +output_to_file_via_temporary is never used + <-- line 93 + ?mode:open_flag list -> string -> (string -> out_channel -> 'a) -> 'a [@@dead "+output_to_file_via_temporary"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 102, characters 0-21 + +log2 is never used + <-- line 102 + val log2 : int -> int [@@dead "+log2"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 106, characters 0-29 + +align is never used + <-- line 106 + val align : int -> int -> int [@@dead "+align"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 110, characters 0-40 + +no_overflow_add is never used + <-- line 110 + val no_overflow_add : int -> int -> bool [@@dead "+no_overflow_add"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 114, characters 0-40 + +no_overflow_sub is never used + <-- line 114 + val no_overflow_sub : int -> int -> bool [@@dead "+no_overflow_sub"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 118, characters 0-40 + +no_overflow_mul is never used + <-- line 118 + val no_overflow_mul : int -> int -> bool [@@dead "+no_overflow_mul"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 122, characters 0-40 + +no_overflow_lsl is never used + <-- line 122 + val no_overflow_lsl : int -> int -> bool [@@dead "+no_overflow_lsl"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 128, characters 2-29 + Int_literal_converter.+int32 is never used + <-- line 128 + val int32 : string -> int32 [@@dead "Int_literal_converter.+int32"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 129, characters 2-29 + Int_literal_converter.+int64 is never used + <-- line 129 + val int64 : string -> int64 [@@dead "Int_literal_converter.+int64"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 132, characters 0-38 + +chop_extensions is never used + <-- line 132 + val chop_extensions : string -> string [@@dead "+chop_extensions"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 139, characters 0-53 + +search_substring is never used + <-- line 139 + val search_substring : string -> string -> int -> int [@@dead "+search_substring"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 145, characters 0-73 + +replace_substring is never used + <-- line 145 + val replace_substring : before:string -> after:string -> string -> string [@@dead "+replace_substring"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 150, characters 0-43 + +rev_split_words is never used + <-- line 150 + val rev_split_words : string -> string list [@@dead "+rev_split_words"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 158, characters 0-29 + +fst3 is never used + <-- line 158 + val fst3 : 'a * 'b * 'c -> 'a [@@dead "+fst3"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 159, characters 0-29 + +snd3 is never used + <-- line 159 + val snd3 : 'a * 'b * 'c -> 'b [@@dead "+snd3"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 160, characters 0-29 + +thd3 is never used + <-- line 160 + val thd3 : 'a * 'b * 'c -> 'c [@@dead "+thd3"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 162, characters 0-34 + +fst4 is never used + <-- line 162 + val fst4 : 'a * 'b * 'c * 'd -> 'a [@@dead "+fst4"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 164, characters 0-34 + +thd4 is never used + <-- line 164 + val thd4 : 'a * 'b * 'c * 'd -> 'c [@@dead "+thd4"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 165, characters 0-34 + +for4 is never used + <-- line 165 + val for4 : 'a * 'b * 'c * 'd -> 'd [@@dead "+for4"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 167, characters 0-57 + +edit_distance is never used + <-- line 167 + val edit_distance : string -> string -> int -> int option [@@dead "+edit_distance"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 198, characters 0-46 + +cut_at is never used + <-- line 198 + val cut_at : string -> char -> string * string [@@dead "+cut_at"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 216, characters 15-20 + color.Black is a variant case which is never constructed + <-- line 216 + type color = Black [@dead "color.Black"] | Red | Green | Yellow | Blue | Magenta | Cyan | White + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 216, characters 21-26 + color.Red is a variant case which is never constructed + <-- line 216 + type color = Black [@dead "color.Black"] | Red [@dead "color.Red"] | Green | Yellow | Blue | Magenta | Cyan | White + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 216, characters 27-34 + color.Green is a variant case which is never constructed + <-- line 216 + type color = Black [@dead "color.Black"] | Red [@dead "color.Red"] | Green [@dead "color.Green"] | Yellow | Blue | Magenta | Cyan | White + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 216, characters 35-43 + color.Yellow is a variant case which is never constructed + <-- line 216 + type color = Black [@dead "color.Black"] | Red [@dead "color.Red"] | Green [@dead "color.Green"] | Yellow [@dead "color.Yellow"] | Blue | Magenta | Cyan | White + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 216, characters 44-50 + color.Blue is a variant case which is never constructed + <-- line 216 + type color = Black [@dead "color.Black"] | Red [@dead "color.Red"] | Green [@dead "color.Green"] | Yellow [@dead "color.Yellow"] | Blue [@dead "color.Blue"] | Magenta | Cyan | White + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 216, characters 51-60 + color.Magenta is a variant case which is never constructed + <-- line 216 + type color = Black [@dead "color.Black"] | Red [@dead "color.Red"] | Green [@dead "color.Green"] | Yellow [@dead "color.Yellow"] | Blue [@dead "color.Blue"] | Magenta [@dead "color.Magenta"] | Cyan | White + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 216, characters 61-67 + color.Cyan is a variant case which is never constructed + <-- line 216 + type color = Black [@dead "color.Black"] | Red [@dead "color.Red"] | Green [@dead "color.Green"] | Yellow [@dead "color.Yellow"] | Blue [@dead "color.Blue"] | Magenta [@dead "color.Magenta"] | Cyan [@dead "color.Cyan"] | White + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 216, characters 68-75 + color.White is a variant case which is never constructed + <-- line 216 + type color = Black [@dead "color.Black"] | Red [@dead "color.Red"] | Green [@dead "color.Green"] | Yellow [@dead "color.Yellow"] | Blue [@dead "color.Blue"] | Magenta [@dead "color.Magenta"] | Cyan [@dead "color.Cyan"] | White [@dead "color.White"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 219, characters 4-17 + style.FG is a variant case which is never constructed + <-- line 219 + | FG of color [@dead "style.FG"] (* foreground *) + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 220, characters 4-17 + style.BG is a variant case which is never constructed + <-- line 220 + | BG of color [@dead "style.BG"] (* background *) + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 221, characters 4-10 + style.Bold is a variant case which is never constructed + <-- line 221 + | Bold [@dead "style.Bold"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 222, characters 4-11 + style.Reset is a variant case which is never constructed + <-- line 222 + | Reset [@dead "style.Reset"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 223, characters 4-9 + style.Dim is a variant case which is never constructed + <-- line 223 + | Dim [@dead "style.Dim"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 225, characters 2-44 + Color.+ansi_of_style_l is never used + <-- line 225 + val ansi_of_style_l : style list -> string [@@dead "Color.+ansi_of_style_l"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 228, characters 17-35 + styles.error is a record label never used to read a value + <-- line 228 + type styles = {error: style list; [@dead "styles.error"] warning: style list; loc: style list} + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 228, characters 36-56 + styles.warning is a record label never used to read a value + <-- line 228 + type styles = {error: style list; [@dead "styles.error"] warning: style list; [@dead "styles.warning"] loc: style list} + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 228, characters 57-72 + styles.loc is a record label never used to read a value + <-- line 228 + type styles = {error: style list; [@dead "styles.error"] warning: style list; [@dead "styles.warning"] loc: style list [@dead "styles.loc"] } + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 230, characters 2-29 + Color.+default_styles is never used + <-- line 230 + val default_styles : styles [@@dead "Color.+default_styles"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 231, characters 2-33 + Color.+get_styles is never used + <-- line 231 + val get_styles : unit -> styles [@@dead "Color.+get_styles"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 232, characters 2-33 + Color.+set_styles is never used + <-- line 232 + val set_styles : styles -> unit [@@dead "Color.+set_styles"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 250, characters 0-40 + +delete_eol_spaces is never used + <-- line 250 + val delete_eol_spaces : string -> string [@@dead "+delete_eol_spaces"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 270, characters 0-37 + +raise_direct_hook_exn is never used + <-- line 270 + val raise_direct_hook_exn : exn -> 'a [@@dead "+raise_direct_hook_exn"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ordered_hash_map_gen.ml", line 75, characters 0-135 + +create is never used + <-- line 75 + {initial_size = s; size = 0; data = Array.make s Empty} [@@dead "+create"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ordered_hash_map_gen.ml", line 79, characters 0-132 + +clear is never used + <-- line 79 + done [@@dead "+clear"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ordered_hash_map_gen.ml", line 86, characters 0-72 + +reset is never used + <-- line 86 + h.data <- Array.make h.initial_size Empty [@@dead "+reset"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ordered_hash_map_gen.ml", line 90, characters 0-21 + +length is never used + <-- line 90 + let length h = h.size [@@dead "+length"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ordered_hash_map_gen.ml", line 92, characters 0-628 + +resize is never used + <-- line 92 + done) [@@dead "+resize"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ordered_hash_map_gen.ml", line 112, characters 0-249 + +iter is never used + <-- line 112 + done [@@dead "+iter"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ordered_hash_map_gen.ml", line 124, characters 0-256 + +choose is never used + <-- line 124 + aux h.data 0 (Array.length h.data) [@@dead "+choose"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ordered_hash_map_gen.ml", line 134, characters 0-177 + +to_sorted_array is never used + <-- line 134 + arr [@@dead "+to_sorted_array"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ordered_hash_map_gen.ml", line 142, characters 0-313 + +fold is never used + <-- line 142 + !accu [@@dead "+fold"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ordered_hash_map_gen.ml", line 155, characters 0-58 + +elements is never used + <-- line 155 + let elements set = fold set [] (fun k _ _ acc -> k :: acc) [@@dead "+elements"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ordered_hash_map_gen.ml", line 157, characters 0-121 + +bucket_length is never used + <-- line 157 + | Cons rhs -> bucket_length (acc + 1) rhs.next [@@dead "+bucket_length"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/primitive_modules.ml", line 25, characters 0-27 + +bool is never used + <-- line 25 + let bool = "Primitive_bool" [@@dead "+bool"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/primitive_modules.ml", line 27, characters 0-25 + +int is never used + <-- line 27 + let int = "Primitive_int" [@@dead "+int"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/primitive_modules.ml", line 29, characters 0-29 + +float is never used + <-- line 29 + let float = "Primitive_float" [@@dead "+float"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/primitive_modules.ml", line 31, characters 0-31 + +bigint is never used + <-- line 31 + let bigint = "Primitive_bigint" [@@dead "+bigint"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/primitive_modules.ml", line 33, characters 0-31 + +string is never used + <-- line 33 + let string = "Primitive_string" [@@dead "+string"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/primitive_modules.ml", line 35, characters 0-29 + +array is never used + <-- line 35 + let array = "Primitive_array" [@@dead "+array"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/primitive_modules.ml", line 39, characters 0-32 + +object_ is never used + <-- line 39 + let object_ = "Primitive_object" [@@dead "+object_"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/primitive_modules.ml", line 47, characters 0-27 + +hash is never used + <-- line 47 + let hash = "Primitive_hash" [@@dead "+hash"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/primitive_modules.ml", line 49, characters 0-39 + +exceptions is never used + <-- line 49 + let exceptions = "Primitive_exceptions" [@@dead "+exceptions"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/runtime_package.ml", line 1, characters 0-30 + +name is never used + <-- line 1 + let name = "@rescript/runtime" [@@dead "+name"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/runtime_package.mli", line 1, characters 0-17 + +name is never used + <-- line 1 + val name : string [@@dead "+name"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.ml", line 23, characters 0-17 + +empty is never used + <-- line 23 + let empty = Empty [@@dead "+empty"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.ml", line 25, characters 0-79 + +height is never used + <-- line 25 + | Node {h} -> h [@@dead "+height"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.ml", line 30, characters 0-60 + +calc_height is never used + <-- line 30 + let[@inline] calc_height a b = (if a >= b then a else b) + 1 [@@dead "+calc_height"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.ml", line 38, characters 0-52 + +unsafe_node is never used + <-- line 38 + let[@inline] unsafe_node v l r h = Node {l; v; r; h} [@@dead "+unsafe_node"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.ml", line 40, characters 0-91 + +unsafe_node_maybe_leaf is never used + <-- line 40 + if h = 1 then Leaf v else Node {l; v; r; h} [@@dead "+unsafe_node_maybe_leaf"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.ml", line 43, characters 0-33 + +singleton is never used + <-- line 43 + let[@inline] singleton x = Leaf x [@@dead "+singleton"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.ml", line 45, characters 0-74 + +unsafe_two_elements is never used + <-- line 45 + let[@inline] unsafe_two_elements x v = unsafe_node v (singleton x) empty 2 [@@dead "+unsafe_two_elements"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.ml", line 48, characters 2-9 + t.Empty is a variant case which is never constructed + <-- line 48 + | Empty [@dead "t.Empty"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.ml", line 49, characters 2-14 + t.Leaf is a variant case which is never constructed + <-- line 49 + | Leaf of 'a [@dead "t.Leaf"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.ml", line 50, characters 2-47 + t.Node is a variant case which is never constructed + <-- line 50 + | Node of {l: 'a t0; v: 'a; r: 'a t0; h: int} [@dead "t.Node"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.ml", line 54, characters 0-162 + +min_exn is never used + <-- line 54 + | Leaf _ | Node _ -> min_exn l) [@@dead "+min_exn"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.ml", line 62, characters 0-65 + +is_empty is never used + <-- line 62 + | _ -> false [@@dead "+is_empty"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.ml", line 66, characters 0-135 + +cardinal_aux is never used + <-- line 66 + | Node {l; r} -> cardinal_aux (cardinal_aux (acc + 1) r) l [@@dead "+cardinal_aux"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.ml", line 71, characters 0-33 + +cardinal is never used + <-- line 71 + let cardinal s = cardinal_aux 0 s [@@dead "+cardinal"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.ml", line 73, characters 0-142 + +elements_aux is never used + <-- line 73 + | Node {l; v; r} -> elements_aux (v :: elements_aux accu r) l [@@dead "+elements_aux"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.ml", line 78, characters 0-34 + +elements is never used + <-- line 78 + let elements s = elements_aux [] s [@@dead "+elements"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.ml", line 80, characters 0-20 + +choose is never used + <-- line 80 + let choose = min_exn [@@dead "+choose"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.ml", line 82, characters 0-125 + +iter is never used + <-- line 82 + iter r f [@@dead "+iter"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.ml", line 91, characters 0-132 + +fold is never used + <-- line 91 + | Node {l; v; r} -> fold r (f v (fold l accu f)) f [@@dead "+fold"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.ml", line 97, characters 0-128 + +for_all is never used + <-- line 97 + | Node {l; v; r} -> p v && for_all l p && for_all r p [@@dead "+for_all"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.ml", line 103, characters 0-126 + +exists is never used + <-- line 103 + | Node {l; v; r} -> p v || exists l p || exists r p [@@dead "+exists"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.ml", line 113, characters 0-336 + +check_height_and_diff is never used + <-- line 113 + if diff > 2 then raise Height_diff_borken else h [@@dead "+check_height_and_diff"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.ml", line 124, characters 0-52 + +check is never used + <-- line 124 + let check tree = ignore (check_height_and_diff tree) [@@dead "+check"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.ml", line 136, characters 0-1421 + +bal is never used + <-- line 136 + else unsafe_node_maybe_leaf v l r (calc_height hl hr) [@@dead "+bal"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.ml", line 179, characters 0-177 + +remove_min_elt is never used + <-- line 179 + | Node {l; v; r} -> bal (remove_min_elt l) v r [@@dead "+remove_min_elt"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.ml", line 191, characters 0-129 + +internal_merge is never used + <-- line 191 + | _, _ -> bal l (min_exn r) (remove_min_elt r) [@@dead "+internal_merge"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.ml", line 204, characters 0-133 + +add_min is never used + <-- line 204 + | Node n -> bal (add_min v n.l) n.v n.r [@@dead "+add_min"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.ml", line 209, characters 0-133 + +add_max is never used + <-- line 209 + | Node n -> bal n.l n.v (add_max v n.r) [@@dead "+add_max"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.ml", line 223, characters 0-728 + +internal_join is never used + <-- line 223 + else unsafe_node v l r (calc_height lh rh) [@@dead "+internal_join"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.ml", line 247, characters 0-147 + +internal_concat is never used + <-- line 247 + | _, _ -> internal_join t1 (min_exn t2) (remove_min_elt t2) [@@dead "+internal_concat"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.ml", line 253, characters 0-425 + +partition is never used + <-- line 253 + else (internal_concat lt rt, internal_join lf v rf) [@@dead "+partition"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.ml", line 267, characters 0-828 + +of_sorted_array is never used + <-- line 267 + sub 0 (Array.length l) l [@@dead "+of_sorted_array"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.ml", line 292, characters 0-690 + +is_ordered is never used + <-- line 292 + is_ordered_min_max tree <> `No [@@dead "+is_ordered"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.ml", line 314, characters 0-53 + +invariant is never used + <-- line 314 + is_ordered ~cmp t [@@dead "+invariant"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.mli", line 1, characters 0-0 + set_gen is a dead module as all its items are dead. + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.mli", line 2, characters 2-9 + t.Empty is a variant case which is never constructed + <-- line 2 + | Empty [@dead "t.Empty"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.mli", line 3, characters 2-14 + t.Leaf is a variant case which is never constructed + <-- line 3 + | Leaf of 'a [@dead "t.Leaf"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.mli", line 4, characters 2-45 + t.Node is a variant case which is never constructed + <-- line 4 + | Node of {l: 'a t; v: 'a; r: 'a t; h: int} [@dead "t.Node"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.mli", line 6, characters 0-16 + +empty is never used + <-- line 6 + val empty : 'a t [@@dead "+empty"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.mli", line 8, characters 0-27 + +is_empty is never used + <-- line 8 + val is_empty : 'a t -> bool [@@dead "+is_empty"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.mli", line 10, characters 0-42 + +unsafe_two_elements is never used + <-- line 10 + val unsafe_two_elements : 'a -> 'a -> 'a t [@@dead "+unsafe_two_elements"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.mli", line 12, characters 0-26 + +cardinal is never used + <-- line 12 + val cardinal : 'a t -> int [@@dead "+cardinal"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.mli", line 14, characters 0-30 + +elements is never used + <-- line 14 + val elements : 'a t -> 'a list [@@dead "+elements"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.mli", line 16, characters 0-23 + +choose is never used + <-- line 16 + val choose : 'a t -> 'a [@@dead "+choose"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.mli", line 18, characters 0-39 + +iter is never used + <-- line 18 + val iter : 'a t -> ('a -> unit) -> unit [@@dead "+iter"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.mli", line 20, characters 0-47 + +fold is never used + <-- line 20 + val fold : 'a t -> 'c -> ('a -> 'c -> 'c) -> 'c [@@dead "+fold"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.mli", line 22, characters 0-42 + +for_all is never used + <-- line 22 + val for_all : 'a t -> ('a -> bool) -> bool [@@dead "+for_all"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.mli", line 24, characters 0-41 + +exists is never used + <-- line 24 + val exists : 'a t -> ('a -> bool) -> bool [@@dead "+exists"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.mli", line 26, characters 0-24 + +check is never used + <-- line 26 + val check : 'a t -> unit [@@dead "+check"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.mli", line 28, characters 0-36 + +bal is never used + <-- line 28 + val bal : 'a t -> 'a -> 'a t -> 'a t [@@dead "+bal"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.mli", line 30, characters 0-33 + +remove_min_elt is never used + <-- line 30 + val remove_min_elt : 'a t -> 'a t [@@dead "+remove_min_elt"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.mli", line 32, characters 0-26 + +singleton is never used + <-- line 32 + val singleton : 'a -> 'a t [@@dead "+singleton"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.mli", line 34, characters 0-41 + +internal_merge is never used + <-- line 34 + val internal_merge : 'a t -> 'a t -> 'a t [@@dead "+internal_merge"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.mli", line 36, characters 0-46 + +internal_join is never used + <-- line 36 + val internal_join : 'a t -> 'a -> 'a t -> 'a t [@@dead "+internal_join"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.mli", line 38, characters 0-42 + +internal_concat is never used + <-- line 38 + val internal_concat : 'a t -> 'a t -> 'a t [@@dead "+internal_concat"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.mli", line 40, characters 0-51 + +partition is never used + <-- line 40 + val partition : 'a t -> ('a -> bool) -> 'a t * 'a t [@@dead "+partition"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.mli", line 42, characters 0-38 + +of_sorted_array is never used + <-- line 42 + val of_sorted_array : 'a array -> 'a t [@@dead "+of_sorted_array"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.mli", line 44, characters 0-54 + +is_ordered is never used + <-- line 44 + val is_ordered : cmp:('a -> 'a -> int) -> 'a t -> bool [@@dead "+is_ordered"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.mli", line 46, characters 0-53 + +invariant is never used + <-- line 46 + val invariant : cmp:('a -> 'a -> int) -> 'a t -> bool [@@dead "+invariant"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/warnings.ml", line 43, characters 2-29 + t.Bad_module_name is a variant case which is never constructed + <-- line 43 + | Bad_module_name of string [@dead "t.Bad_module_name"] (* 24 *) + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/warnings.ml", line 188, characters 0-216 + +mk_lazy is never used + <-- line 188 + raise exn) [@@dead "+mk_lazy"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/warnings.ml", line 489, characters 0-33 + +reset_fatal is never used + <-- line 489 + let reset_fatal () = nerrors := 0 [@@dead "+reset_fatal"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/warnings.mli", line 36, characters 2-29 + t.Bad_module_name is a variant case which is never constructed + <-- line 36 + | Bad_module_name of string [@dead "t.Bad_module_name"] (* 24 *) + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/warnings.mli", line 77, characters 0-24 + +is_error is never used + <-- line 77 + val is_error : t -> bool [@@dead "+is_error"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/warnings.mli", line 92, characters 0-30 + +reset_fatal is never used + <-- line 92 + val reset_fatal : unit -> unit [@@dead "+reset_fatal"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/warnings.mli", line 102, characters 0-39 + +mk_lazy is never used + <-- line 102 + val mk_lazy : (unit -> 'a) -> 'a Lazy.t [@@dead "+mk_lazy"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/warnings.mli", line 106, characters 0-27 + +has_warnings is never used + <-- line 106 + val has_warnings : bool ref [@@dead "+has_warnings"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/warnings.mli", line 108, characters 0-21 + +nerrors is never used + <-- line 108 + val nerrors : int ref [@@dead "+nerrors"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_compatible.ml", line 76, characters 0-341 + +app3 is never used + <-- line 76 + } [@@dead "+app3"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_compatible.ml", line 106, characters 0-217 + +const_exp_string is never used + <-- line 106 + } [@@dead "+const_exp_string"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_compatible.ml", line 114, characters 0-206 + +const_exp_int is never used + <-- line 114 + } [@@dead "+const_exp_int"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_compatible.ml", line 153, characters 0-104 + +const_exp_int_list_as_array is never used + <-- line 153 + Ast_helper.Exp.array (Ext_list.map xs (fun x -> const_exp_int x)) [@@dead "+const_exp_int_list_as_array"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_compatible.mli", line 31, characters 0-101 + +const_exp_string is never used + <-- line 31 + ?loc:Location.t -> ?attrs:attrs -> ?delimiter:string -> string -> expression [@@dead "+const_exp_string"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_compatible.mli", line 34, characters 0-72 + +const_exp_int is never used + <-- line 34 + val const_exp_int : ?loc:Location.t -> ?attrs:attrs -> int -> expression [@@dead "+const_exp_int"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_compatible.mli", line 36, characters 0-56 + +const_exp_int_list_as_array is never used + <-- line 36 + val const_exp_int_list_as_array : int list -> expression [@@dead "+const_exp_int_list_as_array"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_compatible.mli", line 52, characters 0-126 + +app3 is never used + <-- line 52 + expression [@@dead "+app3"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_core_type.ml", line 122, characters 0-139 + +get_uncurry_arity is never used + <-- line 122 + | _ -> None [@@dead "+get_uncurry_arity"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_core_type.ml", line 154, characters 0-178 + +add_last_obj is never used + <-- line 154 + result [@@dead "+add_last_obj"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_core_type.mli", line 44, characters 0-39 + +get_uncurry_arity is never used + <-- line 44 + val get_uncurry_arity : t -> int option [@@dead "+get_uncurry_arity"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_core_type.mli", line 53, characters 0-30 + +add_last_obj is never used + <-- line 53 + val add_last_obj : t -> t -> t [@@dead "+add_last_obj"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_derive.ml", line 30, characters 2-71 + gen.expression_gen is a record label never used to read a value + <-- line 30 + expression_gen: (Parsetree.core_type -> Parsetree.expression) option; [@dead "gen.expression_gen"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_derive.mli", line 30, characters 2-71 + gen.expression_gen is a record label never used to read a value + <-- line 30 + expression_gen: (Parsetree.core_type -> Parsetree.expression) option; [@dead "gen.expression_gen"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_exp_handle_external.ml", line 35, characters 0-1188 + +handle_external is never used + <-- line 35 + empty (Some raw_exp)) [@@dead "+handle_external"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_exp_handle_external.mli", line 25, characters 0-66 + +handle_external is never used + <-- line 25 + val handle_external : Location.t -> string -> Parsetree.expression [@@dead "+handle_external"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_external_mk.ml", line 98, characters 0-998 + +local_extern_cont_to_obj is never used + <-- line 98 + } ) [@@dead "+local_extern_cont_to_obj"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_external_mk.mli", line 56, characters 0-290 + +local_extern_cont_to_obj is never used + <-- line 56 + Parsetree.expression_desc [@@dead "+local_extern_cont_to_obj"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_literal.ml", line 31, characters 0-66 + +predef_some is never used + <-- line 31 + let predef_some : Longident.t = Ldot (predef_prefix_ident, "Some") [@@dead "+predef_some"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_literal.ml", line 33, characters 0-66 + +predef_none is never used + <-- line 33 + let predef_none : Longident.t = Ldot (predef_prefix_ident, "None") [@@dead "+predef_none"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_literal.ml", line 48, characters 2-33 + Lid.+type_exn is never used + <-- line 48 + let type_exn : t = Lident "exn" [@@dead "Lid.+type_exn"] (* use *predef* *) + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_literal.ml", line 52, characters 2-58 + Lid.+pervasives is never used + <-- line 52 + let pervasives : t = Lident Primitive_modules.pervasives [@@dead "Lid.+pervasives"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_literal.ml", line 60, characters 2-49 + Lid.+ignore_id is never used + <-- line 60 + let ignore_id : t = Ldot (pervasives, "ignore") [@@dead "Lid.+ignore_id"] + + Warning Dead Value With Side Effects + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_literal.ml", line 84, characters 2-85 + No_loc.+type_exn is never used and could have side effects + + Warning Dead Value With Side Effects + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_literal.ml", line 89, characters 2-90 + No_loc.+type_bigint is never used and could have side effects + + Warning Dead Value With Side Effects + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_literal.ml", line 98, characters 2-38 + No_loc.+type_any is never used and could have side effects + + Warning Dead Value With Side Effects + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_literal.ml", line 100, characters 2-61 + No_loc.+pat_unit is never used and could have side effects + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_literal.ml", line 122, characters 0-156 + +type_exn is never used + <-- line 122 + Ast_helper.Typ.mk ~loc (Ptyp_constr ({txt = Lid.type_exn; loc}, [])) [@@dead "+type_exn"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_literal.ml", line 150, characters 0-165 + +type_bigint is never used + <-- line 150 + Ast_helper.Typ.mk ~loc (Ptyp_constr ({txt = Lid.type_bigint; loc}, [])) [@@dead "+type_bigint"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_literal.ml", line 156, characters 0-110 + +type_any is never used + <-- line 156 + | Some loc -> Ast_helper.Typ.any ~loc () [@@dead "+type_any"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_literal.ml", line 161, characters 0-133 + +pat_unit is never used + <-- line 161 + | Some loc -> Pat.construct ~loc {txt = Lid.val_unit; loc} None [@@dead "+pat_unit"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_literal.mli", line 29, characters 0-29 + +predef_some is never used + <-- line 29 + val predef_some : Longident.t [@@dead "+predef_some"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_literal.mli", line 31, characters 0-29 + +predef_none is never used + <-- line 31 + val predef_none : Longident.t [@@dead "+predef_none"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_literal.mli", line 36, characters 2-18 + Lid.+val_unit is never used + <-- line 36 + val val_unit : t [@@dead "Lid.+val_unit"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_literal.mli", line 38, characters 2-19 + Lid.+type_unit is never used + <-- line 38 + val type_unit : t [@@dead "Lid.+type_unit"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_literal.mli", line 40, characters 2-18 + Lid.+type_int is never used + <-- line 40 + val type_int : t [@@dead "Lid.+type_int"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_literal.mli", line 42, characters 2-21 + Lid.+type_bigint is never used + <-- line 42 + val type_bigint : t [@@dead "Lid.+type_bigint"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_literal.mli", line 44, characters 2-20 + Lid.+pervasives is never used + <-- line 44 + val pervasives : t [@@dead "Lid.+pervasives"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_literal.mli", line 52, characters 2-19 + Lid.+ignore_id is never used + <-- line 52 + val ignore_id : t [@@dead "Lid.+ignore_id"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_literal.mli", line 73, characters 0-28 + +type_exn is never used + <-- line 73 + val type_exn : core_type_lit [@@dead "+type_exn"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_literal.mli", line 83, characters 0-31 + +type_bigint is never used + <-- line 83 + val type_bigint : core_type_lit [@@dead "+type_bigint"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_literal.mli", line 85, characters 0-28 + +type_any is never used + <-- line 85 + val type_any : core_type_lit [@@dead "+type_any"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_literal.mli", line 87, characters 0-26 + +pat_unit is never used + <-- line 87 + val pat_unit : pattern_lit [@@dead "+pat_unit"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_pat.ml", line 27, characters 0-130 + +is_unit_cont is never used + <-- line 27 + | _ -> no [@@dead "+is_unit_cont"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_pat.ml", line 35, characters 0-383 + +arity_of_fun is never used + <-- line 35 + is_unit_cont ~yes:0 ~no:1 pat + aux e [@@dead "+arity_of_fun"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_pat.ml", line 46, characters 0-149 + +labels_of_fun is never used + <-- line 46 + | _ -> [] [@@dead "+labels_of_fun"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_pat.mli", line 27, characters 0-45 + +is_unit_cont is never used + <-- line 27 + val is_unit_cont : yes:'a -> no:'a -> t -> 'a [@@dead "+is_unit_cont"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_pat.mli", line 29, characters 0-51 + +arity_of_fun is never used + <-- line 29 + val arity_of_fun : t -> Parsetree.expression -> int [@@dead "+arity_of_fun"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_pat.mli", line 33, characters 0-67 + +labels_of_fun is never used + <-- line 33 + val labels_of_fun : Parsetree.expression -> Asttypes.arg_label list [@@dead "+labels_of_fun"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_polyvar.ml", line 44, characters 0-594 + +map_constructor_declarations_into_ints is never used + <-- line 44 + | `complex -> `New (List.rev acc) [@@dead "+map_constructor_declarations_into_ints"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_polyvar.mli", line 29, characters 0-124 + +map_constructor_declarations_into_ints is never used + <-- line 29 + Parsetree.constructor_declaration list -> [`Offset of int | `New of int list] [@@dead "+map_constructor_declarations_into_ints"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_structure.ml", line 53, characters 0-72 + +dummy_item is never used + <-- line 53 + let dummy_item loc : item = Str.eval ~loc (Ast_literal.val_unit ~loc ()) [@@dead "+dummy_item"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_structure.mli", line 40, characters 0-35 + +dummy_item is never used + <-- line 40 + val dummy_item : Location.t -> item [@@dead "+dummy_item"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_utf8_string.ml", line 199, characters 0-370 + +check_no_escapes_or_unicode is never used + <-- line 199 + | Invalid | Cont _ | Leading _ -> false [@@dead "+check_no_escapes_or_unicode"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_utf8_string.ml", line 209, characters 0-75 + +simple_comparison is never used + <-- line 209 + let simple_comparison s = check_no_escapes_or_unicode s 0 (String.length s) [@@dead "+simple_comparison"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_utf8_string.mli", line 29, characters 0-48 + +pp_error is never used + <-- line 29 + val pp_error : Format.formatter -> error -> unit [@@dead "+pp_error"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_utf8_string.mli", line 40, characters 0-38 + +simple_comparison is never used + <-- line 40 + val simple_comparison : string -> bool [@@dead "+simple_comparison"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_utf8_string_interp.ml", line 44, characters 2-16 + pos.byte_bol is a record label never used to read a value + <-- line 44 + byte_bol: int; [@dead "pos.byte_bol"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_utf8_string_interp.ml", line 290, characters 2-41 + Delim.+escaped_back_quote_delimiter is never used + <-- line 290 + let escaped_back_quote_delimiter = "bq" [@@dead "Delim.+escaped_back_quote_delimiter"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_utf8_string_interp.ml", line 337, characters 0-137 + +is_unicode_string is never used + <-- line 337 + || Ext_string.equal opt Delim.escaped_back_quote_delimiter [@@dead "+is_unicode_string"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_utf8_string_interp.mli", line 37, characters 36-49 + pos.byte_bol is a record label never used to read a value + <-- line 37 + type pos = {lnum: int; offset: int; byte_bol: int [@dead "pos.byte_bol"] } + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_utf8_string_interp.mli", line 61, characters 0-38 + +is_unicode_string is never used + <-- line 61 + val is_unicode_string : string -> bool [@@dead "+is_unicode_string"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/bs_syntaxerr.ml", line 25, characters 24-38 + untagged_variant.OnlyOneUnknown is a variant case which is never constructed + <-- line 25 + type untagged_variant = OnlyOneUnknown [@dead "untagged_variant.OnlyOneUnknown"] | AtMostOneObject | AtMostOneArray + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/bs_syntaxerr.ml", line 25, characters 39-56 + untagged_variant.AtMostOneObject is a variant case which is never constructed + <-- line 25 + type untagged_variant = OnlyOneUnknown [@dead "untagged_variant.OnlyOneUnknown"] | AtMostOneObject [@dead "untagged_variant.AtMostOneObject"] | AtMostOneArray + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/bs_syntaxerr.ml", line 25, characters 57-73 + untagged_variant.AtMostOneArray is a variant case which is never constructed + <-- line 25 + type untagged_variant = OnlyOneUnknown [@dead "untagged_variant.OnlyOneUnknown"] | AtMostOneObject [@dead "untagged_variant.AtMostOneObject"] | AtMostOneArray [@dead "untagged_variant.AtMostOneArray"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/bs_syntaxerr.mli", line 25, characters 24-38 + untagged_variant.OnlyOneUnknown is a variant case which is never constructed + <-- line 25 + type untagged_variant = OnlyOneUnknown [@dead "untagged_variant.OnlyOneUnknown"] | AtMostOneObject | AtMostOneArray + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/bs_syntaxerr.mli", line 25, characters 39-56 + untagged_variant.AtMostOneObject is a variant case which is never constructed + <-- line 25 + type untagged_variant = OnlyOneUnknown [@dead "untagged_variant.OnlyOneUnknown"] | AtMostOneObject [@dead "untagged_variant.AtMostOneObject"] | AtMostOneArray + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/bs_syntaxerr.mli", line 25, characters 57-73 + untagged_variant.AtMostOneArray is a variant case which is never constructed + <-- line 25 + type untagged_variant = OnlyOneUnknown [@dead "untagged_variant.OnlyOneUnknown"] | AtMostOneObject [@dead "untagged_variant.AtMostOneObject"] | AtMostOneArray [@dead "untagged_variant.AtMostOneArray"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/external_arg_spec.mli", line 60, characters 0-23 + +empty_label is never used + <-- line 60 + val empty_label : label [@@dead "+empty_label"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/external_ffi_types.mli", line 95, characters 0-29 + +from_string is never used + <-- line 95 + val from_string : string -> t [@@dead "+from_string"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/lam_constant.ml", line 27, characters 2-13 + constructor_tag.const is a record label never used to read a value + <-- line 27 + const: int; [@dead "constructor_tag.const"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/lam_constant.ml", line 28, characters 2-17 + constructor_tag.non_const is a record label never used to read a value + <-- line 28 + non_const: int; [@dead "constructor_tag.non_const"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/lam_constant.ml", line 35, characters 2-18 + pointer_info.Some is a variant case which is never constructed + <-- line 35 + | Some of string [@dead "pointer_info.Some"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/lam_constant.ml", line 37, characters 0-205 + +string_of_pointer_info is never used + <-- line 37 + | None -> None [@@dead "+string_of_pointer_info"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/lam_constant.ml", line 61, characters 0-1153 + +eq_approx is never used + <-- line 61 + | _ -> false) [@@dead "+eq_approx"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/lam_constant.ml", line 102, characters 0-55 + +lam_none is never used + <-- line 102 + let lam_none : t = Const_js_undefined {is_unit = false} [@@dead "+lam_none"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/lam_constant.ml", line 104, characters 0-324 + +is_allocating is never used + <-- line 104 + false [@@dead "+is_allocating"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/lam_constant.mli", line 27, characters 2-13 + constructor_tag.const is a record label never used to read a value + <-- line 27 + const: int; [@dead "constructor_tag.const"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/lam_constant.mli", line 28, characters 2-17 + constructor_tag.non_const is a record label never used to read a value + <-- line 28 + non_const: int; [@dead "constructor_tag.non_const"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/lam_constant.mli", line 35, characters 2-18 + pointer_info.Some is a variant case which is never constructed + <-- line 35 + | Some of string [@dead "pointer_info.Some"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/lam_constant.mli", line 37, characters 0-58 + +string_of_pointer_info is never used + <-- line 37 + val string_of_pointer_info : pointer_info -> string option [@@dead "+string_of_pointer_info"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/lam_constant.mli", line 57, characters 0-30 + +eq_approx is never used + <-- line 57 + val eq_approx : t -> t -> bool [@@dead "+eq_approx"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/lam_constant.mli", line 59, characters 0-16 + +lam_none is never used + <-- line 59 + val lam_none : t [@@dead "+lam_none"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/lam_constant.mli", line 61, characters 0-29 + +is_allocating is never used + <-- line 61 + val is_allocating : t -> bool [@@dead "+is_allocating"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/gentype/gen_ident.ml", line 1, characters 0-102 + +gen_ident.Int_map is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/gentype/gen_ident.ml", line 4, characters 2-47 + Int_map.+compare is never used + <-- line 4 + let compare (x : int) (y : int) = compare x y [@@dead "Int_map.+compare"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/gentype/gentype_config.ml", line 16, characters 2-27 + t.bsb_project_root is a record label never used to read a value + <-- line 16 + bsb_project_root: string; [@dead "t.bsb_project_root"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/gentype/module_name.ml", line 27, characters 0-44 + +compare is never used + <-- line 27 + let compare (s1 : string) s2 = compare s1 s2 [@@dead "+compare"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/gentype/module_name.mli", line 3, characters 0-27 + +compare is never used + <-- line 3 + val compare : t -> t -> int [@@dead "+compare"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/gentype/paths.ml", line 3, characters 0-28 + +concat is never used + <-- line 3 + let concat = Filename.concat [@@dead "+concat"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/gentype/resolved_name.ml", line 10, characters 0-336 + +resolved_name.Name_set is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/gentype/resolved_name.ml", line 13, characters 2-275 + Name_set.+compare is never used + <-- line 13 + | false -> compare rest1 rest2) [@@dead "Name_set.+compare"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/annot.ml", line 18, characters 12-16 + call.Tail is a variant case which is never constructed + <-- line 18 + type call = Tail [@dead "call.Tail"] | Stack | Inline + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/annot.ml", line 18, characters 17-24 + call.Stack is a variant case which is never constructed + <-- line 18 + type call = Tail [@dead "call.Tail"] | Stack [@dead "call.Stack"] | Inline + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/annot.ml", line 18, characters 25-33 + call.Inline is a variant case which is never constructed + <-- line 18 + type call = Tail [@dead "call.Tail"] | Stack [@dead "call.Stack"] | Inline [@dead "call.Inline"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper.ml", line 28, characters 0-182 + +with_default_loc is never used + <-- line 28 + raise exn [@@dead "+with_default_loc"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper.ml", line 42, characters 2-67 + Const.+int32 is never used + <-- line 42 + let int32 ?(suffix = 'l') i = integer ~suffix (Int32.to_string i) [@@dead "Const.+int32"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper.ml", line 43, characters 2-67 + Const.+int64 is never used + <-- line 43 + let int64 ?(suffix = 'L') i = integer ~suffix (Int64.to_string i) [@@dead "Const.+int64"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper.ml", line 44, characters 2-75 + Const.+nativeint is never used + <-- line 44 + let nativeint ?(suffix = 'n') i = integer ~suffix (Nativeint.to_string i) [@@dead "Const.+nativeint"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper.ml", line 45, characters 2-48 + Const.+float is never used + <-- line 45 + let float ?suffix f = Pconst_float (f, suffix) [@@dead "Const.+float"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper.ml", line 46, characters 2-40 + Const.+char is never used + <-- line 46 + let char c = Pconst_char (Char.code c) [@@dead "Const.+char"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper.ml", line 53, characters 2-67 + Typ.+attr is never used + <-- line 53 + let attr d a = {d with ptyp_attributes = d.ptyp_attributes @ [a]} [@@dead "Typ.+attr"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper.ml", line 134, characters 2-67 + Pat.+attr is never used + <-- line 134 + let attr d a = {d with ppat_attributes = d.ppat_attributes @ [a]} [@@dead "Pat.+attr"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper.ml", line 158, characters 2-67 + Exp.+attr is never used + <-- line 158 + let attr d a = {d with pexp_attributes = d.pexp_attributes @ [a]} [@@dead "Exp.+attr"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper.ml", line 257, characters 2-67 + Mty.+attr is never used + <-- line 257 + let attr d a = {d with pmty_attributes = d.pmty_attributes @ [a]} [@@dead "Mty.+attr"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper.ml", line 271, characters 2-67 + Mod.+attr is never used + <-- line 271 + let attr d a = {d with pmod_attributes = d.pmod_attributes @ [a]} [@@dead "Mod.+attr"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper.ml", line 419, characters 2-219 + Te.+decl is never used + <-- line 419 + } [@@dead "Te.+decl"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper.ml", line 428, characters 2-183 + Te.+rebind is never used + <-- line 428 + } [@@dead "Te.+rebind"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper.mli", line 1, characters 0-0 + ast_helper is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper.mli", line 28, characters 0-25 + +default_loc is never used + <-- line 28 + val default_loc : loc ref [@@dead "+default_loc"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper.mli", line 31, characters 0-48 + +with_default_loc is never used + <-- line 31 + val with_default_loc : loc -> (unit -> 'a) -> 'a [@@dead "+with_default_loc"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper.mli", line 38, characters 2-29 + Const.+char is never used + <-- line 38 + val char : char -> constant [@@dead "Const.+char"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper.mli", line 40, characters 2-50 + Const.+integer is never used + <-- line 40 + val integer : ?suffix:char -> string -> constant [@@dead "Const.+integer"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper.mli", line 42, characters 2-47 + Const.+int32 is never used + <-- line 42 + val int32 : ?suffix:char -> int32 -> constant [@@dead "Const.+int32"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper.mli", line 43, characters 2-47 + Const.+int64 is never used + <-- line 43 + val int64 : ?suffix:char -> int64 -> constant [@@dead "Const.+int64"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper.mli", line 44, characters 2-55 + Const.+nativeint is never used + <-- line 44 + val nativeint : ?suffix:char -> nativeint -> constant [@@dead "Const.+nativeint"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper.mli", line 45, characters 2-48 + Const.+float is never used + <-- line 45 + val float : ?suffix:char -> string -> constant [@@dead "Const.+float"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper.mli", line 53, characters 2-48 + Typ.+attr is never used + <-- line 53 + val attr : core_type -> attribute -> core_type [@@dead "Typ.+attr"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper.mli", line 92, characters 2-44 + Pat.+attr is never used + <-- line 92 + val attr : pattern -> attribute -> pattern [@@dead "Pat.+attr"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper.mli", line 121, characters 2-50 + Exp.+attr is never used + <-- line 121 + val attr : expression -> attribute -> expression [@@dead "Exp.+attr"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper.mli", line 310, characters 2-142 + Te.+decl is never used + <-- line 310 + extension_constructor [@@dead "Te.+decl"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper.mli", line 317, characters 2-78 + Te.+rebind is never used + <-- line 317 + val rebind : ?loc:loc -> ?attrs:attrs -> str -> lid -> extension_constructor [@@dead "Te.+rebind"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper.mli", line 330, characters 2-52 + Mty.+attr is never used + <-- line 330 + val attr : module_type -> attribute -> module_type [@@dead "Mty.+attr"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper.mli", line 354, characters 2-70 + Mod.+mk is never used + <-- line 354 + val mk : ?loc:loc -> ?attrs:attrs -> module_expr_desc -> module_expr [@@dead "Mod.+mk"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper.mli", line 355, characters 2-52 + Mod.+attr is never used + <-- line 355 + val attr : module_expr -> attribute -> module_expr [@@dead "Mod.+attr"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 28, characters 0-182 + +with_default_loc is never used + <-- line 28 + raise exn [@@dead "+with_default_loc"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 39, characters 0-513 + +ast_helper0.Const is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 40, characters 2-52 + Const.+integer is never used + <-- line 40 + let integer ?suffix i = Pconst_integer (i, suffix) [@@dead "Const.+integer"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 41, characters 2-55 + Const.+int is never used + <-- line 41 + let int ?suffix i = integer ?suffix (string_of_int i) [@@dead "Const.+int"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 42, characters 2-67 + Const.+int32 is never used + <-- line 42 + let int32 ?(suffix = 'l') i = integer ~suffix (Int32.to_string i) [@@dead "Const.+int32"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 43, characters 2-67 + Const.+int64 is never used + <-- line 43 + let int64 ?(suffix = 'L') i = integer ~suffix (Int64.to_string i) [@@dead "Const.+int64"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 44, characters 2-75 + Const.+nativeint is never used + <-- line 44 + let nativeint ?(suffix = 'n') i = integer ~suffix (Nativeint.to_string i) [@@dead "Const.+nativeint"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 45, characters 2-48 + Const.+float is never used + <-- line 45 + let float ?suffix f = Pconst_float (f, suffix) [@@dead "Const.+float"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 46, characters 2-40 + Const.+char is never used + <-- line 46 + let char c = Pconst_char (Char.code c) [@@dead "Const.+char"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 47, characters 2-76 + Const.+string is never used + <-- line 47 + let string ?quotation_delimiter s = Pconst_string (s, quotation_delimiter) [@@dead "Const.+string"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 53, characters 2-67 + Typ.+attr is never used + <-- line 53 + let attr d a = {d with ptyp_attributes = d.ptyp_attributes @ [a]} [@@dead "Typ.+attr"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 67, characters 2-107 + Typ.+force_poly is never used + <-- line 67 + | _ -> poly ~loc:t.ptyp_loc [] t [@@dead "Typ.+force_poly"] (* -> ghost? *) + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 72, characters 2-1986 + Typ.+varify_constructors is never used + <-- line 72 + loop t [@@dead "Typ.+varify_constructors"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 124, characters 2-67 + Pat.+attr is never used + <-- line 124 + let attr d a = {d with ppat_attributes = d.ppat_attributes @ [a]} [@@dead "Pat.+attr"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 139, characters 2-56 + Pat.+lazy_ is never used + <-- line 139 + let lazy_ ?loc ?attrs a = mk ?loc ?attrs (Ppat_lazy a) [@@dead "Pat.+lazy_"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 149, characters 2-67 + Exp.+attr is never used + <-- line 149 + let attr d a = {d with pexp_attributes = d.pexp_attributes @ [a]} [@@dead "Exp.+attr"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 155, characters 2-64 + Exp.+function_ is never used + <-- line 155 + let function_ ?loc ?attrs a = mk ?loc ?attrs (Pexp_function a) [@@dead "Exp.+function_"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 173, characters 2-54 + Exp.+new_ is never used + <-- line 173 + let new_ ?loc ?attrs a = mk ?loc ?attrs (Pexp_new a) [@@dead "Exp.+new_"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 174, characters 2-74 + Exp.+setinstvar is never used + <-- line 174 + let setinstvar ?loc ?attrs a b = mk ?loc ?attrs (Pexp_setinstvar (a, b)) [@@dead "Exp.+setinstvar"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 175, characters 2-63 + Exp.+override is never used + <-- line 175 + let override ?loc ?attrs a = mk ?loc ?attrs (Pexp_override a) [@@dead "Exp.+override"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 179, characters 2-56 + Exp.+lazy_ is never used + <-- line 179 + let lazy_ ?loc ?attrs a = mk ?loc ?attrs (Pexp_lazy a) [@@dead "Exp.+lazy_"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 180, characters 2-62 + Exp.+poly is never used + <-- line 180 + let poly ?loc ?attrs a b = mk ?loc ?attrs (Pexp_poly (a, b)) [@@dead "Exp.+poly"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 186, characters 2-74 + Exp.+case is never used + <-- line 186 + let case lhs ?guard rhs = {pc_lhs = lhs; pc_guard = guard; pc_rhs = rhs} [@@dead "Exp.+case"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 192, characters 2-67 + Mty.+attr is never used + <-- line 192 + let attr d a = {d with pmty_attributes = d.pmty_attributes @ [a]} [@@dead "Mty.+attr"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 206, characters 2-67 + Mod.+attr is never used + <-- line 206 + let attr d a = {d with pmod_attributes = d.pmod_attributes @ [a]} [@@dead "Mod.+attr"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 352, characters 2-219 + Te.+decl is never used + <-- line 352 + } [@@dead "Te.+decl"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 361, characters 2-183 + Te.+rebind is never used + <-- line 361 + } [@@dead "Te.+rebind"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_mapper.ml", line 529, characters 0-136 + +attribute_of_warning is never used + <-- line 529 + PStr [Str.eval ~loc (Exp.constant (Pconst_string (s, None)))] ) [@@dead "+attribute_of_warning"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_mapper.ml", line 533, characters 0-83 + +ast_mapper.String_map is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_mapper.ml", line 535, characters 2-23 + String_map.+compare is never used + <-- line 535 + let compare = compare [@@dead "String_map.+compare"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_mapper.ml", line 540, characters 0-81 + +get_cookie is never used + <-- line 540 + try Some (String_map.find k !cookies) with Not_found -> None [@@dead "+get_cookie"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_mapper.ml", line 543, characters 0-59 + +set_cookie is never used + <-- line 543 + let set_cookie k v = cookies := String_map.add k v !cookies [@@dead "+set_cookie"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_mapper.ml", line 547, characters 0-33 + +tool_name is never used + <-- line 547 + let tool_name () = !tool_name_ref [@@dead "+tool_name"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_mapper.ml", line 790, characters 0-80 + +apply is never used + <-- line 790 + let apply ~source ~target mapper = apply_lazy ~source ~target (fun () -> mapper) [@@dead "+apply"] + + Warning Dead Value With Side Effects + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_mapper.ml", line 813, characters 0-55 + +register_function is never used and could have side effects + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_mapper.ml", line 814, characters 0-47 + +register is never used + <-- line 814 + let register name f = !register_function name f [@@dead "+register"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_mapper.mli", line 101, characters 0-30 + +tool_name is never used + <-- line 101 + val tool_name : unit -> string [@@dead "+tool_name"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_mapper.mli", line 110, characters 0-60 + +apply is never used + <-- line 110 + val apply : source:string -> target:string -> mapper -> unit [@@dead "+apply"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_mapper.mli", line 116, characters 0-46 + +run_main is never used + <-- line 116 + val run_main : (string list -> mapper) -> unit [@@dead "+run_main"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_mapper.mli", line 125, characters 0-71 + +register_function is never used + <-- line 125 + val register_function : (string -> (string list -> mapper) -> unit) ref [@@dead "+register_function"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_mapper.mli", line 127, characters 0-56 + +register is never used + <-- line 127 + val register : string -> (string list -> mapper) -> unit [@@dead "+register"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_mapper.mli", line 146, characters 0-50 + +map_opt is never used + <-- line 146 + val map_opt : ('a -> 'b) -> 'a option -> 'b option [@@dead "+map_opt"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_mapper.mli", line 148, characters 0-52 + +extension_of_error is never used + <-- line 148 + val extension_of_error : Location.error -> extension [@@dead "+extension_of_error"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_mapper.mli", line 153, characters 0-60 + +attribute_of_warning is never used + <-- line 153 + val attribute_of_warning : Location.t -> string -> attribute [@@dead "+attribute_of_warning"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_mapper.mli", line 187, characters 0-55 + +set_cookie is never used + <-- line 187 + val set_cookie : string -> Parsetree.expression -> unit [@@dead "+set_cookie"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_mapper.mli", line 188, characters 0-54 + +get_cookie is never used + <-- line 188 + val get_cookie : string -> Parsetree.expression option [@@dead "+get_cookie"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_mapper_from0.ml", line 79, characters 0-31 + +map_snd is never used + <-- line 79 + let map_snd f (x, y) = (x, f y) [@@dead "+map_snd"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_mapper_to0.ml", line 73, characters 0-31 + +map_snd is never used + <-- line 73 + let map_snd f (x, y) = (x, f y) [@@dead "+map_snd"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_payload.ml", line 42, characters 0-341 + +is_single_string_as_ast is never used + <-- line 42 + | _ -> None [@@dead "+is_single_string_as_ast"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_payload.ml", line 171, characters 0-118 + +as_core_type is never used + <-- line 171 + | _ -> Location.raise_errorf ~loc "except a core type" [@@dead "+as_core_type"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_payload.ml", line 176, characters 0-140 + +as_ident is never used + <-- line 176 + | _ -> None [@@dead "+as_ident"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_payload.mli", line 38, characters 0-62 + +is_single_string_as_ast is never used + <-- line 38 + val is_single_string_as_ast : t -> Parsetree.expression option [@@dead "+is_single_string_as_ast"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_payload.mli", line 57, characters 0-57 + +as_core_type is never used + <-- line 57 + val as_core_type : Location.t -> t -> Parsetree.core_type [@@dead "+as_core_type"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_payload.mli", line 60, characters 0-51 + +as_ident is never used + <-- line 60 + val as_ident : t -> Longident.t Asttypes.loc option [@@dead "+as_ident"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_payload.mli", line 92, characters 0-61 + +unrecognized_config_record is never used + <-- line 92 + val unrecognized_config_record : Location.t -> string -> unit [@@dead "+unrecognized_config_record"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 169, characters 0-248 + +tag_can_be_undefined is never used + <-- line 169 + | Some Undefined -> true [@@dead "+tag_can_be_undefined"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 527, characters 0-76 + +block_is_object is never used + <-- line 527 + let block_is_object ~env attrs = get_block_type ~env attrs = Some ObjectType [@@dead "+block_is_object"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 539, characters 2-204 + Dynamic_checks.+size is never used + <-- line 539 + | Expr _ -> 1 [@@dead "Dynamic_checks.+size"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 547, characters 2-35 + Dynamic_checks.+bin is never used + <-- line 547 + let bin op x y = BinOp (op, x, y) [@@dead "Dynamic_checks.+bin"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 549, characters 2-25 + Dynamic_checks.+typeof is never used + <-- line 549 + let typeof x = TypeOf x [@@dead "Dynamic_checks.+typeof"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 550, characters 2-34 + Dynamic_checks.+str is never used + <-- line 550 + let str s = String s |> tag_type [@@dead "Dynamic_checks.+str"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 551, characters 2-43 + Dynamic_checks.+is_instance is never used + <-- line 551 + let is_instance i x = IsInstanceOf (i, x) [@@dead "Dynamic_checks.+is_instance"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 552, characters 2-19 + Dynamic_checks.+not is never used + <-- line 552 + let not x = Not x [@@dead "Dynamic_checks.+not"] + + Warning Dead Value With Side Effects + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 553, characters 2-28 + Dynamic_checks.+nil is never used and could have side effects + + Warning Dead Value With Side Effects + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 554, characters 2-39 + Dynamic_checks.+undefined is never used and could have side effects + + Warning Dead Value With Side Effects + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 555, characters 2-47 + Dynamic_checks.+object_ is never used and could have side effects + + Warning Dead Value With Side Effects + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 557, characters 2-51 + Dynamic_checks.+function_ is never used and could have side effects + + Warning Dead Value With Side Effects + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 558, characters 2-46 + Dynamic_checks.+string is never used and could have side effects + + Warning Dead Value With Side Effects + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 559, characters 2-43 + Dynamic_checks.+number is never used and could have side effects + + Warning Dead Value With Side Effects + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 561, characters 2-46 + Dynamic_checks.+bigint is never used and could have side effects + + Warning Dead Value With Side Effects + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 563, characters 2-48 + Dynamic_checks.+boolean is never used and could have side effects + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 565, characters 2-33 + Dynamic_checks.+== is never used + <-- line 565 + let ( == ) x y = bin EqEqEq x y [@@dead "Dynamic_checks.+=="] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 566, characters 2-34 + Dynamic_checks.+!= is never used + <-- line 566 + let ( != ) x y = bin NotEqEq x y [@@dead "Dynamic_checks.+!="] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 567, characters 2-30 + Dynamic_checks.+||| is never used + <-- line 567 + let ( ||| ) x y = bin Or x y [@@dead "Dynamic_checks.+|||"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 568, characters 2-31 + Dynamic_checks.+&&& is never used + <-- line 568 + let ( &&& ) x y = bin And x y [@@dead "Dynamic_checks.+&&&"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 570, characters 2-2866 + Dynamic_checks.+is_a_literal_case is never used + <-- line 570 + | [] -> assert false [@@dead "Dynamic_checks.+is_a_literal_case"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 650, characters 2-411 + Dynamic_checks.+is_a_literal_case is never used + <-- line 650 + else without_literal_cases [@@dead "Dynamic_checks.+is_a_literal_case"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 661, characters 2-706 + Dynamic_checks.+is_int_tag is never used + <-- line 661 + typeof e != object_ [@@dead "Dynamic_checks.+is_int_tag"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 679, characters 2-1031 + Dynamic_checks.+add_runtime_type_check is never used + <-- line 679 + | Bool _ | Float _ | Int _ | BigInt _ | String _ | Null | Undefined -> x [@@dead "Dynamic_checks.+add_runtime_type_check"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/asttypes.ml", line 36, characters 20-27 + virtual_flag.Virtual is a variant case which is never constructed + <-- line 36 + type virtual_flag = Virtual [@dead "virtual_flag.Virtual"] | Concrete + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/asttypes.ml", line 36, characters 28-38 + virtual_flag.Concrete is a variant case which is never constructed + <-- line 36 + type virtual_flag = Virtual [@dead "virtual_flag.Virtual"] | Concrete [@dead "virtual_flag.Concrete"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/bigint_utils.mli", line 1, characters 0-27 + +is_neg is never used + <-- line 1 + val is_neg : string -> bool [@@dead "+is_neg"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/bigint_utils.mli", line 2, characters 0-27 + +is_pos is never used + <-- line 2 + val is_pos : string -> bool [@@dead "+is_pos"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/bigint_utils.mli", line 4, characters 0-49 + +remove_leading_sign is never used + <-- line 4 + val remove_leading_sign : string -> bool * string [@@dead "+remove_leading_sign"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/bigint_utils.mli", line 5, characters 0-43 + +remove_leading_zeros is never used + <-- line 5 + val remove_leading_zeros : string -> string [@@dead "+remove_leading_zeros"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/btype.ml", line 412, characters 0-155 + +copy_kind is never used + <-- line 412 + | Fabsent -> assert false [@@dead "+copy_kind"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/btype.ml", line 489, characters 0-53 + +mark_type_params is never used + <-- line 489 + let mark_type_params ty = iter_type_expr mark_type ty [@@dead "+mark_type_params"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/btype.mli", line 134, characters 0-40 + +copy_kind is never used + <-- line 134 + val copy_kind : field_kind -> field_kind [@@dead "+copy_kind"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/btype.mli", line 157, characters 0-40 + +mark_type_params is never used + <-- line 157 + val mark_type_params : type_expr -> unit [@@dead "+mark_type_params"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/classify_function.ml", line 107, characters 0-210 + +classify_stmt is never used + <-- line 107 + | _ -> Js_stmt_unknown [@@dead "+classify_stmt"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/classify_function.mli", line 29, characters 0-46 + +classify_stmt is never used + <-- line 29 + val classify_stmt : string -> Js_raw_info.stmt [@@dead "+classify_stmt"] + + Warning Dead Value With Side Effects + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/clflags.ml", line 39, characters 0-27 + +dump_lambda is never used and could have side effects + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/clflags.mli", line 23, characters 0-26 + +dump_lambda is never used + <-- line 23 + val dump_lambda : bool ref [@@dead "+dump_lambda"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/cmi_format.ml", line 67, characters 0-369 + +output_cmi is never used + <-- line 67 + crc [@@dead "+output_cmi"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/cmi_format.mli", line 26, characters 0-63 + +output_cmi is never used + <-- line 26 + val output_cmi : string -> out_channel -> cmi_infos -> Digest.t [@@dead "+output_cmi"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/cmi_format.mli", line 31, characters 0-39 + +input_cmi is never used + <-- line 31 + val input_cmi : in_channel -> cmi_infos [@@dead "+input_cmi"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/cmt_format.mli", line 35, characters 2-43 + binary_annots.Packed is a variant case which is never constructed + <-- line 35 + | Packed of Types.signature * string list [@dead "binary_annots.Packed"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/cmt_format.mli", line 39, characters 2-42 + binary_annots.Partial_interface is a variant case which is never constructed + <-- line 39 + | Partial_interface of binary_part array [@dead "binary_annots.Partial_interface"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/cmt_format.mli", line 46, characters 2-30 + binary_part.Partial_class_expr is a variant case which is never constructed + <-- line 46 + | Partial_class_expr of unit [@dead "binary_part.Partial_class_expr"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/cmt_format.mli", line 56, characters 2-43 + cmt_infos.cmt_comments is a record label never used to read a value + <-- line 56 + cmt_comments: (string * Location.t) list; [@dead "cmt_infos.cmt_comments"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/cmt_format.mli", line 57, characters 2-25 + cmt_infos.cmt_args is a record label never used to read a value + <-- line 57 + cmt_args: string array; [@dead "cmt_infos.cmt_args"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/cmt_format.mli", line 58, characters 2-32 + cmt_infos.cmt_sourcefile is a record label never used to read a value + <-- line 58 + cmt_sourcefile: string option; [@dead "cmt_infos.cmt_sourcefile"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/cmt_format.mli", line 59, characters 2-23 + cmt_infos.cmt_builddir is a record label never used to read a value + <-- line 59 + cmt_builddir: string; [@dead "cmt_infos.cmt_builddir"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/cmt_format.mli", line 60, characters 2-28 + cmt_infos.cmt_loadpath is a record label never used to read a value + <-- line 60 + cmt_loadpath: string list; [@dead "cmt_infos.cmt_loadpath"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/cmt_format.mli", line 61, characters 2-35 + cmt_infos.cmt_source_digest is a record label never used to read a value + <-- line 61 + cmt_source_digest: string option; [@dead "cmt_infos.cmt_source_digest"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/cmt_format.mli", line 62, characters 2-25 + cmt_infos.cmt_initial_env is a record label never used to read a value + <-- line 62 + cmt_initial_env: Env.t; [@dead "cmt_infos.cmt_initial_env"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/cmt_format.mli", line 63, characters 2-47 + cmt_infos.cmt_imports is a record label never used to read a value + <-- line 63 + cmt_imports: (string * Digest.t option) list; [@dead "cmt_infos.cmt_imports"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/cmt_format.mli", line 64, characters 2-40 + cmt_infos.cmt_interface_digest is a record label never used to read a value + <-- line 64 + cmt_interface_digest: Digest.t option; [@dead "cmt_infos.cmt_interface_digest"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/cmt_format.mli", line 65, characters 2-26 + cmt_infos.cmt_use_summaries is a record label never used to read a value + <-- line 65 + cmt_use_summaries: bool; [@dead "cmt_infos.cmt_use_summaries"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/cmt_format.mli", line 69, characters 13-38 + error.Not_a_typedtree is a variant case which is never constructed + <-- line 69 + type error = Not_a_typedtree of string [@dead "error.Not_a_typedtree"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/cmt_format.mli", line 73, characters 0-67 + +read is never used + <-- line 73 + val read : string -> Cmi_format.cmi_infos option * cmt_infos option [@@dead "+read"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/cmt_format.mli", line 104, characters 0-44 + +read_magic_number is never used + <-- line 104 + val read_magic_number : in_channel -> string [@@dead "+read_magic_number"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/cmt_format.mli", line 115, characters 0-228 + +record_deprecated_used is never used + <-- line 115 + unit [@@dead "+record_deprecated_used"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/cmt_utils.ml", line 5, characters 2-26 + deprecated_used.deprecated_text is a record label never used to read a value + <-- line 5 + deprecated_text: string; [@dead "deprecated_used.deprecated_text"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/consistbl.ml", line 34, characters 0-221 + +check_noadd is never used + <-- line 34 + with Not_found -> raise (Not_available name) [@@dead "+check_noadd"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/consistbl.ml", line 42, characters 0-49 + +source is never used + <-- line 42 + let source tbl name = snd (Hashtbl.find tbl name) [@@dead "+source"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/consistbl.ml", line 54, characters 0-267 + +filter is never used + <-- line 54 + !to_remove [@@dead "+filter"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/consistbl.mli", line 32, characters 0-59 + +check_noadd is never used + <-- line 32 + val check_noadd : t -> string -> Digest.t -> string -> unit [@@dead "+check_noadd"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/consistbl.mli", line 41, characters 0-34 + +source is never used + <-- line 41 + val source : t -> string -> string [@@dead "+source"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/consistbl.mli", line 51, characters 0-42 + +filter is never used + <-- line 51 + val filter : (string -> bool) -> t -> unit [@@dead "+filter"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 131, characters 0-111 + +begin_class_def is never used + <-- line 131 + incr current_level [@@dead "+begin_class_def"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 134, characters 0-126 + +raise_nongen_level is never used + <-- line 134 + nongen_level := !current_level [@@dead "+raise_nongen_level"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 212, characters 0-176 + +ctype.Type_pairs is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 214, characters 2-56 + Type_pairs.+equal is never used + <-- line 214 + let equal (t1, t1') (t2, t2') = t1 == t2 && t1' == t2' [@@dead "Type_pairs.+equal"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 215, characters 2-40 + Type_pairs.+hash is never used + <-- line 215 + let hash (t, t') = t.id + (93 * t'.id) [@@dead "Type_pairs.+hash"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 278, characters 0-106 + +object_fields is never used + <-- line 278 + | _ -> assert false [@@dead "+object_fields"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 333, characters 0-293 + +close_object is never used + <-- line 333 + | _ -> assert false [@@dead "+close_object"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 347, characters 0-255 + +row_variable is never used + <-- line 347 + | _ -> assert false [@@dead "+row_variable"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 362, characters 0-162 + +set_object_name is never used + <-- line 362 + | _ -> assert false [@@dead "+set_object_name"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 367, characters 0-171 + +remove_object_name is never used + <-- line 367 + | _ -> fatal_error "Ctype.remove_object_name" [@@dead "+remove_object_name"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 375, characters 0-320 + +hide_private_methods is never used + <-- line 375 + | _ -> assert false [@@dead "+hide_private_methods"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 536, characters 2-54 + closed_class_failure.CC_Method is a variant case which is never constructed + <-- line 536 + | CC_Method of type_expr * bool * string * type_expr [@dead "closed_class_failure.CC_Method"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 537, characters 2-53 + closed_class_failure.CC_Value is a variant case which is never constructed + <-- line 537 + | CC_Value of type_expr * bool * string * type_expr [@dead "closed_class_failure.CC_Value"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 727, characters 0-64 + +generalize_global is never used + <-- line 727 + let generalize_global ty = generalize_structure !global_level ty [@@dead "+generalize_global"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 734, characters 0-1352 + +limited_generalize is never used + <-- line 734 + graph [@@dead "+limited_generalize"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 997, characters 0-154 + +generic_instance is never used + <-- line 997 + ty [@@dead "+generic_instance"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 1069, characters 0-219 + +instance_parameterized_type_2 is never used + <-- line 1069 + (ty_args, ty_lst, ty) [@@dead "+instance_parameterized_type_2"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 2829, characters 0-84 + +check_filter_method is never used + <-- line 2829 + ignore (filter_method env name priv ty) [@@dead "+check_filter_method"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 2832, characters 0-230 + +filter_self_method is never used + <-- line 2832 + pair [@@dead "+filter_self_method"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 3303, characters 2-20 + class_match_failure.CM_Virtual_class is a variant case which is never constructed + <-- line 3303 + | CM_Virtual_class [@dead "class_match_failure.CM_Virtual_class"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 3304, characters 2-44 + class_match_failure.CM_Parameter_arity_mismatch is a variant case which is never constructed + <-- line 3304 + | CM_Parameter_arity_mismatch of int * int [@dead "class_match_failure.CM_Parameter_arity_mismatch"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 3305, characters 2-70 + class_match_failure.CM_Type_parameter_mismatch is a variant case which is never constructed + <-- line 3305 + | CM_Type_parameter_mismatch of Env.t * (type_expr * type_expr) list [@dead "class_match_failure.CM_Type_parameter_mismatch"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 3306, characters 2-65 + class_match_failure.CM_Parameter_mismatch is a variant case which is never constructed + <-- line 3306 + | CM_Parameter_mismatch of Env.t * (type_expr * type_expr) list [@dead "class_match_failure.CM_Parameter_mismatch"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 3307, characters 2-73 + class_match_failure.CM_Val_type_mismatch is a variant case which is never constructed + <-- line 3307 + | CM_Val_type_mismatch of string * Env.t * (type_expr * type_expr) list [@dead "class_match_failure.CM_Val_type_mismatch"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 3308, characters 2-74 + class_match_failure.CM_Meth_type_mismatch is a variant case which is never constructed + <-- line 3308 + | CM_Meth_type_mismatch of string * Env.t * (type_expr * type_expr) list [@dead "class_match_failure.CM_Meth_type_mismatch"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 3309, characters 2-34 + class_match_failure.CM_Non_mutable_value is a variant case which is never constructed + <-- line 3309 + | CM_Non_mutable_value of string [@dead "class_match_failure.CM_Non_mutable_value"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 3310, characters 2-35 + class_match_failure.CM_Non_concrete_value is a variant case which is never constructed + <-- line 3310 + | CM_Non_concrete_value of string [@dead "class_match_failure.CM_Non_concrete_value"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 3311, characters 2-30 + class_match_failure.CM_Missing_value is a variant case which is never constructed + <-- line 3311 + | CM_Missing_value of string [@dead "class_match_failure.CM_Missing_value"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 3312, characters 2-31 + class_match_failure.CM_Missing_method is a variant case which is never constructed + <-- line 3312 + | CM_Missing_method of string [@dead "class_match_failure.CM_Missing_method"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 3313, characters 2-28 + class_match_failure.CM_Hide_public is a variant case which is never constructed + <-- line 3313 + | CM_Hide_public of string [@dead "class_match_failure.CM_Hide_public"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 3314, characters 2-38 + class_match_failure.CM_Hide_virtual is a variant case which is never constructed + <-- line 3314 + | CM_Hide_virtual of string * string [@dead "class_match_failure.CM_Hide_virtual"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 3315, characters 2-30 + class_match_failure.CM_Public_method is a variant case which is never constructed + <-- line 3315 + | CM_Public_method of string [@dead "class_match_failure.CM_Public_method"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 3316, characters 2-31 + class_match_failure.CM_Private_method is a variant case which is never constructed + <-- line 3316 + | CM_Private_method of string [@dead "class_match_failure.CM_Private_method"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 3317, characters 2-31 + class_match_failure.CM_Virtual_method is a variant case which is never constructed + <-- line 3317 + | CM_Virtual_method of string [@dead "class_match_failure.CM_Virtual_method"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 4063, characters 0-100 + +arity is never used + <-- line 4063 + | _ -> 0 [@@dead "+arity"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 4376, characters 0-599 + +collapse_conj is never used + <-- line 4376 + | _ -> iter_type_expr (collapse_conj env visited) ty [@@dead "+collapse_conj"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 4395, characters 0-77 + +collapse_conj_params is never used + <-- line 4395 + let collapse_conj_params env params = List.iter (collapse_conj env []) params [@@dead "+collapse_conj_params"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.mli", line 70, characters 0-34 + +begin_class_def is never used + <-- line 70 + val begin_class_def : unit -> unit [@@dead "+begin_class_def"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.mli", line 71, characters 0-37 + +raise_nongen_level is never used + <-- line 71 + val raise_nongen_level : unit -> unit [@@dead "+raise_nongen_level"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.mli", line 105, characters 0-42 + +object_fields is never used + <-- line 105 + val object_fields : type_expr -> type_expr [@@dead "+object_fields"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.mli", line 118, characters 0-36 + +close_object is never used + <-- line 118 + val close_object : type_expr -> unit [@@dead "+close_object"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.mli", line 119, characters 0-41 + +row_variable is never used + <-- line 119 + val row_variable : type_expr -> type_expr [@@dead "+row_variable"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.mli", line 122, characters 0-83 + +set_object_name is never used + <-- line 122 + Ident.t -> type_expr -> type_expr list -> type_expr -> unit [@@dead "+set_object_name"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.mli", line 124, characters 0-42 + +remove_object_name is never used + <-- line 124 + val remove_object_name : type_expr -> unit [@@dead "+remove_object_name"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.mli", line 125, characters 0-44 + +hide_private_methods is never used + <-- line 125 + val hide_private_methods : type_expr -> unit [@@dead "+hide_private_methods"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.mli", line 126, characters 0-74 + +find_cltype_for_path is never used + <-- line 126 + val find_cltype_for_path : Env.t -> Path.t -> type_declaration * type_expr [@@dead "+find_cltype_for_path"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.mli", line 129, characters 0-74 + +sort_row_fields is never used + <-- line 129 + val sort_row_fields : (label * row_field) list -> (label * row_field) list [@@dead "+sort_row_fields"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.mli", line 146, characters 0-41 + +generalize_global is never used + <-- line 146 + val generalize_global : type_expr -> unit [@@dead "+generalize_global"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.mli", line 156, characters 0-55 + +limited_generalize is never used + <-- line 156 + val limited_generalize : type_expr -> type_expr -> unit [@@dead "+limited_generalize"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.mli", line 169, characters 0-54 + +generic_instance is never used + <-- line 169 + val generic_instance : Env.t -> type_expr -> type_expr [@@dead "+generic_instance"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.mli", line 183, characters 0-136 + +instance_parameterized_type_2 is never used + <-- line 183 + type_expr list * type_expr list * type_expr [@@dead "+instance_parameterized_type_2"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.mli", line 214, characters 0-49 + +full_expand is never used + <-- line 214 + val full_expand : Env.t -> type_expr -> type_expr [@@dead "+full_expand"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.mli", line 245, characters 0-78 + +check_filter_method is never used + <-- line 245 + val check_filter_method : Env.t -> string -> private_flag -> type_expr -> unit [@@dead "+check_filter_method"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.mli", line 250, characters 0-141 + +filter_self_method is never used + <-- line 250 + Ident.t * type_expr [@@dead "+filter_self_method"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.mli", line 260, characters 0-42 + +rigidify is never used + <-- line 260 + val rigidify : type_expr -> type_expr list [@@dead "+rigidify"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.mli", line 263, characters 0-55 + +all_distinct_vars is never used + <-- line 263 + val all_distinct_vars : Env.t -> type_expr list -> bool [@@dead "+all_distinct_vars"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.mli", line 271, characters 2-20 + class_match_failure.CM_Virtual_class is a variant case which is never constructed + <-- line 271 + | CM_Virtual_class [@dead "class_match_failure.CM_Virtual_class"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.mli", line 272, characters 2-44 + class_match_failure.CM_Parameter_arity_mismatch is a variant case which is never constructed + <-- line 272 + | CM_Parameter_arity_mismatch of int * int [@dead "class_match_failure.CM_Parameter_arity_mismatch"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.mli", line 273, characters 2-70 + class_match_failure.CM_Type_parameter_mismatch is a variant case which is never constructed + <-- line 273 + | CM_Type_parameter_mismatch of Env.t * (type_expr * type_expr) list [@dead "class_match_failure.CM_Type_parameter_mismatch"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.mli", line 274, characters 2-65 + class_match_failure.CM_Parameter_mismatch is a variant case which is never constructed + <-- line 274 + | CM_Parameter_mismatch of Env.t * (type_expr * type_expr) list [@dead "class_match_failure.CM_Parameter_mismatch"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.mli", line 275, characters 2-73 + class_match_failure.CM_Val_type_mismatch is a variant case which is never constructed + <-- line 275 + | CM_Val_type_mismatch of string * Env.t * (type_expr * type_expr) list [@dead "class_match_failure.CM_Val_type_mismatch"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.mli", line 276, characters 2-74 + class_match_failure.CM_Meth_type_mismatch is a variant case which is never constructed + <-- line 276 + | CM_Meth_type_mismatch of string * Env.t * (type_expr * type_expr) list [@dead "class_match_failure.CM_Meth_type_mismatch"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.mli", line 277, characters 2-34 + class_match_failure.CM_Non_mutable_value is a variant case which is never constructed + <-- line 277 + | CM_Non_mutable_value of string [@dead "class_match_failure.CM_Non_mutable_value"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.mli", line 278, characters 2-35 + class_match_failure.CM_Non_concrete_value is a variant case which is never constructed + <-- line 278 + | CM_Non_concrete_value of string [@dead "class_match_failure.CM_Non_concrete_value"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.mli", line 279, characters 2-30 + class_match_failure.CM_Missing_value is a variant case which is never constructed + <-- line 279 + | CM_Missing_value of string [@dead "class_match_failure.CM_Missing_value"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.mli", line 280, characters 2-31 + class_match_failure.CM_Missing_method is a variant case which is never constructed + <-- line 280 + | CM_Missing_method of string [@dead "class_match_failure.CM_Missing_method"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.mli", line 281, characters 2-28 + class_match_failure.CM_Hide_public is a variant case which is never constructed + <-- line 281 + | CM_Hide_public of string [@dead "class_match_failure.CM_Hide_public"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.mli", line 282, characters 2-38 + class_match_failure.CM_Hide_virtual is a variant case which is never constructed + <-- line 282 + | CM_Hide_virtual of string * string [@dead "class_match_failure.CM_Hide_virtual"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.mli", line 283, characters 2-30 + class_match_failure.CM_Public_method is a variant case which is never constructed + <-- line 283 + | CM_Public_method of string [@dead "class_match_failure.CM_Public_method"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.mli", line 284, characters 2-31 + class_match_failure.CM_Private_method is a variant case which is never constructed + <-- line 284 + | CM_Private_method of string [@dead "class_match_failure.CM_Private_method"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.mli", line 285, characters 2-31 + class_match_failure.CM_Virtual_method is a variant case which is never constructed + <-- line 285 + | CM_Virtual_method of string [@dead "class_match_failure.CM_Virtual_method"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.mli", line 315, characters 0-44 + +is_contractive is never used + <-- line 315 + val is_contractive : Env.t -> Path.t -> bool [@@dead "+is_contractive"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.mli", line 328, characters 2-54 + closed_class_failure.CC_Method is a variant case which is never constructed + <-- line 328 + | CC_Method of type_expr * bool * string * type_expr [@dead "closed_class_failure.CC_Method"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.mli", line 329, characters 2-53 + closed_class_failure.CC_Value is a variant case which is never constructed + <-- line 329 + | CC_Value of type_expr * bool * string * type_expr [@dead "closed_class_failure.CC_Value"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.mli", line 332, characters 0-28 + +arity is never used + <-- line 332 + val arity : type_expr -> int [@@dead "+arity"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.mli", line 335, characters 0-58 + +collapse_conj_params is never used + <-- line 335 + val collapse_conj_params : Env.t -> type_expr list -> unit [@@dead "+collapse_conj_params"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/datarepr.ml", line 261, characters 0-420 + +find_constr is never used + <-- line 261 + else find_constr tag num_const (num_nonconst + 1) rem [@@dead "+find_constr"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/datarepr.ml", line 271, characters 0-66 + +find_constr_by_tag is never used + <-- line 271 + let find_constr_by_tag tag cstrlist = find_constr tag 0 0 cstrlist [@@dead "+find_constr_by_tag"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/datarepr.mli", line 32, characters 0-101 + +find_constr_by_tag is never used + <-- line 32 + constructor_tag -> constructor_declaration list -> constructor_declaration [@@dead "+find_constr_by_tag"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/datarepr.mli", line 35, characters 0-109 + +constructor_existentials is never used + <-- line 35 + constructor_arguments -> type_expr option -> type_expr list * type_expr list [@@dead "+constructor_existentials"] + + Warning Dead Value With Side Effects + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/depend.ml", line 21, characters 0-20 + +pp_deps is never used and could have side effects + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/depend.ml", line 23, characters 0-83 + +depend.String_set is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/depend.ml", line 25, characters 2-23 + String_set.+compare is never used + <-- line 25 + let compare = compare [@@dead "String_set.+compare"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/depend.ml", line 39, characters 0-103 + +weaken_map is never used + <-- line 39 + Node (String_set.union s s0, String_map.map (weaken_map s) m0) [@@dead "+weaken_map"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/depend.ml", line 526, characters 0-70 + +add_implementation_binding is never used + <-- line 526 + and add_implementation_binding bv l = snd (add_structure_binding bv l) [@@dead "+add_implementation_binding"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/depend.mli", line 23, characters 0-34 + +make_leaf is never used + <-- line 23 + val make_leaf : string -> map_tree [@@dead "+make_leaf"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/depend.mli", line 24, characters 0-37 + +make_node is never used + <-- line 24 + val make_node : bound_map -> map_tree [@@dead "+make_node"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/depend.mli", line 25, characters 0-53 + +weaken_map is never used + <-- line 25 + val weaken_map : String_set.t -> map_tree -> map_tree [@@dead "+weaken_map"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/depend.mli", line 30, characters 0-29 + +pp_deps is never used + <-- line 30 + val pp_deps : string list ref [@@dead "+pp_deps"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/depend.mli", line 38, characters 0-78 + +add_implementation_binding is never used + <-- line 38 + val add_implementation_binding : bound_map -> Parsetree.structure -> bound_map [@@dead "+add_implementation_binding"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/depend.mli", line 39, characters 0-73 + +add_signature_binding is never used + <-- line 39 + val add_signature_binding : bound_map -> Parsetree.signature -> bound_map [@@dead "+add_signature_binding"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 230, characters 2-188 + Tycomp_tbl.+local_keys is never used + <-- line 230 + | None -> acc [@@dead "Tycomp_tbl.+local_keys"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 236, characters 2-257 + Tycomp_tbl.+diff_keys is never used + <-- line 236 + with Not_found -> true) [@@dead "Tycomp_tbl.+diff_keys"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 360, characters 2-188 + Id_tbl.+local_keys is never used + <-- line 360 + | None -> acc [@@dead "Id_tbl.+local_keys"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 377, characters 2-200 + Id_tbl.+diff_keys is never used + <-- line 377 + with Not_found -> true) [@@dead "Id_tbl.+diff_keys"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 509, characters 0-75 + +is_ident is never used + <-- line 509 + | Pdot _ | Papply _ -> false [@@dead "+is_ident"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 513, characters 0-90 + +is_local_ext is never used + <-- line 513 + | _ -> false [@@dead "+is_local_ext"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 517, characters 0-174 + +diff is never used + <-- line 517 + @ Id_tbl.diff_keys env1.modules env2.modules [@@dead "+diff"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 604, characters 2-28 + pers_struct.ps_flags is a record label never used to read a value + <-- line 604 + ps_flags: pers_flags list; [@dead "pers_struct.ps_flags"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 615, characters 0-90 + +env.String_set is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 617, characters 2-30 + String_set.+compare is never used + <-- line 617 + let compare = String.compare [@@dead "String_set.+compare"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 762, characters 0-434 + +reset_cache_toplevel is never used + <-- line 762 + Hashtbl.clear prefixed_sg [@@dead "+reset_cache_toplevel"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 1260, characters 0-193 + +lookup_label is never used + <-- line 1260 + desc [@@dead "+lookup_label"] + + Warning Dead Value With Side Effects + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 1810, characters 0-57 + +enter_extension is never used and could have side effects + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 1922, characters 0-199 + +crc_of_unit is never used + <-- line 1922 + | Some crc -> crc [@@dead "+crc_of_unit"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 2072, characters 0-139 + +summary is never used + <-- line 2072 + else Env_constraints (env.summary, env.local_constraints) [@@dead "+summary"] + + Warning Dead Value With Side Effects + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 2076, characters 0-24 + +last_env is never used and could have side effects + + Warning Dead Value With Side Effects + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 2077, characters 0-32 + +last_reduced_env is never used and could have side effects + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 2079, characters 0-314 + +keep_only_summary is never used + <-- line 2079 + new_env [@@dead "+keep_only_summary"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 2094, characters 0-187 + +env_of_only_summary is never used + <-- line 2094 + {new_env with local_constraints = env.local_constraints; flags = env.flags} [@@dead "+env_of_only_summary"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 40, characters 0-33 + +diff is never used + <-- line 40 + val diff : t -> t -> Ident.t list [@@dead "+diff"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 74, characters 0-39 + +add_functor_arg is never used + <-- line 74 + val add_functor_arg : Ident.t -> t -> t [@@dead "+add_functor_arg"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 104, characters 0-75 + +lookup_label is never used + <-- line 104 + val lookup_label : ?loc:Location.t -> Longident.t -> t -> label_description [@@dead "+lookup_label"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 167, characters 0-73 + +enter_extension is never used + <-- line 167 + val enter_extension : string -> extension_constructor -> t -> Ident.t * t [@@dead "+enter_extension"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 177, characters 0-39 + +reset_cache_toplevel is never used + <-- line 177 + val reset_cache_toplevel : unit -> unit [@@dead "+reset_cache_toplevel"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 197, characters 0-186 + +save_signature_with_imports is never used + <-- line 197 + Cmi_format.cmi_infos [@@dead "+save_signature_with_imports"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 210, characters 0-36 + +crc_of_unit is never used + <-- line 210 + val crc_of_unit : string -> Digest.t [@@dead "+crc_of_unit"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 214, characters 0-53 + +imports is never used + <-- line 214 + val imports : unit -> (string * Digest.t option) list [@@dead "+imports"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 218, characters 0-27 + +crc_units is never used + <-- line 218 + val crc_units : Consistbl.t [@@dead "+crc_units"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 219, characters 0-31 + +add_import is never used + <-- line 219 + val add_import : string -> unit [@@dead "+add_import"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 224, characters 0-26 + +summary is never used + <-- line 224 + val summary : t -> summary [@@dead "+summary"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 230, characters 0-30 + +keep_only_summary is never used + <-- line 230 + val keep_only_summary : t -> t [@@dead "+keep_only_summary"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 231, characters 0-61 + +env_of_only_summary is never used + <-- line 231 + val env_of_only_summary : (summary -> Subst.t -> t) -> t -> t [@@dead "+env_of_only_summary"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 245, characters 0-45 + +report_error is never used + <-- line 245 + val report_error : formatter -> error -> unit [@@dead "+report_error"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 321, characters 4-21 + t.filename is a record label never used to read a value + <-- line 321 + filename: string; [@dead "t.filename"] (** Name of the file containing the signature. *) + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 322, characters 4-30 + t.cmi is a record label never used to read a value + <-- line 322 + cmi: Cmi_format.cmi_infos; [@dead "t.cmi"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/error_message_utils.ml", line 20, characters 2-90 + Parser.+parse_expr_at_loc is never used + <-- line 20 + Warnings.loc -> (Parsetree.expression * comment list) option [@@dead "Parser.+parse_expr_at_loc"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/error_message_utils.ml", line 843, characters 0-347 + +type_clash_context_maybe_option is never used + <-- line 843 + | _ -> None [@@dead "+type_clash_context_maybe_option"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/experimental_features.ml", line 12, characters 0-85 + +experimental_features.Feature_set is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/experimental_features.ml", line 14, characters 2-23 + Feature_set.+compare is never used + <-- line 14 + let compare = compare [@@dead "Feature_set.+compare"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/experimental_features.ml", line 23, characters 0-52 + +reset is never used + <-- line 23 + let reset () = enabled_features := Feature_set.empty [@@dead "+reset"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/experimental_features.mli", line 6, characters 0-24 + +reset is never used + <-- line 6 + val reset : unit -> unit [@@dead "+reset"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/includemod.ml", line 146, characters 0-151 + +print_list is never used + <-- line 146 + print_list pr ppf l [@@dead "+print_list"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/includemod.ml", line 153, characters 0-73 + +print_list is never used + <-- line 153 + let print_list pr ppf l = Format.fprintf ppf "[@[%a@]]" (print_list pr) l [@@dead "+print_list"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/includemod.ml", line 155, characters 0-614 + +print_coercion is never used + <-- line 155 + pr "@[<2>alias %a@ (%a)@]" Printtyp.path p print_coercion c [@@dead "+print_coercion"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/includemod.ml", line 173, characters 0-86 + +print_coercion2 is never used + <-- line 173 + Format.fprintf ppf "@[%d,@ %a@]" n print_coercion c [@@dead "+print_coercion2"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/includemod.ml", line 176, characters 0-115 + +print_coercion3 is never used + <-- line 176 + Format.fprintf ppf "@[%s, %d,@ %a@]" (Ident.unique_name i) n print_coercion c [@@dead "+print_coercion3"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/includemod.mli", line 38, characters 0-57 + +print_coercion is never used + <-- line 38 + val print_coercion : formatter -> module_coercion -> unit [@@dead "+print_coercion"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/lambda.ml", line 59, characters 0-342 + +mutable_flag_of_tag_info is never used + <-- line 59 + Immutable [@@dead "+mutable_flag_of_tag_info"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/lambda.ml", line 342, characters 43-53 + let_kind.Variable is a variant case which is never constructed + <-- line 342 + type let_kind = Strict | Alias | StrictOpt | Variable [@dead "let_kind.Variable"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/lambda.mli", line 63, characters 0-55 + +mutable_flag_of_tag_info is never used + <-- line 63 + val mutable_flag_of_tag_info : tag_info -> mutable_flag [@@dead "+mutable_flag_of_tag_info"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/lambda.mli", line 299, characters 43-53 + let_kind.Variable is a variant case which is never constructed + <-- line 299 + type let_kind = Strict | Alias | StrictOpt | Variable [@dead "let_kind.Variable"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/lambda.mli", line 387, characters 0-36 + +const_unit is never used + <-- line 387 + val const_unit : structured_constant [@@dead "+const_unit"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/lambda.mli", line 393, characters 0-45 + +iter is never used + <-- line 393 + val iter : (lambda -> unit) -> lambda -> unit [@@dead "+iter"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/location.mli", line 47, characters 0-64 + +warning_printer is never used + <-- line 47 + val warning_printer : (t -> formatter -> Warnings.t -> unit) ref [@@dead "+warning_printer"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/location.mli", line 50, characters 0-42 + +formatter_for_warnings is never used + <-- line 50 + val formatter_for_warnings : formatter ref [@@dead "+formatter_for_warnings"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/location.mli", line 52, characters 0-66 + +default_warning_printer is never used + <-- line 52 + val default_warning_printer : t -> formatter -> Warnings.t -> unit [@@dead "+default_warning_printer"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/location.mli", line 113, characters 0-118 + +error_reporter is never used + <-- line 113 + ref [@@dead "+error_reporter"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/location.mli", line 122, characters 0-118 + +default_error_reporter is never used + <-- line 122 + unit [@@dead "+default_error_reporter"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/longident.mli", line 22, characters 0-39 + +unflatten is never used + <-- line 22 + val unflatten : string list -> t option [@@dead "+unflatten"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 442, characters 0-143 + +matching.Store_exp is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 445, characters 2-27 + Store_exp.+compare_key is never used + <-- line 445 + let compare_key = compare [@@dead "Store_exp.+compare_key"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 446, characters 2-32 + Store_exp.+make_key is never used + <-- line 446 + let make_key = Lambda.make_key [@@dead "Store_exp.+make_key"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 452, characters 0-158 + +make_catch is never used + <-- line 452 + Lstaticcatch (k (make_exit e), (e, []), d) [@@dead "+make_catch"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 1532, characters 0-30 + +strings_test_threshold is never used + <-- line 1532 + let strings_test_threshold = 8 [@@dead "+strings_test_threshold"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 1534, characters 0-152 + +bind_sw is never used + <-- line 1534 + Llet (Strict, Pgenval, id, arg, k (Lvar id)) [@@dead "+bind_sw"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 1543, characters 0-429 + +make_string_test_sequence is never used + <-- line 1543 + sw d) [@@dead "+make_string_test_sequence"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 1561, characters 0-184 + +split is never used + <-- line 1561 + (x0 :: xs, y0, ys) [@@dead "+split"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 1570, characters 0-48 + +zero_lam is never used + <-- line 1570 + let zero_lam = Lconst (Const_base (Const_int 0)) [@@dead "+zero_lam"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 1572, characters 0-183 + +tree_way_test is never used + <-- line 1572 + Lifthenelse (Lprim (Pintcomp Clt, [zero_lam; arg], loc), gt, eq) ) [@@dead "+tree_way_test"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 1580, characters 0-479 + +do_make_string_test_tree is never used + <-- line 1580 + (do_make_string_test_tree loc arg gt delta d)) [@@dead "+do_make_string_test_tree"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 1595, characters 0-255 + +expand_stringswitch is never used + <-- line 1595 + make_catch e (fun d -> do_make_string_test_tree loc arg sw 1 (Some d))) [@@dead "+expand_stringswitch"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 1709, characters 0-1398 + +matching.S_arg is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 1712, characters 2-26 + S_arg.+eqint is never used + <-- line 1712 + let eqint = Pintcomp Ceq [@@dead "S_arg.+eqint"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 1713, characters 2-27 + S_arg.+neint is never used + <-- line 1713 + let neint = Pintcomp Cneq [@@dead "S_arg.+neint"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 1714, characters 2-26 + S_arg.+leint is never used + <-- line 1714 + let leint = Pintcomp Cle [@@dead "S_arg.+leint"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 1715, characters 2-26 + S_arg.+ltint is never used + <-- line 1715 + let ltint = Pintcomp Clt [@@dead "S_arg.+ltint"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 1716, characters 2-26 + S_arg.+geint is never used + <-- line 1716 + let geint = Pintcomp Cge [@@dead "S_arg.+geint"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 1717, characters 2-26 + S_arg.+gtint is never used + <-- line 1717 + let gtint = Pintcomp Cgt [@@dead "S_arg.+gtint"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 1721, characters 2-55 + S_arg.+make_prim is never used + <-- line 1721 + let make_prim p args = Lprim (p, args, Location.none) [@@dead "S_arg.+make_prim"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 1722, characters 2-111 + S_arg.+make_offset is never used + <-- line 1722 + | _ -> Lprim (Poffsetint n, [arg], Location.none) [@@dead "S_arg.+make_offset"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 1727, characters 2-232 + S_arg.+bind is never used + <-- line 1727 + bind Alias newvar arg (body newarg) [@@dead "S_arg.+bind"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 1736, characters 2-54 + S_arg.+make_const is never used + <-- line 1736 + let make_const i = Lconst (Const_base (Const_int i)) [@@dead "S_arg.+make_const"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 1737, characters 2-64 + S_arg.+make_isout is never used + <-- line 1737 + let make_isout h arg = Lprim (Pisout, [h; arg], Location.none) [@@dead "S_arg.+make_isout"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 1738, characters 2-71 + S_arg.+make_isin is never used + <-- line 1738 + let make_isin h arg = Lprim (Pnot, [make_isout h arg], Location.none) [@@dead "S_arg.+make_isin"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 1739, characters 2-63 + S_arg.+make_if is never used + <-- line 1739 + let make_if cond ifso ifnot = Lifthenelse (cond, ifso, ifnot) [@@dead "S_arg.+make_if"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 1740, characters 2-419 + S_arg.+make_switch is never used + <-- line 1740 + loc ) [@@dead "S_arg.+make_switch"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 1756, characters 2-37 + S_arg.+make_catch is never used + <-- line 1756 + let make_catch = make_catch_delayed [@@dead "S_arg.+make_catch"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 1757, characters 2-27 + S_arg.+make_exit is never used + <-- line 1757 + let make_exit = make_exit [@@dead "S_arg.+make_exit"] + + Warning Dead Value With Side Effects + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 2680, characters 0-63 + +check_partial_list is never used and could have side effects + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 2817, characters 0-577 + +for_tupled_function is never used + <-- line 2817 + with Unused -> partial_function loc () [@@dead "+for_tupled_function"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.mli", line 59, characters 0-115 + +for_tupled_function is never used + <-- line 59 + lambda [@@dead "+for_tupled_function"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.mli", line 68, characters 0-52 + +flatten_pattern is never used + <-- line 68 + val flatten_pattern : int -> pattern -> pattern list [@@dead "+flatten_pattern"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.mli", line 71, characters 0-101 + +expand_stringswitch is never used + <-- line 71 + Location.t -> lambda -> (string * lambda) list -> lambda option -> lambda [@@dead "+expand_stringswitch"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/mtype.ml", line 235, characters 0-248 + +no_code_needed is never used + <-- line 235 + | Mty_alias (Mta_present, _) -> false [@@dead "+no_code_needed"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/mtype.ml", line 243, characters 0-505 + +no_code_needed_sig is never used + <-- line 243 + | (Sig_typext _ | Sig_class _) :: _ -> false [@@dead "+no_code_needed_sig"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/mtype.mli", line 40, characters 0-49 + +no_code_needed is never used + <-- line 40 + val no_code_needed : Env.t -> module_type -> bool [@@dead "+no_code_needed"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/mtype.mli", line 41, characters 0-51 + +no_code_needed_sig is never used + <-- line 41 + val no_code_needed_sig : Env.t -> signature -> bool [@@dead "+no_code_needed_sig"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/oprint.mli", line 24, characters 0-62 + +out_class_type is never used + <-- line 24 + val out_class_type : (formatter -> out_class_type -> unit) ref [@@dead "+out_class_type"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/outcometree.ml", line 30, characters 18-29 + out_string.Ostr_string is a variant case which is never constructed + <-- line 30 + type out_string = Ostr_string [@dead "out_string.Ostr_string"] | Ostr_bytes + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/outcometree.ml", line 30, characters 30-42 + out_string.Ostr_bytes is a variant case which is never constructed + <-- line 30 + type out_string = Ostr_string [@dead "out_string.Ostr_string"] | Ostr_bytes [@dead "out_string.Ostr_bytes"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/outcometree.ml", line 35, characters 2-32 + out_value.Oval_array is a variant case which is never constructed + <-- line 35 + | Oval_array of out_value list [@dead "out_value.Oval_array"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/outcometree.ml", line 36, characters 2-21 + out_value.Oval_char is a variant case which is never constructed + <-- line 36 + | Oval_char of char [@dead "out_value.Oval_char"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/outcometree.ml", line 37, characters 2-45 + out_value.Oval_constr is a variant case which is never constructed + <-- line 37 + | Oval_constr of out_ident * out_value list [@dead "out_value.Oval_constr"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/outcometree.ml", line 38, characters 2-17 + out_value.Oval_ellipsis is a variant case which is never constructed + <-- line 38 + | Oval_ellipsis [@dead "out_value.Oval_ellipsis"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/outcometree.ml", line 39, characters 2-23 + out_value.Oval_float is a variant case which is never constructed + <-- line 39 + | Oval_float of float [@dead "out_value.Oval_float"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/outcometree.ml", line 40, characters 2-19 + out_value.Oval_int is a variant case which is never constructed + <-- line 40 + | Oval_int of int [@dead "out_value.Oval_int"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/outcometree.ml", line 41, characters 2-23 + out_value.Oval_int32 is a variant case which is never constructed + <-- line 41 + | Oval_int32 of int32 [@dead "out_value.Oval_int32"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/outcometree.ml", line 42, characters 2-23 + out_value.Oval_int64 is a variant case which is never constructed + <-- line 42 + | Oval_int64 of int64 [@dead "out_value.Oval_int64"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/outcometree.ml", line 43, characters 2-31 + out_value.Oval_nativeint is a variant case which is never constructed + <-- line 43 + | Oval_nativeint of nativeint [@dead "out_value.Oval_nativeint"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/outcometree.ml", line 44, characters 2-31 + out_value.Oval_list is a variant case which is never constructed + <-- line 44 + | Oval_list of out_value list [@dead "out_value.Oval_list"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/outcometree.ml", line 45, characters 2-46 + out_value.Oval_printer is a variant case which is never constructed + <-- line 45 + | Oval_printer of (Format.formatter -> unit) [@dead "out_value.Oval_printer"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/outcometree.ml", line 46, characters 2-47 + out_value.Oval_record is a variant case which is never constructed + <-- line 46 + | Oval_record of (out_ident * out_value) list [@dead "out_value.Oval_record"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/outcometree.ml", line 47, characters 2-44 + out_value.Oval_string is a variant case which is never constructed + <-- line 47 + | Oval_string of string * int * out_string [@dead "out_value.Oval_string"] (* string, size-to-print, kind *) + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/outcometree.ml", line 48, characters 2-24 + out_value.Oval_stuff is a variant case which is never constructed + <-- line 48 + | Oval_stuff of string [@dead "out_value.Oval_stuff"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/outcometree.ml", line 49, characters 2-32 + out_value.Oval_tuple is a variant case which is never constructed + <-- line 49 + | Oval_tuple of out_value list [@dead "out_value.Oval_tuple"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/outcometree.ml", line 50, characters 2-45 + out_value.Oval_variant is a variant case which is never constructed + <-- line 50 + | Oval_variant of string * out_value option [@dead "out_value.Oval_variant"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/outcometree.ml", line 69, characters 2-46 + out_type.Otyp_attribute is a variant case which is never constructed + <-- line 69 + | Otyp_attribute of out_type * out_attribute [@dead "out_type.Otyp_attribute"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/outcometree.ml", line 76, characters 2-44 + out_class_type.Octy_constr is a variant case which is never constructed + <-- line 76 + | Octy_constr of out_ident * out_type list [@dead "out_class_type.Octy_constr"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/outcometree.ml", line 77, characters 2-52 + out_class_type.Octy_arrow is a variant case which is never constructed + <-- line 77 + | Octy_arrow of string * out_type * out_class_type [@dead "out_class_type.Octy_arrow"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/outcometree.ml", line 78, characters 2-63 + out_class_type.Octy_signature is a variant case which is never constructed + <-- line 78 + | Octy_signature of out_type option * out_class_sig_item list [@dead "out_class_type.Octy_signature"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/outcometree.ml", line 80, characters 2-42 + out_class_sig_item.Ocsg_constraint is a variant case which is never constructed + <-- line 80 + | Ocsg_constraint of out_type * out_type [@dead "out_class_sig_item.Ocsg_constraint"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/outcometree.ml", line 81, characters 2-50 + out_class_sig_item.Ocsg_method is a variant case which is never constructed + <-- line 81 + | Ocsg_method of string * bool * bool * out_type [@dead "out_class_sig_item.Ocsg_method"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/outcometree.ml", line 82, characters 2-49 + out_class_sig_item.Ocsg_value is a variant case which is never constructed + <-- line 82 + | Ocsg_value of string * bool * bool * out_type [@dead "out_class_sig_item.Ocsg_value"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/outcometree.ml", line 91, characters 2-127 + out_sig_item.Osig_class is a variant case which is never constructed + <-- line 91 + * out_rec_status [@dead "out_sig_item.Osig_class"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/outcometree.ml", line 97, characters 2-132 + out_sig_item.Osig_class_type is a variant case which is never constructed + <-- line 97 + * out_rec_status [@dead "out_sig_item.Osig_class_type"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/outcometree.ml", line 144, characters 2-37 + out_phrase.Ophr_eval is a variant case which is never constructed + <-- line 144 + | Ophr_eval of out_value * out_type [@dead "out_phrase.Ophr_eval"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/outcometree.ml", line 145, characters 2-60 + out_phrase.Ophr_signature is a variant case which is never constructed + <-- line 145 + | Ophr_signature of (out_sig_item * out_value option) list [@dead "out_phrase.Ophr_signature"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/outcometree.ml", line 146, characters 2-39 + out_phrase.Ophr_exception is a variant case which is never constructed + <-- line 146 + | Ophr_exception of (exn * out_value) [@dead "out_phrase.Ophr_exception"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/parmatch.ml", line 902, characters 0-147 + +parmatch.Constructor_tag_hashtbl is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/parmatch.ml", line 904, characters 2-25 + Constructor_tag_hashtbl.+hash is never used + <-- line 904 + let hash = Hashtbl.hash [@@dead "Constructor_tag_hashtbl.+hash"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/parmatch.ml", line 905, characters 2-29 + Constructor_tag_hashtbl.+equal is never used + <-- line 905 + let equal = Types.equal_tag [@@dead "Constructor_tag_hashtbl.+equal"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/parmatch.ml", line 2541, characters 4-193 + +enter_expression is never used + <-- line 2541 + | _ -> () [@@dead "+enter_expression"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/parmatch.ml", line 2549, characters 4-103 + +is_unpack is never used + <-- line 2549 + List.exists (fun (attr, _) -> attr.txt = "#modulepat") exp.exp_attributes [@@dead "+is_unpack"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/parmatch.ml", line 2552, characters 4-493 + +leave_expression is never used + <-- line 2552 + | _ -> assert false [@@dead "+leave_expression"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/parsetree0.ml", line 98, characters 2-22 + core_type_desc.Ptyp_class is a variant case which is never constructed + <-- line 98 + | Ptyp_class of unit [@dead "core_type_desc.Ptyp_class"] (* dummy AST node *) + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/parsetree0.ml", line 302, characters 2-23 + expression_desc.Pexp_object is a variant case which is never constructed + <-- line 302 + | Pexp_object of unit [@dead "expression_desc.Pexp_object"] (* dummy AST node *) + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/parsetree0.ml", line 314, characters 2-20 + expression_desc.Pexp_unreachable is a variant case which is never constructed + <-- line 314 + | Pexp_unreachable [@dead "expression_desc.Pexp_unreachable"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/parsetree0.ml", line 474, characters 2-22 + signature_item_desc.Psig_class is a variant case which is never constructed + <-- line 474 + | Psig_class of unit [@dead "signature_item_desc.Psig_class"] (* Dummy AST node *) + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/parsetree0.ml", line 475, characters 2-27 + signature_item_desc.Psig_class_type is a variant case which is never constructed + <-- line 475 + | Psig_class_type of unit [@dead "signature_item_desc.Psig_class_type"] (* Dummy AST node *) + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/parsetree0.ml", line 576, characters 2-22 + structure_item_desc.Pstr_class is a variant case which is never constructed + <-- line 576 + | Pstr_class of unit [@dead "structure_item_desc.Pstr_class"] (* Dummy AST node *) + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/parsetree0.ml", line 577, characters 2-27 + structure_item_desc.Pstr_class_type is a variant case which is never constructed + <-- line 577 + | Pstr_class_type of unit [@dead "structure_item_desc.Pstr_class_type"] (* Dummy AST node *) + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/path.ml", line 27, characters 0-449 + +compare is never used + <-- line 27 + | (Pdot _ | Papply _), (Pident _ | Pdot _) -> 1 [@@dead "+compare"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/path.ml", line 71, characters 0-190 + +heads is never used + <-- line 71 + heads p [] [@@dead "+heads"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/path.mli", line 21, characters 0-27 + +compare is never used + <-- line 21 + val compare : t -> t -> int [@@dead "+compare"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/path.mli", line 33, characters 0-29 + +heads is never used + <-- line 33 + val heads : t -> Ident.t list [@@dead "+heads"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/pprintast.ml", line 1358, characters 0-60 + +expression is never used + <-- line 1358 + let expression f x = pp f "@[%a@]" (expression reset_ctxt) x [@@dead "+expression"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/pprintast.ml", line 1360, characters 0-133 + +string_of_expression is never used + <-- line 1360 + flush_str_formatter () [@@dead "+string_of_expression"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/pprintast.ml", line 1366, characters 0-142 + +string_of_structure is never used + <-- line 1366 + flush_str_formatter () [@@dead "+string_of_structure"] + + Warning Dead Value With Side Effects + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/pprintast.ml", line 1372, characters 0-36 + +core_type is never used and could have side effects + + Warning Dead Value With Side Effects + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/pprintast.ml", line 1373, characters 0-32 + +pattern is never used and could have side effects + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/pprintast.mli", line 18, characters 0-65 + +expression is never used + <-- line 18 + val expression : Format.formatter -> Parsetree.expression -> unit [@@dead "+expression"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/pprintast.mli", line 19, characters 0-57 + +string_of_expression is never used + <-- line 19 + val string_of_expression : Parsetree.expression -> string [@@dead "+string_of_expression"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/pprintast.mli", line 21, characters 0-63 + +core_type is never used + <-- line 21 + val core_type : Format.formatter -> Parsetree.core_type -> unit [@@dead "+core_type"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/pprintast.mli", line 22, characters 0-59 + +pattern is never used + <-- line 22 + val pattern : Format.formatter -> Parsetree.pattern -> unit [@@dead "+pattern"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/pprintast.mli", line 25, characters 0-55 + +string_of_structure is never used + <-- line 25 + val string_of_structure : Parsetree.structure -> string [@@dead "+string_of_structure"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/predef.ml", line 140, characters 0-67 + +type_option is never used + <-- line 140 + and type_option t = newgenty (Tconstr (path_option, [t], ref Mnil)) [@@dead "+type_option"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/predef.ml", line 142, characters 0-76 + +type_result is never used + <-- line 142 + and type_result t1 t2 = newgenty (Tconstr (path_result, [t1; t2], ref Mnil)) [@@dead "+type_result"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/predef.ml", line 144, characters 0-63 + +type_dict is never used + <-- line 144 + and type_dict t = newgenty (Tconstr (path_dict, [t], ref Mnil)) [@@dead "+type_dict"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/predef.ml", line 181, characters 0-255 + +all_predef_exns is never used + <-- line 181 + ] [@@dead "+all_predef_exns"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/predef.ml", line 198, characters 0-77 + +path_undefined_recursive_module is never used + <-- line 198 + and path_undefined_recursive_module = Pident ident_undefined_recursive_module [@@dead "+path_undefined_recursive_module"] + + Warning Dead Value With Side Effects + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/predef.ml", line 439, characters 0-357 + +builtin_values is never used and could have side effects + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/predef.mli", line 30, characters 0-38 + +type_list is never used + <-- line 30 + val type_list : type_expr -> type_expr [@@dead "+type_list"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/predef.mli", line 31, characters 0-40 + +type_option is never used + <-- line 31 + val type_option : type_expr -> type_expr [@@dead "+type_option"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/predef.mli", line 32, characters 0-53 + +type_result is never used + <-- line 32 + val type_result : type_expr -> type_expr -> type_expr [@@dead "+type_result"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/predef.mli", line 33, characters 0-38 + +type_dict is never used + <-- line 33 + val type_dict : type_expr -> type_expr [@@dead "+type_dict"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/predef.mli", line 46, characters 0-26 + +path_iterable is never used + <-- line 46 + val path_iterable : Path.t [@@dead "+path_iterable"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/predef.mli", line 47, characters 0-32 + +path_async_iterable is never used + <-- line 47 + val path_async_iterable : Path.t [@@dead "+path_async_iterable"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/predef.mli", line 54, characters 0-39 + +path_extension_constructor is never used + <-- line 54 + val path_extension_constructor : Path.t [@@dead "+path_extension_constructor"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/predef.mli", line 60, characters 0-44 + +path_undefined_recursive_module is never used + <-- line 60 + val path_undefined_recursive_module : Path.t [@@dead "+path_undefined_recursive_module"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/predef.mli", line 74, characters 0-44 + +builtin_values is never used + <-- line 74 + val builtin_values : (string * Ident.t) list [@@dead "+builtin_values"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/predef.mli", line 77, characters 0-36 + +ident_division_by_zero is never used + <-- line 77 + val ident_division_by_zero : Ident.t [@@dead "+ident_division_by_zero"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/predef.mli", line 83, characters 0-34 + +all_predef_exns is never used + <-- line 83 + val all_predef_exns : Ident.t list [@@dead "+all_predef_exns"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/printast.mli", line 22, characters 0-55 + +expression is never used + <-- line 22 + val expression : int -> formatter -> expression -> unit [@@dead "+expression"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/printast.mli", line 23, characters 0-53 + +structure is never used + <-- line 23 + val structure : int -> formatter -> structure -> unit [@@dead "+structure"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/printlambda.ml", line 406, characters 0-38 + +structured_constant is never used + <-- line 406 + let structured_constant = struct_const [@@dead "+structured_constant"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/printlambda.mli", line 20, characters 0-66 + +structured_constant is never used + <-- line 20 + val structured_constant : formatter -> structured_constant -> unit [@@dead "+structured_constant"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/printtyp.ml", line 965, characters 0-40 + +type_sch is never used + <-- line 965 + and type_sch ppf ty = typexp true ppf ty [@@dead "+type_sch"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/printtyp.ml", line 972, characters 0-113 + +type_scheme_max is never used + <-- line 972 + typexp true ppf ty [@@dead "+type_scheme_max"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/printtyp.ml", line 1186, characters 0-299 + +refresh_weak is never used + <-- line 1186 + weak_var_map := m [@@dead "+refresh_weak"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/printtyp.ml", line 1198, characters 0-358 + +print_items is never used + <-- line 1198 + print showval env x [@@dead "+print_items"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/printtyp.mli", line 31, characters 0-50 + +raw_type_expr is never used + <-- line 31 + val raw_type_expr : formatter -> type_expr -> unit [@@dead "+raw_type_expr"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/printtyp.mli", line 38, characters 0-24 + +reset is never used + <-- line 38 + val reset : unit -> unit [@@dead "+reset"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/printtyp.mli", line 44, characters 0-47 + +tree_of_type_scheme is never used + <-- line 44 + val tree_of_type_scheme : type_expr -> out_type [@@dead "+tree_of_type_scheme"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/printtyp.mli", line 45, characters 0-45 + +type_sch is never used + <-- line 45 + val type_sch : formatter -> type_expr -> unit [@@dead "+type_sch"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/printtyp.mli", line 50, characters 0-75 + +type_scheme_max is never used + <-- line 50 + val type_scheme_max : ?b_reset_names:bool -> formatter -> type_expr -> unit [@@dead "+type_scheme_max"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/printtyp.mli", line 62, characters 0-93 + +tree_of_module is never used + <-- line 62 + Ident.t -> ?ellipsis:bool -> module_type -> rec_status -> out_sig_item [@@dead "+tree_of_module"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/printtyp.mli", line 66, characters 0-80 + +tree_of_modtype_declaration is never used + <-- line 66 + val tree_of_modtype_declaration : Ident.t -> modtype_declaration -> out_sig_item [@@dead "+tree_of_modtype_declaration"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/printtyp.mli", line 71, characters 0-71 + +type_expansion is never used + <-- line 71 + val type_expansion : type_expr -> Format.formatter -> type_expr -> unit [@@dead "+type_expansion"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/printtyp.mli", line 72, characters 0-70 + +prepare_expansion is never used + <-- line 72 + val prepare_expansion : type_expr * type_expr -> type_expr * type_expr [@@dead "+prepare_expansion"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/printtyp.mli", line 73, characters 0-89 + +trace is never used + <-- line 73 + bool -> bool -> string -> formatter -> (type_expr * type_expr) list -> unit [@@dead "+trace"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/printtyp.mli", line 113, characters 0-131 + +print_items is never used + <-- line 113 + (out_sig_item * 'a option) list [@@dead "+print_items"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/record_type_spread.ml", line 3, characters 0-69 + +t_equals is never used + <-- line 3 + let t_equals t1 t2 = t1.Types.level = t2.Types.level && t1.id = t2.id [@@dead "+t_equals"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/stypes.ml", line 30, characters 0-56 + +output_int is never used + <-- line 30 + let output_int oc i = output_string oc (string_of_int i) [@@dead "+output_int"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/stypes.ml", line 35, characters 2-20 + annotation.Ti_class is a variant case which is never constructed + <-- line 35 + | Ti_class of unit [@dead "annotation.Ti_class"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/stypes.ml", line 37, characters 2-38 + annotation.An_call is a variant case which is never constructed + <-- line 37 + | An_call of Location.t * Annot.call [@dead "annotation.An_call"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/stypes.ml", line 62, characters 0-176 + +cmp_loc_inner_first is never used + <-- line 62 + | x -> x [@@dead "+cmp_loc_inner_first"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/stypes.ml", line 66, characters 0-92 + +cmp_ti_inner_first is never used + <-- line 66 + cmp_loc_inner_first (get_location ti1) (get_location ti2) [@@dead "+cmp_ti_inner_first"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/stypes.ml", line 69, characters 0-333 + +print_position is never used + <-- line 69 + output_int pp pos.pos_cnum) [@@dead "+print_position"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/stypes.ml", line 81, characters 0-116 + +print_location is never used + <-- line 81 + print_position pp loc.loc_end [@@dead "+print_location"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/stypes.ml", line 86, characters 0-406 + +sort_filter_phrases is never used + <-- line 86 + phrases := loop [] Location.none ph [@@dead "+sort_filter_phrases"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/stypes.ml", line 100, characters 0-208 + +printtyp_reset_maybe is never used + <-- line 100 + | _ -> () [@@dead "+printtyp_reset_maybe"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/stypes.ml", line 108, characters 0-102 + +call_kind_string is never used + <-- line 108 + | Inline -> "inline" [@@dead "+call_kind_string"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/stypes.ml", line 114, characters 0-448 + +print_ident_annot is never used + <-- line 114 + output_char pp '\n' [@@dead "+print_ident_annot"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/stypes.ml", line 135, characters 0-1140 + +print_info is never used + <-- line 135 + loc [@@dead "+print_info"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/stypes.ml", line 171, characters 0-108 + +get_info is never used + <-- line 171 + info [@@dead "+get_info"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/stypes.ml", line 176, characters 0-423 + +dump is never used + <-- line 176 + else annotations := [] [@@dead "+dump"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/stypes.mli", line 25, characters 2-20 + annotation.Ti_class is a variant case which is never constructed + <-- line 25 + | Ti_class of unit [@dead "annotation.Ti_class"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/stypes.mli", line 27, characters 2-38 + annotation.An_call is a variant case which is never constructed + <-- line 27 + | An_call of Location.t * Annot.call [@dead "annotation.An_call"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/stypes.mli", line 32, characters 0-32 + +dump is never used + <-- line 32 + val dump : string option -> unit [@@dead "+dump"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/stypes.mli", line 34, characters 0-43 + +get_location is never used + <-- line 34 + val get_location : annotation -> Location.t [@@dead "+get_location"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/stypes.mli", line 35, characters 0-38 + +get_info is never used + <-- line 35 + val get_info : unit -> annotation list [@@dead "+get_info"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/subst.mli", line 57, characters 0-70 + +module_declaration is never used + <-- line 57 + val module_declaration : t -> module_declaration -> module_declaration [@@dead "+module_declaration"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/subst.mli", line 58, characters 0-52 + +typexp is never used + <-- line 58 + val typexp : t -> Types.type_expr -> Types.type_expr [@@dead "+typexp"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/switch.ml", line 34, characters 2-91 + +switch.Store.A_map is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/switch.ml", line 36, characters 4-31 + Store.A_map.+compare is never used + <-- line 36 + let compare = A.compare_key [@@dead "Store.A_map.+compare"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/tbl.ml", line 66, characters 0-143 + +mem is never used + <-- line 66 + c = 0 || mem x (if c < 0 then l else r) [@@dead "+mem"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/tbl.ml", line 72, characters 0-187 + +merge is never used + <-- line 72 + bal l1 v1 d1 (bal (merge r1 l2) v2 d2 r2) [@@dead "+merge"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/tbl.ml", line 79, characters 0-208 + +remove is never used + <-- line 79 + else bal l v d (remove x r) [@@dead "+remove"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/tbl.ml", line 94, characters 0-108 + +map is never used + <-- line 94 + | Node (l, v, d, r, h) -> Node (map f l, v, f v d, map f r, h) [@@dead "+map"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/tbl.ml", line 105, characters 0-215 + +print is never used + <-- line 105 + fprintf ppf "@[[[%a]]@]" print_tbl tbl [@@dead "+print"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/tbl.mli", line 25, characters 0-34 + +mem is never used + <-- line 25 + val mem : 'k -> ('k, 'v) t -> bool [@@dead "+mem"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/tbl.mli", line 26, characters 0-43 + +remove is never used + <-- line 26 + val remove : 'k -> ('k, 'v) t -> ('k, 'v) t [@@dead "+remove"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/tbl.mli", line 28, characters 0-58 + +map is never used + <-- line 28 + val map : ('k -> 'v1 -> 'v2) -> ('k, 'v1) t -> ('k, 'v2) t [@@dead "+map"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/tbl.mli", line 33, characters 0-111 + +print is never used + <-- line 33 + unit [@@dead "+print"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/translmod.mli", line 27, characters 0-52 + +report_error is never used + <-- line 27 + val report_error : Format.formatter -> error -> unit [@@dead "+report_error"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typecore.mli", line 22, characters 0-50 + +is_nonexpansive is never used + <-- line 22 + val is_nonexpansive : Typedtree.expression -> bool [@@dead "+is_nonexpansive"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typecore.mli", line 36, characters 0-160 + +check_partial is never used + <-- line 36 + Typedtree.partial [@@dead "+check_partial"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typecore.mli", line 49, characters 0-60 + +type_approx is never used + <-- line 49 + val type_approx : Env.t -> Parsetree.expression -> type_expr [@@dead "+type_approx"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typecore.mli", line 51, characters 0-62 + +option_some is never used + <-- line 51 + val option_some : Typedtree.expression -> Typedtree.expression [@@dead "+option_some"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typecore.mli", line 52, characters 0-65 + +option_none is never used + <-- line 52 + val option_none : type_expr -> Location.t -> Typedtree.expression [@@dead "+option_none"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typecore.mli", line 53, characters 0-57 + +extract_option_type is never used + <-- line 53 + val extract_option_type : Env.t -> type_expr -> type_expr [@@dead "+extract_option_type"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typecore.mli", line 54, characters 0-75 + +iter_pattern is never used + <-- line 54 + val iter_pattern : (Typedtree.pattern -> unit) -> Typedtree.pattern -> unit [@@dead "+iter_pattern"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typecore.mli", line 55, characters 0-44 + +generalizable is never used + <-- line 55 + val generalizable : int -> type_expr -> bool [@@dead "+generalizable"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typecore.mli", line 137, characters 0-68 + +report_error is never used + <-- line 137 + val report_error : Env.t -> Location.t -> formatter -> error -> unit [@@dead "+report_error"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typecore.mli", line 162, characters 0-70 + +constant is never used + <-- line 162 + val constant : Parsetree.constant -> (Asttypes.constant, error) result [@@dead "+constant"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typedecl.ml", line 25, characters 24-31 + native_repr_kind.Unboxed is a variant case which is never constructed + <-- line 25 + type native_repr_kind = Unboxed [@dead "native_repr_kind.Unboxed"] | Untagged + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typedecl.ml", line 25, characters 32-42 + native_repr_kind.Untagged is a variant case which is never constructed + <-- line 25 + type native_repr_kind = Unboxed [@dead "native_repr_kind.Unboxed"] | Untagged [@dead "native_repr_kind.Untagged"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typedecl.ml", line 204, characters 0-97 + +typedecl.String_set is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typedecl.ml", line 206, characters 2-37 + String_set.+compare is never used + <-- line 206 + let compare (x : t) y = compare x y [@@dead "String_set.+compare"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typedecl.mli", line 53, characters 0-48 + +abstract_type_decl is never used + <-- line 53 + val abstract_type_decl : int -> type_declaration [@@dead "+abstract_type_decl"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typedecl.mli", line 67, characters 24-31 + native_repr_kind.Unboxed is a variant case which is never constructed + <-- line 67 + type native_repr_kind = Unboxed [@dead "native_repr_kind.Unboxed"] | Untagged + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typedecl.mli", line 67, characters 32-42 + native_repr_kind.Untagged is a variant case which is never constructed + <-- line 67 + type native_repr_kind = Unboxed [@dead "native_repr_kind.Unboxed"] | Untagged [@dead "native_repr_kind.Untagged"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typedtree.ml", line 281, characters 2-23 + open_description.open_loc is a record label never used to read a value + <-- line 281 + open_loc: Location.t; [@dead "open_description.open_loc"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typedtree.ml", line 327, characters 2-31 + package_type.pack_type is a record label never used to read a value + <-- line 327 + pack_type: Types.module_type; [@dead "package_type.pack_type"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typedtree.ml", line 328, characters 2-28 + package_type.pack_txt is a record label never used to read a value + <-- line 328 + pack_txt: Longident.t loc; [@dead "package_type.pack_txt"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typedtree.ml", line 393, characters 2-29 + type_extension.tyext_txt is a record label never used to read a value + <-- line 393 + tyext_txt: Longident.t loc; [@dead "type_extension.tyext_txt"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typedtree.ml", line 402, characters 2-23 + extension_constructor.ext_name is a record label never used to read a value + <-- line 402 + ext_name: string loc; [@dead "extension_constructor.ext_name"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typedtree.mli", line 387, characters 2-23 + open_description.open_loc is a record label never used to read a value + <-- line 387 + open_loc: Location.t; [@dead "open_description.open_loc"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typedtree.mli", line 433, characters 2-31 + package_type.pack_type is a record label never used to read a value + <-- line 433 + pack_type: Types.module_type; [@dead "package_type.pack_type"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typedtree.mli", line 434, characters 2-28 + package_type.pack_txt is a record label never used to read a value + <-- line 434 + pack_txt: Longident.t loc; [@dead "package_type.pack_txt"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typedtree.mli", line 499, characters 2-29 + type_extension.tyext_txt is a record label never used to read a value + <-- line 499 + tyext_txt: Longident.t loc; [@dead "type_extension.tyext_txt"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typedtree.mli", line 508, characters 2-23 + extension_constructor.ext_name is a record label never used to read a value + <-- line 508 + ext_name: string loc; [@dead "extension_constructor.ext_name"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typedtree_iter.ml", line 72, characters 2-40 + Make_iterator.+iter_structure is never used + <-- line 72 + val iter_structure : structure -> unit [@@dead "Make_iterator.+iter_structure"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typedtree_iter.ml", line 73, characters 2-40 + Make_iterator.+iter_signature is never used + <-- line 73 + val iter_signature : signature -> unit [@@dead "Make_iterator.+iter_signature"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typedtree_iter.ml", line 74, characters 2-50 + Make_iterator.+iter_structure_item is never used + <-- line 74 + val iter_structure_item : structure_item -> unit [@@dead "Make_iterator.+iter_structure_item"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typedtree_iter.ml", line 75, characters 2-50 + Make_iterator.+iter_signature_item is never used + <-- line 75 + val iter_signature_item : signature_item -> unit [@@dead "Make_iterator.+iter_signature_item"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typedtree_iter.ml", line 77, characters 2-44 + Make_iterator.+iter_module_type is never used + <-- line 77 + val iter_module_type : module_type -> unit [@@dead "Make_iterator.+iter_module_type"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typedtree_iter.ml", line 78, characters 2-36 + Make_iterator.+iter_pattern is never used + <-- line 78 + val iter_pattern : pattern -> unit [@@dead "Make_iterator.+iter_pattern"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typedtree_iter.mli", line 64, characters 2-40 + Make_iterator.+iter_structure is never used + <-- line 64 + val iter_structure : structure -> unit [@@dead "Make_iterator.+iter_structure"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typedtree_iter.mli", line 65, characters 2-40 + Make_iterator.+iter_signature is never used + <-- line 65 + val iter_signature : signature -> unit [@@dead "Make_iterator.+iter_signature"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typedtree_iter.mli", line 66, characters 2-50 + Make_iterator.+iter_structure_item is never used + <-- line 66 + val iter_structure_item : structure_item -> unit [@@dead "Make_iterator.+iter_structure_item"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typedtree_iter.mli", line 67, characters 2-50 + Make_iterator.+iter_signature_item is never used + <-- line 67 + val iter_signature_item : signature_item -> unit [@@dead "Make_iterator.+iter_signature_item"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typedtree_iter.mli", line 69, characters 2-44 + Make_iterator.+iter_module_type is never used + <-- line 69 + val iter_module_type : module_type -> unit [@@dead "Make_iterator.+iter_module_type"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typedtree_iter.mli", line 70, characters 2-36 + Make_iterator.+iter_pattern is never used + <-- line 70 + val iter_pattern : pattern -> unit [@@dead "Make_iterator.+iter_pattern"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typemod.ml", line 606, characters 0-104 + +typemod.String_set is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typemod.ml", line 608, characters 2-44 + String_set.+compare is never used + <-- line 608 + let compare (x : t) y = String.compare x y [@@dead "String_set.+compare"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typemod.mli", line 21, characters 0-73 + +type_module is never used + <-- line 21 + val type_module : Env.t -> Parsetree.module_expr -> Typedtree.module_expr [@@dead "+type_module"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typemod.mli", line 22, characters 0-120 + +type_structure is never used + <-- line 22 + Typedtree.structure * Types.signature * Env.t [@@dead "+type_structure"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typemod.mli", line 42, characters 0-59 + +check_nongen_schemes is never used + <-- line 42 + val check_nongen_schemes : Env.t -> Types.signature -> unit [@@dead "+check_nongen_schemes"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typemod.mli", line 51, characters 0-47 + +simplify_signature is never used + <-- line 51 + val simplify_signature : signature -> signature [@@dead "+simplify_signature"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typemod.mli", line 53, characters 0-59 + +path_of_module is never used + <-- line 53 + val path_of_module : Typedtree.module_expr -> Path.t option [@@dead "+path_of_module"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/types.ml", line 66, characters 0-134 + +types.Type_ops is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/types.ml", line 68, characters 2-35 + Type_ops.+compare is never used + <-- line 68 + let compare t1 t2 = t1.id - t2.id [@@dead "Type_ops.+compare"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/types.ml", line 69, characters 2-19 + Type_ops.+hash is never used + <-- line 69 + let hash t = t.id [@@dead "Type_ops.+hash"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/types.ml", line 70, characters 2-28 + Type_ops.+equal is never used + <-- line 70 + let equal t1 t2 = t1 == t2 [@@dead "Type_ops.+equal"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/types.ml", line 75, characters 0-90 + +types.Ordered_string is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/types.ml", line 77, characters 2-37 + Ordered_string.+compare is never used + <-- line 77 + let compare (x : t) y = compare x y [@@dead "Ordered_string.+compare"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/types.ml", line 99, characters 29-39 + Variance.f.May_weak is a variant case which is never constructed + <-- line 99 + type f = May_pos | May_neg | May_weak [@dead "Variance.f.May_weak"] | Inj | Pos | Neg | Inv + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/types.mli", line 207, characters 0-127 + types.Type_ops is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/types.mli", line 209, characters 2-29 + Type_ops.+compare is never used + <-- line 209 + val compare : t -> t -> int [@@dead "Type_ops.+compare"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/types.mli", line 210, characters 2-28 + Type_ops.+equal is never used + <-- line 210 + val equal : t -> t -> bool [@@dead "Type_ops.+equal"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/types.mli", line 211, characters 2-21 + Type_ops.+hash is never used + <-- line 211 + val hash : t -> int [@@dead "Type_ops.+hash"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/syntax/cli/res_cli.ml", line 30, characters 4-11 + Color.color.Black is a variant case which is never constructed + <-- line 30 + | Black [@dead "Color.color.Black"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/syntax/cli/res_cli.ml", line 32, characters 4-11 + Color.color.Green is a variant case which is never constructed + <-- line 32 + | Green [@dead "Color.color.Green"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/syntax/cli/res_cli.ml", line 34, characters 4-10 + Color.color.Blue is a variant case which is never constructed + <-- line 34 + | Blue [@dead "Color.color.Blue"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/syntax/cli/res_cli.ml", line 37, characters 4-11 + Color.color.White is a variant case which is never constructed + <-- line 37 + | White [@dead "Color.color.White"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/syntax/cli/res_cli.ml", line 41, characters 4-17 + Color.style.BG is a variant case which is never constructed + <-- line 41 + | BG of color [@dead "Color.style.BG"] (* background *) + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/syntax/cli/res_cli.ml", line 135, characters 33-37 + Color.setting.Auto is a variant case which is never constructed + <-- line 135 + type[@warning "-37"] setting = Auto [@dead "Color.setting.Auto"] | Always | Never + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/syntax/cli/res_cli.ml", line 135, characters 38-46 + Color.setting.Always is a variant case which is never constructed + <-- line 135 + type[@warning "-37"] setting = Auto [@dead "Color.setting.Auto"] | Always [@dead "Color.setting.Always"] | Never + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/syntax/cli/res_cli.ml", line 135, characters 47-54 + Color.setting.Never is a variant case which is never constructed + <-- line 135 + type[@warning "-37"] setting = Auto [@dead "Color.setting.Auto"] | Always [@dead "Color.setting.Always"] | Never [@dead "Color.setting.Never"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/syntax/src/res_comments_table.ml", line 27, characters 0-116 + +list_last is never used + <-- line 27 + | _ :: rest -> list_last rest [@@dead "+list_last"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/syntax/src/res_core.ml", line 394, characters 6-149 + +_async is never used + <-- line 394 + | _ -> false [@@dead "+_async"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/syntax/src/res_driver.ml", line 40, characters 2-145 + print_engine.print_implementation_from_source is a record label never used to read a value + <-- line 40 + unit; [@dead "print_engine.print_implementation_from_source"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/syntax/src/res_driver.ml", line 52, characters 2-140 + print_engine.print_interface_from_source is a record label never used to read a value + <-- line 52 + unit; [@dead "print_engine.print_interface_from_source"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/syntax/src/res_driver.mli", line 52, characters 2-145 + print_engine.print_implementation_from_source is a record label never used to read a value + <-- line 52 + unit; [@dead "print_engine.print_implementation_from_source"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/syntax/src/res_driver.mli", line 64, characters 2-140 + print_engine.print_interface_from_source is a record label never used to read a value + <-- line 64 + unit; [@dead "print_engine.print_interface_from_source"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/syntax/src/res_parsetree_viewer.mli", line 20, characters 0-60 + +has_dict_spread_attribute is never used + <-- line 20 + val has_dict_spread_attribute : Parsetree.attributes -> bool [@@dead "+has_dict_spread_attribute"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/syntax/src/res_parsetree_viewer.mli", line 74, characters 0-39 + +is_binary_operator is never used + <-- line 74 + val is_binary_operator : string -> bool [@@dead "+is_binary_operator"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/syntax/src/res_scanner.ml", line 151, characters 0-46 + +peek_minus is never used + <-- line 151 + let peek_minus scanner = peek_char scanner '-' [@@dead "+peek_minus"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/syntax/src/res_scanner.mli", line 38, characters 0-26 + +peek_minus is never used + <-- line 38 + val peek_minus : t -> bool [@@dead "+peek_minus"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_bal_tree_tests.ml", line 3, characters 0-31 + +=~ is never used + <-- line 3 + let ( =~ ) = OUnit.assert_equal [@@dead "+=~"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_bal_tree_tests.ml", line 65, characters 0-88 + +ounit_bal_tree_tests.Set_ident is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_bal_tree_tests.ml", line 67, characters 2-30 + Set_ident.+compare is never used + <-- line 67 + let compare = Stdlib.compare [@@dead "Set_ident.+compare"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_bal_tree_tests.ml", line 70, characters 0-200 + +compare_ident is never used + <-- line 70 + if b <> 0 then b else compare (x.flags : int) y.flags [@@dead "+compare_ident"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_bal_tree_tests.ml", line 77, characters 0-417 + +add is never used + <-- line 77 + else Set_gen.bal l v (add r x) [@@dead "+add"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_bal_tree_tests.ml", line 91, characters 0-208 + +mem is never used + <-- line 91 + c = 0 || mem (if c < 0 then l else r) x [@@dead "+mem"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_bal_tree_tests.ml", line 99, characters 0-88 + +ounit_bal_tree_tests.Ident_set2 is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_bal_tree_tests.ml", line 101, characters 2-29 + Ident_set2.+compare is never used + <-- line 101 + let compare = compare_ident [@@dead "Ident_set2.+compare"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_bal_tree_tests.ml", line 104, characters 0-1318 + +bench is never used + <-- line 104 + done) [@@dead "+bench"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_hash_set_tests.ml", line 3, characters 0-31 + +=~ is never used + <-- line 3 + let ( =~ ) = OUnit.assert_equal [@@dead "+=~"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_hash_set_tests.ml", line 7, characters 0-152 + +ounit_hash_set_tests.Id_hash_set is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_hash_set_tests.ml", line 9, characters 2-54 + Id_hash_set.+equal is never used + <-- line 9 + let equal x y = x.stamp = y.stamp && x.name = y.name [@@dead "Id_hash_set.+equal"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_hash_set_tests.ml", line 10, characters 2-35 + Id_hash_set.+hash is never used + <-- line 10 + let hash x = Hashtbl.hash x.stamp [@@dead "Id_hash_set.+hash"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_hash_stubs_test.ml", line 5, characters 0-21 + +count is never used + <-- line 5 + let count = 2_000_000 [@@dead "+count"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_hash_stubs_test.ml", line 7, characters 0-586 + +bench is never used + <-- line 7 + done) [@@dead "+bench"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_hash_stubs_test.ml", line 29, characters 37-55 + id.flags is a record label never used to read a value + <-- line 29 + type id = {stamp: int; name: string; mutable flags: int [@dead "id.flags"] } (* = Ident.t *) + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_ident_mask_tests.ml", line 3, characters 0-31 + +=~ is never used + <-- line 3 + let ( =~ ) = OUnit.assert_equal [@@dead "+=~"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_int_vec_tests.ml", line 3, characters 0-31 + +=~ is never used + <-- line 3 + let ( =~ ) = OUnit.assert_equal [@@dead "+=~"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_list_test.ml", line 3, characters 0-31 + +=~ is never used + <-- line 3 + let ( =~ ) = OUnit.assert_equal [@@dead "+=~"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_scc_tests.ml", line 3, characters 0-31 + +=~ is never used + <-- line 3 + let ( =~ ) = OUnit.assert_equal [@@dead "+=~"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_scc_tests.ml", line 204, characters 0-581 + +read_file is never used + <-- line 204 + fst (Ext_scc.graph_check node_array) [@@dead "+read_file"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_tests_util.ml", line 20, characters 0-492 + +time is never used + <-- line 20 + flush stdout [@@dead "+time"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_vec_test.ml", line 4, characters 0-89 + +=~ is never used + <-- line 4 + OUnit.assert_equal ~cmp:(Vec_int.equal (fun (x : int) y -> x = y)) x y [@@dead "+=~"] + + Analysis reported 3074 issues (Warning Dead Module:145, Warning Dead Type:371, Warning Dead Value:2129, Warning Dead Value With Side Effects:37, Warning Incorrect Annotation:2, Warning Redundant Optional Argument:214, Warning Unused Argument:176) From bab4af90265d3f2ad43e9e43c3a63e737e3b00d6 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 10:59:56 +0000 Subject: [PATCH 005/214] dce: remove unused process_file kind --- _dce/report.txt | 6 +----- compiler/bsc/rescript_compiler_main.ml | 9 +++------ 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index b7d25e73c63..a2b28a20ebc 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -1,8 +1,4 @@ - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/bsc/rescript_compiler_main.ml", line 55, characters 0-1591 - optional argument kind of function +process_file is never used - Warning Unused Argument File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/cmt_viewer.ml", line 19, characters 0-4249 optional argument filter of function +dump is never used @@ -17295,4 +17291,4 @@ <-- line 4 OUnit.assert_equal ~cmp:(Vec_int.equal (fun (x : int) y -> x = y)) x y [@@dead "+=~"] - Analysis reported 3074 issues (Warning Dead Module:145, Warning Dead Type:371, Warning Dead Value:2129, Warning Dead Value With Side Effects:37, Warning Incorrect Annotation:2, Warning Redundant Optional Argument:214, Warning Unused Argument:176) + Analysis reported 3073 issues (Warning Dead Module:145, Warning Dead Type:371, Warning Dead Value:2129, Warning Dead Value With Side Effects:37, Warning Incorrect Annotation:2, Warning Redundant Optional Argument:214, Warning Unused Argument:175) diff --git a/compiler/bsc/rescript_compiler_main.ml b/compiler/bsc/rescript_compiler_main.ml index 24023535e0c..0270d5654f7 100644 --- a/compiler/bsc/rescript_compiler_main.ml +++ b/compiler/bsc/rescript_compiler_main.ml @@ -52,7 +52,7 @@ let setup_outcome_printer () = Lazy.force Res_outcome_printer.setup let setup_runtime_path path = Runtime_package.path := path -let process_file sourcefile ?kind ppf = +let process_file sourcefile ppf = (* This is a better default then "", it will be changed later The {!Location.input_name} relies on that we write the binary ast properly @@ -60,11 +60,8 @@ let process_file sourcefile ?kind ppf = setup_outcome_printer (); Error_message_utils_support.setup (); let kind = - match kind with - | None -> - Ext_file_extensions.classify_input - (Ext_filename.get_extension_maybe sourcefile) - | Some kind -> kind + Ext_file_extensions.classify_input + (Ext_filename.get_extension_maybe sourcefile) in let res = match kind with From 974881351595f7faf982d3f48f3b36a5e140f2bf Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 11:01:55 +0000 Subject: [PATCH 006/214] dce: remove unused cmt filters --- _dce/report.txt | 24 +--------------------- analysis/src/cmt_viewer.ml | 41 +++----------------------------------- analysis/src/loc.ml | 6 ------ 3 files changed, 4 insertions(+), 67 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index a2b28a20ebc..3a027bbb605 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -1,8 +1,4 @@ - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/cmt_viewer.ml", line 19, characters 0-4249 - optional argument filter of function +dump is never used - Warning Unused Argument File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_implementation.mli", line 50, characters 0-131 optional argument outputprefix of function +implementation is never used @@ -2719,24 +2715,6 @@ <-- line 49 unsuppress: string list; [@dead "snapshot.unsuppress"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/cmt_viewer.ml", line 1, characters 0-598 - +filter_by_cursor is never used - <-- line 1 - line_in && col_in [@@dead "+filter_by_cursor"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/cmt_viewer.ml", line 17, characters 14-35 - filter.Cursor is a variant case which is never constructed - <-- line 17 - type filter = Cursor of (int * int) [@dead "filter.Cursor"] | Loc of Loc.t - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/cmt_viewer.ml", line 17, characters 36-50 - filter.Loc is a variant case which is never constructed - <-- line 17 - type filter = Cursor of (int * int) [@dead "filter.Cursor"] | Loc of Loc.t [@dead "filter.Loc"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/completion_back_end.ml", line 903, characters 0-252 +completions_get_type_env is never used @@ -17291,4 +17269,4 @@ <-- line 4 OUnit.assert_equal ~cmp:(Vec_int.equal (fun (x : int) y -> x = y)) x y [@@dead "+=~"] - Analysis reported 3073 issues (Warning Dead Module:145, Warning Dead Type:371, Warning Dead Value:2129, Warning Dead Value With Side Effects:37, Warning Incorrect Annotation:2, Warning Redundant Optional Argument:214, Warning Unused Argument:175) + Analysis reported 3069 issues (Warning Dead Module:145, Warning Dead Type:369, Warning Dead Value:2128, Warning Dead Value With Side Effects:37, Warning Incorrect Annotation:2, Warning Redundant Optional Argument:214, Warning Unused Argument:174) diff --git a/analysis/src/cmt_viewer.ml b/analysis/src/cmt_viewer.ml index ce32f8885bc..9de0717ffa8 100644 --- a/analysis/src/cmt_viewer.ml +++ b/analysis/src/cmt_viewer.ml @@ -1,22 +1,4 @@ -let filter_by_cursor cursor (loc : Warnings.loc) : bool = - match cursor with - | None -> true - | Some (line, col) -> - let start = loc.loc_start and end_ = loc.loc_end in - let line_in = start.pos_lnum <= line && line <= end_.pos_lnum in - let col_in = - if start.pos_lnum = end_.pos_lnum then - start.pos_cnum - start.pos_bol <= col - && col <= end_.pos_cnum - end_.pos_bol - else if line = start.pos_lnum then col >= start.pos_cnum - start.pos_bol - else if line = end_.pos_lnum then col <= end_.pos_cnum - end_.pos_bol - else true - in - line_in && col_in - -type filter = Cursor of (int * int) | Loc of Loc.t - -let dump ~state ?filter rescript_json cmt_path = +let dump ~state rescript_json cmt_path = let uri = Uri.from_path (Filename.remove_extension cmt_path ^ ".res") in let package = let uri = Uri.from_path rescript_json in @@ -31,25 +13,9 @@ let dump ~state ?filter rescript_json cmt_path = | Some full -> let open Shared_types in let open Shared_types.Stamps in - let apply_filter = - match filter with - | None -> fun _ -> true - | Some (Cursor cursor) -> Loc.has_pos ~pos:cursor - | Some (Loc loc) -> Loc.is_inside loc - in - (match filter with - | None -> () - | Some (Cursor (line, col)) -> - Printf.printf "Filtering by cursor %d,%d\n" line col - | Some (Loc loc) -> - Printf.printf "Filtering by loc %s\n" (Loc.to_string loc)); - Printf.printf "file moduleName: %s\n\n" full.file.module_name; - let stamps = - full.file.stamps |> get_entries - |> List.filter (fun (_, stamp) -> apply_filter (loc_of_kind stamp)) - in + let stamps = full.file.stamps |> get_entries in let total_stamps = List.length stamps in Printf.printf "Found %d stamps:\n%s" total_stamps @@ -110,8 +76,7 @@ let dump ~state ?filter rescript_json cmt_path = (* Dump all locItems (typed nodes) *) let loc_items = match full.extra with - | {loc_items} -> - loc_items |> List.filter (fun loc_item -> apply_filter loc_item.loc) + | {loc_items} -> loc_items in Printf.printf "\nFound %d locItems (typed nodes):\n\n" diff --git a/analysis/src/loc.ml b/analysis/src/loc.ml index abb5669ed1a..1ed5f86d697 100644 --- a/analysis/src/loc.ml +++ b/analysis/src/loc.ml @@ -21,9 +21,3 @@ let range_of_loc (loc : t) = let start = loc |> start |> mk_position in let end_ = loc |> end_ |> mk_position in Lsp.Types.Range.create ~start ~end_ - -let is_inside (x : t) (y : t) = - x.loc_start.pos_cnum >= y.loc_start.pos_cnum - && x.loc_end.pos_cnum <= y.loc_end.pos_cnum - && x.loc_start.pos_lnum >= y.loc_start.pos_lnum - && x.loc_end.pos_lnum <= y.loc_end.pos_lnum From e77d9df1b44092da3e44f6e8130dc26800067dd9 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 11:03:17 +0000 Subject: [PATCH 007/214] dce: remove unused outputprefix args --- _dce/report.txt | 18 +----------------- compiler/core/js_implementation.ml | 16 ++++------------ compiler/core/js_implementation.mli | 13 +++---------- 3 files changed, 8 insertions(+), 39 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index 3a027bbb605..f9a02ed8592 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -1,12 +1,4 @@ - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_implementation.mli", line 50, characters 0-131 - optional argument outputprefix of function +implementation is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_implementation.mli", line 27, characters 0-126 - optional argument outputprefix of function +interface is never used - Warning Unused Argument File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/identifiable.ml", line 111, characters 2-544 optional argument eq of function Make.Tbl.T_map.+disjoint_union is never used @@ -271,14 +263,6 @@ File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_util_tests.ml", line 3, characters 0-53 optional argument pp_diff of function +=~ is never used - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_implementation.ml", line 157, characters 0-517 - optional argument outputprefix of function +implementation is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_implementation.ml", line 70, characters 0-502 - optional argument outputprefix of function +interface is never used - Warning Unused Argument File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_tests_util.ml", line 7, characters 0-423 optional argument msg of function +assert_raise_any is never used @@ -17269,4 +17253,4 @@ <-- line 4 OUnit.assert_equal ~cmp:(Vec_int.equal (fun (x : int) y -> x = y)) x y [@@dead "+=~"] - Analysis reported 3069 issues (Warning Dead Module:145, Warning Dead Type:369, Warning Dead Value:2128, Warning Dead Value With Side Effects:37, Warning Incorrect Annotation:2, Warning Redundant Optional Argument:214, Warning Unused Argument:174) + Analysis reported 3065 issues (Warning Dead Module:145, Warning Dead Type:369, Warning Dead Value:2128, Warning Dead Value With Side Effects:37, Warning Incorrect Annotation:2, Warning Redundant Optional Argument:214, Warning Unused Argument:170) diff --git a/compiler/core/js_implementation.ml b/compiler/core/js_implementation.ml index df6ab959d12..9c579c901cd 100644 --- a/compiler/core/js_implementation.ml +++ b/compiler/core/js_implementation.ml @@ -67,12 +67,8 @@ let after_parsing_sig ppf outputprefix ast = initial_env sg; process_with_gentype (outputprefix ^ ".cmti")) -let interface ~parser ppf ?outputprefix fname = - let outputprefix = - match outputprefix with - | None -> Config_util.output_prefix fname - | Some x -> x - in +let interface ~parser ppf fname = + let outputprefix = Config_util.output_prefix fname in Res_compmisc.init_path (); parser fname |> Cmd_ppx_apply.apply_rewriters ~restore:false ~tool_name:Js_config.tool_name @@ -154,12 +150,8 @@ let after_parsing_impl ppf outputprefix (ast : Parsetree.structure) = Lam_compile_main.lambda_as_module js_program outputprefix); process_with_gentype (outputprefix ^ ".cmt")) -let implementation ~parser ppf ?outputprefix fname = - let outputprefix = - match outputprefix with - | None -> Config_util.output_prefix fname - | Some x -> x - in +let implementation ~parser ppf fname = + let outputprefix = Config_util.output_prefix fname in Res_compmisc.init_path (); parser fname |> Cmd_ppx_apply.apply_rewriters ~restore:false ~tool_name:Js_config.tool_name diff --git a/compiler/core/js_implementation.mli b/compiler/core/js_implementation.mli index 3b97cf23dbe..b4a1b5938b2 100644 --- a/compiler/core/js_implementation.mli +++ b/compiler/core/js_implementation.mli @@ -27,22 +27,16 @@ val interface : parser:(string -> Parsetree.signature) -> Format.formatter -> - ?outputprefix:string -> string -> unit (** This module defines a function to compile the program directly into [js] - given [filename] and [outputprefix], + given [filename], it will be useful if we don't care about bytecode output(generating js only). *) val interface_mliast : Format.formatter -> string -> unit -(* val after_parsing_impl : - Format.formatter -> - string -> - Parsetree.structure -> - unit *) -(** [after_parsing_impl ppf sourcefile outputprefix ast ] +(** [after_parsing_impl ppf sourcefile outputprefix ast] Make sure you need run {!Res_compmisc.init_path} for set up Used in eval *) @@ -50,10 +44,9 @@ val interface_mliast : Format.formatter -> string -> unit val implementation : parser:(string -> Parsetree.structure) -> Format.formatter -> - ?outputprefix:string -> string -> unit -(** [implementation ppf sourcefile outprefix] compiles to JS directly *) +(** [implementation ppf sourcefile] compiles to JS directly *) val implementation_mlast : Format.formatter -> string -> unit From 34429613216e64b6b321c6948417ea813a610cca Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 11:04:59 +0000 Subject: [PATCH 008/214] dce: simplify disjoint_union --- _dce/report.txt | 28 ++++++++++------------------ compiler/ext/identifiable.ml | 22 +++------------------- compiler/ext/identifiable.mli | 10 ++-------- 3 files changed, 15 insertions(+), 45 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index f9a02ed8592..960a62e3952 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -1,12 +1,4 @@ - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/identifiable.ml", line 111, characters 2-544 - optional argument eq of function Make.Tbl.T_map.+disjoint_union is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/identifiable.ml", line 111, characters 2-544 - optional argument print of function Make.Tbl.T_map.+disjoint_union is never used - Warning Incorrect Annotation File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/syntax/src/res_multi_printer.mli", line 3, characters 0-75 +print is annotated @dead but is live @@ -11552,21 +11544,21 @@ include Map.OrderedType with type t := t [@@dead "Make.+compare"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/identifiable.ml", line 88, characters 2-106 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/identifiable.ml", line 86, characters 2-106 Pair.+compare is never used - <-- line 88 + <-- line 86 if c <> 0 then c else B.compare b1 b2 [@@dead "Pair.+compare"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/identifiable.ml", line 93, characters 2-53 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/identifiable.ml", line 91, characters 2-53 Pair.+hash is never used - <-- line 93 + <-- line 91 let hash (a, b) = Hashtbl.hash (A.hash a, B.hash b) [@@dead "Pair.+hash"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/identifiable.ml", line 94, characters 2-62 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/identifiable.ml", line 92, characters 2-62 Pair.+equal is never used - <-- line 94 + <-- line 92 let equal (a1, b1) (a2, b2) = A.equal a1 a2 && B.equal b1 b2 [@@dead "Pair.+equal"] Warning Dead Module @@ -11598,13 +11590,13 @@ val print : Format.formatter -> t -> unit [@@dead "Pair.+print"] Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/identifiable.mli", line 106, characters 26-46 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/identifiable.mli", line 100, characters 26-46 identifiable.Make.Tbl is a dead module as all its items are dead. Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/identifiable.mli", line 106, characters 26-46 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/identifiable.mli", line 100, characters 26-46 Make.Tbl.+map is never used - <-- line 106 + <-- line 100 module Make (T : Thing) : S with type t := T.t [@@dead "Make.Tbl.+map"] Warning Dead Module @@ -17253,4 +17245,4 @@ <-- line 4 OUnit.assert_equal ~cmp:(Vec_int.equal (fun (x : int) y -> x = y)) x y [@@dead "+=~"] - Analysis reported 3065 issues (Warning Dead Module:145, Warning Dead Type:369, Warning Dead Value:2128, Warning Dead Value With Side Effects:37, Warning Incorrect Annotation:2, Warning Redundant Optional Argument:214, Warning Unused Argument:170) + Analysis reported 3063 issues (Warning Dead Module:145, Warning Dead Type:369, Warning Dead Value:2128, Warning Dead Value With Side Effects:37, Warning Incorrect Annotation:2, Warning Redundant Optional Argument:214, Warning Unused Argument:168) diff --git a/compiler/ext/identifiable.ml b/compiler/ext/identifiable.ml index bd6133c87e3..b9b88f9e4f8 100644 --- a/compiler/ext/identifiable.ml +++ b/compiler/ext/identifiable.ml @@ -43,8 +43,6 @@ module type Map = sig val of_list : (key * 'a) list -> 'a t val disjoint_union : - ?eq:('a -> 'a -> bool) -> - ?print:(Format.formatter -> 'a -> unit) -> 'a t -> 'a t -> 'a t @@ -108,24 +106,10 @@ module Make_map (T : Thing) = struct let of_list l = List.fold_left (fun map (id, v) -> add id v map) empty l - let disjoint_union ?eq ?print m1 m2 = + let disjoint_union m1 m2 = union - (fun id v1 v2 -> - let ok = - match eq with - | None -> false - | Some eq -> eq v1 v2 - in - if not ok then - let err = - match print with - | None -> Format.asprintf "Map.disjoint_union %a" T.print id - | Some print -> - Format.asprintf "Map.disjoint_union %a => %a <> %a" T.print id - print v1 print v2 - in - Misc.fatal_error err - else Some v1) + (fun id _ _ -> + Misc.fatal_error (Format.asprintf "Map.disjoint_union %a" T.print id)) m1 m2 let union_right m1 m2 = diff --git a/compiler/ext/identifiable.mli b/compiler/ext/identifiable.mli index 9dd8defd9e4..b698fc5d3fe 100644 --- a/compiler/ext/identifiable.mli +++ b/compiler/ext/identifiable.mli @@ -46,15 +46,9 @@ module type Map = sig val filter_map : (key -> 'a -> 'b option) -> 'a t -> 'b t val of_list : (key * 'a) list -> 'a t - val disjoint_union : - ?eq:('a -> 'a -> bool) -> - ?print:(Format.formatter -> 'a -> unit) -> - 'a t -> - 'a t -> - 'a t + val disjoint_union : 'a t -> 'a t -> 'a t (** [disjoint_union m1 m2] contains all bindings from [m1] and - [m2]. If some binding is present in both and the associated - value is not equal, a Fatal_error is raised *) + [m2]. If some binding is present in both, a Fatal_error is raised. *) val union_right : 'a t -> 'a t -> 'a t (** [union_right m1 m2] contains all bindings from [m1] and [m2]. If From d9079af7dba5026b1c51c4f827b7857505f2c8bf Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 11:06:02 +0000 Subject: [PATCH 009/214] dce: fix live printer annotation --- _dce/report.txt | 6 +----- compiler/syntax/src/res_multi_printer.mli | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index 960a62e3952..d279af29393 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -1,8 +1,4 @@ - Warning Incorrect Annotation - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/syntax/src/res_multi_printer.mli", line 3, characters 0-75 - +print is annotated @dead but is live - Warning Unused Argument File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_array_tests.ml", line 32, characters 11-69 optional argument cmp of function +=~ is never used @@ -17245,4 +17241,4 @@ <-- line 4 OUnit.assert_equal ~cmp:(Vec_int.equal (fun (x : int) y -> x = y)) x y [@@dead "+=~"] - Analysis reported 3063 issues (Warning Dead Module:145, Warning Dead Type:369, Warning Dead Value:2128, Warning Dead Value With Side Effects:37, Warning Incorrect Annotation:2, Warning Redundant Optional Argument:214, Warning Unused Argument:168) + Analysis reported 3062 issues (Warning Dead Module:145, Warning Dead Type:369, Warning Dead Value:2128, Warning Dead Value With Side Effects:37, Warning Incorrect Annotation:1, Warning Redundant Optional Argument:214, Warning Unused Argument:168) diff --git a/compiler/syntax/src/res_multi_printer.mli b/compiler/syntax/src/res_multi_printer.mli index bb661069006..bcfa6ce75b3 100644 --- a/compiler/syntax/src/res_multi_printer.mli +++ b/compiler/syntax/src/res_multi_printer.mli @@ -1,3 +1,3 @@ (* Interface to print source code to res. * Takes a filename called "input" and returns the corresponding formatted res syntax *) -val print : ?ignore_parse_errors:bool -> string -> string [@@dead "+print"] +val print : ?ignore_parse_errors:bool -> string -> string From f399489a48f28d43d5049010850ca40976e3f04f Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 11:06:56 +0000 Subject: [PATCH 010/214] dce: simplify array test asserts --- _dce/report.txt | 30 +------------------------- tests/ounit_tests/ounit_array_tests.ml | 4 ++-- 2 files changed, 3 insertions(+), 31 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index d279af29393..aea90b40fec 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -1,32 +1,4 @@ - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_array_tests.ml", line 32, characters 11-69 - optional argument cmp of function +=~ is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_array_tests.ml", line 32, characters 11-69 - optional argument msg of function +=~ is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_array_tests.ml", line 32, characters 11-69 - optional argument pp_diff of function +=~ is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_array_tests.ml", line 3, characters 0-31 - optional argument cmp of function +=~ is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_array_tests.ml", line 3, characters 0-31 - optional argument msg of function +=~ is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_array_tests.ml", line 3, characters 0-31 - optional argument pp_diff of function +=~ is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_array_tests.ml", line 3, characters 0-31 - optional argument printer of function +=~ is never used - Warning Unused Argument File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_hash_stubs_test.ml", line 3, characters 0-31 optional argument cmp of function +=~ is never used @@ -17241,4 +17213,4 @@ <-- line 4 OUnit.assert_equal ~cmp:(Vec_int.equal (fun (x : int) y -> x = y)) x y [@@dead "+=~"] - Analysis reported 3062 issues (Warning Dead Module:145, Warning Dead Type:369, Warning Dead Value:2128, Warning Dead Value With Side Effects:37, Warning Incorrect Annotation:1, Warning Redundant Optional Argument:214, Warning Unused Argument:168) + Analysis reported 3055 issues (Warning Dead Module:145, Warning Dead Type:369, Warning Dead Value:2128, Warning Dead Value With Side Effects:37, Warning Incorrect Annotation:1, Warning Redundant Optional Argument:214, Warning Unused Argument:161) diff --git a/tests/ounit_tests/ounit_array_tests.ml b/tests/ounit_tests/ounit_array_tests.ml index 74274cd4f5b..1eb8ebf17a2 100644 --- a/tests/ounit_tests/ounit_array_tests.ml +++ b/tests/ounit_tests/ounit_array_tests.ml @@ -1,6 +1,6 @@ let ( >:: ), ( >::: ) = OUnit.(( >:: ), ( >::: )) -let ( =~ ) = OUnit.assert_equal +let ( =~ ) x y = OUnit.assert_equal x y let printer_int_array xs = String.concat "," (List.map string_of_int @@ Array.to_list xs) @@ -29,7 +29,7 @@ let suites = Ext_array.reverse [|1; 2|] =~ [|2; 1|]; Ext_array.reverse [||] =~ [||] ); ( __LOC__ >:: fun _ -> - let ( =~ ) = OUnit.assert_equal ~printer:printer_int_array in + let ( =~ ) x y = OUnit.assert_equal ~printer:printer_int_array x y in let k x y = Ext_array.of_list_map y x in k succ [] =~ [||]; k succ [1] =~ [|2|]; From b607181c2ec7b96d65b23bff374a31acfe996d1f Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 11:07:31 +0000 Subject: [PATCH 011/214] dce: simplify hash stub asserts --- _dce/report.txt | 18 +----------------- tests/ounit_tests/ounit_hash_stubs_test.ml | 2 +- 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index aea90b40fec..898ae420d02 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -1,20 +1,4 @@ - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_hash_stubs_test.ml", line 3, characters 0-31 - optional argument cmp of function +=~ is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_hash_stubs_test.ml", line 3, characters 0-31 - optional argument msg of function +=~ is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_hash_stubs_test.ml", line 3, characters 0-31 - optional argument pp_diff of function +=~ is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_hash_stubs_test.ml", line 3, characters 0-31 - optional argument printer of function +=~ is never used - Warning Unused Argument File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_hashtbl_tests.ml", line 3, characters 0-53 optional argument cmp of function +=~ is never used @@ -17213,4 +17197,4 @@ <-- line 4 OUnit.assert_equal ~cmp:(Vec_int.equal (fun (x : int) y -> x = y)) x y [@@dead "+=~"] - Analysis reported 3055 issues (Warning Dead Module:145, Warning Dead Type:369, Warning Dead Value:2128, Warning Dead Value With Side Effects:37, Warning Incorrect Annotation:1, Warning Redundant Optional Argument:214, Warning Unused Argument:161) + Analysis reported 3051 issues (Warning Dead Module:145, Warning Dead Type:369, Warning Dead Value:2128, Warning Dead Value With Side Effects:37, Warning Incorrect Annotation:1, Warning Redundant Optional Argument:214, Warning Unused Argument:157) diff --git a/tests/ounit_tests/ounit_hash_stubs_test.ml b/tests/ounit_tests/ounit_hash_stubs_test.ml index 6f686653c3e..3cac247e610 100644 --- a/tests/ounit_tests/ounit_hash_stubs_test.ml +++ b/tests/ounit_tests/ounit_hash_stubs_test.ml @@ -1,6 +1,6 @@ let ( >:: ), ( >::: ) = OUnit.(( >:: ), ( >::: )) -let ( =~ ) = OUnit.assert_equal +let ( =~ ) x y = OUnit.assert_equal x y let count = 2_000_000 From 58881af3cf9a0573d7d9ba7ae02a89cd2ee5afcb Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 11:08:08 +0000 Subject: [PATCH 012/214] dce: simplify hashtable test asserts --- _dce/report.txt | 14 +------------- tests/ounit_tests/ounit_hashtbl_tests.ml | 2 +- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index 898ae420d02..766ecfadb43 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -1,16 +1,4 @@ - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_hashtbl_tests.ml", line 3, characters 0-53 - optional argument cmp of function +=~ is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_hashtbl_tests.ml", line 3, characters 0-53 - optional argument msg of function +=~ is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_hashtbl_tests.ml", line 3, characters 0-53 - optional argument pp_diff of function +=~ is never used - Warning Unused Argument File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_jsx_loc_tests.ml", line 2, characters 0-37 optional argument cmp of function +assert_equal is never used @@ -17197,4 +17185,4 @@ <-- line 4 OUnit.assert_equal ~cmp:(Vec_int.equal (fun (x : int) y -> x = y)) x y [@@dead "+=~"] - Analysis reported 3051 issues (Warning Dead Module:145, Warning Dead Type:369, Warning Dead Value:2128, Warning Dead Value With Side Effects:37, Warning Incorrect Annotation:1, Warning Redundant Optional Argument:214, Warning Unused Argument:157) + Analysis reported 3048 issues (Warning Dead Module:145, Warning Dead Type:369, Warning Dead Value:2128, Warning Dead Value With Side Effects:37, Warning Incorrect Annotation:1, Warning Redundant Optional Argument:214, Warning Unused Argument:154) diff --git a/tests/ounit_tests/ounit_hashtbl_tests.ml b/tests/ounit_tests/ounit_hashtbl_tests.ml index fde7bb0aaed..30233c5d948 100644 --- a/tests/ounit_tests/ounit_hashtbl_tests.ml +++ b/tests/ounit_tests/ounit_hashtbl_tests.ml @@ -1,6 +1,6 @@ let ( >:: ), ( >::: ) = OUnit.(( >:: ), ( >::: )) -let ( =~ ) = OUnit.assert_equal ~printer:Ext_obj.dump +let ( =~ ) x y = OUnit.assert_equal ~printer:Ext_obj.dump x y let suites = __FILE__ From 96eec8375f1ea8c1624fd64bbabc9f0cd125b156 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 11:08:49 +0000 Subject: [PATCH 013/214] dce: inline jsx loc assert --- _dce/report.txt | 18 +----------------- tests/ounit_tests/ounit_jsx_loc_tests.ml | 3 +-- 2 files changed, 2 insertions(+), 19 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index 766ecfadb43..0c969462c32 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -1,20 +1,4 @@ - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_jsx_loc_tests.ml", line 2, characters 0-37 - optional argument cmp of function +assert_equal is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_jsx_loc_tests.ml", line 2, characters 0-37 - optional argument msg of function +assert_equal is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_jsx_loc_tests.ml", line 2, characters 0-37 - optional argument pp_diff of function +assert_equal is never used - - Warning Redundant Optional Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_jsx_loc_tests.ml", line 2, characters 0-37 - optional argument printer of function +assert_equal is always supplied (1 calls) - Warning Unused Argument File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_list_test.ml", line 93, characters 11-42 optional argument cmp of function +=~ is never used @@ -17185,4 +17169,4 @@ <-- line 4 OUnit.assert_equal ~cmp:(Vec_int.equal (fun (x : int) y -> x = y)) x y [@@dead "+=~"] - Analysis reported 3048 issues (Warning Dead Module:145, Warning Dead Type:369, Warning Dead Value:2128, Warning Dead Value With Side Effects:37, Warning Incorrect Annotation:1, Warning Redundant Optional Argument:214, Warning Unused Argument:154) + Analysis reported 3044 issues (Warning Dead Module:145, Warning Dead Type:369, Warning Dead Value:2128, Warning Dead Value With Side Effects:37, Warning Incorrect Annotation:1, Warning Redundant Optional Argument:213, Warning Unused Argument:151) diff --git a/tests/ounit_tests/ounit_jsx_loc_tests.ml b/tests/ounit_tests/ounit_jsx_loc_tests.ml index 09f667f1626..e9b3845bb89 100644 --- a/tests/ounit_tests/ounit_jsx_loc_tests.ml +++ b/tests/ounit_tests/ounit_jsx_loc_tests.ml @@ -1,5 +1,4 @@ let ( >:: ), ( >::: ) = OUnit.(( >:: ), ( >::: )) -let assert_equal = OUnit.assert_equal let assert_failure = OUnit.assert_failure let parse_structure source = @@ -57,7 +56,7 @@ let assert_same_loc expected actual = loc.loc_end.pos_bol, loc.loc_end.pos_cnum ) in - assert_equal + OUnit.assert_equal ~printer:(fun loc -> let sl, sb, sc, el, eb, ec = to_tuple loc in Printf.sprintf "(%d,%d,%d)-(%d,%d,%d)" sl sb sc el eb ec) From 3b524c624f187d2da7f0d787438ab943911d55f0 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 11:10:55 +0000 Subject: [PATCH 014/214] dce: simplify list test asserts --- _dce/report.txt | 60 +--------------------------- tests/ounit_tests/ounit_list_test.ml | 9 ++--- 2 files changed, 5 insertions(+), 64 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index 0c969462c32..83ac6c5f62b 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -1,56 +1,4 @@ - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_list_test.ml", line 93, characters 11-42 - optional argument cmp of function +=~ is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_list_test.ml", line 93, characters 11-42 - optional argument msg of function +=~ is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_list_test.ml", line 93, characters 11-42 - optional argument pp_diff of function +=~ is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_list_test.ml", line 93, characters 11-42 - optional argument printer of function +=~ is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_list_test.ml", line 62, characters 11-51 - optional argument cmp of function +=~ is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_list_test.ml", line 62, characters 11-51 - optional argument msg of function +=~ is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_list_test.ml", line 62, characters 11-51 - optional argument pp_diff of function +=~ is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_list_test.ml", line 31, characters 11-68 - optional argument cmp of function +=~ is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_list_test.ml", line 31, characters 11-68 - optional argument msg of function +=~ is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_list_test.ml", line 31, characters 11-68 - optional argument pp_diff of function +=~ is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_list_test.ml", line 20, characters 11-68 - optional argument cmp of function +=~ is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_list_test.ml", line 20, characters 11-68 - optional argument msg of function +=~ is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_list_test.ml", line 20, characters 11-68 - optional argument pp_diff of function +=~ is never used - Warning Unused Argument File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_map_tests.ml", line 3, characters 0-31 optional argument cmp of function +=~ is never used @@ -17139,12 +17087,6 @@ <-- line 3 let ( =~ ) = OUnit.assert_equal [@@dead "+=~"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_list_test.ml", line 3, characters 0-31 - +=~ is never used - <-- line 3 - let ( =~ ) = OUnit.assert_equal [@@dead "+=~"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_scc_tests.ml", line 3, characters 0-31 +=~ is never used @@ -17169,4 +17111,4 @@ <-- line 4 OUnit.assert_equal ~cmp:(Vec_int.equal (fun (x : int) y -> x = y)) x y [@@dead "+=~"] - Analysis reported 3044 issues (Warning Dead Module:145, Warning Dead Type:369, Warning Dead Value:2128, Warning Dead Value With Side Effects:37, Warning Incorrect Annotation:1, Warning Redundant Optional Argument:213, Warning Unused Argument:151) + Analysis reported 3030 issues (Warning Dead Module:145, Warning Dead Type:369, Warning Dead Value:2127, Warning Dead Value With Side Effects:37, Warning Incorrect Annotation:1, Warning Redundant Optional Argument:213, Warning Unused Argument:138) diff --git a/tests/ounit_tests/ounit_list_test.ml b/tests/ounit_tests/ounit_list_test.ml index c08725ddab8..1cb3a38f9b5 100644 --- a/tests/ounit_tests/ounit_list_test.ml +++ b/tests/ounit_tests/ounit_list_test.ml @@ -1,6 +1,5 @@ let ( >:: ), ( >::: ) = OUnit.(( >:: ), ( >::: )) -let ( =~ ) = OUnit.assert_equal let printer_int_list xs = Format.asprintf "%a" (Format.pp_print_list Format.pp_print_int ~pp_sep:Format.pp_print_space) @@ -17,7 +16,7 @@ let suites = (Ext_list.flat_map_append [1; 2] [3; 4] (fun x -> [x; x])) [1; 1; 2; 2; 3; 4] ); ( __LOC__ >:: fun _ -> - let ( =~ ) = OUnit.assert_equal ~printer:printer_int_list in + let ( =~ ) x y = OUnit.assert_equal ~printer:printer_int_list x y in Ext_list.flat_map [] (fun x -> [succ x]) =~ []; Ext_list.flat_map [1] (fun x -> [x; succ x]) =~ [1; 2]; Ext_list.flat_map [1; 2] (fun x -> [x; succ x]) =~ [1; 2; 2; 3]; @@ -28,7 +27,7 @@ let suites = (Ext_list.stable_group [1; 2; 3; 4; 3] ( = )) [[1]; [2]; [4]; [3; 3]] ); ( __LOC__ >:: fun _ -> - let ( =~ ) = OUnit.assert_equal ~printer:printer_int_list in + let ( =~ ) x y = OUnit.assert_equal ~printer:printer_int_list x y in let f b _v = if b then 1 else 0 in Ext_list.map_last [] f =~ []; Ext_list.map_last [0] f =~ [1]; @@ -59,7 +58,7 @@ let suites = (Format.pp_print_list Format.pp_print_int) a b in - let ( =~ ) = OUnit.assert_equal ~printer in + let ( =~ ) x y = OUnit.assert_equal ~printer x y in Ext_list.split_at_last [1; 2; 3] =~ ([1; 2], 3); Ext_list.split_at_last [1; 2; 3; 4; 5; 6; 7; 8] =~ ([1; 2; 3; 4; 5; 6; 7], 8); @@ -90,7 +89,7 @@ let suites = OUnit.assert_bool __LOC__ (Ext_list.length_ge [] 0); OUnit.assert_bool __LOC__ (not (Ext_list.length_ge [] 1)) ); ( __LOC__ >:: fun _ -> - let ( =~ ) = OUnit.assert_equal in + let ( =~ ) x y = OUnit.assert_equal x y in let f p x = Ext_list.exclude_with_val x p in f (fun x -> x = 1) [1; 2; 3] =~ Some [2; 3]; From d7e3fb7afdd96f73273cea3af2d3be7875d9f851 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 11:11:32 +0000 Subject: [PATCH 015/214] dce: simplify map test asserts --- _dce/report.txt | 18 +----------------- tests/ounit_tests/ounit_map_tests.ml | 2 +- 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index 83ac6c5f62b..0312802bea8 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -1,20 +1,4 @@ - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_map_tests.ml", line 3, characters 0-31 - optional argument cmp of function +=~ is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_map_tests.ml", line 3, characters 0-31 - optional argument msg of function +=~ is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_map_tests.ml", line 3, characters 0-31 - optional argument pp_diff of function +=~ is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_map_tests.ml", line 3, characters 0-31 - optional argument printer of function +=~ is never used - Warning Unused Argument File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_string_tests.ml", line 349, characters 11-66 optional argument cmp of function +=~ is never used @@ -17111,4 +17095,4 @@ <-- line 4 OUnit.assert_equal ~cmp:(Vec_int.equal (fun (x : int) y -> x = y)) x y [@@dead "+=~"] - Analysis reported 3030 issues (Warning Dead Module:145, Warning Dead Type:369, Warning Dead Value:2127, Warning Dead Value With Side Effects:37, Warning Incorrect Annotation:1, Warning Redundant Optional Argument:213, Warning Unused Argument:138) + Analysis reported 3026 issues (Warning Dead Module:145, Warning Dead Type:369, Warning Dead Value:2127, Warning Dead Value With Side Effects:37, Warning Incorrect Annotation:1, Warning Redundant Optional Argument:213, Warning Unused Argument:134) diff --git a/tests/ounit_tests/ounit_map_tests.ml b/tests/ounit_tests/ounit_map_tests.ml index b488f8eb428..4ecb1cc6524 100644 --- a/tests/ounit_tests/ounit_map_tests.ml +++ b/tests/ounit_tests/ounit_map_tests.ml @@ -1,6 +1,6 @@ let ( >:: ), ( >::: ) = OUnit.(( >:: ), ( >::: )) -let ( =~ ) = OUnit.assert_equal +let ( =~ ) x y = OUnit.assert_equal x y let test_sorted_strict arr = let v = Map_int.of_array arr |> Map_int.to_sorted_array in From 0fde7b91aa7e4d770afeaafd9c1050237174828c Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 11:12:42 +0000 Subject: [PATCH 016/214] dce: simplify string test asserts --- _dce/report.txt | 86 +------------------------ tests/ounit_tests/ounit_string_tests.ml | 20 +++--- 2 files changed, 12 insertions(+), 94 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index 0312802bea8..cb1bedfae0a 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -1,88 +1,4 @@ - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_string_tests.ml", line 349, characters 11-66 - optional argument cmp of function +=~ is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_string_tests.ml", line 349, characters 11-66 - optional argument msg of function +=~ is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_string_tests.ml", line 349, characters 11-66 - optional argument pp_diff of function +=~ is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_string_tests.ml", line 338, characters 11-64 - optional argument cmp of function +=~ is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_string_tests.ml", line 338, characters 11-64 - optional argument msg of function +=~ is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_string_tests.ml", line 338, characters 11-64 - optional argument pp_diff of function +=~ is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_string_tests.ml", line 329, characters 11-181 - optional argument cmp of function +=~ is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_string_tests.ml", line 329, characters 11-181 - optional argument msg of function +=~ is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_string_tests.ml", line 329, characters 11-181 - optional argument pp_diff of function +=~ is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_string_tests.ml", line 308, characters 11-64 - optional argument cmp of function +=~ is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_string_tests.ml", line 308, characters 11-64 - optional argument msg of function +=~ is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_string_tests.ml", line 308, characters 11-64 - optional argument pp_diff of function +=~ is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_string_tests.ml", line 131, characters 11-92 - optional argument cmp of function +=~ is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_string_tests.ml", line 131, characters 11-92 - optional argument msg of function +=~ is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_string_tests.ml", line 131, characters 11-92 - optional argument pp_diff of function +=~ is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_string_tests.ml", line 7, characters 0-58 - optional argument cmp of function +string_eq is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_string_tests.ml", line 7, characters 0-58 - optional argument msg of function +string_eq is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_string_tests.ml", line 7, characters 0-58 - optional argument pp_diff of function +string_eq is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_string_tests.ml", line 3, characters 0-53 - optional argument cmp of function +=~ is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_string_tests.ml", line 3, characters 0-53 - optional argument msg of function +=~ is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_string_tests.ml", line 3, characters 0-53 - optional argument pp_diff of function +=~ is never used - Warning Unused Argument File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_utf8_test.ml", line 6, characters 0-31 optional argument cmp of function +=~ is never used @@ -17095,4 +17011,4 @@ <-- line 4 OUnit.assert_equal ~cmp:(Vec_int.equal (fun (x : int) y -> x = y)) x y [@@dead "+=~"] - Analysis reported 3026 issues (Warning Dead Module:145, Warning Dead Type:369, Warning Dead Value:2127, Warning Dead Value With Side Effects:37, Warning Incorrect Annotation:1, Warning Redundant Optional Argument:213, Warning Unused Argument:134) + Analysis reported 3005 issues (Warning Dead Module:145, Warning Dead Type:369, Warning Dead Value:2127, Warning Dead Value With Side Effects:37, Warning Incorrect Annotation:1, Warning Redundant Optional Argument:213, Warning Unused Argument:113) diff --git a/tests/ounit_tests/ounit_string_tests.ml b/tests/ounit_tests/ounit_string_tests.ml index aba2e4114c4..d03023e8d77 100644 --- a/tests/ounit_tests/ounit_string_tests.ml +++ b/tests/ounit_tests/ounit_string_tests.ml @@ -1,10 +1,10 @@ let ( >:: ), ( >::: ) = OUnit.(( >:: ), ( >::: )) -let ( =~ ) = OUnit.assert_equal ~printer:Ext_obj.dump +let ( =~ ) x y = OUnit.assert_equal ~printer:Ext_obj.dump x y let printer_string x = x -let string_eq = OUnit.assert_equal ~printer:(fun id -> id) +let string_eq x y = OUnit.assert_equal ~printer:(fun id -> id) x y let suites = __FILE__ @@ -128,8 +128,8 @@ let suites = Ext_string.starts_with "abb" "abb" =~ true; Ext_string.starts_with "abb" "abbc" =~ false ); ( __LOC__ >:: fun _ -> - let ( =~ ) = - OUnit.assert_equal ~printer:(fun x -> string_of_bool x) + let ( =~ ) x y = + OUnit.assert_equal ~printer:(fun x -> string_of_bool x) x y in let k = Ext_string.ends_with in k "xx.ml" ".ml" =~ true; @@ -305,7 +305,7 @@ let suites = ( __LOC__ >:: fun _ -> Ext_namespace.namespace_of_package_name "xx" =~ "Xx" ); ( __LOC__ >:: fun _ -> - let ( =~ ) = OUnit.assert_equal ~printer:(fun x -> x) in + let ( =~ ) x y = OUnit.assert_equal ~printer:(fun x -> x) x y in Ext_namespace.namespace_of_package_name "reason-react" =~ "ReasonReact"; Ext_namespace.namespace_of_package_name "Foo_bar" =~ "Foo_bar"; @@ -326,16 +326,18 @@ let suites = Ext_namespace.js_name_of_modulename "AA-b" Upper ".bs.js" =~ "AA.bs.js" ); ( __LOC__ >:: fun _ -> - let ( =~ ) = - OUnit.assert_equal ~printer:(fun x -> + let ( =~ ) x y = + OUnit.assert_equal + ~printer:(fun x -> match x with | None -> "" | Some (a, b) -> a ^ "," ^ b) + x y in Ext_namespace.try_split_module_name "Js-X" =~ Some ("X", "Js"); Ext_namespace.try_split_module_name "Js_X" =~ None ); ( __LOC__ >:: fun _ -> - let ( =~ ) = OUnit.assert_equal ~printer:(fun x -> x) in + let ( =~ ) x y = OUnit.assert_equal ~printer:(fun x -> x) x y in let f = Ext_string.capitalize_ascii in f "x" =~ "X"; f "X" =~ "X"; @@ -346,7 +348,7 @@ let suites = f v =~ "Bc"; v =~ "bc" ); ( __LOC__ >:: fun _ -> - let ( =~ ) = OUnit.assert_equal ~printer:printer_string in + let ( =~ ) x y = OUnit.assert_equal ~printer:printer_string x y in Ext_filename.chop_all_extensions_maybe "a.bs.js" =~ "a"; Ext_filename.chop_all_extensions_maybe "a.js" =~ "a"; Ext_filename.chop_all_extensions_maybe "a" =~ "a"; From 8a3989ac3749f17cc9ea884b7e227d15fdfde1da Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 11:13:19 +0000 Subject: [PATCH 017/214] dce: simplify utf8 test asserts --- _dce/report.txt | 18 +----------------- tests/ounit_tests/ounit_utf8_test.ml | 2 +- 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index cb1bedfae0a..0b3746c4141 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -1,20 +1,4 @@ - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_utf8_test.ml", line 6, characters 0-31 - optional argument cmp of function +=~ is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_utf8_test.ml", line 6, characters 0-31 - optional argument msg of function +=~ is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_utf8_test.ml", line 6, characters 0-31 - optional argument pp_diff of function +=~ is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_utf8_test.ml", line 6, characters 0-31 - optional argument printer of function +=~ is never used - Warning Unused Argument File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_util_tests.ml", line 3, characters 0-53 optional argument cmp of function +=~ is never used @@ -17011,4 +16995,4 @@ <-- line 4 OUnit.assert_equal ~cmp:(Vec_int.equal (fun (x : int) y -> x = y)) x y [@@dead "+=~"] - Analysis reported 3005 issues (Warning Dead Module:145, Warning Dead Type:369, Warning Dead Value:2127, Warning Dead Value With Side Effects:37, Warning Incorrect Annotation:1, Warning Redundant Optional Argument:213, Warning Unused Argument:113) + Analysis reported 3001 issues (Warning Dead Module:145, Warning Dead Type:369, Warning Dead Value:2127, Warning Dead Value With Side Effects:37, Warning Incorrect Annotation:1, Warning Redundant Optional Argument:213, Warning Unused Argument:109) diff --git a/tests/ounit_tests/ounit_utf8_test.ml b/tests/ounit_tests/ounit_utf8_test.ml index 42846b6d049..f241b68722b 100644 --- a/tests/ounit_tests/ounit_utf8_test.ml +++ b/tests/ounit_tests/ounit_utf8_test.ml @@ -3,7 +3,7 @@ let ( >:: ), ( >::: ) = OUnit.(( >:: ), ( >::: )) -let ( =~ ) = OUnit.assert_equal +let ( =~ ) x y = OUnit.assert_equal x y let suites = __FILE__ >::: [ From 79cb28719bd70a5449964b2e9c1daffab0dfd2b1 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 11:13:51 +0000 Subject: [PATCH 018/214] dce: simplify util test asserts --- _dce/report.txt | 14 +------------- tests/ounit_tests/ounit_util_tests.ml | 2 +- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index 0b3746c4141..1111b6454fd 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -1,16 +1,4 @@ - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_util_tests.ml", line 3, characters 0-53 - optional argument cmp of function +=~ is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_util_tests.ml", line 3, characters 0-53 - optional argument msg of function +=~ is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_util_tests.ml", line 3, characters 0-53 - optional argument pp_diff of function +=~ is never used - Warning Unused Argument File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_tests_util.ml", line 7, characters 0-423 optional argument msg of function +assert_raise_any is never used @@ -16995,4 +16983,4 @@ <-- line 4 OUnit.assert_equal ~cmp:(Vec_int.equal (fun (x : int) y -> x = y)) x y [@@dead "+=~"] - Analysis reported 3001 issues (Warning Dead Module:145, Warning Dead Type:369, Warning Dead Value:2127, Warning Dead Value With Side Effects:37, Warning Incorrect Annotation:1, Warning Redundant Optional Argument:213, Warning Unused Argument:109) + Analysis reported 2998 issues (Warning Dead Module:145, Warning Dead Type:369, Warning Dead Value:2127, Warning Dead Value With Side Effects:37, Warning Incorrect Annotation:1, Warning Redundant Optional Argument:213, Warning Unused Argument:106) diff --git a/tests/ounit_tests/ounit_util_tests.ml b/tests/ounit_tests/ounit_util_tests.ml index 3ecb59ec970..526fc09a7aa 100644 --- a/tests/ounit_tests/ounit_util_tests.ml +++ b/tests/ounit_tests/ounit_util_tests.ml @@ -1,6 +1,6 @@ let ( >:: ), ( >::: ) = OUnit.(( >:: ), ( >::: )) -let ( =~ ) = OUnit.assert_equal ~printer:Ext_obj.dump +let ( =~ ) x y = OUnit.assert_equal ~printer:Ext_obj.dump x y let suites = __FILE__ >::: [ From 4875980c2057fb256d846fb39063546907e1e435 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 11:14:35 +0000 Subject: [PATCH 019/214] dce: simplify raise assertion --- _dce/report.txt | 10 +++------- tests/ounit_tests/ounit_tests_util.ml | 12 ++---------- 2 files changed, 5 insertions(+), 17 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index 1111b6454fd..108c0381c8f 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -1,8 +1,4 @@ - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_tests_util.ml", line 7, characters 0-423 - optional argument msg of function +assert_raise_any is never used - Warning Unused Argument File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reanalyze.ml", line 199, characters 0-11133 optional argument file_stats of function +run_analysis is never used @@ -16972,9 +16968,9 @@ fst (Ext_scc.graph_check node_array) [@@dead "+read_file"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_tests_util.ml", line 20, characters 0-492 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_tests_util.ml", line 12, characters 0-492 +time is never used - <-- line 20 + <-- line 12 flush stdout [@@dead "+time"] Warning Dead Value @@ -16983,4 +16979,4 @@ <-- line 4 OUnit.assert_equal ~cmp:(Vec_int.equal (fun (x : int) y -> x = y)) x y [@@dead "+=~"] - Analysis reported 2998 issues (Warning Dead Module:145, Warning Dead Type:369, Warning Dead Value:2127, Warning Dead Value With Side Effects:37, Warning Incorrect Annotation:1, Warning Redundant Optional Argument:213, Warning Unused Argument:106) + Analysis reported 2997 issues (Warning Dead Module:145, Warning Dead Type:369, Warning Dead Value:2127, Warning Dead Value With Side Effects:37, Warning Incorrect Annotation:1, Warning Redundant Optional Argument:213, Warning Unused Argument:105) diff --git a/tests/ounit_tests/ounit_tests_util.ml b/tests/ounit_tests/ounit_tests_util.ml index 5115c346462..86c945a3172 100644 --- a/tests/ounit_tests/ounit_tests_util.ml +++ b/tests/ounit_tests/ounit_tests_util.ml @@ -4,17 +4,9 @@ let raises f = None with e -> Some e -let assert_raise_any ?msg (f : unit -> 'a) = - let get_error_string () = - let str = - Format.sprintf "expected exception, but no exception was raised." - in - match msg with - | None -> OUnit.assert_failure str - | Some s -> OUnit.assert_failure (s ^ "\n" ^ str) - in +let assert_raise_any (f : unit -> 'a) = match raises f with - | None -> OUnit.assert_failure (get_error_string ()) + | None -> OUnit.assert_failure "expected exception, but no exception was raised." | Some exn -> OUnit.assert_bool (Printexc.to_string exn) true let time ?nums description f = From 8115b5faf45a0adbcdaf3c438c165843a7b31b1c Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 11:15:17 +0000 Subject: [PATCH 020/214] dce: note live reanalyze stats --- scripts/dce/live-findings.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 scripts/dce/live-findings.md diff --git a/scripts/dce/live-findings.md b/scripts/dce/live-findings.md new file mode 100644 index 00000000000..c577c16d2f4 --- /dev/null +++ b/scripts/dce/live-findings.md @@ -0,0 +1,18 @@ +# DCE live findings + +Working notes for warnings that look actionable in `_dce/report.txt`, but are +live after manual validation. + +## Live warnings + +### `Reanalyze.run_analysis ?file_stats` + +- Report: `Warning Unused Argument`, `analysis/reanalyze/src/reanalyze.ml`, + optional argument `file_stats` of `run_analysis`. +- Verdict: live; false positive. +- Validation: `analysis/reanalyze/src/reanalyze_server.ml` calls + `state.run_analysis ... ~file_stats ()` in the server request path, then reads + `file_stats.processed` and `file_stats.from_cache` for response stats. +- Implementation: `run_analysis` forwards `?file_stats` to + `process_cmt_files`; `process_cmt_files` mutates it from + `Reactive_analysis.process_files` stats when reactive mode is active. From f724fdd0f07e214fc4fb35913a973b571ca5ac95 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 11:16:02 +0000 Subject: [PATCH 021/214] dce: require ppx restore flag --- _dce/report.txt | 6 +----- compiler/core/cmd_ppx_apply.ml | 10 +++++----- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index 108c0381c8f..24e29d5d2b4 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -3,10 +3,6 @@ File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reanalyze.ml", line 199, characters 0-11133 optional argument file_stats of function +run_analysis is never used - Warning Redundant Optional Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/cmd_ppx_apply.ml", line 120, characters 0-241 - optional argument restore of function +apply_rewriters is always supplied (4 calls) - Warning Unused Argument File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typemod.mli", line 43, characters 0-163 optional argument used_slot of function +type_open_ is never used @@ -16979,4 +16975,4 @@ <-- line 4 OUnit.assert_equal ~cmp:(Vec_int.equal (fun (x : int) y -> x = y)) x y [@@dead "+=~"] - Analysis reported 2997 issues (Warning Dead Module:145, Warning Dead Type:369, Warning Dead Value:2127, Warning Dead Value With Side Effects:37, Warning Incorrect Annotation:1, Warning Redundant Optional Argument:213, Warning Unused Argument:105) + Analysis reported 2996 issues (Warning Dead Module:145, Warning Dead Type:369, Warning Dead Value:2127, Warning Dead Value With Side Effects:37, Warning Incorrect Annotation:1, Warning Redundant Optional Argument:212, Warning Unused Argument:105) diff --git a/compiler/core/cmd_ppx_apply.ml b/compiler/core/cmd_ppx_apply.ml index 111eae078d2..7186aadfa34 100644 --- a/compiler/core/cmd_ppx_apply.ml +++ b/compiler/core/cmd_ppx_apply.ml @@ -93,7 +93,7 @@ let rewrite kind ppxs ast = out | _ -> assert false -let apply_rewriters_str ?(restore = true) ~tool_name ast = +let apply_rewriters_str ~restore ~tool_name ast = match !Clflags.all_ppx with | [] -> if !Js_config.test_ast_conversion then @@ -105,7 +105,7 @@ let apply_rewriters_str ?(restore = true) ~tool_name ast = |> rewrite Ml ppxs |> Ml_binary.ast0_to_structure |> Ast_mapper.drop_ppx_context_str ~restore -let apply_rewriters_sig ?(restore = true) ~tool_name ast = +let apply_rewriters_sig ~restore ~tool_name ast = match !Clflags.all_ppx with | [] -> if !Js_config.test_ast_conversion then @@ -117,8 +117,8 @@ let apply_rewriters_sig ?(restore = true) ~tool_name ast = |> rewrite Mli ppxs |> Ml_binary.ast0_to_signature |> Ast_mapper.drop_ppx_context_sig ~restore -let apply_rewriters ?restore ~tool_name (type a) (kind : a Ml_binary.kind) +let apply_rewriters ~restore ~tool_name (type a) (kind : a Ml_binary.kind) (ast : a) : a = match kind with - | Ml_binary.Ml -> apply_rewriters_str ?restore ~tool_name ast - | Ml_binary.Mli -> apply_rewriters_sig ?restore ~tool_name ast + | Ml_binary.Ml -> apply_rewriters_str ~restore ~tool_name ast + | Ml_binary.Mli -> apply_rewriters_sig ~restore ~tool_name ast From fc9a119e4861c11d33739d7d996406c8d1ef75c9 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 11:18:11 +0000 Subject: [PATCH 022/214] dce: remove unused open slot --- _dce/report.txt | 104 ++++++++++++++++++--------------------- compiler/ml/env.ml | 5 +- compiler/ml/env.mli | 1 - compiler/ml/typecore.ml | 9 +--- compiler/ml/typecore.mli | 7 +-- compiler/ml/typemod.ml | 4 +- compiler/ml/typemod.mli | 1 - 7 files changed, 55 insertions(+), 76 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index 24e29d5d2b4..1f83062ee4e 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -3,10 +3,6 @@ File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reanalyze.ml", line 199, characters 0-11133 optional argument file_stats of function +run_analysis is never used - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typemod.mli", line 43, characters 0-163 - optional argument used_slot of function +type_open_ is never used - Warning Unused Argument File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/completion_back_end.ml", line 1595, characters 2-50 optional argument additional_text_edits of function +create is never used @@ -35,10 +31,6 @@ File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/translcore.ml", line 991, characters 0-2785 optional argument transformed_jsx of function +transl_apply is always supplied (2 calls) - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typemod.ml", line 88, characters 0-346 - optional argument used_slot of function +type_open_ is never used - Warning Unused Argument File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_derive_js_mapper.ml", line 136, characters 0-30 optional argument attrs of function +app2 is never used @@ -892,23 +884,23 @@ optional argument pval_attributes of function +local_external_apply is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typecore.ml", line 4621, characters 0-76 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typecore.ml", line 4616, characters 0-76 optional argument unif of function +super_report_unification_error is never used Warning Redundant Optional Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typecore.ml", line 1743, characters 0-231 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typecore.ml", line 1738, characters 0-231 optional argument lev of function +check_unused is always supplied (1 calls) Warning Redundant Optional Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typecore.ml", line 1714, characters 0-492 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typecore.ml", line 1709, characters 0-492 optional argument explode of function +partial_pred is always supplied (2 calls) Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typecore.ml", line 1150, characters 2-61 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typecore.ml", line 1145, characters 2-61 optional argument from_type of function Constructor.+unbound_name_error is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typecore.ml", line 972, characters 2-55 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typecore.ml", line 967, characters 2-55 optional argument from_type of function Label.+unbound_name_error is never used Warning Incorrect Annotation @@ -15160,35 +15152,35 @@ +enter_extension is never used and could have side effects Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 1922, characters 0-199 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 1921, characters 0-199 +crc_of_unit is never used - <-- line 1922 + <-- line 1921 | Some crc -> crc [@@dead "+crc_of_unit"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 2072, characters 0-139 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 2071, characters 0-139 +summary is never used - <-- line 2072 + <-- line 2071 else Env_constraints (env.summary, env.local_constraints) [@@dead "+summary"] Warning Dead Value With Side Effects - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 2076, characters 0-24 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 2075, characters 0-24 +last_env is never used and could have side effects Warning Dead Value With Side Effects - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 2077, characters 0-32 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 2076, characters 0-32 +last_reduced_env is never used and could have side effects Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 2079, characters 0-314 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 2078, characters 0-314 +keep_only_summary is never used - <-- line 2079 + <-- line 2078 new_env [@@dead "+keep_only_summary"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 2094, characters 0-187 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 2093, characters 0-187 +env_of_only_summary is never used - <-- line 2094 + <-- line 2093 {new_env with local_constraints = env.local_constraints; flags = env.flags} [@@dead "+env_of_only_summary"] Warning Dead Value @@ -15210,81 +15202,81 @@ val lookup_label : ?loc:Location.t -> Longident.t -> t -> label_description [@@dead "+lookup_label"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 167, characters 0-73 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 166, characters 0-73 +enter_extension is never used - <-- line 167 + <-- line 166 val enter_extension : string -> extension_constructor -> t -> Ident.t * t [@@dead "+enter_extension"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 177, characters 0-39 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 176, characters 0-39 +reset_cache_toplevel is never used - <-- line 177 + <-- line 176 val reset_cache_toplevel : unit -> unit [@@dead "+reset_cache_toplevel"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 197, characters 0-186 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 196, characters 0-186 +save_signature_with_imports is never used - <-- line 197 + <-- line 196 Cmi_format.cmi_infos [@@dead "+save_signature_with_imports"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 210, characters 0-36 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 209, characters 0-36 +crc_of_unit is never used - <-- line 210 + <-- line 209 val crc_of_unit : string -> Digest.t [@@dead "+crc_of_unit"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 214, characters 0-53 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 213, characters 0-53 +imports is never used - <-- line 214 + <-- line 213 val imports : unit -> (string * Digest.t option) list [@@dead "+imports"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 218, characters 0-27 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 217, characters 0-27 +crc_units is never used - <-- line 218 + <-- line 217 val crc_units : Consistbl.t [@@dead "+crc_units"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 219, characters 0-31 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 218, characters 0-31 +add_import is never used - <-- line 219 + <-- line 218 val add_import : string -> unit [@@dead "+add_import"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 224, characters 0-26 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 223, characters 0-26 +summary is never used - <-- line 224 + <-- line 223 val summary : t -> summary [@@dead "+summary"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 230, characters 0-30 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 229, characters 0-30 +keep_only_summary is never used - <-- line 230 + <-- line 229 val keep_only_summary : t -> t [@@dead "+keep_only_summary"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 231, characters 0-61 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 230, characters 0-61 +env_of_only_summary is never used - <-- line 231 + <-- line 230 val env_of_only_summary : (summary -> Subst.t -> t) -> t -> t [@@dead "+env_of_only_summary"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 245, characters 0-45 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 244, characters 0-45 +report_error is never used - <-- line 245 + <-- line 244 val report_error : formatter -> error -> unit [@@dead "+report_error"] Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 321, characters 4-21 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 320, characters 4-21 t.filename is a record label never used to read a value - <-- line 321 + <-- line 320 filename: string; [@dead "t.filename"] (** Name of the file containing the signature. *) Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 322, characters 4-30 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 321, characters 4-30 t.cmi is a record label never used to read a value - <-- line 322 + <-- line 321 cmi: Cmi_format.cmi_infos; [@dead "t.cmi"] Warning Dead Value @@ -16464,9 +16456,9 @@ val report_error : Env.t -> Location.t -> formatter -> error -> unit [@@dead "+report_error"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typecore.mli", line 162, characters 0-70 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typecore.mli", line 157, characters 0-70 +constant is never used - <-- line 162 + <-- line 157 val constant : Parsetree.constant -> (Asttypes.constant, error) result [@@dead "+constant"] Warning Dead Type @@ -16670,15 +16662,15 @@ val check_nongen_schemes : Env.t -> Types.signature -> unit [@@dead "+check_nongen_schemes"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typemod.mli", line 51, characters 0-47 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typemod.mli", line 50, characters 0-47 +simplify_signature is never used - <-- line 51 + <-- line 50 val simplify_signature : signature -> signature [@@dead "+simplify_signature"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typemod.mli", line 53, characters 0-59 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typemod.mli", line 52, characters 0-59 +path_of_module is never used - <-- line 53 + <-- line 52 val path_of_module : Typedtree.module_expr -> Path.t option [@@dead "+path_of_module"] Warning Dead Module @@ -16975,4 +16967,4 @@ <-- line 4 OUnit.assert_equal ~cmp:(Vec_int.equal (fun (x : int) y -> x = y)) x y [@@dead "+=~"] - Analysis reported 2996 issues (Warning Dead Module:145, Warning Dead Type:369, Warning Dead Value:2127, Warning Dead Value With Side Effects:37, Warning Incorrect Annotation:1, Warning Redundant Optional Argument:212, Warning Unused Argument:105) + Analysis reported 2994 issues (Warning Dead Module:145, Warning Dead Type:369, Warning Dead Value:2127, Warning Dead Value With Side Effects:37, Warning Incorrect Annotation:1, Warning Redundant Optional Argument:212, Warning Unused Argument:103) diff --git a/compiler/ml/env.ml b/compiler/ml/env.ml index 0626ba55520..5dc7310f303 100644 --- a/compiler/ml/env.ml +++ b/compiler/ml/env.ml @@ -1879,8 +1879,7 @@ let open_signature slot root env0 = (* Open a signature from a file *) -let open_signature ?(used_slot = ref false) ?(loc = Location.none) - ?(toplevel = false) ovf root env = +let open_signature ?(loc = Location.none) ?(toplevel = false) ovf root env = if (not toplevel) && ovf = Asttypes.Fresh && (not loc.Location.loc_ghost) @@ -1888,7 +1887,7 @@ let open_signature ?(used_slot = ref false) ?(loc = Location.none) || Warnings.is_active (Warnings.Open_shadow_identifier ("", "")) || Warnings.is_active (Warnings.Open_shadow_label_constructor ("", ""))) then ( - let used = used_slot in + let used = ref false in Delayed_checks.add_delayed_check (fun () -> if not !used then ( used := true; diff --git a/compiler/ml/env.mli b/compiler/ml/env.mli index 66b8e3192b4..908edc8af2e 100644 --- a/compiler/ml/env.mli +++ b/compiler/ml/env.mli @@ -147,7 +147,6 @@ val add_signature : signature -> t -> t Used to implement open. Returns None if the path refers to a functor, not a structure. *) val open_signature : - ?used_slot:bool ref -> ?loc:Location.t -> ?toplevel:bool -> Asttypes.override_flag -> diff --git a/compiler/ml/typecore.ml b/compiler/ml/typecore.ml index efaea72e882..8fe55de60d5 100644 --- a/compiler/ml/typecore.ml +++ b/compiler/ml/typecore.ml @@ -111,14 +111,9 @@ let type_module = (* Forward declaration, to be filled in by Typemod.type_open *) let type_open : - (?used_slot:bool ref -> - override_flag -> - Env.t -> - Location.t -> - Longident.t loc -> - Path.t * Env.t) + (override_flag -> Env.t -> Location.t -> Longident.t loc -> Path.t * Env.t) ref = - ref (fun ?used_slot:_ _ -> assert false) + ref (fun _ -> assert false) (* Forward declaration, to be filled in by Typemod.type_package *) diff --git a/compiler/ml/typecore.mli b/compiler/ml/typecore.mli index cf87fe7361c..5d5225039d5 100644 --- a/compiler/ml/typecore.mli +++ b/compiler/ml/typecore.mli @@ -142,12 +142,7 @@ val type_module : (Env.t -> Parsetree.module_expr -> Typedtree.module_expr) ref (* Forward declaration, to be filled in by Typemod.type_open *) val type_open : - (?used_slot:bool ref -> - override_flag -> - Env.t -> - Location.t -> - Longident.t loc -> - Path.t * Env.t) + (override_flag -> Env.t -> Location.t -> Longident.t loc -> Path.t * Env.t) ref (* Forward declaration, to be filled in by Typemod.type_package *) diff --git a/compiler/ml/typemod.ml b/compiler/ml/typemod.ml index 7abdb05d434..66ed7943d8d 100644 --- a/compiler/ml/typemod.ml +++ b/compiler/ml/typemod.ml @@ -85,9 +85,9 @@ let extract_sig_open env loc mty = (* Compute the environment after opening a module *) -let type_open_ ?used_slot ?toplevel ovf env loc lid = +let type_open_ ?toplevel ovf env loc lid = let path = Typetexp.lookup_module ~load:true env lid.loc lid.txt in - match Env.open_signature ~loc ?used_slot ?toplevel ovf path env with + match Env.open_signature ~loc ?toplevel ovf path env with | Some env -> (path, env) | None -> let md = Env.find_module path env in diff --git a/compiler/ml/typemod.mli b/compiler/ml/typemod.mli index 0f36cf6afd8..5840233cd04 100644 --- a/compiler/ml/typemod.mli +++ b/compiler/ml/typemod.mli @@ -41,7 +41,6 @@ val type_implementation_more : val transl_signature : Env.t -> Parsetree.signature -> Typedtree.signature val check_nongen_schemes : Env.t -> Types.signature -> unit val type_open_ : - ?used_slot:bool ref -> ?toplevel:bool -> Asttypes.override_flag -> Env.t -> From c02633ffe1f7e2157a50b11b2f0dc8d20b2a6423 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 11:19:21 +0000 Subject: [PATCH 023/214] dce: narrow typed completions helper --- _dce/report.txt | 22 +--------------------- analysis/src/completion_back_end.ml | 6 +++++- 2 files changed, 6 insertions(+), 22 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index 1f83062ee4e..f861fe4f43a 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -3,26 +3,6 @@ File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reanalyze.ml", line 199, characters 0-11133 optional argument file_stats of function +run_analysis is never used - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/completion_back_end.ml", line 1595, characters 2-50 - optional argument additional_text_edits of function +create is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/completion_back_end.ml", line 1595, characters 2-50 - optional argument data of function +create is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/completion_back_end.ml", line 1595, characters 2-50 - optional argument detail of function +create is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/completion_back_end.ml", line 1595, characters 2-50 - optional argument filter_text of function +create is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/completion_back_end.ml", line 1595, characters 2-50 - optional argument synthetic of function +create is never used - Warning Redundant Optional Argument File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/translcore.ml", line 991, characters 0-2785 optional argument inlined of function +transl_apply is always supplied (2 calls) @@ -16967,4 +16947,4 @@ <-- line 4 OUnit.assert_equal ~cmp:(Vec_int.equal (fun (x : int) y -> x = y)) x y [@@dead "+=~"] - Analysis reported 2994 issues (Warning Dead Module:145, Warning Dead Type:369, Warning Dead Value:2127, Warning Dead Value With Side Effects:37, Warning Incorrect Annotation:1, Warning Redundant Optional Argument:212, Warning Unused Argument:103) + Analysis reported 2989 issues (Warning Dead Module:145, Warning Dead Type:369, Warning Dead Value:2127, Warning Dead Value With Side Effects:37, Warning Incorrect Annotation:1, Warning Redundant Optional Argument:212, Warning Unused Argument:98) diff --git a/analysis/src/completion_back_end.ml b/analysis/src/completion_back_end.ml index 3f63bb53027..ecb1a6fd1eb 100644 --- a/analysis/src/completion_back_end.ml +++ b/analysis/src/completion_back_end.ml @@ -1592,7 +1592,11 @@ let rec complete_typed_value ?(type_arg_context : type_arg_context option) (t : Shared_types.completion_type) = let empty_case = empty_case ~mode in let print_constructor_args = print_constructor_args ~mode in - let create = Completion.create ?type_arg_context in + let create ?deprecated ?(docstring = []) ?(includes_snippets = false) + ?insert_text ?sort_text name ~kind ~env = + Completion.create ?type_arg_context ?deprecated ~docstring ~includes_snippets + ?insert_text ?sort_text name ~kind ~env + in let get_record_completions ~env ~fields ~extracted_type = (* As we're completing for a record, we'll need a hint (completionContext) here to figure out whether we should complete for a record field, or From 035260617ce5251208a2b5070b17a0391641969c Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 11:20:09 +0000 Subject: [PATCH 024/214] dce: require apply metadata --- _dce/report.txt | 10 +--------- compiler/ml/translcore.ml | 5 ++--- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index f861fe4f43a..bf764c43685 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -3,14 +3,6 @@ File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reanalyze.ml", line 199, characters 0-11133 optional argument file_stats of function +run_analysis is never used - Warning Redundant Optional Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/translcore.ml", line 991, characters 0-2785 - optional argument inlined of function +transl_apply is always supplied (2 calls) - - Warning Redundant Optional Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/translcore.ml", line 991, characters 0-2785 - optional argument transformed_jsx of function +transl_apply is always supplied (2 calls) - Warning Unused Argument File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_derive_js_mapper.ml", line 136, characters 0-30 optional argument attrs of function +app2 is never used @@ -16947,4 +16939,4 @@ <-- line 4 OUnit.assert_equal ~cmp:(Vec_int.equal (fun (x : int) y -> x = y)) x y [@@dead "+=~"] - Analysis reported 2989 issues (Warning Dead Module:145, Warning Dead Type:369, Warning Dead Value:2127, Warning Dead Value With Side Effects:37, Warning Incorrect Annotation:1, Warning Redundant Optional Argument:212, Warning Unused Argument:98) + Analysis reported 2987 issues (Warning Dead Module:145, Warning Dead Type:369, Warning Dead Value:2127, Warning Dead Value With Side Effects:37, Warning Incorrect Annotation:1, Warning Redundant Optional Argument:210, Warning Unused Argument:98) diff --git a/compiler/ml/translcore.ml b/compiler/ml/translcore.ml index 69fbcab4729..ace39b7322e 100644 --- a/compiler/ml/translcore.ml +++ b/compiler/ml/translcore.ml @@ -988,9 +988,8 @@ and transl_case_try {c_lhs; c_guard; c_rhs} = and transl_cases_try cases = List.map transl_case_try cases -and transl_apply ?(inlined = Default_inline) - ?(uncurried_partial_application = None) ?(transformed_jsx = false) lam sargs - loc = +and transl_apply ~inlined ?(uncurried_partial_application = None) ~transformed_jsx + lam sargs loc = let lapply ap_func ap_args = Lapply { From b3d08ab5ebc25e3cda74447fb1cea67abf7e183b Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 11:21:55 +0000 Subject: [PATCH 025/214] dce: narrow js mapper app helpers --- _dce/report.txt | 18 +----------------- compiler/frontend/ast_derive_js_mapper.ml | 4 ++-- 2 files changed, 3 insertions(+), 19 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index bf764c43685..890609fbf41 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -3,22 +3,6 @@ File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reanalyze.ml", line 199, characters 0-11133 optional argument file_stats of function +run_analysis is never used - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_derive_js_mapper.ml", line 136, characters 0-30 - optional argument attrs of function +app2 is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_derive_js_mapper.ml", line 136, characters 0-30 - optional argument loc of function +app2 is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_derive_js_mapper.ml", line 134, characters 0-30 - optional argument attrs of function +app1 is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_derive_js_mapper.ml", line 134, characters 0-30 - optional argument loc of function +app1 is never used - Warning Redundant Optional Argument File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 344, characters 2-178 optional argument attrs of function Te.+constructor is always supplied (1 calls) @@ -16939,4 +16923,4 @@ <-- line 4 OUnit.assert_equal ~cmp:(Vec_int.equal (fun (x : int) y -> x = y)) x y [@@dead "+=~"] - Analysis reported 2987 issues (Warning Dead Module:145, Warning Dead Type:369, Warning Dead Value:2127, Warning Dead Value With Side Effects:37, Warning Incorrect Annotation:1, Warning Redundant Optional Argument:210, Warning Unused Argument:98) + Analysis reported 2983 issues (Warning Dead Module:145, Warning Dead Type:369, Warning Dead Value:2127, Warning Dead Value With Side Effects:37, Warning Incorrect Annotation:1, Warning Redundant Optional Argument:210, Warning Unused Argument:94) diff --git a/compiler/frontend/ast_derive_js_mapper.ml b/compiler/frontend/ast_derive_js_mapper.ml index ffb5dbd6eca..4ff05c9056e 100644 --- a/compiler/frontend/ast_derive_js_mapper.ml +++ b/compiler/frontend/ast_derive_js_mapper.ml @@ -131,9 +131,9 @@ let build_map (row_fields : Parsetree.row_field list) = in (data, rev_data, !has_bs_as) -let app1 = Ast_compatible.app1 +let app1 fn arg = Ast_compatible.app1 fn arg -let app2 = Ast_compatible.app2 +let app2 fn arg1 arg2 = Ast_compatible.app2 fn arg1 arg2 let ( ->~ ) a b = Ast_helper.Typ.arrows [{attrs = []; lbl = Nolabel; typ = a}] b From 43c60d5711ecac74639b5a3ad418413eed089bec Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 11:23:15 +0000 Subject: [PATCH 026/214] dce: note live ast helper labels --- scripts/dce/live-findings.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/scripts/dce/live-findings.md b/scripts/dce/live-findings.md index c577c16d2f4..e27188757a5 100644 --- a/scripts/dce/live-findings.md +++ b/scripts/dce/live-findings.md @@ -16,3 +16,18 @@ live after manual validation. - Implementation: `run_analysis` forwards `?file_stats` to `process_cmt_files`; `process_cmt_files` mutates it from `Reactive_analysis.process_files` stats when reactive mode is active. + +### `Ast_helper0` helper labels + +- Report: many `Warning Redundant Optional Argument` entries in + `compiler/ml/ast_helper0.ml`, starting with `Te.constructor`, `Te.mk`, + `Type.field`, and `Type.constructor`. +- Verdict: live compatibility surface; do not remove as part of this DCE pass. +- Validation: `compiler/ml/ast_mapper_to0.ml` opens `Ast_helper0` and uses these + helpers while converting the current `Parsetree` to `Parsetree0`, supplying + locations, attributes, privacy flags, constructor arguments, and similar data + from the source tree. +- Context: `Ast_helper0` mirrors the helper shape for the frozen v0 parsetree. + The repository guidance says v0 PPX compatibility must be preserved, so + changing this helper API for locally redundant labels is higher risk than the + DCE warning suggests. From 250c180b746df3d63abc3417e4bb9bf2d3440c35 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 11:24:24 +0000 Subject: [PATCH 027/214] dce: remove unused args finish --- _dce/report.txt | 10 +--------- compiler/ext/bsc_args.ml | 5 +++-- compiler/ext/bsc_args.mli | 1 - 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index 890609fbf41..a98bbc17724 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -759,10 +759,6 @@ File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 55, characters 2-50 optional argument loc of function Typ.+any is always supplied (1 calls) - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/bsc_args.mli", line 47, characters 0-139 - optional argument finish of function +parse_exn is never used - Warning Unused Argument File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/type_utils.ml", line 1277, characters 0-1082 optional argument pos_of_dot of function +filter_pipeable_functions is never used @@ -791,10 +787,6 @@ File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.ml", line 37, characters 0-182 optional argument comment of function +block is never used - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/bsc_args.ml", line 99, characters 0-1158 - optional argument finish of function +parse_exn is never used - Warning Redundant Optional Argument File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/syntax/src/res_driver.ml", line 211, characters 0-399 optional argument ignore_parse_errors of function +parse_interface is always supplied (1 calls) @@ -16923,4 +16915,4 @@ <-- line 4 OUnit.assert_equal ~cmp:(Vec_int.equal (fun (x : int) y -> x = y)) x y [@@dead "+=~"] - Analysis reported 2983 issues (Warning Dead Module:145, Warning Dead Type:369, Warning Dead Value:2127, Warning Dead Value With Side Effects:37, Warning Incorrect Annotation:1, Warning Redundant Optional Argument:210, Warning Unused Argument:94) + Analysis reported 2981 issues (Warning Dead Module:145, Warning Dead Type:369, Warning Dead Value:2127, Warning Dead Value With Side Effects:37, Warning Incorrect Annotation:1, Warning Redundant Optional Argument:210, Warning Unused Argument:92) diff --git a/compiler/ext/bsc_args.ml b/compiler/ext/bsc_args.ml index 1f907eb26b7..19e034a2c66 100644 --- a/compiler/ext/bsc_args.ml +++ b/compiler/ext/bsc_args.ml @@ -96,9 +96,10 @@ let stop_raise ~usage ~(error : error) (speclist : t) = usage_b b ~usage speclist; bad_arg (Ext_buffer.contents b) -let parse_exn ~usage ~argv ?(start = 1) ?(finish = Array.length argv) - (speclist : t) (anonfun : rev_args:string list -> unit) = +let parse_exn ~usage ~argv ?(start = 1) (speclist : t) + (anonfun : rev_args:string list -> unit) = let current = ref start in + let finish = Array.length argv in let rev_list = ref [] in while !current < finish do let s = argv.(!current) in diff --git a/compiler/ext/bsc_args.mli b/compiler/ext/bsc_args.mli index 05bf9e66cca..742313e96b3 100644 --- a/compiler/ext/bsc_args.mli +++ b/compiler/ext/bsc_args.mli @@ -48,7 +48,6 @@ val parse_exn : usage:string -> argv:string array -> ?start:int -> - ?finish:int -> t -> (rev_args:string list -> unit) -> unit From 533064276f889bd6eab3bfa295df0bb4e92d4d7a Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 11:26:45 +0000 Subject: [PATCH 028/214] dce: narrow pipeable filter --- _dce/report.txt | 14 ++------- analysis/src/completion_back_end.ml | 16 +++++------ analysis/src/type_utils.ml | 44 +++++++++++------------------ 3 files changed, 28 insertions(+), 46 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index a98bbc17724..64bce70a3f0 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -759,17 +759,9 @@ File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 55, characters 2-50 optional argument loc of function Typ.+any is always supplied (1 calls) - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/type_utils.ml", line 1277, characters 0-1082 - optional argument pos_of_dot of function +filter_pipeable_functions is never used - - Warning Redundant Optional Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/type_utils.ml", line 1277, characters 0-1082 - optional argument synthetic of function +filter_pipeable_functions is always supplied (4 calls) - Warning Redundant Optional Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/type_utils.ml", line 1277, characters 0-1082 - optional argument target_type_id of function +filter_pipeable_functions is always supplied (4 calls) + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/type_utils.ml", line 1213, characters 0-694 + optional argument synthetic of function +transform_completion_to_pipe_completion is always supplied (1 calls) Warning Unused Argument File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/type_utils.ml", line 588, characters 2-51 @@ -16915,4 +16907,4 @@ <-- line 4 OUnit.assert_equal ~cmp:(Vec_int.equal (fun (x : int) y -> x = y)) x y [@@dead "+=~"] - Analysis reported 2981 issues (Warning Dead Module:145, Warning Dead Type:369, Warning Dead Value:2127, Warning Dead Value With Side Effects:37, Warning Incorrect Annotation:1, Warning Redundant Optional Argument:210, Warning Unused Argument:92) + Analysis reported 2979 issues (Warning Dead Module:145, Warning Dead Type:369, Warning Dead Value:2127, Warning Dead Value With Side Effects:37, Warning Incorrect Annotation:1, Warning Redundant Optional Argument:209, Warning Unused Argument:91) diff --git a/analysis/src/completion_back_end.ml b/analysis/src/completion_back_end.ml index ecb1a6fd1eb..aa43c3e9b63 100644 --- a/analysis/src/completion_back_end.ml +++ b/analysis/src/completion_back_end.ml @@ -1222,7 +1222,7 @@ and get_completions_for_context_path ~state ~debug ~full ~opens ~raw_opens ~pos else None) | None -> []) | None -> []) - | CPPipe {context_path = cp; id = prefix; lhs_loc; in_jsx; synthetic} -> ( + | CPPipe {context_path = cp; id = prefix; lhs_loc; in_jsx} -> ( if Debug.verbose () then print_endline "[ctx_path]--> CPPipe"; (* The environment at the cursor is the environment we're completing from. *) let env_at_cursor = env in @@ -1295,7 +1295,7 @@ and get_completions_for_context_path ~state ~debug ~full ~opens ~raw_opens ~pos completions_for_pipe_from_completion_path ~state ~env_completion_is_made_from ~opens ~pos ~scope ~debug ~prefix ~env ~raw_opens ~full completion_path - |> Type_utils.filter_pipeable_functions ~env ~state ~full ~synthetic + |> Type_utils.filter_pipeable_functions ~state ~full ~target_type_id:main_type_id |> List.filter (fun (c : Completion.t) -> (* If we're completing from the current module then we need to care about scope. @@ -1330,8 +1330,8 @@ and get_completions_for_context_path ~state ~debug ~full ~opens ~raw_opens ~pos ~env_completion_is_made_from ~opens ~pos ~scope ~debug ~prefix ~env ~raw_opens ~full completion_path) |> List.flatten - |> Type_utils.filter_pipeable_functions ~synthetic:true ~state ~env - ~full ~target_type_id:main_type_id + |> Type_utils.filter_pipeable_functions ~state ~full + ~target_type_id:main_type_id in (* Extra completions can be drawn from the @editor.completeFrom attribute. Here we @@ -1344,8 +1344,8 @@ and get_completions_for_context_path ~state ~debug ~full ~opens ~raw_opens ~pos ~env_completion_is_made_from ~opens ~pos ~scope ~debug ~prefix ~env ~raw_opens ~full completion_path) |> List.flatten - |> Type_utils.filter_pipeable_functions ~synthetic:true ~state ~env - ~full ~target_type_id:main_type_id + |> Type_utils.filter_pipeable_functions ~state ~full + ~target_type_id:main_type_id in (* Add JSX completion items if we're in a JSX context. *) let jsx_completions = @@ -1358,8 +1358,8 @@ and get_completions_for_context_path ~state ~debug ~full ~opens ~raw_opens ~pos let current_module_completions = get_completions_for_path ~state ~debug ~completion_context:Value ~exact:false ~opens:[] ~full ~pos ~env:env_at_cursor ~scope [prefix] - |> Type_utils.filter_pipeable_functions ~synthetic:true ~state ~env - ~full ~target_type_id:main_type_id + |> Type_utils.filter_pipeable_functions ~state ~full + ~target_type_id:main_type_id in jsx_completions @ pipe_completions @ extra_completions @ current_module_completions @ globally_configured_completions)) diff --git a/analysis/src/type_utils.ml b/analysis/src/type_utils.ml index fd0c125a703..b16c39647f9 100644 --- a/analysis/src/type_utils.ml +++ b/analysis/src/type_utils.ml @@ -1274,33 +1274,23 @@ let rec find_root_type_id ~full ~env ~state (t : Types.type_expr) = | _ -> None (** Filters out completions that are not pipeable from a list of completions. *) -let filter_pipeable_functions ~env ~state ~full ?synthetic ?target_type_id - ?pos_of_dot completions = - match target_type_id with - | None -> completions - | Some target_type_id -> - completions - |> List.filter_map (fun (completion : Completion.t) -> - let this_completion_item_type_id = - match completion.kind with - | Value t -> ( - match - get_first_fn_unlabelled_arg_type ~full ~env:completion.env - ~state t - with - | None -> None - | Some (t, env_from_labelled_arg) -> - find_root_type_id ~full ~env:env_from_labelled_arg ~state t) - | _ -> None - in - match this_completion_item_type_id with - | Some main_type_id when main_type_id = target_type_id -> ( - match pos_of_dot with - | None -> Some completion - | Some pos_of_dot -> - transform_completion_to_pipe_completion ?synthetic ~env - ~pos_of_dot completion) - | _ -> None) +let filter_pipeable_functions ~state ~full ~target_type_id completions = + completions + |> List.filter_map (fun (completion : Completion.t) -> + let this_completion_item_type_id = + match completion.kind with + | Value t -> ( + match + get_first_fn_unlabelled_arg_type ~full ~env:completion.env ~state t + with + | None -> None + | Some (t, env_from_labelled_arg) -> + find_root_type_id ~full ~env:env_from_labelled_arg ~state t) + | _ -> None + in + match this_completion_item_type_id with + | Some main_type_id when main_type_id = target_type_id -> Some completion + | _ -> None) let remove_current_module_if_needed ~env_completion_is_made_from completion_path = From 65fb4b099a128e5a48573227df0310ef04f21b43 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 11:27:23 +0000 Subject: [PATCH 029/214] dce: require pipe transform flag --- _dce/report.txt | 6 +----- analysis/src/type_utils.ml | 4 ++-- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index 64bce70a3f0..f488435b78e 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -759,10 +759,6 @@ File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 55, characters 2-50 optional argument loc of function Typ.+any is always supplied (1 calls) - Warning Redundant Optional Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/type_utils.ml", line 1213, characters 0-694 - optional argument synthetic of function +transform_completion_to_pipe_completion is always supplied (1 calls) - Warning Unused Argument File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/type_utils.ml", line 588, characters 2-51 optional argument print_opening_debug of function +extract_type is never used @@ -16907,4 +16903,4 @@ <-- line 4 OUnit.assert_equal ~cmp:(Vec_int.equal (fun (x : int) y -> x = y)) x y [@@dead "+=~"] - Analysis reported 2979 issues (Warning Dead Module:145, Warning Dead Type:369, Warning Dead Value:2127, Warning Dead Value With Side Effects:37, Warning Incorrect Annotation:1, Warning Redundant Optional Argument:209, Warning Unused Argument:91) + Analysis reported 2978 issues (Warning Dead Module:145, Warning Dead Type:369, Warning Dead Value:2127, Warning Dead Value With Side Effects:37, Warning Incorrect Annotation:1, Warning Redundant Optional Argument:208, Warning Unused Argument:91) diff --git a/analysis/src/type_utils.ml b/analysis/src/type_utils.ml index b16c39647f9..f2b68eb4a41 100644 --- a/analysis/src/type_utils.ml +++ b/analysis/src/type_utils.ml @@ -1210,8 +1210,8 @@ let make_additional_text_edits_for_removing_dot pos_of_dot = ] (** Turns a completion into a pipe completion. *) -let transform_completion_to_pipe_completion ?(synthetic = false) ~env - ?pos_of_dot (completion : Completion.t) = +let transform_completion_to_pipe_completion ~synthetic ~env ?pos_of_dot + (completion : Completion.t) = let name = completion.name in let name_with_pipe = "->" ^ name in Some From 220400440d0498f3c15032230b18b2529d50d397 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 11:27:40 +0000 Subject: [PATCH 030/214] dce: note live type contexts --- scripts/dce/live-findings.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/scripts/dce/live-findings.md b/scripts/dce/live-findings.md index e27188757a5..75ad4f8365d 100644 --- a/scripts/dce/live-findings.md +++ b/scripts/dce/live-findings.md @@ -31,3 +31,18 @@ live after manual validation. The repository guidance says v0 PPX compatibility must be preserved, so changing this helper API for locally redundant labels is higher risk than the DCE warning suggests. + +### `Type_utils` type argument contexts + +- Report: `Warning Unused Argument`, `analysis/src/type_utils.ml`, optional + arguments on `instantiate_type2` and the local `extract_type` binding inside + `resolve_nested`. +- Verdict: live; false positive. +- Validation: `instantiate_type2` immediately matches `type_arg_context` and uses + its `type_args` and `type_params` to substitute type variables. `extract_type` + forwards `type_arg_context_from_type_manifest` into `maybe_set_type_arg_ctx`, + and recursive calls use `print_opening_debug:false` to avoid repeated verbose + logging. +- Context: reanalyze appears to lose this through optional forwarding/local + aliasing in the recursive type-extraction helpers. Removing these labels would + break generic type instantiation and manifest traversal. From 8101f3e5a9c62cbdb9812bbb52c017af06a087fd Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 11:28:36 +0000 Subject: [PATCH 031/214] dce: remove block comment arg --- _dce/report.txt | 10 +++------- compiler/core/js_stmt_make.ml | 4 ++-- compiler/core/js_stmt_make.mli | 2 +- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index f488435b78e..8574cc93b6e 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -771,10 +771,6 @@ File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/type_utils.ml", line 179, characters 0-2146 optional argument type_arg_context of function +instantiate_type2 is never used - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.ml", line 37, characters 0-182 - optional argument comment of function +block is never used - Warning Redundant Optional Argument File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/syntax/src/res_driver.ml", line 211, characters 0-399 optional argument ignore_parse_errors of function +parse_interface is always supplied (1 calls) @@ -6458,10 +6454,10 @@ t [@@dead "+if_"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.mli", line 46, characters 0-43 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.mli", line 46, characters 0-24 +block is never used <-- line 46 - val block : ?comment:string -> J.block -> t [@@dead "+block"] + val block : J.block -> t [@@dead "+block"] Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.mli", line 52, characters 0-161 @@ -16903,4 +16899,4 @@ <-- line 4 OUnit.assert_equal ~cmp:(Vec_int.equal (fun (x : int) y -> x = y)) x y [@@dead "+=~"] - Analysis reported 2978 issues (Warning Dead Module:145, Warning Dead Type:369, Warning Dead Value:2127, Warning Dead Value With Side Effects:37, Warning Incorrect Annotation:1, Warning Redundant Optional Argument:208, Warning Unused Argument:91) + Analysis reported 2977 issues (Warning Dead Module:145, Warning Dead Type:369, Warning Dead Value:2127, Warning Dead Value With Side Effects:37, Warning Incorrect Annotation:1, Warning Redundant Optional Argument:208, Warning Unused Argument:90) diff --git a/compiler/core/js_stmt_make.ml b/compiler/core/js_stmt_make.ml index c0edf8bc321..051660d28f4 100644 --- a/compiler/core/js_stmt_make.ml +++ b/compiler/core/js_stmt_make.ml @@ -34,12 +34,12 @@ let empty_stmt : t = {statement_desc = Block []; comment = None} let throw_stmt ?comment v : t = {statement_desc = Throw v; comment} (* avoid nested block *) -let rec block ?comment (b : J.block) : t = +let rec block (b : J.block) : t = match b with | [{statement_desc = Block bs}] -> block bs | [b] -> b | [] -> empty_stmt - | _ -> {statement_desc = Block b; comment} + | _ -> {statement_desc = Block b; comment = None} (* It's a statement, we can discard some values *) let rec exp ?comment (e : E.t) : t = diff --git a/compiler/core/js_stmt_make.mli b/compiler/core/js_stmt_make.mli index d58ced95248..86afe2109cf 100644 --- a/compiler/core/js_stmt_make.mli +++ b/compiler/core/js_stmt_make.mli @@ -43,7 +43,7 @@ val if_ : J.block -> t -val block : ?comment:string -> J.block -> t +val block : J.block -> t (** turn a block into a single statement, avoid nested block From 4965d4eddd6e2853bbd0ffd0acd0803a2763c4ed Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 11:29:18 +0000 Subject: [PATCH 032/214] dce: note live parse flag --- scripts/dce/live-findings.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/scripts/dce/live-findings.md b/scripts/dce/live-findings.md index 75ad4f8365d..a30c356fa7a 100644 --- a/scripts/dce/live-findings.md +++ b/scripts/dce/live-findings.md @@ -46,3 +46,18 @@ live after manual validation. - Context: reanalyze appears to lose this through optional forwarding/local aliasing in the recursive type-extraction helpers. Removing these labels would break generic type instantiation and manifest traversal. + +### `Res_driver.parse_* ?ignore_parse_errors` + +- Report: `Warning Redundant Optional Argument`, `compiler/syntax/src/res_driver.ml`, + optional argument `ignore_parse_errors` on `parse_implementation` and + `parse_interface`. +- Verdict: live parser option; do not remove as part of this DCE pass. +- Validation: `compiler/bsc/rescript_compiler_main.ml` passes + `~ignore_parse_errors:!Clflags.ignore_parse_errors` into both parser functions + so the `-ignore-parse-errors` CLI flag controls whether syntax diagnostics + exit compilation. The declarations in `res_driver.mli` are also marked + `[@@live]`. +- Context: the warning only says all known callers supply the option. The option + itself is behaviorally live and part of the syntax driver surface used by the + compiler entry point. From 45dbd7f0b718242505bbb2506a48228f63fff374 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 11:30:08 +0000 Subject: [PATCH 033/214] dce: remove js expr comments --- _dce/report.txt | 26 +++++--------------------- compiler/core/js_exp_make.ml | 6 +++--- compiler/core/js_exp_make.mli | 6 +++--- 3 files changed, 11 insertions(+), 27 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index 8574cc93b6e..3b60c000ce5 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -780,16 +780,8 @@ optional argument ignore_parse_errors of function +parse_implementation is always supplied (1 calls) Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 316, characters 0-71 - optional argument comment of function +array is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 314, characters 0-68 - optional argument comment of function +new_ is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 46, characters 0-46 - optional argument comment of function +js_global is never used + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 44, characters 0-41 + optional argument comment of function +var is never used Warning Unused Argument File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_external_mk.mli", line 45, characters 0-298 @@ -847,21 +839,13 @@ File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 343, characters 0-108 optional argument comment of function +bigint is never used - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 215, characters 0-80 - optional argument comment of function +new_ is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 168, characters 0-74 - optional argument comment of function +array is never used - Warning Unused Argument File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 82, characters 0-317 optional argument comment of function +runtime_var_dot is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 62, characters 0-74 - optional argument comment of function +js_global is never used + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 57, characters 0-66 + optional argument comment of function +var is never used Warning Unused Argument File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_external_mk.ml", line 62, characters 0-1047 @@ -16899,4 +16883,4 @@ <-- line 4 OUnit.assert_equal ~cmp:(Vec_int.equal (fun (x : int) y -> x = y)) x y [@@dead "+=~"] - Analysis reported 2977 issues (Warning Dead Module:145, Warning Dead Type:369, Warning Dead Value:2127, Warning Dead Value With Side Effects:37, Warning Incorrect Annotation:1, Warning Redundant Optional Argument:208, Warning Unused Argument:90) + Analysis reported 2973 issues (Warning Dead Module:145, Warning Dead Type:369, Warning Dead Value:2127, Warning Dead Value With Side Effects:37, Warning Incorrect Annotation:1, Warning Redundant Optional Argument:208, Warning Unused Argument:86) diff --git a/compiler/core/js_exp_make.ml b/compiler/core/js_exp_make.ml index 530765477ed..2e0f302571f 100644 --- a/compiler/core/js_exp_make.ml +++ b/compiler/core/js_exp_make.ml @@ -59,7 +59,7 @@ let var ?comment id : t = {expression_desc = Var (Id id); comment} (* only used in property access, Invariant: it should not call an external module .. *) -let js_global ?comment (v : string) = var ?comment (Ext_ident.create_js v) +let js_global (v : string) = var (Ext_ident.create_js v) let undefined : t = {expression_desc = Undefined {is_unit = false}; comment = None} let nil : t = {expression_desc = Null; comment = None} @@ -165,7 +165,7 @@ let raw_js_code ?comment info s : t = comment; } -let array ?comment mt es : t = {expression_desc = Array (es, mt); comment} +let array mt es : t = {expression_desc = Array (es, mt); comment = None} let some_comment = None let optional_block e : J.expression = @@ -212,7 +212,7 @@ let is_array (e0 : t) : t = let f = str "Array.isArray" ~delim:DNoQuotes in {expression_desc = Call (f, [e0], Js_call_info.ml_full_call); comment = None} -let new_ ?comment e0 args : t = {expression_desc = New (e0, Some args); comment} +let new_ e0 args : t = {expression_desc = New (e0, Some args); comment = None} let unit : t = {expression_desc = Undefined {is_unit = true}; comment = None} diff --git a/compiler/core/js_exp_make.mli b/compiler/core/js_exp_make.mli index d37d55ea9a8..5d018859ea9 100644 --- a/compiler/core/js_exp_make.mli +++ b/compiler/core/js_exp_make.mli @@ -43,7 +43,7 @@ val remove_pure_sub_exp : t -> t option val var : ?comment:string -> J.ident -> t -val js_global : ?comment:string -> string -> t +val js_global : string -> t val runtime_var_dot : ?comment:string -> string -> string -> t @@ -311,9 +311,9 @@ val flat_call : ?comment:string -> t -> t -> t val tagged_template : ?comment:string -> t -> t list -> t list -> t -val new_ : ?comment:string -> J.expression -> J.expression list -> t +val new_ : J.expression -> J.expression list -> t -val array : ?comment:string -> J.mutable_flag -> J.expression list -> t +val array : J.mutable_flag -> J.expression list -> t val optional_block : J.expression -> J.expression From c041798df0e60709957ea5b8eeb7848ffc2daed9 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 11:31:15 +0000 Subject: [PATCH 034/214] dce: narrow local extern helpers --- _dce/report.txt | 58 +++------------------------ compiler/frontend/ast_external_mk.ml | 16 ++++---- compiler/frontend/ast_external_mk.mli | 6 --- 3 files changed, 14 insertions(+), 66 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index 3b60c000ce5..329b16fe608 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -783,30 +783,6 @@ File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 44, characters 0-41 optional argument comment of function +var is never used - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_external_mk.mli", line 45, characters 0-298 - optional argument local_fun_name of function +local_external_obj is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_external_mk.mli", line 45, characters 0-298 - optional argument local_module_name of function +local_external_obj is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_external_mk.mli", line 45, characters 0-298 - optional argument pval_attributes of function +local_external_obj is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_external_mk.mli", line 25, characters 0-265 - optional argument local_fun_name of function +local_external_apply is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_external_mk.mli", line 25, characters 0-265 - optional argument local_module_name of function +local_external_apply is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_external_mk.mli", line 25, characters 0-265 - optional argument pval_attributes of function +local_external_apply is never used - Warning Unused Argument File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typecore.ml", line 4616, characters 0-76 optional argument unif of function +super_report_unification_error is never used @@ -847,30 +823,6 @@ File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 57, characters 0-66 optional argument comment of function +var is never used - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_external_mk.ml", line 62, characters 0-1047 - optional argument local_fun_name of function +local_external_obj is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_external_mk.ml", line 62, characters 0-1047 - optional argument local_module_name of function +local_external_obj is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_external_mk.ml", line 62, characters 0-1047 - optional argument pval_attributes of function +local_external_obj is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_external_mk.ml", line 25, characters 0-1123 - optional argument local_fun_name of function +local_external_apply is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_external_mk.ml", line 25, characters 0-1123 - optional argument local_module_name of function +local_external_apply is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_external_mk.ml", line 25, characters 0-1123 - optional argument pval_attributes of function +local_external_apply is never used - Warning Unused Argument File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/syntax/src/res_core.ml", line 5923, characters 0-1468 optional argument current_type_name_path of function +parse_spread_tail_classified is never used @@ -13118,15 +13070,15 @@ val handle_external : Location.t -> string -> Parsetree.expression [@@dead "+handle_external"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_external_mk.ml", line 98, characters 0-998 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_external_mk.ml", line 100, characters 0-998 +local_extern_cont_to_obj is never used - <-- line 98 + <-- line 100 } ) [@@dead "+local_extern_cont_to_obj"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_external_mk.mli", line 56, characters 0-290 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_external_mk.mli", line 50, characters 0-290 +local_extern_cont_to_obj is never used - <-- line 56 + <-- line 50 Parsetree.expression_desc [@@dead "+local_extern_cont_to_obj"] Warning Dead Value @@ -16883,4 +16835,4 @@ <-- line 4 OUnit.assert_equal ~cmp:(Vec_int.equal (fun (x : int) y -> x = y)) x y [@@dead "+=~"] - Analysis reported 2973 issues (Warning Dead Module:145, Warning Dead Type:369, Warning Dead Value:2127, Warning Dead Value With Side Effects:37, Warning Incorrect Annotation:1, Warning Redundant Optional Argument:208, Warning Unused Argument:86) + Analysis reported 2961 issues (Warning Dead Module:145, Warning Dead Type:369, Warning Dead Value:2127, Warning Dead Value With Side Effects:37, Warning Incorrect Annotation:1, Warning Redundant Optional Argument:208, Warning Unused Argument:74) diff --git a/compiler/frontend/ast_external_mk.ml b/compiler/frontend/ast_external_mk.ml index 3ec65e16124..7a8572e1da3 100644 --- a/compiler/frontend/ast_external_mk.ml +++ b/compiler/frontend/ast_external_mk.ml @@ -22,10 +22,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *) -let local_external_apply loc ?(pval_attributes = []) ~(pval_prim : string list) - ~(pval_type : Parsetree.core_type) ?(local_module_name = "J") - ?(local_fun_name = "unsafe_expr") (args : Parsetree.expression list) : +let local_external_apply loc ~(pval_prim : string list) + ~(pval_type : Parsetree.core_type) (args : Parsetree.expression list) : Parsetree.expression_desc = + let local_module_name = "J" in + let local_fun_name = "unsafe_expr" in Pexp_letmodule ( {txt = local_module_name; loc}, { @@ -40,7 +41,7 @@ let local_external_apply loc ?(pval_attributes = []) ~(pval_prim : string list) pval_type; pval_loc = loc; pval_prim; - pval_attributes; + pval_attributes = []; }; pstr_loc = loc; }; @@ -59,9 +60,10 @@ let local_external_apply loc ?(pval_attributes = []) ~(pval_prim : string list) : Parsetree.expression) args ~loc ) -let local_external_obj loc ?(pval_attributes = []) ~pval_prim ~pval_type - ?(local_module_name = "J") ?(local_fun_name = "unsafe_expr") args : +let local_external_obj loc ~pval_prim ~pval_type args : Parsetree.expression_desc = + let local_module_name = "J" in + let local_fun_name = "unsafe_expr" in Pexp_letmodule ( {txt = local_module_name; loc}, { @@ -76,7 +78,7 @@ let local_external_obj loc ?(pval_attributes = []) ~pval_prim ~pval_type pval_type; pval_loc = loc; pval_prim; - pval_attributes; + pval_attributes = []; }; pstr_loc = loc; }; diff --git a/compiler/frontend/ast_external_mk.mli b/compiler/frontend/ast_external_mk.mli index 550bb3aa8d1..dca82b0db22 100644 --- a/compiler/frontend/ast_external_mk.mli +++ b/compiler/frontend/ast_external_mk.mli @@ -24,11 +24,8 @@ val local_external_apply : Location.t -> - ?pval_attributes:Parsetree.attributes -> pval_prim:string list -> pval_type:Parsetree.core_type -> - ?local_module_name:string -> - ?local_fun_name:string -> Parsetree.expression list -> Parsetree.expression_desc (** @@ -44,11 +41,8 @@ val local_external_apply : val local_external_obj : Location.t -> - ?pval_attributes:Parsetree.attributes -> pval_prim:string list -> pval_type:Parsetree.core_type -> - ?local_module_name:string -> - ?local_fun_name:string -> (string * Parsetree.expression) list -> (* [ (label, exp )]*) Parsetree.expression_desc From 8e7438878c09b51def55967c54f136f2eaf17ec7 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 11:32:07 +0000 Subject: [PATCH 035/214] dce: remove var comment arg --- _dce/report.txt | 10 +--------- compiler/core/js_exp_make.ml | 2 +- compiler/core/js_exp_make.mli | 2 +- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index 329b16fe608..1699da1d364 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -779,10 +779,6 @@ File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/syntax/src/res_driver.ml", line 200, characters 0-409 optional argument ignore_parse_errors of function +parse_implementation is always supplied (1 calls) - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 44, characters 0-41 - optional argument comment of function +var is never used - Warning Unused Argument File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typecore.ml", line 4616, characters 0-76 optional argument unif of function +super_report_unification_error is never used @@ -819,10 +815,6 @@ File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 82, characters 0-317 optional argument comment of function +runtime_var_dot is never used - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 57, characters 0-66 - optional argument comment of function +var is never used - Warning Unused Argument File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/syntax/src/res_core.ml", line 5923, characters 0-1468 optional argument current_type_name_path of function +parse_spread_tail_classified is never used @@ -16835,4 +16827,4 @@ <-- line 4 OUnit.assert_equal ~cmp:(Vec_int.equal (fun (x : int) y -> x = y)) x y [@@dead "+=~"] - Analysis reported 2961 issues (Warning Dead Module:145, Warning Dead Type:369, Warning Dead Value:2127, Warning Dead Value With Side Effects:37, Warning Incorrect Annotation:1, Warning Redundant Optional Argument:208, Warning Unused Argument:74) + Analysis reported 2959 issues (Warning Dead Module:145, Warning Dead Type:369, Warning Dead Value:2127, Warning Dead Value With Side Effects:37, Warning Incorrect Annotation:1, Warning Redundant Optional Argument:208, Warning Unused Argument:72) diff --git a/compiler/core/js_exp_make.ml b/compiler/core/js_exp_make.ml index 2e0f302571f..ee1c82e1aa6 100644 --- a/compiler/core/js_exp_make.ml +++ b/compiler/core/js_exp_make.ml @@ -54,7 +54,7 @@ and is_pure_sub_exp (x : t) = remove_pure_sub_exp x = None (* let mk ?comment exp : t = {expression_desc = exp ; comment } *) -let var ?comment id : t = {expression_desc = Var (Id id); comment} +let var id : t = {expression_desc = Var (Id id); comment = None} (* only used in property access, Invariant: it should not call an external module .. *) diff --git a/compiler/core/js_exp_make.mli b/compiler/core/js_exp_make.mli index 5d018859ea9..5cfa40c1d00 100644 --- a/compiler/core/js_exp_make.mli +++ b/compiler/core/js_exp_make.mli @@ -41,7 +41,7 @@ type t = J.expression val remove_pure_sub_exp : t -> t option -val var : ?comment:string -> J.ident -> t +val var : J.ident -> t val js_global : string -> t From e843dbb31de3ee52c5aee02478bfb10eb45c00f5 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 11:33:39 +0000 Subject: [PATCH 036/214] dce: narrow typecore helpers --- _dce/report.txt | 22 +--------------------- compiler/ml/typecore.ml | 9 +++++---- 2 files changed, 6 insertions(+), 25 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index 1699da1d364..17150121902 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -779,18 +779,6 @@ File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/syntax/src/res_driver.ml", line 200, characters 0-409 optional argument ignore_parse_errors of function +parse_implementation is always supplied (1 calls) - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typecore.ml", line 4616, characters 0-76 - optional argument unif of function +super_report_unification_error is never used - - Warning Redundant Optional Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typecore.ml", line 1738, characters 0-231 - optional argument lev of function +check_unused is always supplied (1 calls) - - Warning Redundant Optional Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typecore.ml", line 1709, characters 0-492 - optional argument explode of function +partial_pred is always supplied (2 calls) - Warning Unused Argument File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typecore.ml", line 1145, characters 2-61 optional argument from_type of function Constructor.+unbound_name_error is never used @@ -919,10 +907,6 @@ File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_ident.ml", line 84, characters 0-597 optional argument op of function +convert is always supplied (1 calls) - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/printtyp.mli", line 84, characters 0-238 - optional argument print_extra_info of function +super_report_unification_error is never used - Warning Unused Argument File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/printtyp.mli", line 84, characters 0-238 optional argument unif of function +super_report_unification_error is never used @@ -931,10 +915,6 @@ File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/printtyp.mli", line 75, characters 0-163 optional argument unif of function +report_unification_error is never used - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/printtyp.ml", line 1563, characters 0-200 - optional argument print_extra_info of function +super_report_unification_error is never used - Warning Unused Argument File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/printtyp.ml", line 1563, characters 0-200 optional argument unif of function +super_report_unification_error is never used @@ -16827,4 +16807,4 @@ <-- line 4 OUnit.assert_equal ~cmp:(Vec_int.equal (fun (x : int) y -> x = y)) x y [@@dead "+=~"] - Analysis reported 2959 issues (Warning Dead Module:145, Warning Dead Type:369, Warning Dead Value:2127, Warning Dead Value With Side Effects:37, Warning Incorrect Annotation:1, Warning Redundant Optional Argument:208, Warning Unused Argument:72) + Analysis reported 2954 issues (Warning Dead Module:145, Warning Dead Type:369, Warning Dead Value:2127, Warning Dead Value With Side Effects:37, Warning Incorrect Annotation:1, Warning Redundant Optional Argument:206, Warning Unused Argument:69) diff --git a/compiler/ml/typecore.ml b/compiler/ml/typecore.ml index 8fe55de60d5..4e0983f9c52 100644 --- a/compiler/ml/typecore.ml +++ b/compiler/ml/typecore.ml @@ -1706,14 +1706,14 @@ let type_pat ?(allow_existentials = false) ?constrs ?labels ?(mode = Normal) (* this function is passed to Partial.parmatch to type check gadt nonexhaustiveness *) -let partial_pred ~lev ?mode ?explode env expected_ty constrs labels p = +let partial_pred ~lev ?mode ~explode env expected_ty constrs labels p = let env = ref env in let state = save_state env in try reset_pattern None true; let typed_p = Ctype.with_passive_variants - (type_pat ~allow_existentials:true ~lev ~constrs ~labels ?mode ?explode + (type_pat ~allow_existentials:true ~lev ~constrs ~labels ?mode ~explode env p) expected_ty in @@ -1735,7 +1735,7 @@ let check_partial ?(lev = get_current_level ()) ?partial_match_warning_hint env (partial_pred ~lev ~explode env expected_ty) loc cases -let check_unused ?(lev = get_current_level ()) env expected_ty cases = +let check_unused ~lev env expected_ty cases = Parmatch.check_unused (fun constrs labels spat -> partial_pred ~lev ~mode:Split_or ~explode:5 env expected_ty constrs labels @@ -4613,7 +4613,8 @@ let find_arity_suggestion env function_name target_arity = open Format let longident = Printtyp.longident -let super_report_unification_error = Printtyp.super_report_unification_error +let super_report_unification_error ?print_extra_info ppf env trace = + Printtyp.super_report_unification_error ?print_extra_info ppf env trace let report_ambiguous_type_error = Printtyp.report_ambiguous_type_error let report_subtyping_error = Printtyp.report_subtyping_error From 9164d9423ff638c4140c2ff8218d8729d19d21a6 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 11:34:06 +0000 Subject: [PATCH 037/214] dce: note live from_type errors --- scripts/dce/live-findings.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/scripts/dce/live-findings.md b/scripts/dce/live-findings.md index a30c356fa7a..592a1e1e9b0 100644 --- a/scripts/dce/live-findings.md +++ b/scripts/dce/live-findings.md @@ -61,3 +61,18 @@ live after manual validation. - Context: the warning only says all known callers supply the option. The option itself is behaviorally live and part of the syntax driver surface used by the compiler entry point. + +### `from_type` in unbound name errors + +- Report: `Warning Unused Argument`, `compiler/ml/typecore.ml` and + `compiler/ml/typetexp.ml`, optional argument `from_type` on label and + constructor unbound-name error helpers. +- Verdict: live for labels; intentionally shared/ignored for constructors. +- Validation: `compiler/ml/typecore.ml` calls `Label.disambiguate + ~from_type:ty_exp` for field access, and `compiler/ml/typetexp.ml` stores that + value in `Unbound_label`. The error printer uses it to emit the specific + option-unwrapping diagnostic when the attempted field access is on an + `option`. +- Context: constructors share the `Name_choice` functor interface but currently + ignore `from_type`. Splitting that interface for DCE would risk the shared + lookup/error plumbing for little practical cleanup. From dfcf8b9a9641d32a782d35f849641a1cbf48c10f Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 11:34:58 +0000 Subject: [PATCH 038/214] dce: fix write_file annotation --- _dce/report.txt | 6 +----- compiler/syntax/src/res_io.ml | 2 +- compiler/syntax/src/res_io.mli | 1 - 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index 17150121902..b2d6dc09d15 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -787,10 +787,6 @@ File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typecore.ml", line 967, characters 2-55 optional argument from_type of function Label.+unbound_name_error is never used - Warning Incorrect Annotation - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/syntax/src/res_io.mli", line 7, characters 0-82 - +write_file is annotated @dead but is live - Warning Unused Argument File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 370, characters 0-74 optional argument comment of function +float is never used @@ -16807,4 +16803,4 @@ <-- line 4 OUnit.assert_equal ~cmp:(Vec_int.equal (fun (x : int) y -> x = y)) x y [@@dead "+=~"] - Analysis reported 2954 issues (Warning Dead Module:145, Warning Dead Type:369, Warning Dead Value:2127, Warning Dead Value With Side Effects:37, Warning Incorrect Annotation:1, Warning Redundant Optional Argument:206, Warning Unused Argument:69) + Analysis reported 2953 issues (Warning Dead Module:145, Warning Dead Type:369, Warning Dead Value:2127, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:206, Warning Unused Argument:69) diff --git a/compiler/syntax/src/res_io.ml b/compiler/syntax/src/res_io.ml index 1912705f2bf..1d55da8318f 100644 --- a/compiler/syntax/src/res_io.ml +++ b/compiler/syntax/src/res_io.ml @@ -11,4 +11,4 @@ let write_file ~filename ~contents:txt = let chan = open_out_bin filename in output_string chan txt; close_out chan -[@@raises Sys_error] [@@dead "+write_file"] +[@@raises Sys_error] diff --git a/compiler/syntax/src/res_io.mli b/compiler/syntax/src/res_io.mli index b0ec5ff356a..65e399e151f 100644 --- a/compiler/syntax/src/res_io.mli +++ b/compiler/syntax/src/res_io.mli @@ -5,4 +5,3 @@ val read_file : filename:string -> string (* writes "content" into file with name "filename" *) val write_file : filename:string -> contents:string -> unit -[@@dead "+write_file"] From 592fe626dbbc02c634fbfc749cfe6f94c9946299 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 11:35:56 +0000 Subject: [PATCH 039/214] dce: remove literal comments --- _dce/report.txt | 414 +++++++++++++++++----------------- compiler/core/js_exp_make.ml | 13 +- compiler/core/js_exp_make.mli | 6 +- 3 files changed, 212 insertions(+), 221 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index b2d6dc09d15..1b7eda89623 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -787,18 +787,6 @@ File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typecore.ml", line 967, characters 2-55 optional argument from_type of function Label.+unbound_name_error is never used - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 370, characters 0-74 - optional argument comment of function +float is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 343, characters 0-108 - optional argument comment of function +bigint is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 82, characters 0-317 - optional argument comment of function +runtime_var_dot is never used - Warning Unused Argument File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/syntax/src/res_core.ml", line 5923, characters 0-1468 optional argument current_type_name_path of function +parse_spread_tail_classified is never used @@ -3270,585 +3258,585 @@ let fuse_to_seq x xs = if xs = [] then x else Ext_list.fold_left xs x seq [@@dead "+fuse_to_seq"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 346, characters 0-127 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 349, characters 0-127 +zero_bigint_literal is never used - <-- line 346 + <-- line 349 } [@@dead "+zero_bigint_literal"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 372, characters 0-88 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 375, characters 0-88 +zero_float_lit is never used - <-- line 372 + <-- line 375 {expression_desc = Number (Float {f = "0."}); comment = None} [@@dead "+zero_float_lit"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 375, characters 0-94 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 378, characters 0-94 +float_mod is never used - <-- line 375 + <-- line 378 {comment; expression_desc = Bin (Mod, e1, e2)} [@@dead "+float_mod"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 378, characters 0-422 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 381, characters 0-422 +array_index is never used - <-- line 378 + <-- line 381 | _ -> {expression_desc = Array_index (e0, e1); comment} [@@dead "+array_index"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 388, characters 0-447 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 391, characters 0-447 +array_index_by_int is never used - <-- line 388 + <-- line 391 | _ -> {expression_desc = Array_index (e, int ?comment pos); comment = None} [@@dead "+array_index_by_int"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 399, characters 0-489 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 402, characters 0-489 +record_access is never used - <-- line 399 + <-- line 402 | _ -> {expression_desc = Static_index (e, name, Some pos); comment = None} [@@dead "+record_access"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 412, characters 0-40 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 415, characters 0-40 +inline_record_access is never used - <-- line 412 + <-- line 415 let inline_record_access = record_access [@@dead "+inline_record_access"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 414, characters 0-99 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 417, characters 0-99 +variant_access is never used - <-- line 414 + <-- line 417 inline_record_access e ("_" ^ Int32.to_string pos) pos [@@dead "+variant_access"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 417, characters 0-178 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 420, characters 0-178 +cons_access is never used - <-- line 417 + <-- line 420 pos [@@dead "+cons_access"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 425, characters 0-297 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 428, characters 0-297 +poly_var_tag_access is never used - <-- line 425 + <-- line 428 } [@@dead "+poly_var_tag_access"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 437, characters 0-304 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 440, characters 0-304 +poly_var_value_access is never used - <-- line 437 + <-- line 440 } [@@dead "+poly_var_value_access"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 449, characters 0-665 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 452, characters 0-665 +extension_access is never used - <-- line 449 + <-- line 452 {expression_desc = Static_index (e, name, Some pos); comment = None} [@@dead "+extension_access"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 471, characters 0-487 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 474, characters 0-487 +string_index is never used - <-- line 471 + <-- line 474 | _ -> {expression_desc = String_index (e0, e1); comment} [@@dead "+string_index"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 484, characters 0-77 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 487, characters 0-77 +assign is never used - <-- line 484 + <-- line 487 let assign ?comment e0 e1 : t = {expression_desc = Bin (Eq, e0, e1); comment} [@@dead "+assign"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 486, characters 0-419 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 489, characters 0-419 +assign_by_exp is never used - <-- line 486 + <-- line 489 | _ -> assign {expression_desc = Array_index (e, index); comment = None} value [@@dead "+assign_by_exp"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 501, characters 0-99 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 504, characters 0-99 +assign_by_int is never used - <-- line 501 + <-- line 504 assign_by_exp e0 (int ?comment index) value [@@dead "+assign_by_int"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 504, characters 0-447 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 507, characters 0-447 +record_assign is never used - <-- line 504 + <-- line 507 value [@@dead "+record_assign"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 522, characters 0-457 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 525, characters 0-457 +extension_assign is never used - <-- line 522 + <-- line 525 value [@@dead "+extension_assign"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 542, characters 0-277 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 545, characters 0-277 +array_length is never used - <-- line 542 + <-- line 545 | _ -> {expression_desc = Length (e, Array); comment} [@@dead "+array_length"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 549, characters 0-242 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 552, characters 0-242 +string_length is never used - <-- line 549 + <-- line 552 | _ -> {expression_desc = Length (e, String); comment} [@@dead "+string_length"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 555, characters 0-304 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 558, characters 0-304 +function_length is never used - <-- line 555 + <-- line 558 | _ -> {expression_desc = Length (e, Function); comment} [@@dead "+function_length"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 568, characters 0-1023 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 571, characters 0-1023 +string_append is never used - <-- line 568 + <-- line 571 | _, _ -> {comment; expression_desc = String_append (e, el)} [@@dead "+string_append"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 589, characters 0-94 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 592, characters 0-94 +obj is never used - <-- line 589 + <-- line 592 {expression_desc = Object (dup, properties); comment} [@@dead "+obj"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 592, characters 0-304 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 595, characters 0-304 +str_equal is never used - <-- line 592 + <-- line 595 else None [@@dead "+str_equal"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 602, characters 0-824 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 605, characters 0-824 +triple_equal is never used - <-- line 602 + <-- line 605 | _ -> {expression_desc = Bin (EqEqEq, e0, e1); comment} [@@dead "+triple_equal"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 623, characters 0-493 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 626, characters 0-493 +bin is never used - <-- line 623 + <-- line 626 | _ -> {expression_desc = Bin (op, e0, e1); comment} [@@dead "+bin"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 657, characters 0-17 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 660, characters 0-17 +debug is never used - <-- line 657 + <-- line 660 let debug = false [@@dead "+debug"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 673, characters 0-634 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 676, characters 0-634 +push_negation is never used - <-- line 673 + <-- line 676 | _ -> None [@@dead "+push_negation"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 690, characters 0-27 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 693, characters 0-27 +simplify_max_depth is never used - <-- line 690 + <-- line 693 let simplify_max_depth = 10 [@@dead "+simplify_max_depth"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 732, characters 0-12453 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 735, characters 0-12453 +simplify_and_ is never used - <-- line 732 + <-- line 735 res [@@dead "+simplify_and_"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1041, characters 0-174 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1044, characters 0-174 +simplify_and_force is never used - <-- line 1041 + <-- line 1044 | x -> x [@@dead "+simplify_and_force"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1066, characters 0-818 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1069, characters 0-818 +simplify_or_ is never used - <-- line 1066 + <-- line 1069 res [@@dead "+simplify_or_"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1095, characters 0-171 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1098, characters 0-171 +simplify_or_force is never used - <-- line 1095 + <-- line 1098 | x -> x [@@dead "+simplify_or_force"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1100, characters 0-133 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1103, characters 0-133 +simplify_and is never used - <-- line 1100 + <-- line 1103 else None [@@dead "+simplify_and"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1104, characters 0-131 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1107, characters 0-131 +simplify_or is never used - <-- line 1104 + <-- line 1107 else None [@@dead "+simplify_or"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1108, characters 0-751 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1111, characters 0-751 +and_ is never used - <-- line 1108 + <-- line 1111 | None -> {expression_desc = Bin (And, e1, e2); comment}) [@@dead "+and_"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1128, characters 0-516 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1131, characters 0-516 +or_ is never used - <-- line 1128 + <-- line 1131 | None -> {expression_desc = Bin (Or, e1, e2); comment}) [@@dead "+or_"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1142, characters 0-87 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1145, characters 0-87 +in_ is never used - <-- line 1142 + <-- line 1145 {expression_desc = In (prop, obj); comment = None} [@@dead "+in_"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1145, characters 0-685 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1148, characters 0-685 +not is never used - <-- line 1145 + <-- line 1148 | None -> {expression_desc = Js_not e; comment = None}) [@@dead "+not"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1161, characters 0-124 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1164, characters 0-124 +not_empty_branch is never used - <-- line 1161 + <-- line 1164 | _ -> true [@@dead "+not_empty_branch"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1166, characters 0-1851 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1169, characters 0-1851 +econd is never used - <-- line 1166 + <-- line 1169 | _ -> default () [@@dead "+econd"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1215, characters 0-1526 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1218, characters 0-1526 +float_equal is never used - <-- line 1215 + <-- line 1218 | _ -> {expression_desc = Bin (EqEqEq, e0, e1); comment} [@@dead "+float_equal"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1253, characters 0-27 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1256, characters 0-27 +int_equal is never used - <-- line 1253 + <-- line 1256 let int_equal = float_equal [@@dead "+int_equal"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1278, characters 0-636 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1281, characters 0-636 +emit_check is never used - <-- line 1278 + <-- line 1281 | Expr x -> x [@@dead "+emit_check"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1298, characters 0-199 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1301, characters 0-199 +is_a_literal_case is never used - <-- line 1298 + <-- line 1301 emit_check check [@@dead "+is_a_literal_case"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1305, characters 0-175 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1308, characters 0-175 +is_int_tag is never used - <-- line 1305 + <-- line 1308 emit_check check [@@dead "+is_int_tag"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1317, characters 0-106 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1320, characters 0-106 +tag is never used - <-- line 1317 + <-- line 1320 {expression_desc = Caml_block_tag (e, name); comment} [@@dead "+tag"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1333, characters 0-726 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1336, characters 0-726 +int32_bor is never used - <-- line 1333 + <-- line 1336 | _ -> {comment; expression_desc = Bin (Bor, e1, e2)} [@@dead "+int32_bor"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1351, characters 0-97 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1354, characters 0-97 +to_int32 is never used - <-- line 1351 + <-- line 1354 int32_bor ?comment e zero_int_literal [@@dead "+to_int32"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1355, characters 0-434 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1358, characters 0-434 +string_comp is never used - <-- line 1355 + <-- line 1358 | _ -> bin ?comment (Lam_compile_util.jsop_of_comp cmp) e0 e1 [@@dead "+string_comp"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1364, characters 0-80 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1367, characters 0-80 +string_equal is never used - <-- line 1364 + <-- line 1367 let string_equal ?comment (e0 : t) (e1 : t) : t = string_comp Ceq ?comment e0 e1 [@@dead "+string_equal"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1366, characters 0-91 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1369, characters 0-91 +is_type_number is never used - <-- line 1366 + <-- line 1369 string_equal ?comment (typeof e) (str "number") [@@dead "+is_type_number"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1369, characters 0-91 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1372, characters 0-91 +is_type_string is never used - <-- line 1369 + <-- line 1372 string_equal ?comment (typeof e) (str "string") [@@dead "+is_type_string"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1372, characters 0-71 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1375, characters 0-71 +is_type_object is never used - <-- line 1372 + <-- line 1375 let is_type_object (e : t) : t = string_equal (typeof e) (str "object") [@@dead "+is_type_object"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1374, characters 0-94 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1377, characters 0-94 +obj_length is never used - <-- line 1374 + <-- line 1377 to_int32 {expression_desc = Length (e, Caml_block); comment} [@@dead "+obj_length"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1377, characters 0-186 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1380, characters 0-186 +compare_int_aux is never used - <-- line 1377 + <-- line 1380 | Cge -> l >= r [@@dead "+compare_int_aux"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1386, characters 0-990 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1389, characters 0-990 +int_comp is never used - <-- line 1386 + <-- line 1389 | _ -> bin ?comment (Lam_compile_util.jsop_of_comp cmp) e0 e1 [@@dead "+int_comp"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1414, characters 0-901 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1417, characters 0-901 +bool_comp is never used - <-- line 1414 + <-- line 1417 | _, _ -> bin ?comment (Lam_compile_util.jsop_of_comp cmp) e0 e1 [@@dead "+bool_comp"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1441, characters 0-92 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1444, characters 0-92 +float_comp is never used - <-- line 1441 + <-- line 1444 bin ?comment (Lam_compile_util.jsop_of_comp cmp) e0 e1 [@@dead "+float_comp"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1444, characters 0-89 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1447, characters 0-89 +js_comp is never used - <-- line 1444 + <-- line 1447 bin ?comment (Lam_compile_util.jsop_of_comp cmp) e0 e1 [@@dead "+js_comp"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1447, characters 0-555 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1450, characters 0-555 +int32_lsr is never used - <-- line 1447 + <-- line 1450 | _, _ -> {comment; expression_desc = Bin (Lsr, e1, e2)} [@@dead "+int32_lsr"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1463, characters 0-1966 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1466, characters 0-1966 +is_out is never used - <-- line 1463 + <-- line 1466 | _, _ -> int_comp ?comment Cgt e range [@@dead "+is_out"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1517, characters 0-1244 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1520, characters 0-1244 +float_add is never used - <-- line 1517 + <-- line 1520 | _ -> {comment; expression_desc = Bin (Plus, e1, e2)} [@@dead "+float_add"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1547, characters 0-241 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1550, characters 0-241 +float_minus is never used - <-- line 1547 + <-- line 1550 | _ -> {comment; expression_desc = Bin (Minus, e1, e2)} [@@dead "+float_minus"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1553, characters 0-65 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1556, characters 0-65 +unchecked_int32_add is never used - <-- line 1553 + <-- line 1556 let unchecked_int32_add ?comment e1 e2 = float_add ?comment e1 e2 [@@dead "+unchecked_int32_add"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1554, characters 0-66 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1557, characters 0-66 +int32_add is never used - <-- line 1554 + <-- line 1557 let int32_add ?comment e1 e2 = to_int32 (float_add ?comment e1 e2) [@@dead "+int32_add"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1556, characters 0-91 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1559, characters 0-91 +offset is never used - <-- line 1556 + <-- line 1559 if offset = 0 then e1 else int32_add e1 (small_int offset) [@@dead "+offset"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1559, characters 0-87 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1562, characters 0-87 +int32_minus is never used - <-- line 1559 + <-- line 1562 to_int32 (float_minus ?comment e1 e2) [@@dead "+int32_minus"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1562, characters 0-86 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1565, characters 0-86 +unchecked_int32_minus is never used - <-- line 1562 + <-- line 1565 float_minus ?comment e1 e2 [@@dead "+unchecked_int32_minus"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1565, characters 0-53 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1568, characters 0-53 +float_div is never used - <-- line 1565 + <-- line 1568 let float_div ?comment e1 e2 = bin ?comment Div e1 e2 [@@dead "+float_div"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1566, characters 0-53 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1569, characters 0-53 +float_pow is never used - <-- line 1566 + <-- line 1569 let float_pow ?comment e1 e2 = bin ?comment Pow e1 e2 [@@dead "+float_pow"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1567, characters 0-62 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1570, characters 0-62 +float_notequal is never used - <-- line 1567 + <-- line 1570 let float_notequal ?comment e1 e2 = bin ?comment NotEqEq e1 e2 [@@dead "+float_notequal"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1569, characters 0-94 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1572, characters 0-94 +int32_asr is never used - <-- line 1569 + <-- line 1572 {comment; expression_desc = Bin (Asr, e1, e2)} [@@dead "+int32_asr"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1573, characters 0-482 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1576, characters 0-482 +int32_div is never used - <-- line 1573 + <-- line 1576 else to_int32 (float_div ?comment e1 e2) [@@dead "+int32_div"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1584, characters 0-316 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1587, characters 0-316 +int32_mod is never used - <-- line 1584 + <-- line 1587 else {comment; expression_desc = Bin (Mod, e1, e2)} [@@dead "+int32_mod"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1592, characters 0-53 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1595, characters 0-53 +float_mul is never used - <-- line 1592 + <-- line 1595 let float_mul ?comment e1 e2 = bin ?comment Mul e1 e2 [@@dead "+float_mul"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1594, characters 0-316 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1597, characters 0-316 +int32_lsl is never used - <-- line 1594 + <-- line 1597 | _ -> {comment; expression_desc = Bin (Lsl, e1, e2)} [@@dead "+int32_lsl"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1601, characters 0-253 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1604, characters 0-253 +is_pos_pow is never used - <-- line 1601 + <-- line 1604 try aux 0 n with E -> -1 [@@dead "+is_pos_pow"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1611, characters 0-702 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1614, characters 0-702 +int32_mul is never used - <-- line 1611 + <-- line 1614 | _ -> to_int32 (float_mul ?comment e1 e2) [@@dead "+int32_mul"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1627, characters 0-104 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1630, characters 0-104 +unchecked_int32_mul is never used - <-- line 1627 + <-- line 1630 {comment; expression_desc = Bin (Mul, e1, e2)} [@@dead "+unchecked_int32_mul"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1630, characters 0-179 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1633, characters 0-179 +int_bnot is never used - <-- line 1630 + <-- line 1633 | _ -> {comment; expression_desc = Js_bnot e} [@@dead "+int_bnot"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1635, characters 0-251 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1638, characters 0-251 +int32_pow is never used - <-- line 1635 + <-- line 1638 | _ -> to_int32 (float_pow ?comment e1 e2) [@@dead "+int32_pow"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1641, characters 0-445 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1644, characters 0-445 +int32_bxor is never used - <-- line 1641 + <-- line 1644 | _ -> {comment; expression_desc = Bin (Bxor, e1, e2)} [@@dead "+int32_bxor"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1651, characters 0-384 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1654, characters 0-384 +int32_band is never used - <-- line 1651 + <-- line 1654 | _ -> {comment; expression_desc = Bin (Band, e1, e2)} [@@dead "+int32_band"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1665, characters 0-67 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1668, characters 0-67 +bigint_op is never used - <-- line 1665 + <-- line 1668 let bigint_op ?comment op (e1 : t) (e2 : t) = bin ?comment op e1 e2 [@@dead "+bigint_op"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1667, characters 0-992 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1670, characters 0-992 +bigint_comp is never used - <-- line 1667 + <-- line 1670 | _ -> bin ?comment (Lam_compile_util.jsop_of_comp cmp) e0 e1 [@@dead "+bigint_comp"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1694, characters 0-159 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1697, characters 0-159 +bigint_div is never used - <-- line 1694 + <-- line 1697 else bigint_op ?comment Div e0 e1 [@@dead "+bigint_div"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1698, characters 0-160 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1701, characters 0-160 +bigint_mod is never used - <-- line 1698 + <-- line 1701 else bigint_op ?comment Mod e0 e1 [@@dead "+bigint_mod"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1705, characters 0-596 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1708, characters 0-596 +of_block is never used - <-- line 1705 + <-- line 1708 [] [@@dead "+of_block"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1729, characters 0-58 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1732, characters 0-58 +is_null is never used - <-- line 1729 + <-- line 1732 let is_null ?comment (x : t) = triple_equal ?comment x nil [@@dead "+is_null"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1730, characters 0-59 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1733, characters 0-59 +is_undef is never used - <-- line 1730 + <-- line 1733 let is_undef ?comment x = triple_equal ?comment x undefined [@@dead "+is_undef"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1732, characters 0-117 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1735, characters 0-117 +is_null_undefined_constant is never used - <-- line 1732 + <-- line 1735 | _ -> false [@@dead "+is_null_undefined_constant"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1737, characters 0-216 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1740, characters 0-216 +is_null_undefined is never used - <-- line 1737 + <-- line 1740 | _ -> {comment; expression_desc = Is_null_or_undefined x} [@@dead "+is_null_undefined"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1743, characters 0-605 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1746, characters 0-605 +eq_null_undefined_boolean is never used - <-- line 1743 + <-- line 1746 | _ -> {expression_desc = Bin (EqEqEq, a, b); comment} [@@dead "+eq_null_undefined_boolean"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1758, characters 0-605 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1761, characters 0-605 +neq_null_undefined_boolean is never used - <-- line 1758 + <-- line 1761 | _ -> {expression_desc = Bin (NotEqEq, a, b); comment} [@@dead "+neq_null_undefined_boolean"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1773, characters 0-106 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1776, characters 0-106 +make_exception is never used - <-- line 1773 + <-- line 1776 pure_runtime_call Primitive_modules.exceptions Literals.create [str s] [@@dead "+make_exception"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1776, characters 0-173 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1779, characters 0-173 +variadic_args is never used - <-- line 1776 + <-- line 1779 | arg :: args -> arg :: variadic_args args [@@dead "+variadic_args"] Warning Dead Value @@ -3858,10 +3846,10 @@ val remove_pure_sub_exp : t -> t option [@@dead "+remove_pure_sub_exp"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 48, characters 0-62 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 48, characters 0-43 +runtime_var_dot is never used <-- line 48 - val runtime_var_dot : ?comment:string -> string -> string -> t [@@dead "+runtime_var_dot"] + val runtime_var_dot : string -> string -> t [@@dead "+runtime_var_dot"] Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 52, characters 0-84 @@ -3930,16 +3918,16 @@ val small_int : int -> t [@@dead "+small_int"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 126, characters 0-51 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 126, characters 0-32 +bigint is never used <-- line 126 - val bigint : ?comment:string -> bool -> string -> t [@@dead "+bigint"] + val bigint : bool -> string -> t [@@dead "+bigint"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 128, characters 0-42 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 128, characters 0-23 +float is never used <-- line 128 - val float : ?comment:string -> string -> t [@@dead "+float"] + val float : string -> t [@@dead "+float"] Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 132, characters 0-24 @@ -16803,4 +16791,4 @@ <-- line 4 OUnit.assert_equal ~cmp:(Vec_int.equal (fun (x : int) y -> x = y)) x y [@@dead "+=~"] - Analysis reported 2953 issues (Warning Dead Module:145, Warning Dead Type:369, Warning Dead Value:2127, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:206, Warning Unused Argument:69) + Analysis reported 2950 issues (Warning Dead Module:145, Warning Dead Type:369, Warning Dead Value:2127, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:206, Warning Unused Argument:66) diff --git a/compiler/core/js_exp_make.ml b/compiler/core/js_exp_make.ml index ee1c82e1aa6..51d9c9c4cbf 100644 --- a/compiler/core/js_exp_make.ml +++ b/compiler/core/js_exp_make.ml @@ -79,7 +79,7 @@ let tagged_template ?comment call_expr string_args value_args : t = comment; } -let runtime_var_dot ?comment (x : string) (e1 : string) : J.expression = +let runtime_var_dot (x : string) (e1 : string) : J.expression = { expression_desc = Var @@ -90,7 +90,7 @@ let runtime_var_dot ?comment (x : string) (e1 : string) : J.expression = dynamic_import = false; }, Some e1 )); - comment; + comment = None; } let ml_var_dot ?comment ?(dynamic_import = false) (id : Ident.t) e : @@ -340,8 +340,11 @@ let nine_int_literal : t = let int ?comment ?c i : t = {expression_desc = Number (Int {i; c}); comment} -let bigint ?comment sign i : t = - {expression_desc = Number (BigInt {positive = sign; value = i}); comment} +let bigint sign i : t = + { + expression_desc = Number (BigInt {positive = sign; value = i}); + comment = None; + } let zero_bigint_literal : t = { @@ -367,7 +370,7 @@ let true_ : t = {comment = None; expression_desc = Bool true} let false_ : t = {comment = None; expression_desc = Bool false} let bool v = if v then true_ else false_ -let float ?comment f : t = {expression_desc = Number (Float {f}); comment} +let float f : t = {expression_desc = Number (Float {f}); comment = None} let zero_float_lit : t = {expression_desc = Number (Float {f = "0."}); comment = None} diff --git a/compiler/core/js_exp_make.mli b/compiler/core/js_exp_make.mli index 5cfa40c1d00..d0042c9c7f9 100644 --- a/compiler/core/js_exp_make.mli +++ b/compiler/core/js_exp_make.mli @@ -45,7 +45,7 @@ val var : J.ident -> t val js_global : string -> t -val runtime_var_dot : ?comment:string -> string -> string -> t +val runtime_var_dot : string -> string -> t (* val runtime_var_vid : string -> string -> J.vident *) @@ -123,9 +123,9 @@ val int : ?comment:string -> ?c:int -> int32 -> t val small_int : int -> t -val bigint : ?comment:string -> bool -> string -> t +val bigint : bool -> string -> t -val float : ?comment:string -> string -> t +val float : string -> t (* val empty_string_literal : t *) (* TODO: we can do hash consing for small integers *) From 16d57408144efbedac4c7446853f8570a48626cd Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 11:36:41 +0000 Subject: [PATCH 040/214] dce: narrow spread parser --- _dce/report.txt | 10 +--------- compiler/syntax/src/res_core.ml | 6 ++---- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index 1b7eda89623..8579a71c6ef 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -787,14 +787,6 @@ File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typecore.ml", line 967, characters 2-55 optional argument from_type of function Label.+unbound_name_error is never used - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/syntax/src/res_core.ml", line 5923, characters 0-1468 - optional argument current_type_name_path of function +parse_spread_tail_classified is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/syntax/src/res_core.ml", line 5923, characters 0-1468 - optional argument inline_types_context of function +parse_spread_tail_classified is never used - Warning Unused Argument File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_compatible.mli", line 74, characters 0-130 optional argument async of function +fun_ is never used @@ -16791,4 +16783,4 @@ <-- line 4 OUnit.assert_equal ~cmp:(Vec_int.equal (fun (x : int) y -> x = y)) x y [@@dead "+=~"] - Analysis reported 2950 issues (Warning Dead Module:145, Warning Dead Type:369, Warning Dead Value:2127, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:206, Warning Unused Argument:66) + Analysis reported 2948 issues (Warning Dead Module:145, Warning Dead Type:369, Warning Dead Value:2127, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:206, Warning Unused Argument:64) diff --git a/compiler/syntax/src/res_core.ml b/compiler/syntax/src/res_core.ml index 2d3eabd3944..95157d44908 100644 --- a/compiler/syntax/src/res_core.ml +++ b/compiler/syntax/src/res_core.ml @@ -5920,8 +5920,7 @@ and parse_type_equation_or_constr_decl p = (* TODO: is this a good idea? *) (None, Asttypes.Public, Parsetree.Ptype_abstract) -and parse_spread_tail_classified ?current_type_name_path ?inline_types_context - ~start_pos ~spread_typ ~grammar p = +and parse_spread_tail_classified ~start_pos ~spread_typ ~grammar p = match p.token with | Rbrace -> (* `{...t}` no extra fields: treat as record without tail fields *) @@ -5933,8 +5932,7 @@ and parse_spread_tail_classified ?current_type_name_path ?inline_types_context let (fields : Parsetree.label_declaration list) = parse_comma_delimited_region ~grammar ~closing:Rbrace ~f: - (parse_field_declaration_region ?current_type_name_path - ?inline_types_context ~found_object_field) + (parse_field_declaration_region ~found_object_field) p in Parser.expect Rbrace p; From 61991332e02a9706784f3be02056130314b3fa23 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 11:37:52 +0000 Subject: [PATCH 041/214] dce: narrow ast compatible helpers --- _dce/report.txt | 54 ++-------------------------- compiler/frontend/ast_compatible.ml | 24 ++++++------- compiler/frontend/ast_compatible.mli | 13 ++----- 3 files changed, 17 insertions(+), 74 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index 8579a71c6ef..f963884d884 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -787,30 +787,6 @@ File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typecore.ml", line 967, characters 2-55 optional argument from_type of function Label.+unbound_name_error is never used - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_compatible.mli", line 74, characters 0-130 - optional argument async of function +fun_ is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_compatible.mli", line 74, characters 0-130 - optional argument attrs of function +fun_ is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_compatible.mli", line 74, characters 0-130 - optional argument loc of function +fun_ is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_compatible.mli", line 61, characters 0-179 - optional argument attrs of function +apply_labels is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_compatible.mli", line 44, characters 0-110 - optional argument attrs of function +app2 is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_compatible.mli", line 38, characters 0-99 - optional argument attrs of function +apply_simple is never used - Warning Redundant Optional Argument File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/parmatch.ml", line 2047, characters 0-2615 optional argument pred of function +do_check_partial is always supplied (1 calls) @@ -819,30 +795,6 @@ File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/parmatch.ml", line 950, characters 0-927 optional argument always of function +pats_of_type is never used - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_compatible.ml", line 121, characters 0-438 - optional argument attrs of function +apply_labels is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_compatible.ml", line 90, characters 0-319 - optional argument async of function +fun_ is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_compatible.ml", line 90, characters 0-319 - optional argument attrs of function +fun_ is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_compatible.ml", line 90, characters 0-319 - optional argument loc of function +fun_ is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_compatible.ml", line 62, characters 0-319 - optional argument attrs of function +app2 is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_compatible.ml", line 33, characters 0-377 - optional argument attrs of function +apply_simple is never used - Warning Unused Argument File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/pprintast.ml", line 220, characters 0-346 optional argument first of function +paren is never used @@ -12964,9 +12916,9 @@ val const_exp_int_list_as_array : int list -> expression [@@dead "+const_exp_int_list_as_array"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_compatible.mli", line 52, characters 0-126 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_compatible.mli", line 47, characters 0-126 +app3 is never used - <-- line 52 + <-- line 47 expression [@@dead "+app3"] Warning Dead Value @@ -16783,4 +16735,4 @@ <-- line 4 OUnit.assert_equal ~cmp:(Vec_int.equal (fun (x : int) y -> x = y)) x y [@@dead "+=~"] - Analysis reported 2948 issues (Warning Dead Module:145, Warning Dead Type:369, Warning Dead Value:2127, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:206, Warning Unused Argument:64) + Analysis reported 2936 issues (Warning Dead Module:145, Warning Dead Type:369, Warning Dead Value:2127, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:206, Warning Unused Argument:52) diff --git a/compiler/frontend/ast_compatible.ml b/compiler/frontend/ast_compatible.ml index 8d6ac2d4277..598a7ed63b2 100644 --- a/compiler/frontend/ast_compatible.ml +++ b/compiler/frontend/ast_compatible.ml @@ -30,11 +30,11 @@ open Parsetree let default_loc = Location.none -let apply_simple ?(loc = default_loc) ?(attrs = []) (fn : expression) - (args : expression list) : expression = +let apply_simple ?(loc = default_loc) (fn : expression) (args : expression list) + : expression = { pexp_loc = loc; - pexp_attributes = attrs; + pexp_attributes = []; pexp_desc = Pexp_apply { @@ -59,10 +59,10 @@ let app1 ?(loc = default_loc) ?(attrs = []) fn arg1 : expression = }; } -let app2 ?(loc = default_loc) ?(attrs = []) fn arg1 arg2 : expression = +let app2 ?(loc = default_loc) fn arg1 arg2 : expression = { pexp_loc = loc; - pexp_attributes = attrs; + pexp_attributes = []; pexp_desc = Pexp_apply { @@ -87,10 +87,10 @@ let app3 ?(loc = default_loc) ?(attrs = []) fn arg1 arg2 arg3 : expression = }; } -let fun_ ?(loc = default_loc) ?(attrs = []) ?(async = false) ~arity pat exp = +let fun_ ~arity pat exp = { - pexp_loc = loc; - pexp_attributes = attrs; + pexp_loc = default_loc; + pexp_attributes = []; pexp_desc = Pexp_fun { @@ -99,7 +99,7 @@ let fun_ ?(loc = default_loc) ?(attrs = []) ?(async = false) ~arity pat exp = lhs = pat; rhs = exp; arity; - async; + async = false; }; } @@ -118,11 +118,11 @@ let const_exp_int ?(loc = default_loc) ?(attrs = []) (s : int) : expression = pexp_desc = Pexp_constant (Pconst_integer (string_of_int s, None)); } -let apply_labels ?(loc = default_loc) ?(attrs = []) fn - (args : (string * expression) list) : expression = +let apply_labels ?(loc = default_loc) fn (args : (string * expression) list) : + expression = { pexp_loc = loc; - pexp_attributes = attrs; + pexp_attributes = []; pexp_desc = Pexp_apply { diff --git a/compiler/frontend/ast_compatible.mli b/compiler/frontend/ast_compatible.mli index 77f6e686704..c3724016299 100644 --- a/compiler/frontend/ast_compatible.mli +++ b/compiler/frontend/ast_compatible.mli @@ -36,18 +36,13 @@ val const_exp_int : ?loc:Location.t -> ?attrs:attrs -> int -> expression val const_exp_int_list_as_array : int list -> expression val apply_simple : - ?loc:Location.t -> ?attrs:attrs -> expression -> expression list -> expression + ?loc:Location.t -> expression -> expression list -> expression val app1 : ?loc:Location.t -> ?attrs:attrs -> expression -> expression -> expression val app2 : - ?loc:Location.t -> - ?attrs:attrs -> - expression -> - expression -> - expression -> - expression + ?loc:Location.t -> expression -> expression -> expression -> expression val app3 : ?loc:Location.t -> @@ -60,7 +55,6 @@ val app3 : val apply_labels : ?loc:Location.t -> - ?attrs:attrs -> expression -> (string * expression) list -> (* [(label,e)] [label] is strictly interpreted as label *) @@ -72,9 +66,6 @@ val apply_labels : *) val fun_ : - ?loc:Location.t -> - ?attrs:attrs -> - ?async:bool -> arity:int option -> pattern -> expression -> From 8182d8c02fec88a3c8b3b997f64850e9f59a8c37 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 11:38:46 +0000 Subject: [PATCH 042/214] dce: narrow parmatch helpers --- _dce/report.txt | 22 +++++++--------------- compiler/ml/parmatch.ml | 27 ++++++++++----------------- 2 files changed, 17 insertions(+), 32 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index f963884d884..eeb49741a5e 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -787,14 +787,6 @@ File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typecore.ml", line 967, characters 2-55 optional argument from_type of function Label.+unbound_name_error is never used - Warning Redundant Optional Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/parmatch.ml", line 2047, characters 0-2615 - optional argument pred of function +do_check_partial is always supplied (1 calls) - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/parmatch.ml", line 950, characters 0-927 - optional argument always of function +pats_of_type is never used - Warning Unused Argument File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/pprintast.ml", line 220, characters 0-346 optional argument first of function +paren is never used @@ -15614,21 +15606,21 @@ let equal = Types.equal_tag [@@dead "Constructor_tag_hashtbl.+equal"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/parmatch.ml", line 2541, characters 4-193 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/parmatch.ml", line 2534, characters 4-193 +enter_expression is never used - <-- line 2541 + <-- line 2534 | _ -> () [@@dead "+enter_expression"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/parmatch.ml", line 2549, characters 4-103 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/parmatch.ml", line 2542, characters 4-103 +is_unpack is never used - <-- line 2549 + <-- line 2542 List.exists (fun (attr, _) -> attr.txt = "#modulepat") exp.exp_attributes [@@dead "+is_unpack"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/parmatch.ml", line 2552, characters 4-493 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/parmatch.ml", line 2545, characters 4-493 +leave_expression is never used - <-- line 2552 + <-- line 2545 | _ -> assert false [@@dead "+leave_expression"] Warning Dead Type @@ -16735,4 +16727,4 @@ <-- line 4 OUnit.assert_equal ~cmp:(Vec_int.equal (fun (x : int) y -> x = y)) x y [@@dead "+=~"] - Analysis reported 2936 issues (Warning Dead Module:145, Warning Dead Type:369, Warning Dead Value:2127, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:206, Warning Unused Argument:52) + Analysis reported 2934 issues (Warning Dead Module:145, Warning Dead Type:369, Warning Dead Value:2127, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:205, Warning Unused Argument:51) diff --git a/compiler/ml/parmatch.ml b/compiler/ml/parmatch.ml index 4ae23724fb4..c872db94365 100644 --- a/compiler/ml/parmatch.ml +++ b/compiler/ml/parmatch.ml @@ -947,15 +947,14 @@ let pat_of_constrs ex_pat cstrs = if cstrs = [] then raise Empty else orify_many (List.map (pat_of_constr ex_pat) cstrs) -let pats_of_type ?(always = false) env ty = +let pats_of_type env ty = let ty' = Ctype.expand_head env ty in match ty'.desc with | Tconstr (path, _, _) -> ( try match (Env.find_type path env).type_kind with | Type_variant cl - when always - || List.length cl = 1 + when List.length cl = 1 || List.for_all (fun cd -> cd.Types.cd_res <> None) cl -> let cstrs = fst (Env.find_type_descrs path env) in List.map (pat_of_constr (make_pat Tpat_any ty env)) cstrs @@ -2044,7 +2043,7 @@ let ppat_of_type env ty = (Conv.mkpat Parsetree.Ppat_any, Hashtbl.create 0, Hashtbl.create 0) | pats -> Conv.conv (orify_many pats) -let do_check_partial ?partial_match_warning_hint ?pred exhaust loc casel pss = +let do_check_partial ?partial_match_warning_hint ~pred exhaust loc casel pss = match pss with | [] -> (* @@ -2065,19 +2064,13 @@ let do_check_partial ?partial_match_warning_hint ?pred exhaust loc casel pss = match exhaust None pss (List.length ps) with | Rnone -> Total | Rsome [u] -> ( - let v = - match pred with - | Some pred -> - let pattern, constrs, labels = Conv.conv u in - let u' = pred constrs labels pattern in - (* pretty_pat u; - begin match u' with - None -> prerr_endline ": impossible" - | Some _ -> prerr_endline ": possible" - end; *) - u' - | None -> Some u - in + let pattern, constrs, labels = Conv.conv u in + let v = pred constrs labels pattern in + (* pretty_pat u; + begin match v with + None -> prerr_endline ": impossible" + | Some _ -> prerr_endline ": possible" + end; *) match v with | None -> Total | Some v -> From 3a69af6df8ef868372c171232c3fb52fecd0c9ad Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 11:39:41 +0000 Subject: [PATCH 043/214] dce: simplify paren printer --- _dce/report.txt | 26 +++++++++----------------- compiler/ml/pprintast.ml | 6 +----- 2 files changed, 10 insertions(+), 22 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index eeb49741a5e..05ff696e5f7 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -787,14 +787,6 @@ File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typecore.ml", line 967, characters 2-55 optional argument from_type of function Label.+unbound_name_error is never used - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/pprintast.ml", line 220, characters 0-346 - optional argument first of function +paren is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/pprintast.ml", line 220, characters 0-346 - optional argument last of function +paren is never used - Warning Unused Argument File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typetexp.mli", line 102, characters 0-91 optional argument from_type of function +unbound_label_error is never used @@ -15690,29 +15682,29 @@ val heads : t -> Ident.t list [@@dead "+heads"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/pprintast.ml", line 1358, characters 0-60 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/pprintast.ml", line 1354, characters 0-60 +expression is never used - <-- line 1358 + <-- line 1354 let expression f x = pp f "@[%a@]" (expression reset_ctxt) x [@@dead "+expression"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/pprintast.ml", line 1360, characters 0-133 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/pprintast.ml", line 1356, characters 0-133 +string_of_expression is never used - <-- line 1360 + <-- line 1356 flush_str_formatter () [@@dead "+string_of_expression"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/pprintast.ml", line 1366, characters 0-142 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/pprintast.ml", line 1362, characters 0-142 +string_of_structure is never used - <-- line 1366 + <-- line 1362 flush_str_formatter () [@@dead "+string_of_structure"] Warning Dead Value With Side Effects - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/pprintast.ml", line 1372, characters 0-36 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/pprintast.ml", line 1368, characters 0-36 +core_type is never used and could have side effects Warning Dead Value With Side Effects - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/pprintast.ml", line 1373, characters 0-32 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/pprintast.ml", line 1369, characters 0-32 +pattern is never used and could have side effects Warning Dead Value @@ -16727,4 +16719,4 @@ <-- line 4 OUnit.assert_equal ~cmp:(Vec_int.equal (fun (x : int) y -> x = y)) x y [@@dead "+=~"] - Analysis reported 2934 issues (Warning Dead Module:145, Warning Dead Type:369, Warning Dead Value:2127, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:205, Warning Unused Argument:51) + Analysis reported 2932 issues (Warning Dead Module:145, Warning Dead Type:369, Warning Dead Value:2127, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:205, Warning Unused Argument:49) diff --git a/compiler/ml/pprintast.ml b/compiler/ml/pprintast.ml index a2f0fd45305..b8bcf6d5b38 100644 --- a/compiler/ml/pprintast.ml +++ b/compiler/ml/pprintast.ml @@ -219,19 +219,15 @@ let option : let paren : 'a. - ?first:space_formatter -> - ?last:space_formatter -> bool -> (Format.formatter -> 'a -> unit) -> Format.formatter -> 'a -> unit = - fun ?(first = ("" : _ format6)) ?(last = ("" : _ format6)) b fu f x -> + fun b fu f x -> if b then ( pp f "("; - pp f first; fu f x; - pp f last; pp f ")") else fu f x From d6794ab2bdb462ee28c8b744be44f94efd53bb33 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 11:40:50 +0000 Subject: [PATCH 044/214] dce: simplify completion create --- _dce/report.txt | 16 +--------------- analysis/src/shared_types.ml | 8 +++----- 2 files changed, 4 insertions(+), 20 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index 05ff696e5f7..0a7a7ac1da8 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -795,14 +795,6 @@ File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typetexp.mli", line 100, characters 0-97 optional argument from_type of function +unbound_constructor_error is never used - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/shared_types.ml", line 862, characters 2-570 - optional argument data of function Completion.+create is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/shared_types.ml", line 862, characters 2-570 - optional argument filter_text of function Completion.+create is never used - Warning Unused Argument File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typetexp.ml", line 173, characters 0-141 optional argument from_type of function +unbound_label_error is never used @@ -2235,12 +2227,6 @@ <-- line 855 type_arg_context: type_arg_context option; [@dead "Completion.t.type_arg_context"] - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/shared_types.ml", line 856, characters 4-40 - Completion.t.data is a record label never used to read a value - <-- line 856 - data: (string * string) list option; [@dead "Completion.t.data"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/type_utils.ml", line 980, characters 0-153 +unwrap_completion_type_if_option is never used @@ -16719,4 +16705,4 @@ <-- line 4 OUnit.assert_equal ~cmp:(Vec_int.equal (fun (x : int) y -> x = y)) x y [@@dead "+=~"] - Analysis reported 2932 issues (Warning Dead Module:145, Warning Dead Type:369, Warning Dead Value:2127, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:205, Warning Unused Argument:49) + Analysis reported 2929 issues (Warning Dead Module:145, Warning Dead Type:368, Warning Dead Value:2127, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:205, Warning Unused Argument:47) diff --git a/analysis/src/shared_types.ml b/analysis/src/shared_types.ml index 173a6bfb7a7..afcc9a1f374 100644 --- a/analysis/src/shared_types.ml +++ b/analysis/src/shared_types.ml @@ -853,15 +853,14 @@ module Completion = struct kind: kind; detail: string option; type_arg_context: type_arg_context option; - data: (string * string) list option; additional_text_edits: Lsp.Types.TextEdit.t list option; synthetic: bool; (** Whether this item is an made up, synthetic item or not. *) } - let create ?(synthetic = false) ?additional_text_edits ?data ?type_arg_context + let create ?(synthetic = false) ?additional_text_edits ?type_arg_context ?(includes_snippets = false) ?insert_text ~kind ~env ?sort_text - ?deprecated ?filter_text ?detail ?(docstring = []) name = + ?deprecated ?detail ?(docstring = []) name = { name; env; @@ -873,10 +872,9 @@ module Completion = struct insert_text_format = (if includes_snippets then Some Lsp.Types.InsertTextFormat.Snippet else None); - filter_text; + filter_text = None; detail; type_arg_context; - data; additional_text_edits; synthetic; } From 92a56bc974d38a45b39ed10a0a38dec694754730 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 11:42:00 +0000 Subject: [PATCH 045/214] dce: simplify exotic ident printer --- _dce/report.txt | 6 +----- analysis/src/type_utils.ml | 3 +-- analysis/src/utils.ml | 4 ++-- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index 0a7a7ac1da8..723ebcb72cf 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -803,10 +803,6 @@ File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typetexp.ml", line 168, characters 0-160 optional argument from_type of function +unbound_constructor_error is never used - Warning Redundant Optional Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/utils.ml", line 247, characters 0-555 - optional argument allow_uident of function +print_maybe_exotic_ident is always supplied (1 calls) - Warning Redundant Optional Argument File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_ident.ml", line 84, characters 0-597 optional argument op of function +convert is always supplied (1 calls) @@ -16705,4 +16701,4 @@ <-- line 4 OUnit.assert_equal ~cmp:(Vec_int.equal (fun (x : int) y -> x = y)) x y [@@dead "+=~"] - Analysis reported 2929 issues (Warning Dead Module:145, Warning Dead Type:368, Warning Dead Value:2127, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:205, Warning Unused Argument:47) + Analysis reported 2928 issues (Warning Dead Module:145, Warning Dead Type:368, Warning Dead Value:2127, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:204, Warning Unused Argument:47) diff --git a/analysis/src/type_utils.ml b/analysis/src/type_utils.ml index f2b68eb4a41..70f46b60aec 100644 --- a/analysis/src/type_utils.ml +++ b/analysis/src/type_utils.ml @@ -449,8 +449,7 @@ let rec extract_type ?(print_opening_debug = true) |> List.map (fun (label, field) -> { name = label; - display_name = - Utils.print_maybe_exotic_ident ~allow_uident:true label; + display_name = Utils.print_maybe_exotic_ident label; args = (* Multiple arguments are represented as a Ttuple, while a single argument is just the type expression itself. *) (match field with diff --git a/analysis/src/utils.ml b/analysis/src/utils.ml index 18a26e3241b..142e5aa2861 100644 --- a/analysis/src/utils.ml +++ b/analysis/src/utils.ml @@ -244,14 +244,14 @@ let rec flatten_any_namespace_in_path path = (parts |> List.rev) @ flatten_any_namespace_in_path tail else head :: flatten_any_namespace_in_path tail -let print_maybe_exotic_ident ?(allow_uident = false) txt = +let print_maybe_exotic_ident txt = let len = String.length txt in let rec loop i = if i == len then txt else if i == 0 then match String.unsafe_get txt i with - | 'A' .. 'Z' when allow_uident -> loop (i + 1) + | 'A' .. 'Z' -> loop (i + 1) | 'a' .. 'z' | '_' -> loop (i + 1) | _ -> "\"" ^ txt ^ "\"" else From 470287cf74931609b12d057381209870db772eae Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 11:43:04 +0000 Subject: [PATCH 046/214] dce: narrow ident char convert --- _dce/report.txt | 14 +++++--------- compiler/ext/ext_ident.ml | 4 ++-- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index 723ebcb72cf..cb181c67a97 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -760,11 +760,11 @@ optional argument loc of function Typ.+any is always supplied (1 calls) Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/type_utils.ml", line 588, characters 2-51 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/type_utils.ml", line 587, characters 2-51 optional argument print_opening_debug of function +extract_type is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/type_utils.ml", line 588, characters 2-51 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/type_utils.ml", line 587, characters 2-51 optional argument type_arg_context_from_type_manifest of function +extract_type is never used Warning Unused Argument @@ -803,10 +803,6 @@ File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typetexp.ml", line 168, characters 0-160 optional argument from_type of function +unbound_constructor_error is never used - Warning Redundant Optional Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_ident.ml", line 84, characters 0-597 - optional argument op of function +convert is always supplied (1 calls) - Warning Unused Argument File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/printtyp.mli", line 84, characters 0-238 optional argument unif of function +super_report_unification_error is never used @@ -2224,9 +2220,9 @@ type_arg_context: type_arg_context option; [@dead "Completion.t.type_arg_context"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/type_utils.ml", line 980, characters 0-153 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/type_utils.ml", line 979, characters 0-153 +unwrap_completion_type_if_option is never used - <-- line 980 + <-- line 979 | _ -> t [@@dead "+unwrap_completion_type_if_option"] Warning Dead Value @@ -16701,4 +16697,4 @@ <-- line 4 OUnit.assert_equal ~cmp:(Vec_int.equal (fun (x : int) y -> x = y)) x y [@@dead "+=~"] - Analysis reported 2928 issues (Warning Dead Module:145, Warning Dead Type:368, Warning Dead Value:2127, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:204, Warning Unused Argument:47) + Analysis reported 2927 issues (Warning Dead Module:145, Warning Dead Type:368, Warning Dead Value:2127, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:203, Warning Unused Argument:47) diff --git a/compiler/ext/ext_ident.ml b/compiler/ext/ext_ident.ml index 8a7910ca381..7a4dac253a0 100644 --- a/compiler/ext/ext_ident.ml +++ b/compiler/ext/ext_ident.ml @@ -81,7 +81,7 @@ let js_module_table : Ident.t Hash_string.t = Hash_string.create 31 | v -> (* v *) Ident.rename v *) -let[@inline] convert ?(op = false) (c : char) : string = +let[@inline] convert_char ~op (c : char) : string = match c with | '*' -> "$star" | '\'' -> "$p" @@ -146,7 +146,7 @@ let name_mangle name = for j = 0 to len - 1 do let c = String.unsafe_get name j in if no_escape c then Ext_buffer.add_char buffer c - else Ext_buffer.add_string buffer (convert ~op:(i = 0) c) + else Ext_buffer.add_string buffer (convert_char ~op:(i = 0) c) done; Ext_buffer.contents buffer From 4e3e270b71fd398adde11d50590dfbf862be00eb Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 11:44:30 +0000 Subject: [PATCH 047/214] dce: narrow printtyp reporters --- _dce/report.txt | 50 +++++++++------------------------------- compiler/ml/printtyp.ml | 24 +++++++++---------- compiler/ml/printtyp.mli | 2 -- 3 files changed, 22 insertions(+), 54 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index cb181c67a97..854ce18584b 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -803,34 +803,6 @@ File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typetexp.ml", line 168, characters 0-160 optional argument from_type of function +unbound_constructor_error is never used - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/printtyp.mli", line 84, characters 0-238 - optional argument unif of function +super_report_unification_error is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/printtyp.mli", line 75, characters 0-163 - optional argument unif of function +report_unification_error is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/printtyp.ml", line 1563, characters 0-200 - optional argument unif of function +super_report_unification_error is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/printtyp.ml", line 1503, characters 0-146 - optional argument unif of function +report_unification_error is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/printtyp.ml", line 960, characters 0-106 - optional argument printing_context of function +typexp is never used - - Warning Redundant Optional Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/printtyp.ml", line 950, characters 0-310 - optional argument printing_context of function +tree_of_constraints is always supplied (1 calls) - - Warning Redundant Optional Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/printtyp.ml", line 911, characters 0-1065 - optional argument printing_context of function +tree_of_constructor is always supplied (1 calls) - Warning Unused Argument File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.mli", line 322, characters 0-62 optional argument env of function +free_variables is never used @@ -15840,27 +15812,27 @@ val structured_constant : formatter -> structured_constant -> unit [@@dead "+structured_constant"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/printtyp.ml", line 965, characters 0-40 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/printtyp.ml", line 964, characters 0-40 +type_sch is never used - <-- line 965 + <-- line 964 and type_sch ppf ty = typexp true ppf ty [@@dead "+type_sch"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/printtyp.ml", line 972, characters 0-113 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/printtyp.ml", line 971, characters 0-113 +type_scheme_max is never used - <-- line 972 + <-- line 971 typexp true ppf ty [@@dead "+type_scheme_max"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/printtyp.ml", line 1186, characters 0-299 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/printtyp.ml", line 1185, characters 0-299 +refresh_weak is never used - <-- line 1186 + <-- line 1185 weak_var_map := m [@@dead "+refresh_weak"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/printtyp.ml", line 1198, characters 0-358 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/printtyp.ml", line 1197, characters 0-358 +print_items is never used - <-- line 1198 + <-- line 1197 print showval env x [@@dead "+print_items"] Warning Dead Value @@ -15924,9 +15896,9 @@ bool -> bool -> string -> formatter -> (type_expr * type_expr) list -> unit [@@dead "+trace"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/printtyp.mli", line 113, characters 0-131 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/printtyp.mli", line 111, characters 0-131 +print_items is never used - <-- line 113 + <-- line 111 (out_sig_item * 'a option) list [@@dead "+print_items"] Warning Dead Value @@ -16697,4 +16669,4 @@ <-- line 4 OUnit.assert_equal ~cmp:(Vec_int.equal (fun (x : int) y -> x = y)) x y [@@dead "+=~"] - Analysis reported 2927 issues (Warning Dead Module:145, Warning Dead Type:368, Warning Dead Value:2127, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:203, Warning Unused Argument:47) + Analysis reported 2920 issues (Warning Dead Module:145, Warning Dead Type:368, Warning Dead Value:2127, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:201, Warning Unused Argument:42) diff --git a/compiler/ml/printtyp.ml b/compiler/ml/printtyp.ml index da6a3b25b16..4337c2a736e 100644 --- a/compiler/ml/printtyp.ml +++ b/compiler/ml/printtyp.ml @@ -908,7 +908,7 @@ and tree_of_constructor_arguments ?printing_context = function | Cstr_tuple l -> tree_of_typlist ?printing_context false l | Cstr_record l -> [Otyp_record (List.map tree_of_label l)] -and tree_of_constructor ?printing_context cd = +and tree_of_constructor ~printing_context cd = let name = Ident.name cd.cd_id in let nullary = Ast_untagged_variants.is_nullary_variant cd.cd_args in let repr = @@ -924,13 +924,13 @@ and tree_of_constructor ?printing_context cd = | Some (BigInt s) -> Some (Printf.sprintf "@as(%sn)" s) | Some (Untagged _) (* should never happen *) | None -> None in - let arg () = tree_of_constructor_arguments ?printing_context cd.cd_args in + let arg () = tree_of_constructor_arguments ~printing_context cd.cd_args in match cd.cd_res with | None -> (name, arg (), None, repr) | Some res -> let nm = !names in names := []; - let ret = tree_of_typexp ?printing_context false res in + let ret = tree_of_typexp ~printing_context false res in let args = arg () in names := nm; (name, args, Some ret, repr) @@ -947,18 +947,17 @@ and tree_of_label ?printing_context l = opt, tree_of_typexp ?printing_context false typ ) -and tree_of_constraints ?printing_context params = +and tree_of_constraints ~printing_context params = List.fold_right (fun ty list -> let ty' = unalias ty in if proxy ty != proxy ty' then - let tr = tree_of_typexp ?printing_context true ty in - (tr, tree_of_typexp ?printing_context true ty') :: list + let tr = tree_of_typexp ~printing_context true ty in + (tr, tree_of_typexp ~printing_context true ty') :: list else list) params [] -let typexp ?printing_context sch ppf ty = - !Oprint.out_type ppf (tree_of_typexp ?printing_context sch ty) +let typexp sch ppf ty = !Oprint.out_type ppf (tree_of_typexp sch ty) let type_expr ppf ty = typexp false ppf ty @@ -1500,8 +1499,8 @@ let unification_error env unif tr txt1 ppf txt2 = warn_on_missing_def env ppf t2) with exn -> raise exn) -let report_unification_error ppf env ?(unif = true) tr txt1 txt2 = - wrap_printing_env env (fun () -> unification_error env unif tr txt1 ppf txt2) +let report_unification_error ppf env tr txt1 txt2 = + wrap_printing_env env (fun () -> unification_error env true tr txt1 ppf txt2) let super_type_expansion ~tag t ppf t' = let tag = Format.String_tag tag in @@ -1560,10 +1559,9 @@ let super_unification_error ?print_extra_info unif tr txt1 ppf txt2 = | Some f -> f ppf t1 t2) with exn -> raise exn) -let super_report_unification_error ?print_extra_info ppf env ?(unif = true) tr - txt1 txt2 = +let super_report_unification_error ?print_extra_info ppf env tr txt1 txt2 = wrap_printing_env env (fun () -> - super_unification_error ?print_extra_info unif tr txt1 ppf txt2) + super_unification_error ?print_extra_info true tr txt1 ppf txt2) let trace fst keep_last txt ppf tr = trace_same_names tr; diff --git a/compiler/ml/printtyp.mli b/compiler/ml/printtyp.mli index 0fe84f38f1a..e217b95c8af 100644 --- a/compiler/ml/printtyp.mli +++ b/compiler/ml/printtyp.mli @@ -75,7 +75,6 @@ val trace : val report_unification_error : formatter -> Env.t -> - ?unif:bool -> (type_expr * type_expr) list -> (formatter -> unit) -> (formatter -> unit) -> @@ -85,7 +84,6 @@ val super_report_unification_error : ?print_extra_info:(formatter -> type_expr -> type_expr -> unit) -> formatter -> Env.t -> - ?unif:bool -> (type_expr * type_expr) list -> (formatter -> unit) -> (formatter -> unit) -> From 36e7b23251392c1f01408cb091fbe8b3a4302c6f Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 11:46:17 +0000 Subject: [PATCH 048/214] dce: remove free_variables env --- _dce/report.txt | 132 +++++++++++++++++++--------------------- compiler/ml/ctype.ml | 26 +++----- compiler/ml/ctype.mli | 3 +- compiler/ml/typedecl.ml | 2 +- 4 files changed, 72 insertions(+), 91 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index 854ce18584b..2030b04be7a 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -804,17 +804,9 @@ optional argument from_type of function +unbound_constructor_error is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.mli", line 322, characters 0-62 - optional argument env of function +free_variables is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 3563, characters 0-97 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 3553, characters 0-97 optional argument ctx of function +subtype_error is never used - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 475, characters 0-98 - optional argument env of function +free_variables is never used - Warning Unused Argument File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 116, characters 0-90 optional argument loc of function +lookup_modtype is never used @@ -14304,159 +14296,159 @@ | _ -> assert false [@@dead "+hide_private_methods"] Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 536, characters 2-54 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 526, characters 2-54 closed_class_failure.CC_Method is a variant case which is never constructed - <-- line 536 + <-- line 526 | CC_Method of type_expr * bool * string * type_expr [@dead "closed_class_failure.CC_Method"] Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 537, characters 2-53 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 527, characters 2-53 closed_class_failure.CC_Value is a variant case which is never constructed - <-- line 537 + <-- line 527 | CC_Value of type_expr * bool * string * type_expr [@dead "closed_class_failure.CC_Value"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 727, characters 0-64 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 717, characters 0-64 +generalize_global is never used - <-- line 727 + <-- line 717 let generalize_global ty = generalize_structure !global_level ty [@@dead "+generalize_global"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 734, characters 0-1352 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 724, characters 0-1352 +limited_generalize is never used - <-- line 734 + <-- line 724 graph [@@dead "+limited_generalize"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 997, characters 0-154 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 987, characters 0-154 +generic_instance is never used - <-- line 997 + <-- line 987 ty [@@dead "+generic_instance"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 1069, characters 0-219 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 1059, characters 0-219 +instance_parameterized_type_2 is never used - <-- line 1069 + <-- line 1059 (ty_args, ty_lst, ty) [@@dead "+instance_parameterized_type_2"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 2829, characters 0-84 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 2819, characters 0-84 +check_filter_method is never used - <-- line 2829 + <-- line 2819 ignore (filter_method env name priv ty) [@@dead "+check_filter_method"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 2832, characters 0-230 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 2822, characters 0-230 +filter_self_method is never used - <-- line 2832 + <-- line 2822 pair [@@dead "+filter_self_method"] Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 3303, characters 2-20 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 3293, characters 2-20 class_match_failure.CM_Virtual_class is a variant case which is never constructed - <-- line 3303 + <-- line 3293 | CM_Virtual_class [@dead "class_match_failure.CM_Virtual_class"] Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 3304, characters 2-44 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 3294, characters 2-44 class_match_failure.CM_Parameter_arity_mismatch is a variant case which is never constructed - <-- line 3304 + <-- line 3294 | CM_Parameter_arity_mismatch of int * int [@dead "class_match_failure.CM_Parameter_arity_mismatch"] Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 3305, characters 2-70 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 3295, characters 2-70 class_match_failure.CM_Type_parameter_mismatch is a variant case which is never constructed - <-- line 3305 + <-- line 3295 | CM_Type_parameter_mismatch of Env.t * (type_expr * type_expr) list [@dead "class_match_failure.CM_Type_parameter_mismatch"] Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 3306, characters 2-65 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 3296, characters 2-65 class_match_failure.CM_Parameter_mismatch is a variant case which is never constructed - <-- line 3306 + <-- line 3296 | CM_Parameter_mismatch of Env.t * (type_expr * type_expr) list [@dead "class_match_failure.CM_Parameter_mismatch"] Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 3307, characters 2-73 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 3297, characters 2-73 class_match_failure.CM_Val_type_mismatch is a variant case which is never constructed - <-- line 3307 + <-- line 3297 | CM_Val_type_mismatch of string * Env.t * (type_expr * type_expr) list [@dead "class_match_failure.CM_Val_type_mismatch"] Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 3308, characters 2-74 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 3298, characters 2-74 class_match_failure.CM_Meth_type_mismatch is a variant case which is never constructed - <-- line 3308 + <-- line 3298 | CM_Meth_type_mismatch of string * Env.t * (type_expr * type_expr) list [@dead "class_match_failure.CM_Meth_type_mismatch"] Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 3309, characters 2-34 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 3299, characters 2-34 class_match_failure.CM_Non_mutable_value is a variant case which is never constructed - <-- line 3309 + <-- line 3299 | CM_Non_mutable_value of string [@dead "class_match_failure.CM_Non_mutable_value"] Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 3310, characters 2-35 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 3300, characters 2-35 class_match_failure.CM_Non_concrete_value is a variant case which is never constructed - <-- line 3310 + <-- line 3300 | CM_Non_concrete_value of string [@dead "class_match_failure.CM_Non_concrete_value"] Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 3311, characters 2-30 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 3301, characters 2-30 class_match_failure.CM_Missing_value is a variant case which is never constructed - <-- line 3311 + <-- line 3301 | CM_Missing_value of string [@dead "class_match_failure.CM_Missing_value"] Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 3312, characters 2-31 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 3302, characters 2-31 class_match_failure.CM_Missing_method is a variant case which is never constructed - <-- line 3312 + <-- line 3302 | CM_Missing_method of string [@dead "class_match_failure.CM_Missing_method"] Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 3313, characters 2-28 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 3303, characters 2-28 class_match_failure.CM_Hide_public is a variant case which is never constructed - <-- line 3313 + <-- line 3303 | CM_Hide_public of string [@dead "class_match_failure.CM_Hide_public"] Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 3314, characters 2-38 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 3304, characters 2-38 class_match_failure.CM_Hide_virtual is a variant case which is never constructed - <-- line 3314 + <-- line 3304 | CM_Hide_virtual of string * string [@dead "class_match_failure.CM_Hide_virtual"] Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 3315, characters 2-30 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 3305, characters 2-30 class_match_failure.CM_Public_method is a variant case which is never constructed - <-- line 3315 + <-- line 3305 | CM_Public_method of string [@dead "class_match_failure.CM_Public_method"] Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 3316, characters 2-31 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 3306, characters 2-31 class_match_failure.CM_Private_method is a variant case which is never constructed - <-- line 3316 + <-- line 3306 | CM_Private_method of string [@dead "class_match_failure.CM_Private_method"] Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 3317, characters 2-31 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 3307, characters 2-31 class_match_failure.CM_Virtual_method is a variant case which is never constructed - <-- line 3317 + <-- line 3307 | CM_Virtual_method of string [@dead "class_match_failure.CM_Virtual_method"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 4063, characters 0-100 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 4053, characters 0-100 +arity is never used - <-- line 4063 + <-- line 4053 | _ -> 0 [@@dead "+arity"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 4376, characters 0-599 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 4366, characters 0-599 +collapse_conj is never used - <-- line 4376 + <-- line 4366 | _ -> iter_type_expr (collapse_conj env visited) ty [@@dead "+collapse_conj"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 4395, characters 0-77 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 4385, characters 0-77 +collapse_conj_params is never used - <-- line 4395 + <-- line 4385 let collapse_conj_params env params = List.iter (collapse_conj env []) params [@@dead "+collapse_conj_params"] Warning Dead Value @@ -14670,27 +14662,27 @@ val is_contractive : Env.t -> Path.t -> bool [@@dead "+is_contractive"] Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.mli", line 328, characters 2-54 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.mli", line 327, characters 2-54 closed_class_failure.CC_Method is a variant case which is never constructed - <-- line 328 + <-- line 327 | CC_Method of type_expr * bool * string * type_expr [@dead "closed_class_failure.CC_Method"] Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.mli", line 329, characters 2-53 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.mli", line 328, characters 2-53 closed_class_failure.CC_Value is a variant case which is never constructed - <-- line 329 + <-- line 328 | CC_Value of type_expr * bool * string * type_expr [@dead "closed_class_failure.CC_Value"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.mli", line 332, characters 0-28 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.mli", line 331, characters 0-28 +arity is never used - <-- line 332 + <-- line 331 val arity : type_expr -> int [@@dead "+arity"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.mli", line 335, characters 0-58 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.mli", line 334, characters 0-58 +collapse_conj_params is never used - <-- line 335 + <-- line 334 val collapse_conj_params : Env.t -> type_expr list -> unit [@@dead "+collapse_conj_params"] Warning Dead Value @@ -16669,4 +16661,4 @@ <-- line 4 OUnit.assert_equal ~cmp:(Vec_int.equal (fun (x : int) y -> x = y)) x y [@@dead "+=~"] - Analysis reported 2920 issues (Warning Dead Module:145, Warning Dead Type:368, Warning Dead Value:2127, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:201, Warning Unused Argument:42) + Analysis reported 2918 issues (Warning Dead Module:145, Warning Dead Type:368, Warning Dead Value:2127, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:201, Warning Unused Argument:40) diff --git a/compiler/ml/ctype.ml b/compiler/ml/ctype.ml index 32deb499be0..53a61bd3f2f 100644 --- a/compiler/ml/ctype.ml +++ b/compiler/ml/ctype.ml @@ -434,46 +434,36 @@ let rec filter_row_fields erase = function exception Non_closed of type_expr * bool let free_variables = ref [] -let really_closed = ref None let rec free_vars_rec real ty = let ty = repr ty in if ty.level >= lowest_level then ( ty.level <- pivot_level - ty.level; - match (ty.desc, !really_closed) with - | Tvar _, _ -> free_variables := (ty, real) :: !free_variables - | Tconstr (path, tl, _), Some env -> - (try - let _, body, _ = Env.find_type_expansion path env in - if (repr body).level <> generic_level then - free_variables := (ty, real) :: !free_variables - with Not_found -> ()); - List.iter (free_vars_rec true) tl + match ty.desc with + | Tvar _ -> free_variables := (ty, real) :: !free_variables (* Do not count "virtual" free variables | Tobject(ty, {contents = Some (_, p)}) -> free_vars_rec false ty; List.iter (free_vars_rec true) p *) - | Tobject (ty, _), _ -> free_vars_rec false ty - | Tfield (_, _, ty1, ty2), _ -> + | Tobject (ty, _) -> free_vars_rec false ty + | Tfield (_, _, ty1, ty2) -> free_vars_rec true ty1; free_vars_rec false ty2 - | Tvariant row, _ -> + | Tvariant row -> let row = row_repr row in iter_row (free_vars_rec true) row; if not (static_row row) then free_vars_rec false row.row_more | _ -> iter_type_expr (free_vars_rec true) ty) -let free_vars ?env ty = +let free_vars ty = free_variables := []; - really_closed := env; free_vars_rec true ty; let res = !free_variables in free_variables := []; - really_closed := None; res -let free_variables ?env ty = - let tl = List.map fst (free_vars ?env ty) in +let free_variables ty = + let tl = List.map fst (free_vars ty) in unmark_type ty; tl diff --git a/compiler/ml/ctype.mli b/compiler/ml/ctype.mli index 1e359ecc204..53d0a624f9e 100644 --- a/compiler/ml/ctype.mli +++ b/compiler/ml/ctype.mli @@ -319,8 +319,7 @@ val closed_schema : Env.t -> type_expr -> bool (* Check whether the given type scheme contains no non-generic type variables *) -val free_variables : ?env:Env.t -> type_expr -> type_expr list -(* If env present, then check for incomplete definitions too *) +val free_variables : type_expr -> type_expr list val closed_type_decl : type_declaration -> type_expr option val closed_extension_constructor : extension_constructor -> type_expr option diff --git a/compiler/ml/typedecl.ml b/compiler/ml/typedecl.ml index 128b98b360a..94328b70160 100644 --- a/compiler/ml/typedecl.ml +++ b/compiler/ml/typedecl.ml @@ -1257,7 +1257,7 @@ let compute_variance_gadt env check ((required, loc) as rloc) decl | {desc = Tconstr (_, tyl, _)} -> (* let tyl = List.map (Ctype.expand_head env) tyl in *) let tyl = List.map Ctype.repr tyl in - let fvl = List.map (Ctype.free_variables ?env:None) tyl in + let fvl = List.map Ctype.free_variables tyl in let _ = List.fold_left2 (fun (fv1, fv2) ty (c, n, _) -> From 8b2eb65dfda0a44175a1605bc8c64efd0ed1eb9e Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 11:47:14 +0000 Subject: [PATCH 049/214] dce: remove subtype ctx --- _dce/report.txt | 6 +----- compiler/ml/ctype.ml | 4 ++-- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index 2030b04be7a..211712bf30d 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -803,10 +803,6 @@ File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typetexp.ml", line 168, characters 0-160 optional argument from_type of function +unbound_constructor_error is never used - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 3553, characters 0-97 - optional argument ctx of function +subtype_error is never used - Warning Unused Argument File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 116, characters 0-90 optional argument loc of function +lookup_modtype is never used @@ -16661,4 +16657,4 @@ <-- line 4 OUnit.assert_equal ~cmp:(Vec_int.equal (fun (x : int) y -> x = y)) x y [@@dead "+=~"] - Analysis reported 2918 issues (Warning Dead Module:145, Warning Dead Type:368, Warning Dead Value:2127, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:201, Warning Unused Argument:40) + Analysis reported 2917 issues (Warning Dead Module:145, Warning Dead Type:368, Warning Dead Value:2127, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:201, Warning Unused Argument:39) diff --git a/compiler/ml/ctype.ml b/compiler/ml/ctype.ml index 53a61bd3f2f..57969b3def6 100644 --- a/compiler/ml/ctype.ml +++ b/compiler/ml/ctype.ml @@ -3550,8 +3550,8 @@ let enlarge_type env ty = let subtypes = Type_pairs.create 17 -let subtype_error ?ctx env trace = - raise (Subtype (expand_trace env (List.rev trace), [], ctx)) +let subtype_error env trace = + raise (Subtype (expand_trace env (List.rev trace), [], None)) let extract_concrete_typedecl_opt env t = match extract_concrete_typedecl env t with From bad5555dd146622dfdf6e409a8e338b0e5c3747b Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 11:48:38 +0000 Subject: [PATCH 050/214] dce: note live env lookup loc --- scripts/dce/live-findings.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/scripts/dce/live-findings.md b/scripts/dce/live-findings.md index 592a1e1e9b0..eac21b3d9ee 100644 --- a/scripts/dce/live-findings.md +++ b/scripts/dce/live-findings.md @@ -76,3 +76,19 @@ live after manual validation. - Context: constructors share the `Name_choice` functor interface but currently ignore `from_type`. Splitting that interface for DCE would risk the shared lookup/error plumbing for little practical cleanup. + +### `Env.lookup_* ?loc` + +- Report: `Warning Unused Argument`, `compiler/ml/env.ml` and + `compiler/ml/env.mli`, optional argument `loc` on the generic lookup helpers + and value/type/constructor/label/modtype wrappers. +- Verdict: live; false positive. +- Validation: `compiler/ml/typetexp.ml` passes `~loc` through `find_component` + into `Env.lookup_type`, `Env.lookup_constructor`, + `Env.lookup_all_constructors`, `Env.lookup_all_labels`, `Env.lookup_value`, + `Env.lookup_module`, and `Env.lookup_modtype`. For dotted paths, the generic + Env lookup helpers forward `?loc` into `lookup_module_descr`, which uses it + for deprecated-module warnings. +- Context: `compiler/ml/env.mli` documents that `?loc` reports deprecated-module + warnings. Removing the labels from the wrappers would drop source locations for + those diagnostics even though reanalyze does not see the cross-module flow. From a433ac5bb03ff0c32d23fa836662a32c7c3e3d7e Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 11:49:29 +0000 Subject: [PATCH 051/214] dce: require async promise loc --- _dce/report.txt | 6 +----- compiler/ml/ast_async.ml | 3 +-- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index 211712bf30d..b06245a8e5c 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -859,10 +859,6 @@ File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 1092, characters 0-391 optional argument loc of function +lookup is never used - Warning Redundant Optional Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_async.ml", line 7, characters 0-320 - optional argument loc of function +add_promise_type is always supplied (1 calls) - Warning Unused Argument File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/btype.mli", line 37, characters 0-49 optional argument name of function +newgenvar is never used @@ -16657,4 +16653,4 @@ <-- line 4 OUnit.assert_equal ~cmp:(Vec_int.equal (fun (x : int) y -> x = y)) x y [@@dead "+=~"] - Analysis reported 2917 issues (Warning Dead Module:145, Warning Dead Type:368, Warning Dead Value:2127, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:201, Warning Unused Argument:39) + Analysis reported 2916 issues (Warning Dead Module:145, Warning Dead Type:368, Warning Dead Value:2127, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:200, Warning Unused Argument:39) diff --git a/compiler/ml/ast_async.ml b/compiler/ml/ast_async.ml index d5494ebfba0..21535a3d4b4 100644 --- a/compiler/ml/ast_async.ml +++ b/compiler/ml/ast_async.ml @@ -4,8 +4,7 @@ let rec dig_async_payload_from_function (expr : Parsetree.expression) = | Pexp_newtype (_, body) -> dig_async_payload_from_function body | _ -> false -let add_promise_type ?(loc = Location.none) ~async - (result : Parsetree.expression) = +let add_promise_type ~loc ~async (result : Parsetree.expression) = if async then let unsafe_async = Ast_helper.Exp.ident ~loc From 3bf943cae0c5ea8023ed939825f17950fd8c87e7 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 11:50:28 +0000 Subject: [PATCH 052/214] dce: remove newgenvar name --- _dce/report.txt | 10 +--------- compiler/ml/btype.ml | 2 +- compiler/ml/btype.mli | 2 +- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index b06245a8e5c..8df42aacc96 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -859,14 +859,6 @@ File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 1092, characters 0-391 optional argument loc of function +lookup is never used - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/btype.mli", line 37, characters 0-49 - optional argument name of function +newgenvar is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/btype.ml", line 50, characters 0-45 - optional argument name of function +newgenvar is never used - Warning Redundant Optional Argument File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper.mli", line 72, characters 2-75 optional argument loc of function Typ.+poly is always supplied (6 calls) @@ -16653,4 +16645,4 @@ <-- line 4 OUnit.assert_equal ~cmp:(Vec_int.equal (fun (x : int) y -> x = y)) x y [@@dead "+=~"] - Analysis reported 2916 issues (Warning Dead Module:145, Warning Dead Type:368, Warning Dead Value:2127, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:200, Warning Unused Argument:39) + Analysis reported 2914 issues (Warning Dead Module:145, Warning Dead Type:368, Warning Dead Value:2127, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:200, Warning Unused Argument:37) diff --git a/compiler/ml/btype.ml b/compiler/ml/btype.ml index dc72b0578f4..6419cc3daa5 100644 --- a/compiler/ml/btype.ml +++ b/compiler/ml/btype.ml @@ -47,7 +47,7 @@ let newty2 level desc = incr new_id; {desc; level; id = !new_id} let newgenty desc = newty2 generic_level desc -let newgenvar ?name () = newgenty (Tvar name) +let newgenvar () = newgenty (Tvar None) (* let newmarkedvar level = incr new_id; { desc = Tvar; level = pivot_level - level; id = !new_id } diff --git a/compiler/ml/btype.mli b/compiler/ml/btype.mli index 02a04a7e062..117f23f7a75 100644 --- a/compiler/ml/btype.mli +++ b/compiler/ml/btype.mli @@ -34,7 +34,7 @@ val newty2 : int -> type_desc -> type_expr val newgenty : type_desc -> type_expr (* Create a generic type *) -val newgenvar : ?name:string -> unit -> type_expr +val newgenvar : unit -> type_expr (* Return a fresh generic variable *) (* Use Tsubst instead From f8a780230eb8a5111084ce5020b9ae35f0b1b280 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 11:53:15 +0000 Subject: [PATCH 053/214] dce: exclude unit tests --- _dce/report.txt | 1008 +++++++++++++++++--- scripts/dce/README.md | 5 + scripts/dce/run-dce.sh | 13 +- tests/ounit_tests/ounit_array_tests.ml | 4 +- tests/ounit_tests/ounit_hash_stubs_test.ml | 2 +- tests/ounit_tests/ounit_hashtbl_tests.ml | 2 +- tests/ounit_tests/ounit_jsx_loc_tests.ml | 3 +- tests/ounit_tests/ounit_list_test.ml | 9 +- tests/ounit_tests/ounit_map_tests.ml | 2 +- tests/ounit_tests/ounit_string_tests.ml | 20 +- tests/ounit_tests/ounit_tests_util.ml | 12 +- tests/ounit_tests/ounit_utf8_test.ml | 2 +- tests/ounit_tests/ounit_util_tests.ml | 2 +- 13 files changed, 927 insertions(+), 157 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index 8df42aacc96..4856436f8d8 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -2273,6 +2273,42 @@ <-- line 81 Set_ident.diff init.used_idents init.defined_idents [@@dead "+free_variables_of_expression"] + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_analyzer.ml", line 86, characters 0-1631 + +no_side_effect_expression_desc is never used + <-- line 86 + | Spread _ -> false [@@dead "+no_side_effect_expression_desc"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_analyzer.ml", line 122, characters 0-90 + +no_side_effect is never used + <-- line 122 + no_side_effect_expression_desc x.expression_desc [@@dead "+no_side_effect"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_analyzer.ml", line 125, characters 0-67 + +no_side_effect_expression is never used + <-- line 125 + let no_side_effect_expression (x : J.expression) = no_side_effect x [@@dead "+no_side_effect_expression"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_analyzer.ml", line 127, characters 0-32 + +super is never used + <-- line 127 + let super = Js_record_iter.super [@@dead "+super"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_analyzer.ml", line 129, characters 0-581 + +no_side_effect_obj is never used + <-- line 129 + } [@@dead "+no_side_effect_obj"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_analyzer.ml", line 147, characters 0-122 + +no_side_effect_statement is never used + <-- line 147 + with _ -> false [@@dead "+no_side_effect_statement"] + Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_analyzer.ml", line 164, characters 0-2369 +eq_expression is never used @@ -2315,6 +2351,10 @@ <-- line 304 | _ -> false [@@dead "+is_okay_to_duplicate"] + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_analyzer.mli", line 1, characters 0-0 + js_analyzer is a dead module as all its items are dead. + Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_analyzer.mli", line 30, characters 0-60 +free_variables_of_statement is never used @@ -2333,6 +2373,12 @@ <-- line 37 val no_side_effect_expression : J.expression -> bool [@@dead "+no_side_effect_expression"] + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_analyzer.mli", line 47, characters 0-50 + +no_side_effect_statement is never used + <-- line 47 + val no_side_effect_statement : J.statement -> bool [@@dead "+no_side_effect_statement"] + Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_analyzer.mli", line 56, characters 0-56 +eq_expression is never used @@ -9629,6 +9675,12 @@ <-- line 38 let reverse_in_place a = reverse_range a 0 (Array.length a) [@@dead "+reverse_in_place"] + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.ml", line 40, characters 0-217 + +reverse is never used + <-- line 40 + b [@@dead "+reverse"] + Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.ml", line 63, characters 0-241 +filter is never used @@ -9659,24 +9711,72 @@ <-- line 101 else Array.mapi (fun i a -> f i a (Array.unsafe_get b i)) a [@@dead "+map2i"] + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.ml", line 114, characters 0-159 + +tolist_aux is never used + <-- line 114 + | None -> res) [@@dead "+tolist_aux"] + Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.ml", line 122, characters 0-60 +to_list_map is never used <-- line 122 let to_list_map a f = tolist_aux a f (Array.length a - 1) [] [@@dead "+to_list_map"] + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.ml", line 124, characters 0-69 + +to_list_map_acc is never used + <-- line 124 + let to_list_map_acc a acc f = tolist_aux a f (Array.length a - 1) acc [@@dead "+to_list_map_acc"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.ml", line 126, characters 0-1053 + +of_list_map is never used + <-- line 126 + fill 5 tl [@@dead "+of_list_map"] + Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.ml", line 186, characters 0-194 +rfind_with_index is never used <-- line 186 aux (len - 1) [@@dead "+rfind_with_index"] + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.ml", line 197, characters 0-201 + +find_with_index is never used + <-- line 197 + aux 0 len [@@dead "+find_with_index"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.ml", line 206, characters 0-191 + +find_and_split is never used + <-- line 206 + Split (Array.sub arr 0 i, Array.sub arr (i + 1) (Array.length arr - i - 1)) [@@dead "+find_and_split"] + Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.ml", line 223, characters 0-39 +is_empty is never used <-- line 223 let is_empty arr = Array.length arr = 0 [@@dead "+is_empty"] + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.ml", line 225, characters 0-180 + +unsafe_loop is never used + <-- line 225 + && unsafe_loop (succ index) len p xs ys [@@dead "+unsafe_loop"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.ml", line 240, characters 0-147 + +for_all2_no_exn is never used + <-- line 240 + len_xs = len_ys && unsafe_loop 0 len_xs p xs ys [@@dead "+for_all2_no_exn"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.ml", line 262, characters 0-135 + +fold_left is never used + <-- line 262 + !r [@@dead "+fold_left"] + Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.ml", line 270, characters 0-96 +get_or is never used @@ -9695,6 +9795,12 @@ <-- line 28 val reverse_in_place : 'a array -> unit [@@dead "+reverse_in_place"] + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.mli", line 30, characters 0-34 + +reverse is never used + <-- line 30 + val reverse : 'a array -> 'a array [@@dead "+reverse"] + Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.mli", line 34, characters 0-49 +filter is never used @@ -9731,24 +9837,60 @@ <-- line 46 val to_list_map : 'a array -> ('a -> 'b option) -> 'b list [@@dead "+to_list_map"] + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.mli", line 48, characters 0-73 + +to_list_map_acc is never used + <-- line 48 + val to_list_map_acc : 'a array -> 'b list -> ('a -> 'b option) -> 'b list [@@dead "+to_list_map_acc"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.mli", line 50, characters 0-51 + +of_list_map is never used + <-- line 50 + val of_list_map : 'a list -> ('a -> 'b) -> 'b array [@@dead "+of_list_map"] + Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.mli", line 52, characters 0-66 +rfind_with_index is never used <-- line 52 val rfind_with_index : 'a array -> ('a -> 'b -> bool) -> 'b -> int [@@dead "+rfind_with_index"] + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.mli", line 56, characters 0-69 + +find_and_split is never used + <-- line 56 + val find_and_split : 'a array -> ('a -> 'b -> bool) -> 'b -> 'a split [@@dead "+find_and_split"] + Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.mli", line 60, characters 0-31 +is_empty is never used <-- line 60 val is_empty : 'a array -> bool [@@dead "+is_empty"] + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.mli", line 62, characters 0-72 + +for_all2_no_exn is never used + <-- line 62 + val for_all2_no_exn : 'a array -> 'b array -> ('a -> 'b -> bool) -> bool [@@dead "+for_all2_no_exn"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.mli", line 70, characters 0-56 + +fold_left is never used + <-- line 70 + val fold_left : 'b array -> 'a -> ('a -> 'b -> 'a) -> 'a [@@dead "+fold_left"] + Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.mli", line 72, characters 0-50 +get_or is never used <-- line 72 val get_or : 'a array -> int -> (unit -> 'a) -> 'a [@@dead "+get_or"] + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_buffer.ml", line 42, characters 0-31 + +is_empty is never used + <-- line 42 + let is_empty b = b.position = 0 [@@dead "+is_empty"] + Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_buffer.ml", line 44, characters 0-29 +clear is never used @@ -9761,6 +9903,18 @@ <-- line 128 let digest b = unsafe_string b.buffer 0 b.position [@@dead "+digest"] + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_buffer.ml", line 130, characters 0-173 + +not_equal_aux is never used + <-- line 130 + || not_equal_aux b s (i + 1) len [@@dead "+not_equal_aux"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_buffer.ml", line 137, characters 0-150 + +not_equal is never used + <-- line 137 + b_len <> s_len || not_equal_aux b.buffer s 0 s_len [@@dead "+not_equal"] + Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_buffer.ml", line 146, characters 0-199 +add_int_1 is never used @@ -9785,6 +9939,12 @@ <-- line 175 b.position <- pos + 4 [@@dead "+add_int_4"] + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_buffer.mli", line 48, characters 0-24 + +is_empty is never used + <-- line 48 + val is_empty : t -> bool [@@dead "+is_empty"] + Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_buffer.mli", line 50, characters 0-21 +clear is never used @@ -9797,6 +9957,12 @@ <-- line 86 val digest : t -> Digest.t [@@dead "+digest"] + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_buffer.mli", line 88, characters 0-35 + +not_equal is never used + <-- line 88 + val not_equal : t -> string -> bool [@@dead "+not_equal"] + Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_buffer.mli", line 90, characters 0-32 +add_int_1 is never used @@ -9851,6 +10017,12 @@ <-- line 31 search_dot (String.length name - 1) [@@dead "+chop_extension_maybe"] + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_filename.ml", line 48, characters 0-363 + +chop_all_extensions_maybe is never used + <-- line 48 + search_dot (String.length name - 1) None [@@dead "+chop_all_extensions_maybe"] + Warning Dead Type File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_filename.ml", line 89, characters 20-40 module_info.module_name is a record label never used to read a value @@ -9863,12 +10035,36 @@ <-- line 89 type module_info = {module_name: string; [@dead "module_info.module_name"] case: bool [@dead "module_info.case"] } + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_filename.ml", line 91, characters 0-277 + +valid_module_name_aux is never used + <-- line 91 + | _ -> false [@@dead "+valid_module_name_aux"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_filename.ml", line 102, characters 0-338 + +valid_module_name is never used + <-- line 102 + | _ -> Invalid [@@dead "+valid_module_name"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_filename.ml", line 112, characters 0-796 + +as_module is never used + <-- line 112 + search_dot (name_len - 1) basename name_len [@@dead "+as_module"] + Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_filename.mli", line 36, characters 0-43 +chop_extension_maybe is never used <-- line 36 val chop_extension_maybe : string -> string [@@dead "+chop_extension_maybe"] + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_filename.mli", line 43, characters 0-48 + +chop_all_extensions_maybe is never used + <-- line 43 + val chop_all_extensions_maybe : string -> string [@@dead "+chop_all_extensions_maybe"] + Warning Dead Type File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_filename.mli", line 48, characters 20-40 module_info.module_name is a record label never used to read a value @@ -9881,6 +10077,12 @@ <-- line 48 type module_info = {module_name: string; [@dead "module_info.module_name"] case: bool [@dead "module_info.case"] } + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_filename.mli", line 50, characters 0-53 + +as_module is never used + <-- line 50 + val as_module : basename:string -> module_info option [@@dead "+as_module"] + Warning Dead Module File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_fmt.ml", line 1, characters 0-0 +ext_fmt is a dead module as all its items are dead. @@ -9955,6 +10157,12 @@ <-- line 178 if u = 0 then Ext_string.compare x.name y.name else u [@@dead "+compare"] + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_ident.ml", line 182, characters 0-116 + +equal is never used + <-- line 182 + if x.stamp <> 0 then x.stamp = y.stamp else y.stamp = 0 && x.name = y.name [@@dead "+equal"] + Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_ident.mli", line 29, characters 0-34 +is_js_object is never used @@ -10003,6 +10211,12 @@ <-- line 57 val compare : Ident.t -> Ident.t -> int [@@dead "+compare"] + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_ident.mli", line 58, characters 0-38 + +equal is never used + <-- line 58 + val equal : Ident.t -> Ident.t -> bool [@@dead "+equal"] + Warning Dead Module File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_int.ml", line 1, characters 0-0 +ext_int is a dead module as all its items are dead. @@ -10077,6 +10291,22 @@ <-- line 27 val rev_lines_of_file : string -> string list [@@dead "+rev_lines_of_file"] + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_js_file_kind.ml", line 1, characters 0-0 + +ext_js_file_kind is a dead module as all its items are dead. + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_js_file_kind.ml", line 24, characters 12-17 + case.Upper is a variant case which is never constructed + <-- line 24 + type case = Upper [@dead "case.Upper"] | Little + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_js_file_kind.ml", line 24, characters 18-26 + case.Little is a variant case which is never constructed + <-- line 24 + type case = Upper [@dead "case.Upper"] | Little [@dead "case.Little"] + Warning Dead Type File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_js_file_kind.ml", line 26, characters 10-21 t.case is a record label never used to read a value @@ -10143,6 +10373,42 @@ <-- line 357 | a :: l -> fold_left_with_offset l (f a accu i) (i + 1) f [@@dead "+fold_left_with_offset"] + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 370, characters 0-151 + +exclude is never used + <-- line 370 + | x :: xs -> if p x then exclude xs p else x :: exclude xs p [@@dead "+exclude"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 375, characters 0-370 + +exclude_with_val is never used + <-- line 375 + | Some rest -> Some (a0 :: a1 :: rest))) [@@dead "+exclude_with_val"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 435, characters 0-183 + +small_split_at is never used + <-- line 435 + | _ -> invalid_arg "Ext_list.split_at" [@@dead "+small_split_at"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 442, characters 0-40 + +split_at is never used + <-- line 442 + let split_at l n = small_split_at n [] l [@@dead "+split_at"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 444, characters 0-168 + +split_at_last_aux is never used + <-- line 444 + | y0 :: ys -> split_at_last_aux (y0 :: acc) ys [@@dead "+split_at_last_aux"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 450, characters 0-409 + +split_at_last is never used + <-- line 450 + (a0 :: a1 :: a2 :: a3 :: a4 :: rev, last) [@@dead "+split_at_last"] + Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 465, characters 0-204 +filter_mapi is never used @@ -10155,6 +10421,48 @@ <-- line 476 | _ -> invalid_arg "Ext_list.filter_map2" [@@dead "+filter_map2"] + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 509, characters 0-61 + +flat_map_append is never used + <-- line 509 + let flat_map_append lx append f = flat_map_aux f [] append lx [@@dead "+flat_map_append"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 511, characters 0-154 + +length_compare is never used + <-- line 511 + | [] -> if n = 0 then `Eq else `Lt [@@dead "+length_compare"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 518, characters 0-124 + +length_ge is never used + <-- line 518 + else true [@@dead "+length_ge"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 528, characters 0-171 + +length_larger_than_n is never used + <-- line 528 + | [], _ -> false [@@dead "+length_larger_than_n"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 534, characters 0-111 + +group is never used + <-- line 534 + | x :: xs -> aux eq x (group eq xs) [@@dead "+group"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 539, characters 0-228 + +aux is never used + <-- line 539 + | _ :: _ -> assert false [@@dead "+aux"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 547, characters 0-45 + +stable_group is never used + <-- line 547 + let stable_group lst eq = group eq lst |> rev [@@dead "+stable_group"] + Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 549, characters 0-182 +drop is never used @@ -10167,6 +10475,12 @@ <-- line 562 | a :: l -> if p a then find_first_not l p else Some a [@@dead "+find_first_not"] + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 620, characters 0-101 + +for_all_snd is never used + <-- line 620 + | (_, a) :: l -> p a && for_all_snd l p [@@dead "+for_all_snd"] + Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 647, characters 0-776 +split_map is never used @@ -10185,6 +10499,12 @@ <-- line 687 | (k1, v1) :: rest -> if k1 = k then v1 else assoc_by_string rest k def [@@dead "+assoc_by_string"] + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 695, characters 0-205 + +assoc_by_int is never used + <-- line 695 + | (k1, v1) :: rest -> if k1 = k then v1 else assoc_by_int rest k def [@@dead "+assoc_by_int"] + Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 703, characters 0-109 +nth_aux is never used @@ -10299,6 +10619,24 @@ <-- line 81 val exclude : 'a list -> ('a -> bool) -> 'a list [@@dead "+exclude"] + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 84, characters 0-64 + +exclude_with_val is never used + <-- line 84 + val exclude_with_val : 'a list -> ('a -> bool) -> 'a list option [@@dead "+exclude_with_val"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 96, characters 0-50 + +split_at is never used + <-- line 96 + val split_at : 'a list -> int -> 'a list * 'a list [@@dead "+split_at"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 102, characters 0-43 + +split_at_last is never used + <-- line 102 + val split_at_last : 'a list -> 'a list * 'a [@@dead "+split_at_last"] + Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 107, characters 0-64 +filter_mapi is never used @@ -10311,6 +10649,36 @@ <-- line 109 val filter_map2 : 'a list -> 'b list -> ('a -> 'b -> 'c option) -> 'c list [@@dead "+filter_map2"] + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 111, characters 0-56 + +length_compare is never used + <-- line 111 + val length_compare : 'a list -> int -> [`Gt | `Eq | `Lt] [@@dead "+length_compare"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 113, characters 0-38 + +length_ge is never used + <-- line 113 + val length_ge : 'a list -> int -> bool [@@dead "+length_ge"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 122, characters 0-60 + +length_larger_than_n is never used + <-- line 122 + val length_larger_than_n : 'a list -> 'a list -> int -> bool [@@dead "+length_larger_than_n"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 134, characters 0-70 + +flat_map_append is never used + <-- line 134 + val flat_map_append : 'a list -> 'b list -> ('a -> 'b list) -> 'b list [@@dead "+flat_map_append"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 136, characters 0-64 + +stable_group is never used + <-- line 136 + val stable_group : 'a list -> ('a -> 'a -> bool) -> 'a list list [@@dead "+stable_group"] + Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 152, characters 0-36 +drop is never used @@ -10323,6 +10691,12 @@ <-- line 160 val find_first_not : 'a list -> ('a -> bool) -> 'a option [@@dead "+find_first_not"] + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 181, characters 0-56 + +for_all_snd is never used + <-- line 181 + val for_all_snd : ('a * 'b) list -> ('b -> bool) -> bool [@@dead "+for_all_snd"] + Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 189, characters 0-63 +split_map is never used @@ -10347,6 +10721,12 @@ <-- line 199 val assoc_by_string : (string * 'a) list -> string -> 'a option -> 'a [@@dead "+assoc_by_string"] + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 206, characters 0-60 + +assoc_by_int is never used + <-- line 206 + val assoc_by_int : (int * 'a) list -> int -> 'a option -> 'a [@@dead "+assoc_by_int"] + Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 208, characters 0-41 +nth_opt is never used @@ -10395,6 +10775,108 @@ <-- line 228 val mem_string : string list -> string -> bool [@@dead "+mem_string"] + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_modulename.ml", line 1, characters 0-0 + +ext_modulename is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_modulename.ml", line 25, characters 0-363 + +good_hint_name is never used + <-- line 25 + | _ -> false) [@@dead "+good_hint_name"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_modulename.ml", line 36, characters 0-381 + +collect_start is never used + <-- line 36 + | _ -> collect_start buf s next len [@@dead "+collect_start"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_modulename.ml", line 49, characters 0-341 + +collect_next is never used + <-- line 49 + | _ -> collect_next buf s next len [@@dead "+collect_next"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_modulename.ml", line 68, characters 0-836 + +js_id_name_of_hint_name is never used + <-- line 68 + if Ext_buffer.is_empty buf then module_name else Ext_buffer.contents buf [@@dead "+js_id_name_of_hint_name"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_modulename.mli", line 1, characters 0-0 + ext_modulename is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_modulename.mli", line 25, characters 0-46 + +js_id_name_of_hint_name is never used + <-- line 25 + val js_id_name_of_hint_name : string -> string [@@dead "+js_id_name_of_hint_name"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_namespace.ml", line 33, characters 0-147 + +change_ext_ns_suffix is never used + <-- line 33 + if i < 0 then name ^ ext else String.sub name 0 i ^ ext [@@dead "+change_ext_ns_suffix"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_namespace.ml", line 44, characters 0-208 + +js_name_of_modulename is never used + <-- line 44 + change_ext_ns_suffix s suffix [@@dead "+js_name_of_modulename"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_namespace.ml", line 59, characters 0-352 + +is_valid_npm_package_name is never used + <-- line 59 + | _ -> false [@@dead "+is_valid_npm_package_name"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_namespace.ml", line 72, characters 0-598 + +namespace_of_package_name is never used + <-- line 72 + Ext_buffer.contents buf [@@dead "+namespace_of_package_name"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_namespace.mli", line 34, characters 0-53 + +change_ext_ns_suffix is never used + <-- line 34 + val change_ext_ns_suffix : string -> string -> string [@@dead "+change_ext_ns_suffix"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_namespace.mli", line 36, characters 0-79 + +js_name_of_modulename is never used + <-- line 36 + val js_name_of_modulename : string -> Ext_js_file_kind.case -> string -> string [@@dead "+js_name_of_modulename"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_namespace.mli", line 48, characters 0-46 + +is_valid_npm_package_name is never used + <-- line 48 + val is_valid_npm_package_name : string -> bool [@@dead "+is_valid_npm_package_name"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_namespace.mli", line 50, characters 0-48 + +namespace_of_package_name is never used + <-- line 50 + val namespace_of_package_name : string -> string [@@dead "+namespace_of_package_name"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_obj.ml", line 1, characters 0-0 + +ext_obj is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_obj.ml", line 25, characters 0-2650 + +dump is never used + <-- line 25 + | _ -> opaque (Printf.sprintf "unknown: tag %d size %d" t s) [@@dead "+dump"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_obj.ml", line 101, characters 0-30 + +dump is never used + <-- line 101 + let dump v = dump (Obj.repr v) [@@dead "+dump"] + Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_obj.ml", line 103, characters 0-86 +dump_endline is never used @@ -10413,6 +10895,16 @@ <-- line 109 bt.line_number bt.start_char bt.end_char) [@@dead "+bt"] + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_obj.mli", line 1, characters 0-0 + ext_obj is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_obj.mli", line 24, characters 0-23 + +dump is never used + <-- line 24 + val dump : 'a -> string [@@dead "+dump"] + Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_obj.mli", line 26, characters 0-48 +dump_endline is never used @@ -10503,12 +10995,42 @@ <-- line 39 finally (open_out_bin filename) ~clean:close_out f [@@dead "+with_file_as_chan"] + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_pervasives.ml", line 69, characters 0-221 + +int_of_string_aux is never used + <-- line 69 + else -1 [@@dead "+int_of_string_aux"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_pervasives.ml", line 77, characters 0-134 + +nat_of_string_exn is never used + <-- line 77 + if acc < 0 then invalid_arg s else acc [@@dead "+nat_of_string_exn"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_pervasives.ml", line 82, characters 0-441 + +parse_nat_of_string is never used + <-- line 82 + !acc [@@dead "+parse_nat_of_string"] + Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_pervasives.mli", line 34, characters 0-59 +with_file_as_chan is never used <-- line 34 val with_file_as_chan : string -> (out_channel -> 'a) -> 'a [@@dead "+with_file_as_chan"] + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_pervasives.mli", line 51, characters 0-37 + +nat_of_string_exn is never used + <-- line 51 + val nat_of_string_exn : string -> int [@@dead "+nat_of_string_exn"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_pervasives.mli", line 53, characters 0-50 + +parse_nat_of_string is never used + <-- line 53 + val parse_nat_of_string : string -> int ref -> int [@@dead "+parse_nat_of_string"] + Warning Dead Value With Side Effects File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_pp.ml", line 31, characters 0-46 +indent_length is never used and could have side effects @@ -10621,6 +11143,44 @@ <-- line 40 val protect_list : ('a ref * 'a) list -> (unit -> 'b) -> 'b [@@dead "+protect_list"] + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_scc.ml", line 1, characters 0-0 + +ext_scc is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_scc.ml", line 37, characters 0-48 + +min_int is never used + <-- line 37 + let min_int (x : int) y = if x < y then x else y [@@dead "+min_int"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_scc.ml", line 39, characters 0-1928 + +graph is never used + <-- line 39 + output [@@dead "+graph"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_scc.ml", line 98, characters 0-138 + +graph_check is never used + <-- line 98 + Int_vec_vec.fold_left (fun acc x -> Vec_int.length x :: acc) [] v ) [@@dead "+graph_check"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_scc.mli", line 1, characters 0-0 + ext_scc is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_scc.mli", line 27, characters 0-44 + +graph is never used + <-- line 27 + val graph : Vec_int.t array -> Int_vec_vec.t [@@dead "+graph"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_scc.mli", line 41, characters 0-46 + +graph_check is never used + <-- line 41 + val graph_check : node array -> int * int list [@@dead "+graph_check"] + Warning Dead Module File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_sys.mli", line 1, characters 0-0 ext_sys is a dead module as all its items are dead. @@ -10637,18 +11197,48 @@ <-- line 27 val is_windows_or_cygwin : bool [@@dead "+is_windows_or_cygwin"] + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_utf8.ml", line 64, characters 0-250 + +follow is never used + <-- line 64 + | _ -> raise (Invalid_utf8 "Continuation byte expected") [@@dead "+follow"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_utf8.ml", line 80, characters 0-580 + +decode_utf8_string is never used + <-- line 80 + List.rev !lst [@@dead "+decode_utf8_string"] + Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_utf8.mli", line 29, characters 0-53 +follow is never used <-- line 29 val follow : string -> int -> int -> int -> int * int [@@dead "+follow"] + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_utf8.mli", line 38, characters 0-43 + +decode_utf8_string is never used + <-- line 38 + val decode_utf8_string : string -> int list [@@dead "+decode_utf8_string"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_util.ml", line 31, characters 0-123 + +power_2_above is never used + <-- line 31 + else power_2_above (x * 2) n [@@dead "+power_2_above"] + Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_util.ml", line 36, characters 0-324 +stats_to_string is never used <-- line 36 (Array.to_list (Array.map string_of_int bucket_histogram))) [@@dead "+stats_to_string"] + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_util.mli", line 25, characters 0-37 + +power_2_above is never used + <-- line 25 + val power_2_above : int -> int -> int [@@dead "+power_2_above"] + Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_util.mli", line 27, characters 0-50 +stats_to_string is never used @@ -10811,6 +11401,82 @@ <-- line 125 else remove_bucket h i key ~prec:buck next eq_key [@@dead "+remove_bucket"] + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_set_ident_mask.ml", line 37, characters 0-130 + +key_index_by_ident is never used + <-- line 37 + Bs_hash_stubs.hash_string_int key.name key.stamp land (Array.length h.data - 1) [@@dead "+key_index_by_ident"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_set_ident_mask.ml", line 40, characters 0-131 + +create is never used + <-- line 40 + {size = 0; data = Array.make s Empty; mask_size = 0} [@@dead "+create"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_set_ident_mask.ml", line 44, characters 0-526 + +iter_and_unmask is never used + <-- line 44 + done [@@dead "+iter_and_unmask"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_set_ident_mask.ml", line 65, characters 0-381 + +small_bucket_mem is never used + <-- line 65 + Ext_ident.equal key rst.ident || small_bucket_mem key rst.rest)) [@@dead "+small_bucket_mem"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_set_ident_mask.ml", line 81, characters 0-634 + +resize is never used + <-- line 81 + done) [@@dead "+resize"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_set_ident_mask.ml", line 101, characters 0-394 + +add_unmask is never used + <-- line 101 + if h.size > Array.length h_data lsl 1 then resize key_index_by_ident h) [@@dead "+add_unmask"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_set_ident_mask.ml", line 111, characters 0-745 + +small_bucket_mask is never used + <-- line 111 + else small_bucket_mask key rst.rest)) [@@dead "+small_bucket_mask"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_set_ident_mask.ml", line 140, characters 0-194 + +mask_and_check_all_hit is never used + <-- line 140 + h.size = h.mask_size [@@dead "+mask_and_check_all_hit"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_set_ident_mask.mli", line 1, characters 0-0 + hash_set_ident_mask is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_set_ident_mask.mli", line 6, characters 0-21 + +create is never used + <-- line 6 + val create : int -> t [@@dead "+create"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_set_ident_mask.mli", line 11, characters 0-35 + +add_unmask is never used + <-- line 11 + val add_unmask : t -> ident -> unit [@@dead "+add_unmask"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_set_ident_mask.mli", line 13, characters 0-47 + +mask_and_check_all_hit is never used + <-- line 13 + val mask_and_check_all_hit : t -> ident -> bool [@@dead "+mask_and_check_all_hit"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_set_ident_mask.mli", line 18, characters 0-58 + +iter_and_unmask is never used + <-- line 18 + val iter_and_unmask : t -> (ident -> bool -> unit) -> unit [@@dead "+iter_and_unmask"] + Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_set_poly.mli", line 29, characters 0-24 +clear is never used @@ -10823,6 +11489,12 @@ <-- line 31 val reset : 'a t -> unit [@@dead "+reset"] + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_set_poly.mli", line 37, characters 0-31 + +remove is never used + <-- line 37 + val remove : 'a t -> 'a -> unit [@@dead "+remove"] + Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_set_poly.mli", line 41, characters 0-39 +iter is never used @@ -10835,6 +11507,12 @@ <-- line 43 val to_list : 'a t -> 'a list [@@dead "+to_list"] + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_set_poly.mli", line 45, characters 0-24 + +length is never used + <-- line 45 + val length : 'a t -> int [@@dead "+length"] + Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ident.ml", line 44, characters 0-56 +unique_name is never used @@ -11005,6 +11683,32 @@ <-- line 100 module Make (T : Thing) : S with type t := T.t [@@dead "Make.Tbl.+map"] + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/int_vec_util.ml", line 1, characters 0-0 + +int_vec_util is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/int_vec_util.ml", line 25, characters 0-182 + +unsafe_mem_aux is never used + <-- line 25 + else false [@@dead "+unsafe_mem_aux"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/int_vec_util.ml", line 31, characters 0-167 + +mem is never used + <-- line 31 + unsafe_mem_aux internal_array 0 key (len - 1) [@@dead "+mem"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/int_vec_util.mli", line 1, characters 0-0 + int_vec_util is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/int_vec_util.mli", line 25, characters 0-34 + +mem is never used + <-- line 25 + val mem : int -> Vec_int.t -> bool [@@dead "+mem"] + Warning Dead Module File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/int_vec_vec.ml", line 1, characters 0-0 +int_vec_vec is a dead module as all its items are dead. @@ -13093,6 +13797,12 @@ <-- line 40 val dummy_item : Location.t -> item [@@dead "+dummy_item"] + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_utf8_string.ml", line 184, characters 0-157 + +transform_test is never used + <-- line 184 + Buffer.contents buf [@@dead "+transform_test"] + Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_utf8_string.ml", line 199, characters 0-370 +check_no_escapes_or_unicode is never used @@ -13111,18 +13821,144 @@ <-- line 29 val pp_error : Format.formatter -> error -> unit [@@dead "+pp_error"] + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_utf8_string.mli", line 35, characters 0-37 + +transform_test is never used + <-- line 35 + val transform_test : string -> string [@@dead "+transform_test"] + Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_utf8_string.mli", line 40, characters 0-38 +simple_comparison is never used <-- line 40 val simple_comparison : string -> bool [@@dead "+simple_comparison"] + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_utf8_string_interp.ml", line 42, characters 2-12 + pos.lnum is a record label never used to read a value + <-- line 42 + lnum: int; [@dead "pos.lnum"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_utf8_string_interp.ml", line 43, characters 2-14 + pos.offset is a record label never used to read a value + <-- line 43 + offset: int; [@dead "pos.offset"] + Warning Dead Type File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_utf8_string_interp.ml", line 44, characters 2-16 pos.byte_bol is a record label never used to read a value <-- line 44 byte_bol: int; [@dead "pos.byte_bol"] + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_utf8_string_interp.ml", line 49, characters 16-27 + segment.start is a record label never used to read a value + <-- line 49 + type segment = {start: pos; [@dead "segment.start"] finish: pos; kind: kind; content: string} + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_utf8_string_interp.ml", line 49, characters 28-40 + segment.finish is a record label never used to read a value + <-- line 49 + type segment = {start: pos; [@dead "segment.start"] finish: pos; [@dead "segment.finish"] kind: kind; content: string} + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_utf8_string_interp.ml", line 49, characters 41-52 + segment.kind is a record label never used to read a value + <-- line 49 + type segment = {start: pos; [@dead "segment.start"] finish: pos; [@dead "segment.finish"] kind: kind; [@dead "segment.kind"] content: string} + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_utf8_string_interp.ml", line 65, characters 0-93 + +valid_lead_identifier_char is never used + <-- line 65 + | _ -> false [@@dead "+valid_lead_identifier_char"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_utf8_string_interp.ml", line 71, characters 0-121 + +valid_identifier_char is never used + <-- line 71 + | _ -> false [@@dead "+valid_identifier_char"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_utf8_string_interp.ml", line 76, characters 0-184 + +valid_identifier is never used + <-- line 76 + && Ext_string.for_all_from s 1 valid_identifier_char [@@dead "+valid_identifier"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_utf8_string_interp.ml", line 89, characters 0-57 + +empty_segment is never used + <-- line 89 + let empty_segment {content} = Ext_string.is_empty content [@@dead "+empty_segment"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_utf8_string_interp.ml", line 91, characters 0-123 + +update_newline is never used + <-- line 91 + cxt.byte_bol <- byte_bol [@@dead "+update_newline"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_utf8_string_interp.ml", line 96, characters 0-225 + +pos_error is never used + <-- line 96 + error )) [@@dead "+pos_error"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_utf8_string_interp.ml", line 107, characters 0-520 + +add_var_segment is never used + <-- line 107 + else pos_error cxt ~loc (Invalid_syntax_of_var content) [@@dead "+add_var_segment"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_utf8_string_interp.ml", line 125, characters 0-343 + +add_str_segment is never used + <-- line 125 + cxt.segment_start <- next_loc [@@dead "+add_str_segment"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_utf8_string_interp.ml", line 136, characters 0-1645 + +check_and_transform is never used + <-- line 136 + check_and_transform (loc + 1) s (i' + 1) cxt) [@@dead "+check_and_transform"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_utf8_string_interp.ml", line 182, characters 0-639 + +expect_simple_var is never used + <-- line 182 + check_and_transform loc s (added_length + offset) cxt) [@@dead "+expect_simple_var"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_utf8_string_interp.ml", line 199, characters 0-540 + +expect_var_paren is never used + <-- line 199 + else pos_error cxt ~loc Unmatched_paren [@@dead "+expect_var_paren"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_utf8_string_interp.ml", line 215, characters 0-584 + +escape_code is never used + <-- line 215 + | _ -> pos_error cxt ~loc (Invalid_escape_code cur_char) [@@dead "+escape_code"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_utf8_string_interp.ml", line 231, characters 0-372 + +two_hex is never used + <-- line 231 + else pos_error cxt ~loc Invalid_hex_escape [@@dead "+two_hex"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_utf8_string_interp.ml", line 240, characters 0-548 + +unicode is never used + <-- line 240 + else pos_error cxt ~loc Invalid_unicode_escape [@@dead "+unicode"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_utf8_string_interp.ml", line 256, characters 0-346 + +transform_test is never used + <-- line 256 + List.rev cxt.segments [@@dead "+transform_test"] + Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_utf8_string_interp.ml", line 290, characters 2-41 Delim.+escaped_back_quote_delimiter is never used @@ -13135,11 +13971,53 @@ <-- line 337 || Ext_string.equal opt Delim.escaped_back_quote_delimiter [@@dead "+is_unicode_string"] + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_utf8_string_interp.mli", line 37, characters 12-22 + pos.lnum is a record label never used to read a value + <-- line 37 + type pos = {lnum: int; [@dead "pos.lnum"] offset: int; byte_bol: int} + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_utf8_string_interp.mli", line 37, characters 23-35 + pos.offset is a record label never used to read a value + <-- line 37 + type pos = {lnum: int; [@dead "pos.lnum"] offset: int; [@dead "pos.offset"] byte_bol: int} + Warning Dead Type File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_utf8_string_interp.mli", line 37, characters 36-49 pos.byte_bol is a record label never used to read a value <-- line 37 - type pos = {lnum: int; offset: int; byte_bol: int [@dead "pos.byte_bol"] } + type pos = {lnum: int; [@dead "pos.lnum"] offset: int; [@dead "pos.offset"] byte_bol: int [@dead "pos.byte_bol"] } + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_utf8_string_interp.mli", line 40, characters 16-27 + segment.start is a record label never used to read a value + <-- line 40 + type segment = {start: pos; [@dead "segment.start"] finish: pos; kind: kind; content: string} + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_utf8_string_interp.mli", line 40, characters 28-40 + segment.finish is a record label never used to read a value + <-- line 40 + type segment = {start: pos; [@dead "segment.start"] finish: pos; [@dead "segment.finish"] kind: kind; content: string} + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_utf8_string_interp.mli", line 40, characters 41-52 + segment.kind is a record label never used to read a value + <-- line 40 + type segment = {start: pos; [@dead "segment.start"] finish: pos; [@dead "segment.finish"] kind: kind; [@dead "segment.kind"] content: string} + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_utf8_string_interp.mli", line 56, characters 0-35 + +empty_segment is never used + <-- line 56 + val empty_segment : segment -> bool [@@dead "+empty_segment"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_utf8_string_interp.mli", line 57, characters 0-43 + +transform_test is never used + <-- line 57 + val transform_test : string -> segment list [@@dead "+transform_test"] Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_utf8_string_interp.mli", line 61, characters 0-38 @@ -16518,131 +17396,5 @@ +peek_minus is never used <-- line 38 val peek_minus : t -> bool [@@dead "+peek_minus"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_bal_tree_tests.ml", line 3, characters 0-31 - +=~ is never used - <-- line 3 - let ( =~ ) = OUnit.assert_equal [@@dead "+=~"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_bal_tree_tests.ml", line 65, characters 0-88 - +ounit_bal_tree_tests.Set_ident is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_bal_tree_tests.ml", line 67, characters 2-30 - Set_ident.+compare is never used - <-- line 67 - let compare = Stdlib.compare [@@dead "Set_ident.+compare"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_bal_tree_tests.ml", line 70, characters 0-200 - +compare_ident is never used - <-- line 70 - if b <> 0 then b else compare (x.flags : int) y.flags [@@dead "+compare_ident"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_bal_tree_tests.ml", line 77, characters 0-417 - +add is never used - <-- line 77 - else Set_gen.bal l v (add r x) [@@dead "+add"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_bal_tree_tests.ml", line 91, characters 0-208 - +mem is never used - <-- line 91 - c = 0 || mem (if c < 0 then l else r) x [@@dead "+mem"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_bal_tree_tests.ml", line 99, characters 0-88 - +ounit_bal_tree_tests.Ident_set2 is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_bal_tree_tests.ml", line 101, characters 2-29 - Ident_set2.+compare is never used - <-- line 101 - let compare = compare_ident [@@dead "Ident_set2.+compare"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_bal_tree_tests.ml", line 104, characters 0-1318 - +bench is never used - <-- line 104 - done) [@@dead "+bench"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_hash_set_tests.ml", line 3, characters 0-31 - +=~ is never used - <-- line 3 - let ( =~ ) = OUnit.assert_equal [@@dead "+=~"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_hash_set_tests.ml", line 7, characters 0-152 - +ounit_hash_set_tests.Id_hash_set is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_hash_set_tests.ml", line 9, characters 2-54 - Id_hash_set.+equal is never used - <-- line 9 - let equal x y = x.stamp = y.stamp && x.name = y.name [@@dead "Id_hash_set.+equal"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_hash_set_tests.ml", line 10, characters 2-35 - Id_hash_set.+hash is never used - <-- line 10 - let hash x = Hashtbl.hash x.stamp [@@dead "Id_hash_set.+hash"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_hash_stubs_test.ml", line 5, characters 0-21 - +count is never used - <-- line 5 - let count = 2_000_000 [@@dead "+count"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_hash_stubs_test.ml", line 7, characters 0-586 - +bench is never used - <-- line 7 - done) [@@dead "+bench"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_hash_stubs_test.ml", line 29, characters 37-55 - id.flags is a record label never used to read a value - <-- line 29 - type id = {stamp: int; name: string; mutable flags: int [@dead "id.flags"] } (* = Ident.t *) - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_ident_mask_tests.ml", line 3, characters 0-31 - +=~ is never used - <-- line 3 - let ( =~ ) = OUnit.assert_equal [@@dead "+=~"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_int_vec_tests.ml", line 3, characters 0-31 - +=~ is never used - <-- line 3 - let ( =~ ) = OUnit.assert_equal [@@dead "+=~"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_scc_tests.ml", line 3, characters 0-31 - +=~ is never used - <-- line 3 - let ( =~ ) = OUnit.assert_equal [@@dead "+=~"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_scc_tests.ml", line 204, characters 0-581 - +read_file is never used - <-- line 204 - fst (Ext_scc.graph_check node_array) [@@dead "+read_file"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_tests_util.ml", line 12, characters 0-492 - +time is never used - <-- line 12 - flush stdout [@@dead "+time"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/tests/ounit_tests/ounit_vec_test.ml", line 4, characters 0-89 - +=~ is never used - <-- line 4 - OUnit.assert_equal ~cmp:(Vec_int.equal (fun (x : int) y -> x = y)) x y [@@dead "+=~"] - Analysis reported 2914 issues (Warning Dead Module:145, Warning Dead Type:368, Warning Dead Value:2127, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:200, Warning Unused Argument:37) + Analysis reported 3042 issues (Warning Dead Module:153, Warning Dead Type:379, Warning Dead Value:2236, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:200, Warning Unused Argument:37) diff --git a/scripts/dce/README.md b/scripts/dce/README.md index 68dcb4b43ba..f6563a373c4 100644 --- a/scripts/dce/README.md +++ b/scripts/dce/README.md @@ -14,6 +14,11 @@ Requires the host OCaml switch (5.3) with `dune` available (`eval $(opam env)`). The script fetches + builds a pinned standalone reanalyze on first run (cached in `~/.cache/rescript-dce`). +The runner excludes `tests/ounit_tests` from DCE by default. Unit tests should not +keep compiler implementation details live, and test-only helpers are intentionally +out of scope for the dead-code removal pass. Override `DCE_EXCLUDE_PATHS` only when +you explicitly want to experiment with a different exclusion set. + ## Why the vendored `rescript-tools reanalyze` does NOT work here The compiler's OCaml is compiled by the **host OCaml (5.3)** via dune, producing diff --git a/scripts/dce/run-dce.sh b/scripts/dce/run-dce.sh index 93800e52f6a..cc0bc98d511 100755 --- a/scripts/dce/run-dce.sh +++ b/scripts/dce/run-dce.sh @@ -25,6 +25,10 @@ REANALYZE_SRC="${REANALYZE_SRC:-$HOME/.cache/rescript-dce/reanalyze}" OUT="${1:-_dce/report.txt}" mkdir -p "$(dirname "$OUT")" +# Unit tests are intentionally excluded from DCE. They should not keep compiler +# implementation details live, and test-only helpers are noisy DCE targets. +EXCLUDE_PATHS="${DCE_EXCLUDE_PATHS:-$REPO_ROOT/tests/ounit_tests,tests/ounit_tests,./tests/ounit_tests,$REPO_ROOT/_build/default/tests/ounit_tests,_build/default/tests/ounit_tests}" + # 1. Fetch + build the standalone reanalyze (cached). if [ ! -x "$REANALYZE_SRC/_build/default/src/Reanalyze.exe" ]; then echo "==> Fetching standalone reanalyze ($REANALYZE_REF)" @@ -44,11 +48,12 @@ BIN="$REANALYZE_SRC/_build/default/src/Reanalyze.exe" echo "==> dune build @check (producing .cmt files incl. entry points)" dune build @check -# 3. Run DCE over the whole dune build tree (compiler + tools + analysis + -# executables). All are host-OCaml 5.3 cmts; the ReScript runtime (4.06 cmts) -# lives outside _build/default so it is not picked up. +# 3. Run DCE over the dune build tree (compiler + tools + analysis + +# executables), excluding unit tests. All are host-OCaml 5.3 cmts; the +# ReScript runtime (4.06 cmts) lives outside _build/default so it is not +# picked up. echo "==> Running DCE -> $OUT" -"$BIN" -dce-cmt _build/default > "$OUT" 2>&1 || true +"$BIN" -exclude-paths "$EXCLUDE_PATHS" -dce-cmt _build/default > "$OUT" 2>&1 || true echo "==> Done. Summary:" grep -oE "Warning [A-Za-z ]+" "$OUT" | sort | uniq -c | sort -rn || true diff --git a/tests/ounit_tests/ounit_array_tests.ml b/tests/ounit_tests/ounit_array_tests.ml index 1eb8ebf17a2..74274cd4f5b 100644 --- a/tests/ounit_tests/ounit_array_tests.ml +++ b/tests/ounit_tests/ounit_array_tests.ml @@ -1,6 +1,6 @@ let ( >:: ), ( >::: ) = OUnit.(( >:: ), ( >::: )) -let ( =~ ) x y = OUnit.assert_equal x y +let ( =~ ) = OUnit.assert_equal let printer_int_array xs = String.concat "," (List.map string_of_int @@ Array.to_list xs) @@ -29,7 +29,7 @@ let suites = Ext_array.reverse [|1; 2|] =~ [|2; 1|]; Ext_array.reverse [||] =~ [||] ); ( __LOC__ >:: fun _ -> - let ( =~ ) x y = OUnit.assert_equal ~printer:printer_int_array x y in + let ( =~ ) = OUnit.assert_equal ~printer:printer_int_array in let k x y = Ext_array.of_list_map y x in k succ [] =~ [||]; k succ [1] =~ [|2|]; diff --git a/tests/ounit_tests/ounit_hash_stubs_test.ml b/tests/ounit_tests/ounit_hash_stubs_test.ml index 3cac247e610..6f686653c3e 100644 --- a/tests/ounit_tests/ounit_hash_stubs_test.ml +++ b/tests/ounit_tests/ounit_hash_stubs_test.ml @@ -1,6 +1,6 @@ let ( >:: ), ( >::: ) = OUnit.(( >:: ), ( >::: )) -let ( =~ ) x y = OUnit.assert_equal x y +let ( =~ ) = OUnit.assert_equal let count = 2_000_000 diff --git a/tests/ounit_tests/ounit_hashtbl_tests.ml b/tests/ounit_tests/ounit_hashtbl_tests.ml index 30233c5d948..fde7bb0aaed 100644 --- a/tests/ounit_tests/ounit_hashtbl_tests.ml +++ b/tests/ounit_tests/ounit_hashtbl_tests.ml @@ -1,6 +1,6 @@ let ( >:: ), ( >::: ) = OUnit.(( >:: ), ( >::: )) -let ( =~ ) x y = OUnit.assert_equal ~printer:Ext_obj.dump x y +let ( =~ ) = OUnit.assert_equal ~printer:Ext_obj.dump let suites = __FILE__ diff --git a/tests/ounit_tests/ounit_jsx_loc_tests.ml b/tests/ounit_tests/ounit_jsx_loc_tests.ml index e9b3845bb89..09f667f1626 100644 --- a/tests/ounit_tests/ounit_jsx_loc_tests.ml +++ b/tests/ounit_tests/ounit_jsx_loc_tests.ml @@ -1,4 +1,5 @@ let ( >:: ), ( >::: ) = OUnit.(( >:: ), ( >::: )) +let assert_equal = OUnit.assert_equal let assert_failure = OUnit.assert_failure let parse_structure source = @@ -56,7 +57,7 @@ let assert_same_loc expected actual = loc.loc_end.pos_bol, loc.loc_end.pos_cnum ) in - OUnit.assert_equal + assert_equal ~printer:(fun loc -> let sl, sb, sc, el, eb, ec = to_tuple loc in Printf.sprintf "(%d,%d,%d)-(%d,%d,%d)" sl sb sc el eb ec) diff --git a/tests/ounit_tests/ounit_list_test.ml b/tests/ounit_tests/ounit_list_test.ml index 1cb3a38f9b5..c08725ddab8 100644 --- a/tests/ounit_tests/ounit_list_test.ml +++ b/tests/ounit_tests/ounit_list_test.ml @@ -1,5 +1,6 @@ let ( >:: ), ( >::: ) = OUnit.(( >:: ), ( >::: )) +let ( =~ ) = OUnit.assert_equal let printer_int_list xs = Format.asprintf "%a" (Format.pp_print_list Format.pp_print_int ~pp_sep:Format.pp_print_space) @@ -16,7 +17,7 @@ let suites = (Ext_list.flat_map_append [1; 2] [3; 4] (fun x -> [x; x])) [1; 1; 2; 2; 3; 4] ); ( __LOC__ >:: fun _ -> - let ( =~ ) x y = OUnit.assert_equal ~printer:printer_int_list x y in + let ( =~ ) = OUnit.assert_equal ~printer:printer_int_list in Ext_list.flat_map [] (fun x -> [succ x]) =~ []; Ext_list.flat_map [1] (fun x -> [x; succ x]) =~ [1; 2]; Ext_list.flat_map [1; 2] (fun x -> [x; succ x]) =~ [1; 2; 2; 3]; @@ -27,7 +28,7 @@ let suites = (Ext_list.stable_group [1; 2; 3; 4; 3] ( = )) [[1]; [2]; [4]; [3; 3]] ); ( __LOC__ >:: fun _ -> - let ( =~ ) x y = OUnit.assert_equal ~printer:printer_int_list x y in + let ( =~ ) = OUnit.assert_equal ~printer:printer_int_list in let f b _v = if b then 1 else 0 in Ext_list.map_last [] f =~ []; Ext_list.map_last [0] f =~ [1]; @@ -58,7 +59,7 @@ let suites = (Format.pp_print_list Format.pp_print_int) a b in - let ( =~ ) x y = OUnit.assert_equal ~printer x y in + let ( =~ ) = OUnit.assert_equal ~printer in Ext_list.split_at_last [1; 2; 3] =~ ([1; 2], 3); Ext_list.split_at_last [1; 2; 3; 4; 5; 6; 7; 8] =~ ([1; 2; 3; 4; 5; 6; 7], 8); @@ -89,7 +90,7 @@ let suites = OUnit.assert_bool __LOC__ (Ext_list.length_ge [] 0); OUnit.assert_bool __LOC__ (not (Ext_list.length_ge [] 1)) ); ( __LOC__ >:: fun _ -> - let ( =~ ) x y = OUnit.assert_equal x y in + let ( =~ ) = OUnit.assert_equal in let f p x = Ext_list.exclude_with_val x p in f (fun x -> x = 1) [1; 2; 3] =~ Some [2; 3]; diff --git a/tests/ounit_tests/ounit_map_tests.ml b/tests/ounit_tests/ounit_map_tests.ml index 4ecb1cc6524..b488f8eb428 100644 --- a/tests/ounit_tests/ounit_map_tests.ml +++ b/tests/ounit_tests/ounit_map_tests.ml @@ -1,6 +1,6 @@ let ( >:: ), ( >::: ) = OUnit.(( >:: ), ( >::: )) -let ( =~ ) x y = OUnit.assert_equal x y +let ( =~ ) = OUnit.assert_equal let test_sorted_strict arr = let v = Map_int.of_array arr |> Map_int.to_sorted_array in diff --git a/tests/ounit_tests/ounit_string_tests.ml b/tests/ounit_tests/ounit_string_tests.ml index d03023e8d77..aba2e4114c4 100644 --- a/tests/ounit_tests/ounit_string_tests.ml +++ b/tests/ounit_tests/ounit_string_tests.ml @@ -1,10 +1,10 @@ let ( >:: ), ( >::: ) = OUnit.(( >:: ), ( >::: )) -let ( =~ ) x y = OUnit.assert_equal ~printer:Ext_obj.dump x y +let ( =~ ) = OUnit.assert_equal ~printer:Ext_obj.dump let printer_string x = x -let string_eq x y = OUnit.assert_equal ~printer:(fun id -> id) x y +let string_eq = OUnit.assert_equal ~printer:(fun id -> id) let suites = __FILE__ @@ -128,8 +128,8 @@ let suites = Ext_string.starts_with "abb" "abb" =~ true; Ext_string.starts_with "abb" "abbc" =~ false ); ( __LOC__ >:: fun _ -> - let ( =~ ) x y = - OUnit.assert_equal ~printer:(fun x -> string_of_bool x) x y + let ( =~ ) = + OUnit.assert_equal ~printer:(fun x -> string_of_bool x) in let k = Ext_string.ends_with in k "xx.ml" ".ml" =~ true; @@ -305,7 +305,7 @@ let suites = ( __LOC__ >:: fun _ -> Ext_namespace.namespace_of_package_name "xx" =~ "Xx" ); ( __LOC__ >:: fun _ -> - let ( =~ ) x y = OUnit.assert_equal ~printer:(fun x -> x) x y in + let ( =~ ) = OUnit.assert_equal ~printer:(fun x -> x) in Ext_namespace.namespace_of_package_name "reason-react" =~ "ReasonReact"; Ext_namespace.namespace_of_package_name "Foo_bar" =~ "Foo_bar"; @@ -326,18 +326,16 @@ let suites = Ext_namespace.js_name_of_modulename "AA-b" Upper ".bs.js" =~ "AA.bs.js" ); ( __LOC__ >:: fun _ -> - let ( =~ ) x y = - OUnit.assert_equal - ~printer:(fun x -> + let ( =~ ) = + OUnit.assert_equal ~printer:(fun x -> match x with | None -> "" | Some (a, b) -> a ^ "," ^ b) - x y in Ext_namespace.try_split_module_name "Js-X" =~ Some ("X", "Js"); Ext_namespace.try_split_module_name "Js_X" =~ None ); ( __LOC__ >:: fun _ -> - let ( =~ ) x y = OUnit.assert_equal ~printer:(fun x -> x) x y in + let ( =~ ) = OUnit.assert_equal ~printer:(fun x -> x) in let f = Ext_string.capitalize_ascii in f "x" =~ "X"; f "X" =~ "X"; @@ -348,7 +346,7 @@ let suites = f v =~ "Bc"; v =~ "bc" ); ( __LOC__ >:: fun _ -> - let ( =~ ) x y = OUnit.assert_equal ~printer:printer_string x y in + let ( =~ ) = OUnit.assert_equal ~printer:printer_string in Ext_filename.chop_all_extensions_maybe "a.bs.js" =~ "a"; Ext_filename.chop_all_extensions_maybe "a.js" =~ "a"; Ext_filename.chop_all_extensions_maybe "a" =~ "a"; diff --git a/tests/ounit_tests/ounit_tests_util.ml b/tests/ounit_tests/ounit_tests_util.ml index 86c945a3172..5115c346462 100644 --- a/tests/ounit_tests/ounit_tests_util.ml +++ b/tests/ounit_tests/ounit_tests_util.ml @@ -4,9 +4,17 @@ let raises f = None with e -> Some e -let assert_raise_any (f : unit -> 'a) = +let assert_raise_any ?msg (f : unit -> 'a) = + let get_error_string () = + let str = + Format.sprintf "expected exception, but no exception was raised." + in + match msg with + | None -> OUnit.assert_failure str + | Some s -> OUnit.assert_failure (s ^ "\n" ^ str) + in match raises f with - | None -> OUnit.assert_failure "expected exception, but no exception was raised." + | None -> OUnit.assert_failure (get_error_string ()) | Some exn -> OUnit.assert_bool (Printexc.to_string exn) true let time ?nums description f = diff --git a/tests/ounit_tests/ounit_utf8_test.ml b/tests/ounit_tests/ounit_utf8_test.ml index f241b68722b..42846b6d049 100644 --- a/tests/ounit_tests/ounit_utf8_test.ml +++ b/tests/ounit_tests/ounit_utf8_test.ml @@ -3,7 +3,7 @@ let ( >:: ), ( >::: ) = OUnit.(( >:: ), ( >::: )) -let ( =~ ) x y = OUnit.assert_equal x y +let ( =~ ) = OUnit.assert_equal let suites = __FILE__ >::: [ diff --git a/tests/ounit_tests/ounit_util_tests.ml b/tests/ounit_tests/ounit_util_tests.ml index 526fc09a7aa..3ecb59ec970 100644 --- a/tests/ounit_tests/ounit_util_tests.ml +++ b/tests/ounit_tests/ounit_util_tests.ml @@ -1,6 +1,6 @@ let ( >:: ), ( >::: ) = OUnit.(( >:: ), ( >::: )) -let ( =~ ) x y = OUnit.assert_equal ~printer:Ext_obj.dump x y +let ( =~ ) = OUnit.assert_equal ~printer:Ext_obj.dump let suites = __FILE__ >::: [ From 81a69c7a813b11578fc0a6d5652760f9d318dec8 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 11:55:34 +0000 Subject: [PATCH 054/214] dce: narrow ast helper labels --- _dce/report.txt | 34 +--------------------------------- compiler/ml/ast_helper.ml | 12 ++++++------ compiler/ml/ast_helper.mli | 8 ++++---- 3 files changed, 11 insertions(+), 43 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index 4856436f8d8..29063d85472 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -859,42 +859,10 @@ File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 1092, characters 0-391 optional argument loc of function +lookup is never used - Warning Redundant Optional Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper.mli", line 72, characters 2-75 - optional argument loc of function Typ.+poly is always supplied (6 calls) - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper.mli", line 59, characters 2-77 - optional argument attrs of function Typ.+arrows is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper.mli", line 41, characters 2-43 - optional argument suffix of function Const.+int is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper.mli", line 39, characters 2-64 - optional argument quotation_delimiter of function Const.+string is never used - Warning Unused Argument File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/asttypes.ml", line 62, characters 0-175 optional argument loc of function +to_arg_label is never used - Warning Redundant Optional Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper.ml", line 73, characters 2-62 - optional argument loc of function Typ.+poly is always supplied (1 calls) - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper.ml", line 59, characters 2-341 - optional argument attrs of function Typ.+arrows is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper.ml", line 47, characters 2-76 - optional argument quotation_delimiter of function Const.+string is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper.ml", line 41, characters 2-55 - optional argument suffix of function Const.+int is never used - Warning Redundant Optional Argument File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/location.mli", line 106, characters 0-108 optional argument custom_intro of function +report_error is always supplied (1 calls) @@ -17397,4 +17365,4 @@ <-- line 38 val peek_minus : t -> bool [@@dead "+peek_minus"] - Analysis reported 3042 issues (Warning Dead Module:153, Warning Dead Type:379, Warning Dead Value:2236, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:200, Warning Unused Argument:37) + Analysis reported 3034 issues (Warning Dead Module:153, Warning Dead Type:379, Warning Dead Value:2236, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:198, Warning Unused Argument:31) diff --git a/compiler/ml/ast_helper.ml b/compiler/ml/ast_helper.ml index d8d3b350cb4..2b6becf61c9 100644 --- a/compiler/ml/ast_helper.ml +++ b/compiler/ml/ast_helper.ml @@ -38,13 +38,13 @@ let with_default_loc l f = module Const = struct let integer ?suffix i = Pconst_integer (i, suffix) - let int ?suffix i = integer ?suffix (string_of_int i) + let int i = integer (string_of_int i) let int32 ?(suffix = 'l') i = integer ~suffix (Int32.to_string i) let int64 ?(suffix = 'L') i = integer ~suffix (Int64.to_string i) let nativeint ?(suffix = 'n') i = integer ~suffix (Nativeint.to_string i) let float ?suffix f = Pconst_float (f, suffix) let char c = Pconst_char (Char.code c) - let string ?quotation_delimiter s = Pconst_string (s, quotation_delimiter) + let string s = Pconst_string (s, None) end module Typ = struct @@ -56,13 +56,13 @@ module Typ = struct let var ?loc ?attrs a = mk ?loc ?attrs (Ptyp_var a) let arrow ?loc ?attrs ~arity arg ret = mk ?loc ?attrs (Ptyp_arrow {arg; ret; arity}) - let arrows ?loc ?attrs args ret = + let arrows ?loc args ret = let arity = Some (List.length args) in let rec build_arrows arity_to_use = function | [] -> ret - | [arg] -> arrow ?loc ?attrs ~arity:arity_to_use arg ret + | [arg] -> arrow ?loc ~arity:arity_to_use arg ret | arg :: rest -> - arrow ?loc ?attrs ~arity:arity_to_use arg (build_arrows None rest) + arrow ?loc ~arity:arity_to_use arg (build_arrows None rest) in build_arrows arity args let tuple ?loc ?attrs a = mk ?loc ?attrs (Ptyp_tuple a) @@ -70,7 +70,7 @@ module Typ = struct let object_ ?loc ?attrs a b = mk ?loc ?attrs (Ptyp_object (a, b)) let alias ?loc ?attrs a b = mk ?loc ?attrs (Ptyp_alias (a, b)) let variant ?loc ?attrs a b c = mk ?loc ?attrs (Ptyp_variant (a, b, c)) - let poly ?loc ?attrs a b = mk ?loc ?attrs (Ptyp_poly (a, b)) + let poly ~loc ?attrs a b = mk ~loc ?attrs (Ptyp_poly (a, b)) let package ?loc ?attrs a b = mk ?loc ?attrs (Ptyp_package (a, b)) let extension ?loc ?attrs a = mk ?loc ?attrs (Ptyp_extension a) diff --git a/compiler/ml/ast_helper.mli b/compiler/ml/ast_helper.mli index 6538c50419f..24a592173b7 100644 --- a/compiler/ml/ast_helper.mli +++ b/compiler/ml/ast_helper.mli @@ -36,9 +36,9 @@ val with_default_loc : loc -> (unit -> 'a) -> 'a module Const : sig val char : char -> constant - val string : ?quotation_delimiter:string -> string -> constant + val string : string -> constant val integer : ?suffix:char -> string -> constant - val int : ?suffix:char -> int -> constant + val int : int -> constant val int32 : ?suffix:char -> int32 -> constant val int64 : ?suffix:char -> int64 -> constant val nativeint : ?suffix:char -> nativeint -> constant @@ -56,7 +56,7 @@ module Typ : sig val var : ?loc:loc -> ?attrs:attrs -> string -> core_type val arrow : ?loc:loc -> ?attrs:attrs -> arity:arity -> arg -> core_type -> core_type - val arrows : ?loc:loc -> ?attrs:attrs -> arg list -> core_type -> core_type + val arrows : ?loc:loc -> arg list -> core_type -> core_type val tuple : ?loc:loc -> ?attrs:attrs -> core_type list -> core_type val constr : ?loc:loc -> ?attrs:attrs -> lid -> core_type list -> core_type val object_ : @@ -69,7 +69,7 @@ module Typ : sig closed_flag -> label list option -> core_type - val poly : ?loc:loc -> ?attrs:attrs -> str list -> core_type -> core_type + val poly : loc:loc -> ?attrs:attrs -> str list -> core_type -> core_type val package : ?loc:loc -> ?attrs:attrs -> lid -> (lid * core_type) list -> core_type val extension : ?loc:loc -> ?attrs:attrs -> extension -> core_type From 629f971a9c8acf1f8da0fbdb5716d902183a6290 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 11:56:38 +0000 Subject: [PATCH 055/214] dce: remove arg label loc --- _dce/report.txt | 6 +----- compiler/ml/asttypes.ml | 6 +++--- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index 29063d85472..b259d4c599b 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -859,10 +859,6 @@ File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 1092, characters 0-391 optional argument loc of function +lookup is never used - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/asttypes.ml", line 62, characters 0-175 - optional argument loc of function +to_arg_label is never used - Warning Redundant Optional Argument File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/location.mli", line 106, characters 0-108 optional argument custom_intro of function +report_error is always supplied (1 calls) @@ -17365,4 +17361,4 @@ <-- line 38 val peek_minus : t -> bool [@@dead "+peek_minus"] - Analysis reported 3034 issues (Warning Dead Module:153, Warning Dead Type:379, Warning Dead Value:2236, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:198, Warning Unused Argument:31) + Analysis reported 3033 issues (Warning Dead Module:153, Warning Dead Type:379, Warning Dead Value:2236, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:198, Warning Unused Argument:30) diff --git a/compiler/ml/asttypes.ml b/compiler/ml/asttypes.ml index e12960a0058..de7ae1d75eb 100644 --- a/compiler/ml/asttypes.ml +++ b/compiler/ml/asttypes.ml @@ -59,11 +59,11 @@ module Noloc = struct | Optional of string (* ~(label=e) => ... *) end -let to_arg_label ?(loc = Location.none) lbl = +let to_arg_label lbl = match lbl with | Noloc.Nolabel -> Nolabel - | Labelled s -> Labelled {loc; txt = s} - | Optional s -> Optional {loc; txt = s} + | Labelled s -> Labelled {loc = Location.none; txt = s} + | Optional s -> Optional {loc = Location.none; txt = s} let to_noloc = function | Nolabel -> Noloc.Nolabel From 1677ceddd19ff6619ad3397005452bfd8365d50d Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 11:58:19 +0000 Subject: [PATCH 056/214] dce: narrow location helpers --- _dce/report.txt | 54 +++++++--------------------------------- compiler/ml/location.ml | 14 +++++------ compiler/ml/location.mli | 5 +--- 3 files changed, 16 insertions(+), 57 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index b259d4c599b..aa76cd8bfca 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -860,57 +860,21 @@ optional argument loc of function +lookup is never used Warning Redundant Optional Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/location.mli", line 106, characters 0-108 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/location.mli", line 103, characters 0-108 optional argument custom_intro of function +report_error is always supplied (1 calls) Warning Redundant Optional Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/location.mli", line 106, characters 0-108 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/location.mli", line 103, characters 0-108 optional argument src of function +report_error is always supplied (1 calls) - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/location.mli", line 85, characters 0-128 - optional argument if_highlight of function +raise_errorf is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/location.mli", line 85, characters 0-128 - optional argument sub of function +raise_errorf is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/location.mli", line 78, characters 0-125 - optional argument if_highlight of function +errorf is never used - - Warning Redundant Optional Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/location.mli", line 78, characters 0-125 - optional argument loc of function +errorf is always supplied (3 calls) - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/location.ml", line 297, characters 0-177 - optional argument if_highlight of function +raise_errorf is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/location.ml", line 297, characters 0-177 - optional argument sub of function +raise_errorf is never used - Warning Redundant Optional Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/location.ml", line 255, characters 0-108 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/location.ml", line 253, characters 0-108 optional argument custom_intro of function +report_error is always supplied (1 calls) Warning Redundant Optional Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/location.ml", line 255, characters 0-108 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/location.ml", line 253, characters 0-108 optional argument src of function +report_error is always supplied (1 calls) - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/location.ml", line 205, characters 0-167 - optional argument if_highlight of function +errorf is never used - - Warning Redundant Optional Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/location.ml", line 205, characters 0-167 - optional argument loc of function +errorf is always supplied (3 calls) - - Warning Redundant Optional Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/location.ml", line 183, characters 0-326 - optional argument before of function +pp_ksprintf is always supplied (2 calls) - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 18, characters 0-24 +remove is never used @@ -15924,15 +15888,15 @@ val default_warning_printer : t -> formatter -> Warnings.t -> unit [@@dead "+default_warning_printer"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/location.mli", line 113, characters 0-118 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/location.mli", line 110, characters 0-118 +error_reporter is never used - <-- line 113 + <-- line 110 ref [@@dead "+error_reporter"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/location.mli", line 122, characters 0-118 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/location.mli", line 119, characters 0-118 +default_error_reporter is never used - <-- line 122 + <-- line 119 unit [@@dead "+default_error_reporter"] Warning Dead Value @@ -17361,4 +17325,4 @@ <-- line 38 val peek_minus : t -> bool [@@dead "+peek_minus"] - Analysis reported 3033 issues (Warning Dead Module:153, Warning Dead Type:379, Warning Dead Value:2236, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:198, Warning Unused Argument:30) + Analysis reported 3024 issues (Warning Dead Module:153, Warning Dead Type:379, Warning Dead Value:2236, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:195, Warning Unused Argument:24) diff --git a/compiler/ml/location.ml b/compiler/ml/location.ml index fa2e806db07..78c1fc69040 100644 --- a/compiler/ml/location.ml +++ b/compiler/ml/location.ml @@ -180,13 +180,11 @@ type error = { if_highlight: string; (* alternative message if locations are highlighted *) } -let pp_ksprintf ?before k fmt = +let pp_ksprintf ~before k fmt = let buf = Buffer.create 64 in let ppf = Format.formatter_of_buffer buf in Misc.Color.set_color_tag_handling ppf; - (match before with - | None -> () - | Some f -> f ppf); + before ppf; kfprintf (fun _ -> pp_print_flush ppf (); @@ -202,9 +200,9 @@ let print_phanton_error_prefix ppf = (see super_error_reporter above) *) Format.pp_print_as ppf 2 "" -let errorf ?(loc = none) ?(sub = []) ?(if_highlight = "") fmt = +let errorf ~loc ?(sub = []) fmt = pp_ksprintf ~before:print_phanton_error_prefix - (fun msg -> {loc; msg; sub; if_highlight}) + (fun msg -> {loc; msg; sub; if_highlight = ""}) fmt let error ?(loc = none) ?(sub = []) ?(if_highlight = "") msg = @@ -294,9 +292,9 @@ let () = | Error e -> Some e | _ -> None) -let raise_errorf ?(loc = none) ?(sub = []) ?(if_highlight = "") = +let raise_errorf ?(loc = none) = pp_ksprintf ~before:print_phanton_error_prefix (fun msg -> - raise (Error {loc; msg; sub; if_highlight})) + raise (Error {loc; msg; sub = []; if_highlight = ""})) let deprecated ?(can_be_automigrated = false) ?(def = none) ?(use = none) loc msg = diff --git a/compiler/ml/location.mli b/compiler/ml/location.mli index 76f4db2bd81..b1ae6178a55 100644 --- a/compiler/ml/location.mli +++ b/compiler/ml/location.mli @@ -76,16 +76,13 @@ exception Error of error val error : ?loc:t -> ?sub:error list -> ?if_highlight:string -> string -> error val errorf : - ?loc:t -> + loc:t -> ?sub:error list -> - ?if_highlight:string -> ('a, Format.formatter, unit, error) format4 -> 'a val raise_errorf : ?loc:t -> - ?sub:error list -> - ?if_highlight:string -> ('a, Format.formatter, unit, 'b) format4 -> 'a From f2afdbf13e2752f1ced0906cb720f226af51607f Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 11:58:41 +0000 Subject: [PATCH 057/214] dce: note live report error args --- scripts/dce/live-findings.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/scripts/dce/live-findings.md b/scripts/dce/live-findings.md index eac21b3d9ee..2d7341f3ced 100644 --- a/scripts/dce/live-findings.md +++ b/scripts/dce/live-findings.md @@ -92,3 +92,17 @@ live after manual validation. - Context: `compiler/ml/env.mli` documents that `?loc` reports deprecated-module warnings. Removing the labels from the wrappers would drop source locations for those diagnostics even though reanalyze does not see the cross-module flow. + +### `Location.report_error ?custom_intro ?src` + +- Report: `Warning Redundant Optional Argument`, `compiler/ml/location.ml` and + `compiler/ml/location.mli`, optional arguments `custom_intro` and `src` on + `report_error`. +- Verdict: live; false positive. +- Validation: `compiler/syntax/src/res_diagnostics.ml` calls + `Location.report_error ~custom_intro ~src:(Some src)` when rendering syntax + diagnostics, and `compiler/jsoo/jsoo_playground_main.ml` uses the default + wrapper form. The local exception reporter also passes explicit `None` values. +- Context: these labels select syntax-error intro text and source rendering for + diagnostics. Reanalyze only counts the local wrapper call, so it misses the + cross-module diagnostic call that supplies real values. From 764230d242e3af1c240faa9b75807b802cf2ef3b Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 12:00:22 +0000 Subject: [PATCH 058/214] dce: remove unused reactive exports --- _dce/report.txt | 178 +++++++++++------------------ analysis/reactive/src/reactive.ml | 4 - analysis/reactive/src/reactive.mli | 10 -- 3 files changed, 65 insertions(+), 127 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index aa76cd8bfca..9604b9bc8ee 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -876,245 +876,197 @@ optional argument src of function +report_error is always supplied (1 calls) Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 18, characters 0-24 - +remove is never used - <-- line 18 - let remove k = (k, None) [@@dead "+remove"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 25, characters 0-232 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 24, characters 0-232 +merge_entries is never used - <-- line 25 + <-- line 24 Hashtbl.fold (fun k v acc -> (k, v) :: acc) tbl [] [@@dead "+merge_entries"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 74, characters 0-223 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 73, characters 0-223 +count_changes is never used - <-- line 74 + <-- line 73 (!adds, !removes) [@@dead "+count_changes"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 111, characters 2-261 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 110, characters 2-261 Registry.+register is never used - <-- line 111 + <-- line 110 info [@@dead "Registry.+register"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 440, characters 2-35 - Scheduler.+wave_count is never used - <-- line 440 - let wave_count () = !wave_counter [@@dead "Scheduler.+wave_count"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 441, characters 2-45 - Scheduler.+reset_wave_count is never used - <-- line 441 - let reset_wave_count () = wave_counter := 0 [@@dead "Scheduler.+reset_wave_count"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 460, characters 0-21 - +level is never used - <-- line 460 - let level t = t.level [@@dead "+level"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 461, characters 0-19 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 457, characters 0-19 +name is never used - <-- line 461 + <-- line 457 let name t = t.name [@@dead "+name"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 473, characters 2-648 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 469, characters 2-648 +process is never used - <-- line 473 + <-- line 469 List.iter (fun h -> h delta) !subscribers)) [@@dead "+process"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 490, characters 2-71 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 486, characters 2-71 +_info is never used - <-- line 490 + <-- line 486 let _info = Registry.register ~name ~level:0 ~process ~stats:my_stats [@@dead "+_info"] in Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 537, characters 2-82 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 533, characters 2-82 +merge_fn is never used - <-- line 537 + <-- line 533 | None -> fun _ v -> v [@@dead "+merge_fn"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 555, characters 2-614 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 551, characters 2-614 +recompute_target is never used - <-- line 555 + <-- line 551 Some (k2, Some merged) [@@dead "+recompute_target"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 576, characters 2-358 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 572, characters 2-358 +remove_source is never used - <-- line 576 + <-- line 572 target_keys [@@dead "+remove_source"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 608, characters 2-550 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 604, characters 2-550 +process_entry is never used - <-- line 608 + <-- line 604 all_affected [@@dead "+process_entry"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 629, characters 2-1165 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 625, characters 2-1165 +process is never used - <-- line 629 + <-- line 625 List.iter (fun h -> h delta) !subscribers)) [@@dead "+process"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 656, characters 2-82 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 652, characters 2-82 +_info is never used - <-- line 656 + <-- line 652 Registry.register ~name ~level:my_level ~process ~stats:my_stats [@@dead "+_info"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 699, characters 2-82 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 695, characters 2-82 +merge_fn is never used - <-- line 699 + <-- line 695 | None -> fun _ v -> v [@@dead "+merge_fn"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 721, characters 2-614 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 717, characters 2-614 +recompute_target is never used - <-- line 721 + <-- line 717 Some (k3, Some merged) [@@dead "+recompute_target"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 801, characters 2-462 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 797, characters 2-462 +remove_left_entry is never used - <-- line 801 + <-- line 797 affected [@@dead "+remove_left_entry"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 816, characters 2-2770 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 812, characters 2-2770 +process is never used - <-- line 816 + <-- line 812 List.iter (fun h -> h delta) !subscribers) [@@dead "+process"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 895, characters 2-82 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 891, characters 2-82 +_info is never used - <-- line 895 + <-- line 891 Registry.register ~name ~level:my_level ~process ~stats:my_stats [@@dead "+_info"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 950, characters 2-403 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 946, characters 2-403 +recompute_target is never used - <-- line 950 + <-- line 946 Some (k, Some merged) [@@dead "+recompute_target"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 964, characters 2-2260 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 960, characters 2-2260 +process is never used - <-- line 964 + <-- line 960 List.iter (fun h -> h delta) !subscribers) [@@dead "+process"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 1030, characters 2-82 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 1026, characters 2-82 +_info is never used - <-- line 1030 + <-- line 1026 Registry.register ~name ~level:my_level ~process ~stats:my_stats [@@dead "+_info"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 1088, characters 2-524 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 1084, characters 2-524 +emit_output is never used - <-- line 1088 + <-- line 1084 List.iter (fun h -> h delta) !subscribers) [@@dead "+emit_output"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 1100, characters 2-1019 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 1096, characters 2-1019 +process is never used - <-- line 1100 + <-- line 1096 emit_output output_entries [@@dead "+process"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 1130, characters 2-82 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 1126, characters 2-82 +_info is never used - <-- line 1130 + <-- line 1126 Registry.register ~name ~level:my_level ~process ~stats:my_stats [@@dead "+_info"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.mli", line 21, characters 0-33 - +remove is never used - <-- line 21 - val remove : 'k -> 'k * 'v option [@@dead "+remove"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.mli", line 24, characters 0-62 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.mli", line 21, characters 0-62 +delta_to_entries is never used - <-- line 24 + <-- line 21 val delta_to_entries : ('k, 'v) delta -> ('k * 'v option) list [@@dead "+delta_to_entries"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.mli", line 48, characters 0-32 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.mli", line 45, characters 0-32 +create_stats is never used - <-- line 48 + <-- line 45 val create_stats : unit -> stats [@@dead "+create_stats"] Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.mli", line 52, characters 0-319 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.mli", line 49, characters 0-319 reactive.Registry is a dead module as all its items are dead. Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.mli", line 56, characters 2-26 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.mli", line 53, characters 2-26 Registry.+clear is never used - <-- line 56 + <-- line 53 val clear : unit -> unit [@@dead "Registry.+clear"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.mli", line 59, characters 2-33 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.mli", line 56, characters 2-33 Registry.+to_mermaid is never used - <-- line 59 + <-- line 56 val to_mermaid : unit -> string [@@dead "Registry.+to_mermaid"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.mli", line 62, characters 2-32 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.mli", line 59, characters 2-32 Registry.+print_stats is never used - <-- line 62 + <-- line 59 val print_stats : unit -> unit [@@dead "Registry.+print_stats"] Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.mli", line 68, characters 0-403 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.mli", line 65, characters 0-254 reactive.Scheduler is a dead module as all its items are dead. Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.mli", line 69, characters 2-30 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.mli", line 66, characters 2-30 Scheduler.+propagate is never used - <-- line 69 + <-- line 66 val propagate : unit -> unit [@@dead "Scheduler.+propagate"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.mli", line 73, characters 2-35 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.mli", line 70, characters 2-35 Scheduler.+is_propagating is never used - <-- line 73 + <-- line 70 val is_propagating : unit -> bool [@@dead "Scheduler.+is_propagating"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.mli", line 76, characters 2-30 - Scheduler.+wave_count is never used - <-- line 76 - val wave_count : unit -> int [@@dead "Scheduler.+wave_count"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.mli", line 79, characters 2-37 - Scheduler.+reset_wave_count is never used - <-- line 79 - val reset_wave_count : unit -> unit [@@dead "Scheduler.+reset_wave_count"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.mli", line 100, characters 0-29 - +level is never used - <-- line 100 - val level : ('k, 'v) t -> int [@@dead "+level"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.mli", line 101, characters 0-31 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.mli", line 91, characters 0-31 +name is never used - <-- line 101 + <-- line 91 val name : ('k, 'v) t -> string [@@dead "+name"] Warning Dead Value @@ -17325,4 +17277,4 @@ <-- line 38 val peek_minus : t -> bool [@@dead "+peek_minus"] - Analysis reported 3024 issues (Warning Dead Module:153, Warning Dead Type:379, Warning Dead Value:2236, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:195, Warning Unused Argument:24) + Analysis reported 3016 issues (Warning Dead Module:153, Warning Dead Type:379, Warning Dead Value:2228, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:195, Warning Unused Argument:24) diff --git a/analysis/reactive/src/reactive.ml b/analysis/reactive/src/reactive.ml index 9a12f90fd96..2698e220bc6 100644 --- a/analysis/reactive/src/reactive.ml +++ b/analysis/reactive/src/reactive.ml @@ -15,7 +15,6 @@ type ('k, 'v) delta = | Batch of ('k * 'v option) list let set k v = (k, Some v) -let remove k = (k, None) let delta_to_entries = function | Set (k, v) -> [(k, Some v)] @@ -437,8 +436,6 @@ module Scheduler = struct !processed_nodes wave_elapsed_ms); propagating := false) - let wave_count () = !wave_counter - let reset_wave_count () = wave_counter := 0 end (** {1 Collection Interface} *) @@ -457,7 +454,6 @@ let iter f t = t.iter f let get t k = t.get k let length t = t.length () let stats t = t.stats -let level t = t.level let name t = t.name (** {1 Source Collection} *) diff --git a/analysis/reactive/src/reactive.mli b/analysis/reactive/src/reactive.mli index b666907d5bc..a9dbf12a754 100644 --- a/analysis/reactive/src/reactive.mli +++ b/analysis/reactive/src/reactive.mli @@ -18,9 +18,6 @@ type ('k, 'v) delta = val set : 'k -> 'v -> 'k * 'v option (** Create a batch entry that sets a key *) -val remove : 'k -> 'k * 'v option -(** Create a batch entry that removes a key *) - val delta_to_entries : ('k, 'v) delta -> ('k * 'v option) list (** Convert delta to batch entries *) @@ -72,12 +69,6 @@ module Scheduler : sig val is_propagating : unit -> bool (** Returns true if currently in a propagation wave *) - - val wave_count : unit -> int - (** Number of propagation waves executed *) - - val reset_wave_count : unit -> unit - (** Reset the wave counter *) end (** {1 Collection Interface} *) @@ -97,7 +88,6 @@ val iter : ('k -> 'v -> unit) -> ('k, 'v) t -> unit val get : ('k, 'v) t -> 'k -> 'v option val length : ('k, 'v) t -> int val stats : ('k, 'v) t -> stats -val level : ('k, 'v) t -> int val name : ('k, 'v) t -> string (** {1 Source Collection} *) From 0f35d0070db3ceb050264321d7a105c21e06442d Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 12:00:40 +0000 Subject: [PATCH 059/214] dce: note live reactive internals --- scripts/dce/live-findings.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/scripts/dce/live-findings.md b/scripts/dce/live-findings.md index 2d7341f3ced..3c49900786f 100644 --- a/scripts/dce/live-findings.md +++ b/scripts/dce/live-findings.md @@ -106,3 +106,21 @@ live after manual validation. - Context: these labels select syntax-error intro text and source rendering for diagnostics. Reanalyze only counts the local wrapper call, so it misses the cross-module diagnostic call that supplies real values. + +### Reactive combinator internals + +- Report: many `Warning Dead Value` entries in + `analysis/reactive/src/reactive.ml`, including `merge_entries`, + `count_changes`, `Registry.register`, nested `process` functions, and + combinator-local helpers such as `recompute_target`. +- Verdict: live; false positive. +- Validation: `analysis/reanalyze/src/reactive_liveness.ml`, + `reactive_solver.ml`, `reactive_merge.ml`, `reactive_decl_refs.ml`, + `reactive_type_deps.ml`, and related modules build the DCE pipeline with + `Reactive.source`, `Reactive.flat_map`, `Reactive.join`, `Reactive.union`, and + `Reactive.fixpoint`. Those public combinators call these local helpers when + sources emit and the scheduler propagates updates. +- Context: these warnings are cascading from the known cross-module liveness + blind spot: reanalyze does not mark the exported combinators live from their + users, so the implementation below them looks dead even though it runs in the + analyzer's reactive mode. From 4411f5045d788aa6d6379a34c4a6fc7169086536 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 12:02:30 +0000 Subject: [PATCH 060/214] dce: trim reactive interfaces --- _dce/report.txt | 208 ++++-------------- analysis/reactive/src/reactive.ml | 1 - analysis/reactive/src/reactive.mli | 28 --- .../reactive/src/reactive_file_collection.ml | 33 --- .../reactive/src/reactive_file_collection.mli | 15 -- 5 files changed, 43 insertions(+), 242 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index 9604b9bc8ee..47af2df5d25 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -894,123 +894,117 @@ info [@@dead "Registry.+register"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 457, characters 0-19 - +name is never used - <-- line 457 - let name t = t.name [@@dead "+name"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 469, characters 2-648 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 468, characters 2-648 +process is never used - <-- line 469 + <-- line 468 List.iter (fun h -> h delta) !subscribers)) [@@dead "+process"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 486, characters 2-71 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 485, characters 2-71 +_info is never used - <-- line 486 + <-- line 485 let _info = Registry.register ~name ~level:0 ~process ~stats:my_stats [@@dead "+_info"] in Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 533, characters 2-82 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 532, characters 2-82 +merge_fn is never used - <-- line 533 + <-- line 532 | None -> fun _ v -> v [@@dead "+merge_fn"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 551, characters 2-614 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 550, characters 2-614 +recompute_target is never used - <-- line 551 + <-- line 550 Some (k2, Some merged) [@@dead "+recompute_target"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 572, characters 2-358 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 571, characters 2-358 +remove_source is never used - <-- line 572 + <-- line 571 target_keys [@@dead "+remove_source"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 604, characters 2-550 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 603, characters 2-550 +process_entry is never used - <-- line 604 + <-- line 603 all_affected [@@dead "+process_entry"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 625, characters 2-1165 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 624, characters 2-1165 +process is never used - <-- line 625 + <-- line 624 List.iter (fun h -> h delta) !subscribers)) [@@dead "+process"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 652, characters 2-82 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 651, characters 2-82 +_info is never used - <-- line 652 + <-- line 651 Registry.register ~name ~level:my_level ~process ~stats:my_stats [@@dead "+_info"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 695, characters 2-82 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 694, characters 2-82 +merge_fn is never used - <-- line 695 + <-- line 694 | None -> fun _ v -> v [@@dead "+merge_fn"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 717, characters 2-614 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 716, characters 2-614 +recompute_target is never used - <-- line 717 + <-- line 716 Some (k3, Some merged) [@@dead "+recompute_target"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 797, characters 2-462 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 796, characters 2-462 +remove_left_entry is never used - <-- line 797 + <-- line 796 affected [@@dead "+remove_left_entry"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 812, characters 2-2770 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 811, characters 2-2770 +process is never used - <-- line 812 + <-- line 811 List.iter (fun h -> h delta) !subscribers) [@@dead "+process"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 891, characters 2-82 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 890, characters 2-82 +_info is never used - <-- line 891 + <-- line 890 Registry.register ~name ~level:my_level ~process ~stats:my_stats [@@dead "+_info"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 946, characters 2-403 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 945, characters 2-403 +recompute_target is never used - <-- line 946 + <-- line 945 Some (k, Some merged) [@@dead "+recompute_target"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 960, characters 2-2260 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 959, characters 2-2260 +process is never used - <-- line 960 + <-- line 959 List.iter (fun h -> h delta) !subscribers) [@@dead "+process"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 1026, characters 2-82 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 1025, characters 2-82 +_info is never used - <-- line 1026 + <-- line 1025 Registry.register ~name ~level:my_level ~process ~stats:my_stats [@@dead "+_info"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 1084, characters 2-524 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 1083, characters 2-524 +emit_output is never used - <-- line 1084 + <-- line 1083 List.iter (fun h -> h delta) !subscribers) [@@dead "+emit_output"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 1096, characters 2-1019 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 1095, characters 2-1019 +process is never used - <-- line 1096 + <-- line 1095 emit_output output_entries [@@dead "+process"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 1126, characters 2-82 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 1125, characters 2-82 +_info is never used - <-- line 1126 + <-- line 1125 Registry.register ~name ~level:my_level ~process ~stats:my_stats [@@dead "+_info"] Warning Dead Value @@ -1025,132 +1019,16 @@ <-- line 45 val create_stats : unit -> stats [@@dead "+create_stats"] - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.mli", line 49, characters 0-319 - reactive.Registry is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.mli", line 53, characters 2-26 - Registry.+clear is never used - <-- line 53 - val clear : unit -> unit [@@dead "Registry.+clear"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.mli", line 56, characters 2-33 - Registry.+to_mermaid is never used - <-- line 56 - val to_mermaid : unit -> string [@@dead "Registry.+to_mermaid"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.mli", line 59, characters 2-32 - Registry.+print_stats is never used - <-- line 59 - val print_stats : unit -> unit [@@dead "Registry.+print_stats"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.mli", line 65, characters 0-254 - reactive.Scheduler is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.mli", line 66, characters 2-30 - Scheduler.+propagate is never used - <-- line 66 - val propagate : unit -> unit [@@dead "Scheduler.+propagate"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.mli", line 70, characters 2-35 - Scheduler.+is_propagating is never used - <-- line 70 - val is_propagating : unit -> bool [@@dead "Scheduler.+is_propagating"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.mli", line 91, characters 0-31 - +name is never used - <-- line 91 - val name : ('k, 'v) t -> string [@@dead "+name"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive_file_collection.ml", line 43, characters 0-416 - +process_if_changed is never used - <-- line 43 - true [@@dead "+process_if_changed"] (* changed *) - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive_file_collection.ml", line 56, characters 0-94 - +process_files is never used - <-- line 56 - List.iter (fun path -> ignore (process_if_changed t path)) paths [@@dead "+process_files"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive_file_collection.ml", line 81, characters 0-91 - +remove is never used - <-- line 81 - emit t (Reactive.Remove path) [@@dead "+remove"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive_file_collection.ml", line 99, characters 0-44 - +clear is never used - <-- line 99 - let clear t = Hashtbl.clear t.internal.cache [@@dead "+clear"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive_file_collection.ml", line 102, characters 0-60 - +invalidate is never used - <-- line 102 - let invalidate t path = Hashtbl.remove t.internal.cache path [@@dead "+invalidate"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive_file_collection.ml", line 104, characters 0-111 - +get is never used - <-- line 104 - | None -> None [@@dead "+get"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive_file_collection.ml", line 110, characters 0-43 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive_file_collection.ml", line 77, characters 0-43 +length is never used - <-- line 110 + <-- line 77 let length t = Reactive.length t.collection [@@dead "+length"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive_file_collection.mli", line 42, characters 0-55 - +process_files is never used - <-- line 42 - val process_files : ('raw, 'v) t -> string list -> unit [@@dead "+process_files"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive_file_collection.mli", line 51, characters 0-55 - +process_if_changed is never used - <-- line 51 - val process_if_changed : ('raw, 'v) t -> string -> bool [@@dead "+process_if_changed"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive_file_collection.mli", line 54, characters 0-43 - +remove is never used - <-- line 54 - val remove : ('raw, 'v) t -> string -> unit [@@dead "+remove"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive_file_collection.mli", line 63, characters 0-47 - +invalidate is never used - <-- line 63 - val invalidate : ('raw, 'v) t -> string -> unit [@@dead "+invalidate"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive_file_collection.mli", line 64, characters 0-32 - +clear is never used - <-- line 64 - val clear : ('raw, 'v) t -> unit [@@dead "+clear"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive_file_collection.mli", line 68, characters 0-45 - +get is never used - <-- line 68 - val get : ('raw, 'v) t -> string -> 'v option [@@dead "+get"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive_file_collection.mli", line 70, characters 0-32 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive_file_collection.mli", line 55, characters 0-32 +length is never used - <-- line 70 + <-- line 55 val length : ('raw, 'v) t -> int [@@dead "+length"] Warning Dead Value @@ -17277,4 +17155,4 @@ <-- line 38 val peek_minus : t -> bool [@@dead "+peek_minus"] - Analysis reported 3016 issues (Warning Dead Module:153, Warning Dead Type:379, Warning Dead Value:2228, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:195, Warning Unused Argument:24) + Analysis reported 2995 issues (Warning Dead Module:151, Warning Dead Type:379, Warning Dead Value:2209, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:195, Warning Unused Argument:24) diff --git a/analysis/reactive/src/reactive.ml b/analysis/reactive/src/reactive.ml index 2698e220bc6..6413be70e54 100644 --- a/analysis/reactive/src/reactive.ml +++ b/analysis/reactive/src/reactive.ml @@ -454,7 +454,6 @@ let iter f t = t.iter f let get t k = t.get k let length t = t.length () let stats t = t.stats -let name t = t.name (** {1 Source Collection} *) diff --git a/analysis/reactive/src/reactive.mli b/analysis/reactive/src/reactive.mli index a9dbf12a754..4936c33a3d1 100644 --- a/analysis/reactive/src/reactive.mli +++ b/analysis/reactive/src/reactive.mli @@ -44,33 +44,6 @@ type stats = { val create_stats : unit -> stats -(** {1 Node Registry} *) - -module Registry : sig - type node_info - (** Information about a registered node *) - - val clear : unit -> unit - (** Clear all registered nodes *) - - val to_mermaid : unit -> string - (** Generate a Mermaid diagram of the pipeline *) - - val print_stats : unit -> unit - (** Print timing statistics for all nodes *) -end - -(** {1 Scheduler} *) - -module Scheduler : sig - val propagate : unit -> unit - (** Process all dirty nodes in topological order. - Called automatically when a source emits. *) - - val is_propagating : unit -> bool - (** Returns true if currently in a propagation wave *) -end - (** {1 Collection Interface} *) type ('k, 'v) t = { @@ -88,7 +61,6 @@ val iter : ('k -> 'v -> unit) -> ('k, 'v) t -> unit val get : ('k, 'v) t -> 'k -> 'v option val length : ('k, 'v) t -> int val stats : ('k, 'v) t -> stats -val name : ('k, 'v) t -> string (** {1 Source Collection} *) diff --git a/analysis/reactive/src/reactive_file_collection.ml b/analysis/reactive/src/reactive_file_collection.ml index bcae68a0b79..89a661beae7 100644 --- a/analysis/reactive/src/reactive_file_collection.ml +++ b/analysis/reactive/src/reactive_file_collection.ml @@ -39,23 +39,6 @@ let to_collection t : (string, 'v) Reactive.t = t.collection (** Emit a delta *) let emit t delta = t.emit delta -(** Process a file if changed. Emits delta to subscribers. *) -let process_if_changed t path = - let new_id = get_file_id path in - match Hashtbl.find_opt t.internal.cache path with - | Some (old_id, _) when not (file_changed ~old_id ~new_id) -> - false (* unchanged *) - | _ -> - let raw = t.internal.read_file path in - let value = t.internal.process path raw in - Hashtbl.replace t.internal.cache path (new_id, value); - emit t (Reactive.Set (path, value)); - true (* changed *) - -(** Process multiple files (emits individual deltas) *) -let process_files t paths = - List.iter (fun path -> ignore (process_if_changed t path)) paths - (** Process a file without emitting. Returns batch entry if changed. *) let process_file_silent t path = let new_id = get_file_id path in @@ -77,11 +60,6 @@ let process_files_batch t paths = if entries <> [] then emit t (Reactive.Batch entries); List.length entries -(** Remove a file *) -let remove t path = - Hashtbl.remove t.internal.cache path; - emit t (Reactive.Remove path) - (** Remove multiple files as a batch *) let remove_batch t paths = let entries = @@ -95,17 +73,6 @@ let remove_batch t paths = if entries <> [] then emit t (Reactive.Batch entries); List.length entries -(** Clear all cached data *) -let clear t = Hashtbl.clear t.internal.cache - -(** Invalidate a path *) -let invalidate t path = Hashtbl.remove t.internal.cache path - -let get t path = - match Hashtbl.find_opt t.internal.cache path with - | Some (_, v) -> Some v - | None -> None - let mem t path = Hashtbl.mem t.internal.cache path let length t = Reactive.length t.collection let iter f t = Reactive.iter f t.collection diff --git a/analysis/reactive/src/reactive_file_collection.mli b/analysis/reactive/src/reactive_file_collection.mli index e50c6618284..e3433eae377 100644 --- a/analysis/reactive/src/reactive_file_collection.mli +++ b/analysis/reactive/src/reactive_file_collection.mli @@ -39,33 +39,18 @@ val to_collection : ('raw, 'v) t -> (string, 'v) Reactive.t (** {1 Processing} *) -val process_files : ('raw, 'v) t -> string list -> unit -(** Process files, emitting individual deltas for each changed file. *) - val process_files_batch : ('raw, 'v) t -> string list -> int (** Process files, emitting a single [Batch] delta with all changes. Returns the number of files that changed. More efficient than [process_files] when processing many files at once, as downstream combinators can process all changes together. *) -val process_if_changed : ('raw, 'v) t -> string -> bool -(** Process a file if changed. Returns true if file was processed. *) - -val remove : ('raw, 'v) t -> string -> unit -(** Remove a file from the collection. *) - val remove_batch : ('raw, 'v) t -> string list -> int (** Remove multiple files as a batch. Returns the number of files removed. More efficient than calling [remove] multiple times. *) -(** {1 Cache Management} *) - -val invalidate : ('raw, 'v) t -> string -> unit -val clear : ('raw, 'v) t -> unit - (** {1 Access} *) -val get : ('raw, 'v) t -> string -> 'v option val mem : ('raw, 'v) t -> string -> bool val length : ('raw, 'v) t -> int val iter : (string -> 'v -> unit) -> ('raw, 'v) t -> unit From 5ef9ca53384634717bbc69dee04e3e9fc533377a Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 12:02:45 +0000 Subject: [PATCH 061/214] dce: note live file collection --- scripts/dce/live-findings.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/scripts/dce/live-findings.md b/scripts/dce/live-findings.md index 3c49900786f..8f887f38a6e 100644 --- a/scripts/dce/live-findings.md +++ b/scripts/dce/live-findings.md @@ -124,3 +124,15 @@ live after manual validation. blind spot: reanalyze does not mark the exported combinators live from their users, so the implementation below them looks dead even though it runs in the analyzer's reactive mode. + +### `Reactive_file_collection` live helpers + +- Report: `Warning Dead Value`, `analysis/reactive/src/reactive_file_collection.ml` + and `.mli`, currently including `length`. +- Verdict: live; false positive. +- Validation: `analysis/reanalyze/src/reactive_analysis.ml` uses + `Reactive_file_collection.create`, `process_files_batch`, `mem`, `iter`, + `length`, and `to_collection`; `analysis/reanalyze/src/reanalyze.ml` uses + `process_files_batch` and `remove_batch` directly for churn tests. +- Context: the single-file/cache-management helpers were removed, but the + remaining collection operations are part of the live reactive analyzer path. From cd7bf433fc1c077759a7372a82254d04eeae2db3 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 12:03:48 +0000 Subject: [PATCH 062/214] dce: remove unused result helpers --- _dce/report.txt | 26 +--------------------- analysis/reanalyze/src/analysis_result.ml | 4 ---- analysis/reanalyze/src/analysis_result.mli | 6 ----- 3 files changed, 1 insertion(+), 35 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index 47af2df5d25..bb704a0b994 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -1115,30 +1115,6 @@ <-- line 36 ('k * unit option) list [@@dead "+apply"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/analysis_result.ml", line 11, characters 0-62 - +add_issue is never used - <-- line 11 - let add_issue result issue = {issues = issue :: result.issues} [@@dead "+add_issue"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/analysis_result.ml", line 18, characters 0-50 - +issue_count is never used - <-- line 18 - let issue_count result = List.length result.issues [@@dead "+issue_count"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/analysis_result.mli", line 12, characters 0-33 - +add_issue is never used - <-- line 12 - val add_issue : t -> Issue.t -> t [@@dead "+add_issue"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/analysis_result.mli", line 21, characters 0-26 - +issue_count is never used - <-- line 21 - val issue_count : t -> int [@@dead "+issue_count"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/arnold.ml", line 33, characters 2-134 Function_args.+compare_arg is never used @@ -17155,4 +17131,4 @@ <-- line 38 val peek_minus : t -> bool [@@dead "+peek_minus"] - Analysis reported 2995 issues (Warning Dead Module:151, Warning Dead Type:379, Warning Dead Value:2209, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:195, Warning Unused Argument:24) + Analysis reported 2991 issues (Warning Dead Module:151, Warning Dead Type:379, Warning Dead Value:2205, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:195, Warning Unused Argument:24) diff --git a/analysis/reanalyze/src/analysis_result.ml b/analysis/reanalyze/src/analysis_result.ml index a2075b67d5b..144d6b57c14 100644 --- a/analysis/reanalyze/src/analysis_result.ml +++ b/analysis/reanalyze/src/analysis_result.ml @@ -8,15 +8,11 @@ type t = {issues: Issue.t list} let empty = {issues = []} -let add_issue result issue = {issues = issue :: result.issues} - let add_issues result new_issues = {issues = List.rev_append new_issues result.issues} let get_issues result = result.issues |> List.rev -let issue_count result = List.length result.issues - (** Create a dead code issue *) let make_dead_issue ~loc ~dead_warning ~path ~message : Issue.t = { diff --git a/analysis/reanalyze/src/analysis_result.mli b/analysis/reanalyze/src/analysis_result.mli index 1fd429ad04d..d4b90ca09fe 100644 --- a/analysis/reanalyze/src/analysis_result.mli +++ b/analysis/reanalyze/src/analysis_result.mli @@ -9,18 +9,12 @@ type t val empty : t (** Empty result with no issues *) -val add_issue : t -> Issue.t -> t -(** Add a single issue to the result *) - val add_issues : t -> Issue.t list -> t (** Add multiple issues to the result *) val get_issues : t -> Issue.t list (** Get all issues in order they were added *) -val issue_count : t -> int -(** Count of issues *) - (** {2 Issue constructors} *) val make_dead_issue : From f8c67b10f7260c76b4637f8af08b85bd5c734106 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 12:04:16 +0000 Subject: [PATCH 063/214] dce: note live arnold compares --- scripts/dce/live-findings.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/scripts/dce/live-findings.md b/scripts/dce/live-findings.md index 8f887f38a6e..10c3d386f13 100644 --- a/scripts/dce/live-findings.md +++ b/scripts/dce/live-findings.md @@ -136,3 +136,17 @@ live after manual validation. `process_files_batch` and `remove_batch` directly for churn tests. - Context: the single-file/cache-management helpers were removed, but the remaining collection operations are part of the live reactive analyzer path. + +### `Arnold` ordered-set compare callbacks + +- Report: `Warning Dead Value`, `analysis/reanalyze/src/arnold.ml`, + `Function_args.compare_arg`, `Function_args.compare`, and + `Function_call.compare`. +- Verdict: live; false positive. +- Validation: `Function_call_set = Set.Make (Function_call)` uses + `Function_call.compare`, which delegates to `Function_args.compare`. The set is + used in the termination analyzer call stack (`Call_stack.to_set`, + `Function_call_set.mem`, `Function_call_set.union`, and + `Function_call_set.empty`). +- Context: compare functions supplied to functors can look unreferenced as plain + values even though the generated set module calls them. From 3ea9dc2566d8ad32fd3167cc789b7797483d440a Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 12:05:22 +0000 Subject: [PATCH 064/214] dce: drop inline record bindings --- _dce/report.txt | 20 ++++------------ analysis/reanalyze/src/collect_annotations.ml | 24 +++++++++---------- analysis/reanalyze/src/dead_type.ml | 20 +++++++--------- 3 files changed, 24 insertions(+), 40 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index bb704a0b994..3f5808061e5 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -1133,12 +1133,6 @@ <-- line 74 else Function_args.compare x1.function_args x2.function_args [@@dead "Function_call.+compare"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/collect_annotations.ml", line 93, characters 13-571 - +_process_inline_records is never used - <-- line 93 - | Cstr_tuple _ -> () [@@dead "+_process_inline_records"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/cross_file_items_store.mli", line 18, characters 0-89 +iter_optional_arg_calls is never used @@ -1183,20 +1177,14 @@ <-- line 6 let compare = Stdlib.compare [@@dead "Path_map.+compare"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/dead_type.ml", line 45, characters 8-376 - +_handle_inline_records is never used - <-- line 45 - | Cstr_tuple _ -> () [@@dead "+_handle_inline_records"] - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/dead_type.ml", line 71, characters 0-93 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/dead_type.ml", line 69, characters 0-93 +dead_type.Path_map is a dead module as all its items are dead. Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/dead_type.ml", line 74, characters 2-30 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/dead_type.ml", line 72, characters 2-30 Path_map.+compare is never used - <-- line 74 + <-- line 72 let compare = Stdlib.compare [@@dead "Path_map.+compare"] Warning Dead Value @@ -17131,4 +17119,4 @@ <-- line 38 val peek_minus : t -> bool [@@dead "+peek_minus"] - Analysis reported 2991 issues (Warning Dead Module:151, Warning Dead Type:379, Warning Dead Value:2205, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:195, Warning Unused Argument:24) + Analysis reported 2989 issues (Warning Dead Module:151, Warning Dead Type:379, Warning Dead Value:2203, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:195, Warning Unused Argument:24) diff --git a/analysis/reanalyze/src/collect_annotations.ml b/analysis/reanalyze/src/collect_annotations.ml index 1e05fcfef08..cf31294f33f 100644 --- a/analysis/reanalyze/src/collect_annotations.ml +++ b/analysis/reanalyze/src/collect_annotations.ml @@ -90,19 +90,17 @@ let collect_export_locations ~state ~config ~do_gentype = ({cd_attributes; cd_loc; cd_args} : Typedtree.constructor_declaration) -> - let _process_inline_records = - match cd_args with - | Cstr_record flds -> - List.iter - (fun ({ld_attributes; ld_loc} : Typedtree.label_declaration) - -> - toplevel_attrs @ cd_attributes @ ld_attributes - |> process_attributes ~scope_default:!current_scope_default - ~state ~config ~do_gentype:false ~name:"" - ~pos:ld_loc.loc_start) - flds - | Cstr_tuple _ -> () - in + (match cd_args with + | Cstr_record flds -> + List.iter + (fun ({ld_attributes; ld_loc} : Typedtree.label_declaration) + -> + toplevel_attrs @ cd_attributes @ ld_attributes + |> process_attributes ~scope_default:!current_scope_default + ~state ~config ~do_gentype:false ~name:"" + ~pos:ld_loc.loc_start) + flds + | Cstr_tuple _ -> ()); toplevel_attrs @ cd_attributes |> process_attributes ~scope_default:!current_scope_default ~state ~config ~do_gentype:false ~name:"" ~pos:cd_loc.loc_start) diff --git a/analysis/reanalyze/src/dead_type.ml b/analysis/reanalyze/src/dead_type.ml index 1bfad3e33a3..00835465ba5 100644 --- a/analysis/reanalyze/src/dead_type.ml +++ b/analysis/reanalyze/src/dead_type.ml @@ -42,17 +42,15 @@ let add_declaration ~config ~decls ~file ~(module_path : Module_path.t) | Type_variant decls -> List.iteri (fun i {Types.cd_id; cd_loc; cd_args} -> - let _handle_inline_records = - match cd_args with - | Cstr_record lbls -> - List.iter - (fun {Types.ld_id; ld_loc} -> - Ident.name cd_id ^ "." ^ Ident.name ld_id - |> Name.create - |> process_type_label ~decl_kind:RecordLabel ~loc:ld_loc) - lbls - | Cstr_tuple _ -> () - in + (match cd_args with + | Cstr_record lbls -> + List.iter + (fun {Types.ld_id; ld_loc} -> + Ident.name cd_id ^ "." ^ Ident.name ld_id + |> Name.create + |> process_type_label ~decl_kind:RecordLabel ~loc:ld_loc) + lbls + | Cstr_tuple _ -> ()); let pos_adjustment = (* In Res the variant loc can include the | and spaces after it *) let is_res = From 47438f068b6bf591af9df25d007d24d42c309390 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 12:06:09 +0000 Subject: [PATCH 065/214] dce: hide item store iterators --- _dce/report.txt | 14 +------------- analysis/reanalyze/src/cross_file_items_store.mli | 7 ------- 2 files changed, 1 insertion(+), 20 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index 3f5808061e5..91bcfdda1bd 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -1133,18 +1133,6 @@ <-- line 74 else Function_args.compare x1.function_args x2.function_args [@@dead "Function_call.+compare"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/cross_file_items_store.mli", line 18, characters 0-89 - +iter_optional_arg_calls is never used - <-- line 18 - t -> (Cross_file_items.optional_arg_call -> unit) -> unit [@@dead "+iter_optional_arg_calls"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/cross_file_items_store.mli", line 22, characters 0-77 - +iter_function_refs is never used - <-- line 22 - val iter_function_refs : t -> (Cross_file_items.function_ref -> unit) -> unit [@@dead "+iter_function_refs"] - Warning Dead Module File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/dead_code.ml", line 1, characters 0-0 +dead_code is a dead module as all its items are dead. @@ -17119,4 +17107,4 @@ <-- line 38 val peek_minus : t -> bool [@@dead "+peek_minus"] - Analysis reported 2989 issues (Warning Dead Module:151, Warning Dead Type:379, Warning Dead Value:2203, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:195, Warning Unused Argument:24) + Analysis reported 2987 issues (Warning Dead Module:151, Warning Dead Type:379, Warning Dead Value:2201, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:195, Warning Unused Argument:24) diff --git a/analysis/reanalyze/src/cross_file_items_store.mli b/analysis/reanalyze/src/cross_file_items_store.mli index f8da5db43c8..7f43bb457b4 100644 --- a/analysis/reanalyze/src/cross_file_items_store.mli +++ b/analysis/reanalyze/src/cross_file_items_store.mli @@ -15,13 +15,6 @@ val of_frozen : Cross_file_items.t -> t val of_reactive : (string, Cross_file_items.t) Reactive.t -> t (** Wrap reactive collection directly (no intermediate collection) *) -val iter_optional_arg_calls : - t -> (Cross_file_items.optional_arg_call -> unit) -> unit -(** Iterate over all optional arg calls *) - -val iter_function_refs : t -> (Cross_file_items.function_ref -> unit) -> unit -(** Iterate over all function refs *) - val compute_optional_args_state : t -> find_decl:(Lexing.position -> Decl.t option) -> From 5a34796e496525a7e09754f2c6893e2ce10f376f Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 12:07:05 +0000 Subject: [PATCH 066/214] dce: remove dead code alias --- _dce/report.txt | 12 +----------- analysis/reanalyze/src/dead_code.ml | 4 ---- 2 files changed, 1 insertion(+), 15 deletions(-) delete mode 100644 analysis/reanalyze/src/dead_code.ml diff --git a/_dce/report.txt b/_dce/report.txt index 91bcfdda1bd..5572d707e8f 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -1133,16 +1133,6 @@ <-- line 74 else Function_args.compare x1.function_args x2.function_args [@@dead "Function_call.+compare"] - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/dead_code.ml", line 1, characters 0-0 - +dead_code is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/dead_code.ml", line 4, characters 0-54 - +process_cmt is never used - <-- line 4 - let process_cmt = Dce_file_processing.process_cmt_file [@@dead "+process_cmt"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/dead_common.ml", line 19, characters 2-43 Config.+warn_on_circular_dependencies is never used @@ -17107,4 +17097,4 @@ <-- line 38 val peek_minus : t -> bool [@@dead "+peek_minus"] - Analysis reported 2987 issues (Warning Dead Module:151, Warning Dead Type:379, Warning Dead Value:2201, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:195, Warning Unused Argument:24) + Analysis reported 2985 issues (Warning Dead Module:150, Warning Dead Type:379, Warning Dead Value:2200, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:195, Warning Unused Argument:24) diff --git a/analysis/reanalyze/src/dead_code.ml b/analysis/reanalyze/src/dead_code.ml deleted file mode 100644 index e97abaa18bf..00000000000 --- a/analysis/reanalyze/src/dead_code.ml +++ /dev/null @@ -1,4 +0,0 @@ -(** Dead code analysis - cmt file processing. - Delegates to DceFileProcessing for AST traversal. *) - -let process_cmt = Dce_file_processing.process_cmt_file From e5d5dc7dad13c4c16d0afc862a0c65389d2de371 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 12:09:03 +0000 Subject: [PATCH 067/214] dce: remove stale reactive solver --- _dce/report.txt | 14 +-- analysis/reanalyze/src/dead_common.ml | 151 +------------------------- 2 files changed, 2 insertions(+), 163 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index 5572d707e8f..0bd0c65c9d8 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -1133,18 +1133,6 @@ <-- line 74 else Function_args.compare x1.function_args x2.function_args [@@dead "Function_call.+compare"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/dead_common.ml", line 19, characters 2-43 - Config.+warn_on_circular_dependencies is never used - <-- line 19 - let warn_on_circular_dependencies = false [@@dead "Config.+warn_on_circular_dependencies"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/dead_common.ml", line 475, characters 0-5529 - +solve_dead_reactive is never used - <-- line 475 - Analysis_result.add_issues Analysis_result.empty all_issues [@@dead "+solve_dead_reactive"] - Warning Dead Module File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/dead_exception.ml", line 3, characters 0-93 +dead_exception.Path_map is a dead module as all its items are dead. @@ -17097,4 +17085,4 @@ <-- line 38 val peek_minus : t -> bool [@@dead "+peek_minus"] - Analysis reported 2985 issues (Warning Dead Module:150, Warning Dead Type:379, Warning Dead Value:2200, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:195, Warning Unused Argument:24) + Analysis reported 2983 issues (Warning Dead Module:150, Warning Dead Type:379, Warning Dead Value:2198, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:195, Warning Unused Argument:24) diff --git a/analysis/reanalyze/src/dead_common.ml b/analysis/reanalyze/src/dead_common.ml index a843d68606b..0ba1a7a7d96 100644 --- a/analysis/reanalyze/src/dead_common.ml +++ b/analysis/reanalyze/src/dead_common.ml @@ -16,7 +16,6 @@ module Config = struct let analyze_externals = ref false let report_underscore = false let report_types_dead_only_in_interface = false - let warn_on_circular_dependencies = false end let rec check_sub s1 s2 n = @@ -469,154 +468,6 @@ let solve_dead_forward ~ann_store ~config ~decl_store ~refs ~optional_args_state let all_issues = List.rev !inline_issues @ dead_issues in Analysis_result.add_issues Analysis_result.empty all_issues -(** Reactive solver using reactive liveness collection. - [value_refs_from] is only needed when [transitive=false] for hasRefBelow. - Pass [None] when [transitive=true] to avoid any refs computation. *) -let solve_dead_reactive ~ann_store ~config ~decl_store ~value_refs_from - ~(live : (Lexing.position, unit) Reactive.t) - ~(roots : (Lexing.position, unit) Reactive.t) ~optional_args_state - ~check_optional_arg: - (check_optional_arg_fn : - optional_args_state:Optional_args_state.t -> - ann_store:Annotation_store.t -> - config:Dce_config.t -> - Decl.t -> - Issue.t list) : Analysis_result.t = - let t0 = Unix.gettimeofday () in - let debug = config.Dce_config.cli.debug in - let transitive = config.Dce_config.run.transitive in - let is_live pos = Reactive.get live pos <> None in - - (* hasRefBelow uses on-demand search through value_refs_from *) - let has_ref_below = - match value_refs_from with - | None -> fun _ -> false - | Some refs_from -> - make_hasRefBelow ~transitive ~iter_value_refs_from:(fun f -> - Reactive.iter f refs_from) - in - - (* Process each declaration based on computed liveness *) - let dead_declarations = ref [] in - let inline_issues = ref [] in - - let t1 = Unix.gettimeofday () in - (* For consistent debug output, collect and sort declarations *) - let all_decls = - Declaration_store.fold (fun _pos decl acc -> decl :: acc) decl_store [] - in - let t2 = Unix.gettimeofday () in - let all_decls = all_decls |> List.fast_sort Decl.compare_for_reporting in - let t3 = Unix.gettimeofday () in - let num_decls = List.length all_decls in - - (* Count operations in the loop *) - let num_live_checks = ref 0 in - let num_dead = ref 0 in - let num_live = ref 0 in - - all_decls - |> List.iter (fun (decl : Decl.t) -> - let pos = decl.pos in - incr num_live_checks; - let is_live = is_live pos in - let is_dead = not is_live in - - (* Debug output (forward model): derive root/propagated from [roots]. *) - (if debug then - let live_reason : Liveness.live_reason option = - if not is_live then None - else if Reactive.get roots pos <> None then - if Annotation_store.is_annotated_gentype_or_live ann_store pos - then Some Liveness.Annotated - else Some Liveness.ExternalRef - else Some Liveness.Propagated - in - let status = - match live_reason with - | None -> "Dead" - | Some reason -> - Printf.sprintf "Live (%s)" (Liveness.reason_to_string reason) - in - Log_.item "%s %s %s@." status - (decl.decl_kind |> Decl.Kind.to_string) - (decl.path |> Dce_path.to_string)); - - decl.resolved_dead <- Some is_dead; - - if is_dead then ( - incr num_dead; - decl.path - |> Dead_modules.mark_dead ~config - ~is_type:(decl.decl_kind |> Decl.Kind.is_type) - ~loc:decl.module_loc; - if not (do_report_dead ~ann_store decl.pos) then decl.report <- false; - dead_declarations := decl :: !dead_declarations) - else ( - incr num_live; - (* Collect optional args issues for live declarations *) - check_optional_arg_fn ~optional_args_state ~ann_store ~config decl - |> List.iter (fun issue -> inline_issues := issue :: !inline_issues); - decl.path - |> Dead_modules.mark_live ~config - ~is_type:(decl.decl_kind |> Decl.Kind.is_type) - ~loc:decl.module_loc; - if Annotation_store.is_annotated_dead ann_store decl.pos then ( - (* Collect incorrect @dead annotation issue *) - let issue = - make_dead_issue ~decl ~message:" is annotated @dead but is live" - IncorrectDeadAnnotation - in - decl.path - |> Dce_path.to_module_name - ~is_type:(decl.decl_kind |> Decl.Kind.is_type) - |> Dead_modules.check_module_dead ~config - ~file_name:decl.pos.pos_fname - |> Option.iter (fun mod_issue -> - inline_issues := mod_issue :: !inline_issues); - inline_issues := issue :: !inline_issues))); - let t4 = Unix.gettimeofday () in - - let sorted_dead_declarations = - !dead_declarations |> List.fast_sort Decl.compare_for_reporting - in - let t5 = Unix.gettimeofday () in - - (* Collect issues from dead declarations *) - let reporting_ctx = Reporting_context.create () in - let dead_issues = - sorted_dead_declarations - |> List.concat_map (fun decl -> - report_declaration ~config ~has_ref_below reporting_ctx decl) - in - let t6 = Unix.gettimeofday () in - let all_issues = List.rev !inline_issues @ dead_issues in - let t7 = Unix.gettimeofday () in - - Printf.eprintf - " solveDeadReactive timing breakdown:\n\ - \ setup: %6.2fms\n\ - \ collect: %6.2fms (DeclarationStore.fold)\n\ - \ sort: %6.2fms (List.fast_sort %d decls)\n\ - \ iterate: %6.2fms (check liveness for %d decls: %d dead, %d live)\n\ - \ sort_dead: %6.2fms (sort %d dead decls)\n\ - \ report: %6.2fms (generate issues)\n\ - \ combine: %6.2fms\n\ - \ TOTAL: %6.2fms\n" - ((t1 -. t0) *. 1000.0) - ((t2 -. t1) *. 1000.0) - ((t3 -. t2) *. 1000.0) - num_decls - ((t4 -. t3) *. 1000.0) - !num_live_checks !num_dead !num_live - ((t5 -. t4) *. 1000.0) - !num_dead - ((t6 -. t5) *. 1000.0) - ((t7 -. t6) *. 1000.0) - ((t7 -. t0) *. 1000.0); - - Analysis_result.add_issues Analysis_result.empty all_issues - (** Main entry point - uses forward solver. *) let solve_dead ~ann_store ~config ~decl_store ~ref_store ~optional_args_state ~check_optional_arg : Analysis_result.t = @@ -626,5 +477,5 @@ let solve_dead ~ann_store ~config ~decl_store ~ref_store ~optional_args_state ~check_optional_arg | None -> failwith - "solveDead: ReferenceStore must be Frozen (use solveDeadReactive for \ + "solveDead: ReferenceStore must be Frozen (use Reactive_solver for \ reactive mode)" From d257a44d3c05df4b96b8d6ab4247c41059188aae Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 12:09:28 +0000 Subject: [PATCH 068/214] dce: note live map compares --- scripts/dce/live-findings.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/dce/live-findings.md b/scripts/dce/live-findings.md index 10c3d386f13..a955e83f5dd 100644 --- a/scripts/dce/live-findings.md +++ b/scripts/dce/live-findings.md @@ -141,12 +141,15 @@ live after manual validation. - Report: `Warning Dead Value`, `analysis/reanalyze/src/arnold.ml`, `Function_args.compare_arg`, `Function_args.compare`, and - `Function_call.compare`. + `Function_call.compare`; same pattern for `Path_map.compare` in + `analysis/reanalyze/src/dead_exception.ml` and `dead_type.ml`. - Verdict: live; false positive. - Validation: `Function_call_set = Set.Make (Function_call)` uses `Function_call.compare`, which delegates to `Function_args.compare`. The set is used in the termination analyzer call stack (`Call_stack.to_set`, `Function_call_set.mem`, `Function_call_set.union`, and - `Function_call_set.empty`). + `Function_call_set.empty`). `dead_exception.ml` and `dead_type.ml` both build + `Path_map = Map.Make (...)`, then use `Path_map.add`, `find_opt`, and `iter` + for exception and type-label indexes. - Context: compare functions supplied to functors can look unreferenced as plain values even though the generated set module calls them. From 50ff761f380db825f8516569737ccaa387de835c Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 12:10:34 +0000 Subject: [PATCH 069/214] dce: remove stale declaration helpers --- _dce/report.txt | 20 +------------------- analysis/reanalyze/src/decl.ml | 24 ------------------------ analysis/reanalyze/src/declarations.ml | 2 -- analysis/reanalyze/src/declarations.mli | 2 -- 4 files changed, 1 insertion(+), 47 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index 0bd0c65c9d8..be84a9522f3 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -1153,36 +1153,18 @@ <-- line 72 let compare = Stdlib.compare [@@dead "Path_map.+compare"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/decl.ml", line 57, characters 0-759 - +compare_using_dependencies is never used - <-- line 57 - (position2, lnum1, bol1, cnum1, kind2) [@@dead "+compare_using_dependencies"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/declarations.ml", line 38, characters 0-55 +create_from_hashtbl is never used <-- line 38 let create_from_hashtbl (h : Decl.t Pos_hash.t) : t = h [@@dead "+create_from_hashtbl"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/declarations.ml", line 48, characters 0-38 - +length is never used - <-- line 48 - let length (t : t) = Pos_hash.length t [@@dead "+length"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/declarations.mli", line 33, characters 0-48 +create_from_hashtbl is never used <-- line 33 val create_from_hashtbl : Decl.t Pos_hash.t -> t [@@dead "+create_from_hashtbl"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/declarations.mli", line 42, characters 0-21 - +length is never used - <-- line 42 - val length : t -> int [@@dead "+length"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/exn.ml", line 3, characters 0-28 +compare is never used @@ -17085,4 +17067,4 @@ <-- line 38 val peek_minus : t -> bool [@@dead "+peek_minus"] - Analysis reported 2983 issues (Warning Dead Module:150, Warning Dead Type:379, Warning Dead Value:2198, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:195, Warning Unused Argument:24) + Analysis reported 2980 issues (Warning Dead Module:150, Warning Dead Type:379, Warning Dead Value:2195, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:195, Warning Unused Argument:24) diff --git a/analysis/reanalyze/src/decl.ml b/analysis/reanalyze/src/decl.ml index aa457b3f5b8..f56cfd62beb 100644 --- a/analysis/reanalyze/src/decl.ml +++ b/analysis/reanalyze/src/decl.ml @@ -54,30 +54,6 @@ let is_live decl = | Some true -> false | Some false | None -> true -let compare_using_dependencies ~ordered_files - { - decl_kind = kind1; - path = _path1; - pos = - {pos_fname = fname1; pos_lnum = lnum1; pos_bol = bol1; pos_cnum = cnum1}; - } - { - decl_kind = kind2; - path = _path2; - pos = - {pos_fname = fname2; pos_lnum = lnum2; pos_bol = bol2; pos_cnum = cnum2}; - } = - let find_position fn = Hashtbl.find ordered_files fn [@@raises Not_found] in - (* From the root of the file dependency DAG to the leaves. - From the bottom of the file to the top. *) - let position1, position2 = - try (fname1 |> find_position, fname2 |> find_position) - with Not_found -> (0, 0) - in - compare - (position1, lnum2, bol2, cnum2, kind1) - (position2, lnum1, bol1, cnum1, kind2) - let compare_for_reporting { decl_kind = kind1; diff --git a/analysis/reanalyze/src/declarations.ml b/analysis/reanalyze/src/declarations.ml index bcdee966ab7..5672666beeb 100644 --- a/analysis/reanalyze/src/declarations.ml +++ b/analysis/reanalyze/src/declarations.ml @@ -44,5 +44,3 @@ let find_opt (t : t) pos = Pos_hash.find_opt t pos let fold f (t : t) init = Pos_hash.fold f t init let iter f (t : t) = Pos_hash.iter f t - -let length (t : t) = Pos_hash.length t diff --git a/analysis/reanalyze/src/declarations.mli b/analysis/reanalyze/src/declarations.mli index 4020a4f122b..c957172a0ce 100644 --- a/analysis/reanalyze/src/declarations.mli +++ b/analysis/reanalyze/src/declarations.mli @@ -38,5 +38,3 @@ val create_from_hashtbl : Decl.t Pos_hash.t -> t val find_opt : t -> Lexing.position -> Decl.t option val fold : (Lexing.position -> Decl.t -> 'a -> 'a) -> t -> 'a -> 'a val iter : (Lexing.position -> Decl.t -> unit) -> t -> unit - -val length : t -> int From 39e7327130658bcef028d98651a666deef116641 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 12:10:49 +0000 Subject: [PATCH 070/214] dce: note live freeze helpers --- scripts/dce/live-findings.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/scripts/dce/live-findings.md b/scripts/dce/live-findings.md index a955e83f5dd..e512eb84e29 100644 --- a/scripts/dce/live-findings.md +++ b/scripts/dce/live-findings.md @@ -137,6 +137,18 @@ live after manual validation. - Context: the single-file/cache-management helpers were removed, but the remaining collection operations are part of the live reactive analyzer path. +### Reactive merge freeze helpers + +- Report: `Warning Dead Value`, `analysis/reanalyze/src/declarations.ml` and + `file_annotations.ml`, `create_from_hashtbl`. +- Verdict: live; false positive. +- Validation: `analysis/reanalyze/src/reactive_merge.ml` calls + `Declarations.create_from_hashtbl` from `freeze_decls` and + `File_annotations.create_from_hashtbl` from `freeze_annotations`. +- Context: the freeze helpers bridge reactive hashtable aggregation back to the + immutable store types. Reanalyze reports them because the caller sits in the + reactive pipeline, which is affected by the cross-module liveness blind spot. + ### `Arnold` ordered-set compare callbacks - Report: `Warning Dead Value`, `analysis/reanalyze/src/arnold.ml`, From dc0cbf8bb06c108c857f220f9955f7f71d2244f5 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 12:12:13 +0000 Subject: [PATCH 071/214] dce: remove unused exception names --- _dce/report.txt | 38 +--------------------------------- analysis/reanalyze/src/exn.ml | 3 --- analysis/reanalyze/src/exn.mli | 3 --- 3 files changed, 1 insertion(+), 43 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index be84a9522f3..e414b2e4354 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -1171,48 +1171,12 @@ <-- line 3 let compare = String.compare [@@dead "+compare"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/exn.ml", line 7, characters 0-31 - +end_of_file is never used - <-- line 7 - let end_of_file = "End_of_file" [@@dead "+end_of_file"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/exn.ml", line 8, characters 0-17 - +exit is never used - <-- line 8 - let exit = "exit" [@@dead "+exit"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/exn.ml", line 14, characters 0-27 - +sys_error is never used - <-- line 14 - let sys_error = "Sys_error" [@@dead "+sys_error"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/exn.mli", line 3, characters 0-27 +compare is never used <-- line 3 val compare : t -> t -> int [@@dead "+compare"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/exn.mli", line 7, characters 0-19 - +end_of_file is never used - <-- line 7 - val end_of_file : t [@@dead "+end_of_file"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/exn.mli", line 8, characters 0-12 - +exit is never used - <-- line 8 - val exit : t [@@dead "+exit"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/exn.mli", line 16, characters 0-17 - +sys_error is never used - <-- line 16 - val sys_error : t [@@dead "+sys_error"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/file_annotations.ml", line 41, characters 0-61 +create_from_hashtbl is never used @@ -17067,4 +17031,4 @@ <-- line 38 val peek_minus : t -> bool [@@dead "+peek_minus"] - Analysis reported 2980 issues (Warning Dead Module:150, Warning Dead Type:379, Warning Dead Value:2195, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:195, Warning Unused Argument:24) + Analysis reported 2974 issues (Warning Dead Module:150, Warning Dead Type:379, Warning Dead Value:2189, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:195, Warning Unused Argument:24) diff --git a/analysis/reanalyze/src/exn.ml b/analysis/reanalyze/src/exn.ml index 0f83bc988b1..c14e5476969 100644 --- a/analysis/reanalyze/src/exn.ml +++ b/analysis/reanalyze/src/exn.ml @@ -4,14 +4,11 @@ let compare = String.compare let decode_error = "DecodeError" let assert_failure = "Assert_failure" let division_by_zero = "Division_by_zero" -let end_of_file = "End_of_file" -let exit = "exit" let failure = "Failure" let invalid_argument = "Invalid_argument" let js_exn = "JsExn" let match_failure = "Match_failure" let not_found = "Not_found" -let sys_error = "Sys_error" let from_lid lid = lid |> Longident.flatten |> String.concat "." let from_string s = s let to_string s = s diff --git a/analysis/reanalyze/src/exn.mli b/analysis/reanalyze/src/exn.mli index 694e2ea4429..fc6ee05557b 100644 --- a/analysis/reanalyze/src/exn.mli +++ b/analysis/reanalyze/src/exn.mli @@ -4,8 +4,6 @@ val compare : t -> t -> int val assert_failure : t val decode_error : t val division_by_zero : t -val end_of_file : t -val exit : t val failure : t val from_lid : Longident.t -> t val from_string : string -> t @@ -13,7 +11,6 @@ val invalid_argument : t val js_exn : t val match_failure : t val not_found : t -val sys_error : t val to_string : t -> string val yojson_json_error : t val yojson_type_error : t From 728fe6bd803b8e5600a6e6d7cf0a36c1bcb48eff Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 12:12:26 +0000 Subject: [PATCH 072/214] dce: note live exn compare --- scripts/dce/live-findings.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/dce/live-findings.md b/scripts/dce/live-findings.md index e512eb84e29..0613f0f7f71 100644 --- a/scripts/dce/live-findings.md +++ b/scripts/dce/live-findings.md @@ -154,7 +154,8 @@ live after manual validation. - Report: `Warning Dead Value`, `analysis/reanalyze/src/arnold.ml`, `Function_args.compare_arg`, `Function_args.compare`, and `Function_call.compare`; same pattern for `Path_map.compare` in - `analysis/reanalyze/src/dead_exception.ml` and `dead_type.ml`. + `analysis/reanalyze/src/dead_exception.ml` and `dead_type.ml`, and + `Exn.compare` in `analysis/reanalyze/src/exn.ml`. - Verdict: live; false positive. - Validation: `Function_call_set = Set.Make (Function_call)` uses `Function_call.compare`, which delegates to `Function_args.compare`. The set is @@ -162,6 +163,7 @@ live after manual validation. `Function_call_set.mem`, `Function_call_set.union`, and `Function_call_set.empty`). `dead_exception.ml` and `dead_type.ml` both build `Path_map = Map.Make (...)`, then use `Path_map.add`, `find_opt`, and `iter` - for exception and type-label indexes. + for exception and type-label indexes. `exceptions.ml` and `issue.ml` build + `Set.Make (Exn)`, which requires `Exn.compare`. - Context: compare functions supplied to functors can look unreferenced as plain values even though the generated set module calls them. From ab435a23ee0cb96f8d25f35503e8904e2de95796 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 12:13:21 +0000 Subject: [PATCH 073/214] dce: remove annotation accessors --- _dce/report.txt | 26 +-------------------- analysis/reanalyze/src/file_annotations.ml | 4 ---- analysis/reanalyze/src/file_annotations.mli | 2 -- 3 files changed, 1 insertion(+), 31 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index e414b2e4354..3c876db2a53 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -1183,36 +1183,12 @@ <-- line 41 let create_from_hashtbl (h : annotated_as Pos_hash.t) : t = h [@@dead "+create_from_hashtbl"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/file_annotations.ml", line 57, characters 0-38 - +length is never used - <-- line 57 - let length (t : t) = Pos_hash.length t [@@dead "+length"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/file_annotations.ml", line 59, characters 0-38 - +iter is never used - <-- line 59 - let iter f (t : t) = Pos_hash.iter f t [@@dead "+iter"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/file_annotations.mli", line 35, characters 0-54 +create_from_hashtbl is never used <-- line 35 val create_from_hashtbl : annotated_as Pos_hash.t -> t [@@dead "+create_from_hashtbl"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/file_annotations.mli", line 43, characters 0-21 - +length is never used - <-- line 43 - val length : t -> int [@@dead "+length"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/file_annotations.mli", line 44, characters 0-65 - +iter is never used - <-- line 44 - val iter : (Lexing.position -> annotated_as -> unit) -> t -> unit [@@dead "+iter"] - Warning Dead Module File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/file_deps.ml", line 6, characters 0-129 +file_deps.File_hash is a dead module as all its items are dead. @@ -17031,4 +17007,4 @@ <-- line 38 val peek_minus : t -> bool [@@dead "+peek_minus"] - Analysis reported 2974 issues (Warning Dead Module:150, Warning Dead Type:379, Warning Dead Value:2189, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:195, Warning Unused Argument:24) + Analysis reported 2970 issues (Warning Dead Module:150, Warning Dead Type:379, Warning Dead Value:2185, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:195, Warning Unused Argument:24) diff --git a/analysis/reanalyze/src/file_annotations.ml b/analysis/reanalyze/src/file_annotations.ml index 83cded03713..69ade081ac1 100644 --- a/analysis/reanalyze/src/file_annotations.ml +++ b/analysis/reanalyze/src/file_annotations.ml @@ -53,7 +53,3 @@ let is_annotated_gentype_or_dead (state : t) pos = match Pos_hash.find_opt state pos with | Some (Dead | GenType) -> true | Some Live | None -> false - -let length (t : t) = Pos_hash.length t - -let iter f (t : t) = Pos_hash.iter f t diff --git a/analysis/reanalyze/src/file_annotations.mli b/analysis/reanalyze/src/file_annotations.mli index 3ca50fcacd2..c64f9f984e5 100644 --- a/analysis/reanalyze/src/file_annotations.mli +++ b/analysis/reanalyze/src/file_annotations.mli @@ -40,5 +40,3 @@ val create_from_hashtbl : annotated_as Pos_hash.t -> t val is_annotated_dead : t -> Lexing.position -> bool val is_annotated_gentype_or_live : t -> Lexing.position -> bool val is_annotated_gentype_or_dead : t -> Lexing.position -> bool -val length : t -> int -val iter : (Lexing.position -> annotated_as -> unit) -> t -> unit From fe7ccea8f6e28337d15ab1df5899dc572d292152 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 12:18:51 +0000 Subject: [PATCH 074/214] dce: trim file deps --- _dce/report.txt | 156 ++++------------------ analysis/reanalyze/src/file_deps.ml | 102 -------------- analysis/reanalyze/src/file_deps.mli | 52 +------- analysis/reanalyze/src/reactive_merge.ml | 32 ----- analysis/reanalyze/src/reactive_merge.mli | 3 - scripts/dce/live-findings.md | 12 ++ 6 files changed, 38 insertions(+), 319 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index 3c876db2a53..31852126c29 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -1205,126 +1205,6 @@ <-- line 10 let equal (x : t) y = x = y [@@dead "File_hash.+equal"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/file_deps.ml", line 55, characters 0-265 - +freeze_builder is never used - <-- line 55 - {files = b.files; deps = b.deps} [@@dead "+freeze_builder"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/file_deps.ml", line 61, characters 0-207 - +merge_all is never used - <-- line 61 - freeze_builder merged_builder [@@dead "+merge_all"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/file_deps.ml", line 76, characters 0-43 - +create is never used - <-- line 76 - let create ~files ~deps : t = {files; deps} [@@dead "+create"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/file_deps.ml", line 80, characters 0-31 - +get_files is never used - <-- line 80 - let get_files (t : t) = t.files [@@dead "+get_files"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/file_deps.ml", line 82, characters 0-114 - +get_deps is never used - <-- line 82 - | None -> File_set.empty [@@dead "+get_deps"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/file_deps.ml", line 87, characters 0-49 - +iter_deps is never used - <-- line 87 - let iter_deps (t : t) f = File_hash.iter f t.deps [@@dead "+iter_deps"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/file_deps.ml", line 89, characters 0-56 - +file_exists is never used - <-- line 89 - let file_exists (t : t) file = File_hash.mem t.deps file [@@dead "+file_exists"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/file_deps.ml", line 91, characters 0-51 - +files_count is never used - <-- line 91 - let files_count (t : t) = File_set.cardinal t.files [@@dead "+files_count"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/file_deps.ml", line 93, characters 0-48 - +deps_count is never used - <-- line 93 - let deps_count (t : t) = File_hash.length t.deps [@@dead "+deps_count"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/file_deps.ml", line 97, characters 0-2717 - +iter_files_from_roots_to_leaves is never used - <-- line 97 - else set |> File_set.iter (fun file_name -> iter_fun file_name)) [@@dead "+iter_files_from_roots_to_leaves"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/file_deps.mli", line 31, characters 0-33 - +freeze_builder is never used - <-- line 31 - val freeze_builder : builder -> t [@@dead "+freeze_builder"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/file_deps.mli", line 35, characters 0-33 - +merge_all is never used - <-- line 35 - val merge_all : builder list -> t [@@dead "+merge_all"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/file_deps.mli", line 51, characters 0-65 - +create is never used - <-- line 51 - val create : files:File_set.t -> deps:File_set.t File_hash.t -> t [@@dead "+create"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/file_deps.mli", line 56, characters 0-31 - +get_files is never used - <-- line 56 - val get_files : t -> File_set.t [@@dead "+get_files"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/file_deps.mli", line 59, characters 0-40 - +get_deps is never used - <-- line 59 - val get_deps : t -> string -> File_set.t [@@dead "+get_deps"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/file_deps.mli", line 62, characters 0-59 - +iter_deps is never used - <-- line 62 - val iter_deps : t -> (string -> File_set.t -> unit) -> unit [@@dead "+iter_deps"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/file_deps.mli", line 65, characters 0-37 - +file_exists is never used - <-- line 65 - val file_exists : t -> string -> bool [@@dead "+file_exists"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/file_deps.mli", line 68, characters 0-26 - +files_count is never used - <-- line 68 - val files_count : t -> int [@@dead "+files_count"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/file_deps.mli", line 71, characters 0-25 - +deps_count is never used - <-- line 71 - val deps_count : t -> int [@@dead "+deps_count"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/file_deps.mli", line 76, characters 0-67 - +iter_files_from_roots_to_leaves is never used - <-- line 76 - val iter_files_from_roots_to_leaves : t -> (string -> unit) -> unit [@@dead "+iter_files_from_roots_to_leaves"] - Warning Dead Module File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/file_hash.ml", line 1, characters 0-0 +file_hash is a dead module as all its items are dead. @@ -1461,6 +1341,18 @@ <-- line 58 val add_to_file_deps_builder : t -> file_deps:File_deps.builder -> unit [@@dead "+add_to_file_deps_builder"] + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reactive_merge.ml", line 14, characters 2-49 + t.file_deps_map is a record label never used to read a value + <-- line 14 + file_deps_map: (string, File_set.t) Reactive.t; [@dead "t.file_deps_map"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reactive_merge.ml", line 15, characters 2-35 + t.files is a record label never used to read a value + <-- line 15 + files: (string, unit) Reactive.t; [@dead "t.files"] + Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reactive_merge.ml", line 159, characters 0-199 +freeze_decls is never used @@ -1485,11 +1377,17 @@ <-- line 224 } [@@dead "+collect_cross_file_items"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reactive_merge.ml", line 243, characters 0-1044 - +freeze_file_deps is never used - <-- line 243 - File_deps.create ~files ~deps [@@dead "+freeze_file_deps"] + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reactive_merge.mli", line 35, characters 2-49 + t.file_deps_map is a record label never used to read a value + <-- line 35 + file_deps_map: (string, File_set.t) Reactive.t; [@dead "t.file_deps_map"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reactive_merge.mli", line 36, characters 2-35 + t.files is a record label never used to read a value + <-- line 36 + files: (string, unit) Reactive.t; [@dead "t.files"] Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reactive_merge.mli", line 51, characters 0-38 @@ -1515,12 +1413,6 @@ <-- line 60 val collect_cross_file_items : t -> Cross_file_items.t [@@dead "+collect_cross_file_items"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reactive_merge.mli", line 63, characters 0-39 - +freeze_file_deps is never used - <-- line 63 - val freeze_file_deps : t -> File_deps.t [@@dead "+freeze_file_deps"] - Warning Dead Type File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reactive_solver.ml", line 30, characters 2-75 t.annotations is a record label never used to read a value @@ -17007,4 +16899,4 @@ <-- line 38 val peek_minus : t -> bool [@@dead "+peek_minus"] - Analysis reported 2970 issues (Warning Dead Module:150, Warning Dead Type:379, Warning Dead Value:2185, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:195, Warning Unused Argument:24) + Analysis reported 2952 issues (Warning Dead Module:150, Warning Dead Type:383, Warning Dead Value:2163, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:195, Warning Unused Argument:24) diff --git a/analysis/reanalyze/src/file_deps.ml b/analysis/reanalyze/src/file_deps.ml index d02a040a77b..126ae51fc7b 100644 --- a/analysis/reanalyze/src/file_deps.ml +++ b/analysis/reanalyze/src/file_deps.ml @@ -10,13 +10,6 @@ module File_hash = Hashtbl.Make (struct let equal (x : t) y = x = y end) -(** {2 Types} *) - -type t = { - files: File_set.t; - deps: File_set.t File_hash.t; (* from_file -> set of to_files *) -} - type builder = {mutable files: File_set.t; deps: File_set.t File_hash.t} (** {2 Builder API} *) @@ -52,18 +45,6 @@ let merge_into_builder ~(from : builder) ~(into : builder) = File_hash.replace into.deps from_file (File_set.union existing to_files)) from.deps -let freeze_builder (b : builder) : t = - (* This is a zero-copy operation, so it's "unsafe" if the builder is - subsequently mutated. However, the calling discipline is that the - builder is no longer used after freezing. *) - {files = b.files; deps = b.deps} - -let merge_all (builders : builder list) : t = - let merged_builder = create_builder () in - builders - |> List.iter (fun b -> merge_into_builder ~from:b ~into:merged_builder); - freeze_builder merged_builder - (** {2 Builder extraction for reactive merge} *) let builder_files (builder : builder) : File_set.t = builder.files @@ -72,86 +53,3 @@ let builder_deps_to_list (builder : builder) : (string * File_set.t) list = File_hash.fold (fun from_file to_files acc -> (from_file, to_files) :: acc) builder.deps [] - -let create ~files ~deps : t = {files; deps} - -(** {2 Read-only API} *) - -let get_files (t : t) = t.files - -let get_deps (t : t) file = - match File_hash.find_opt t.deps file with - | Some s -> s - | None -> File_set.empty - -let iter_deps (t : t) f = File_hash.iter f t.deps - -let file_exists (t : t) file = File_hash.mem t.deps file - -let files_count (t : t) = File_set.cardinal t.files - -let deps_count (t : t) = File_hash.length t.deps - -(** {2 Topological ordering} *) - -let iter_files_from_roots_to_leaves (t : t) iter_fun = - (* For each file, the number of incoming references *) - let inverse_references = (Hashtbl.create 256 : (string, int) Hashtbl.t) in - (* For each number of incoming references, the files *) - let references_by_number = - (Hashtbl.create 256 : (int, File_set.t) Hashtbl.t) - in - let get_num file_name = - try Hashtbl.find inverse_references file_name with Not_found -> 0 - in - let get_set num = - try Hashtbl.find references_by_number num with Not_found -> File_set.empty - in - let add_incoming_edge file_name = - let old_num = get_num file_name in - let new_num = old_num + 1 in - let old_set_at_num = get_set old_num in - let new_set_at_num = File_set.remove file_name old_set_at_num in - let old_set_at_new_num = get_set new_num in - let new_set_at_new_num = File_set.add file_name old_set_at_new_num in - Hashtbl.replace inverse_references file_name new_num; - Hashtbl.replace references_by_number old_num new_set_at_num; - Hashtbl.replace references_by_number new_num new_set_at_new_num - in - let remove_incoming_edge file_name = - let old_num = get_num file_name in - let new_num = old_num - 1 in - let old_set_at_num = get_set old_num in - let new_set_at_num = File_set.remove file_name old_set_at_num in - let old_set_at_new_num = get_set new_num in - let new_set_at_new_num = File_set.add file_name old_set_at_new_num in - Hashtbl.replace inverse_references file_name new_num; - Hashtbl.replace references_by_number old_num new_set_at_num; - Hashtbl.replace references_by_number new_num new_set_at_new_num - in - let add_edge from_file to_file = - if file_exists t from_file then add_incoming_edge to_file - in - let remove_edge from_file to_file = - if file_exists t from_file then remove_incoming_edge to_file - in - iter_deps t (fun from_file set -> - if get_num from_file = 0 then - Hashtbl.replace references_by_number 0 - (File_set.add from_file (get_set 0)); - set |> File_set.iter (fun to_file -> add_edge from_file to_file)); - while get_set 0 <> File_set.empty do - let files_with_no_incoming_references = get_set 0 in - Hashtbl.remove references_by_number 0; - files_with_no_incoming_references - |> File_set.iter (fun file_name -> - iter_fun file_name; - let references = get_deps t file_name in - references - |> File_set.iter (fun to_file -> remove_edge file_name to_file)) - done; - (* Process any remaining items in case of circular references *) - references_by_number - |> Hashtbl.iter (fun _num set -> - if File_set.is_empty set then () - else set |> File_set.iter (fun file_name -> iter_fun file_name)) diff --git a/analysis/reanalyze/src/file_deps.mli b/analysis/reanalyze/src/file_deps.mli index 3e43a806e37..db83dc51246 100644 --- a/analysis/reanalyze/src/file_deps.mli +++ b/analysis/reanalyze/src/file_deps.mli @@ -1,14 +1,7 @@ (** File dependencies collected during AST processing. - - Tracks which files reference which other files. - Two types are provided: - - [builder] - mutable, for AST processing - - [t] - immutable, for analysis *) -(** {2 Types} *) - -type t -(** Immutable file dependencies - for analysis *) + Tracks which files reference which other files with a mutable [builder]. + Reactive merge consumes builders through extraction helpers. *) type builder (** Mutable builder - for AST processing *) @@ -28,13 +21,6 @@ val add_dep : builder -> from_file:string -> to_file:string -> unit val merge_into_builder : from:builder -> into:builder -> unit (** Merge one builder into another. *) -val freeze_builder : builder -> t -(** Freeze a builder into an immutable result. - Note: Zero-copy - caller must not mutate builder after freezing. *) - -val merge_all : builder list -> t -(** Merge all builders into one immutable result. Order doesn't matter. *) - (** {2 Builder extraction for reactive merge} *) val builder_files : builder -> File_set.t @@ -42,37 +28,3 @@ val builder_files : builder -> File_set.t val builder_deps_to_list : builder -> (string * File_set.t) list (** Extract all deps as a list for reactive merge *) - -(** {2 Internal types (for ReactiveMerge)} *) - -module File_hash : Hashtbl.S with type key = string -(** File-keyed hashtable *) - -val create : files:File_set.t -> deps:File_set.t File_hash.t -> t -(** Create a FileDeps.t from files set and deps hashtable *) - -(** {2 Read-only API for t - for analysis} *) - -val get_files : t -> File_set.t -(** Get all files. *) - -val get_deps : t -> string -> File_set.t -(** Get files that a given file depends on. *) - -val iter_deps : t -> (string -> File_set.t -> unit) -> unit -(** Iterate over all file dependencies. *) - -val file_exists : t -> string -> bool -(** Check if a file exists in the graph. *) - -val files_count : t -> int -(** Count of files in the file set. *) - -val deps_count : t -> int -(** Count of dependencies (number of from_file entries). *) - -(** {2 Topological ordering} *) - -val iter_files_from_roots_to_leaves : t -> (string -> unit) -> unit -(** Iterate over files in topological order (roots first, leaves last). - Files with no incoming references are processed first. *) diff --git a/analysis/reanalyze/src/reactive_merge.ml b/analysis/reanalyze/src/reactive_merge.ml index 6c376e0efa6..d197630b9a7 100644 --- a/analysis/reanalyze/src/reactive_merge.ml +++ b/analysis/reanalyze/src/reactive_merge.ml @@ -237,35 +237,3 @@ let collect_cross_file_items (t : t) : Cross_file_items.t = optional_arg_calls = !optional_arg_calls; function_refs = !function_refs; } - -(** Convert reactive file deps to FileDeps.t for solver. - Includes file deps from exception refs. *) -let freeze_file_deps (t : t) : File_deps.t = - let files = - let result = ref File_set.empty in - Reactive.iter (fun path () -> result := File_set.add path !result) t.files; - !result - in - let deps = File_deps.File_hash.create 256 in - Reactive.iter - (fun from_file to_files -> - File_deps.File_hash.replace deps from_file to_files) - t.file_deps_map; - (* Add file deps from exception refs - iterate value_refs_from *) - Reactive.iter - (fun pos_from pos_to_set -> - Pos_set.iter - (fun pos_to -> - let from_file = pos_from.Lexing.pos_fname in - let to_file = pos_to.Lexing.pos_fname in - if from_file <> to_file then - let existing = - match File_deps.File_hash.find_opt deps from_file with - | Some s -> s - | None -> File_set.empty - in - File_deps.File_hash.replace deps from_file - (File_set.add to_file existing)) - pos_to_set) - t.exception_refs.resolved_refs_from; - File_deps.create ~files ~deps diff --git a/analysis/reanalyze/src/reactive_merge.mli b/analysis/reanalyze/src/reactive_merge.mli index d170b398407..ffc0be52328 100644 --- a/analysis/reanalyze/src/reactive_merge.mli +++ b/analysis/reanalyze/src/reactive_merge.mli @@ -59,6 +59,3 @@ val freeze_refs : t -> References.t val collect_cross_file_items : t -> Cross_file_items.t (** Collect all cross-file items *) - -val freeze_file_deps : t -> File_deps.t -(** Convert reactive file deps to FileDeps.t for solver *) diff --git a/scripts/dce/live-findings.md b/scripts/dce/live-findings.md index 0613f0f7f71..cb5cac22c37 100644 --- a/scripts/dce/live-findings.md +++ b/scripts/dce/live-findings.md @@ -149,6 +149,18 @@ live after manual validation. immutable store types. Reanalyze reports them because the caller sits in the reactive pipeline, which is affected by the cross-module liveness blind spot. +### `File_deps.File_hash` callbacks + +- Report: `Warning Dead Module` and `Warning Dead Value`, + `analysis/reanalyze/src/file_deps.ml`, `File_hash.hash` and `File_hash.equal`. +- Verdict: live; false positive. +- Validation: `File_deps.create_builder`, `add_file`, `add_dep`, + `merge_into_builder`, and the reactive merge extraction helpers all use the + `File_hash` table produced by `Hashtbl.Make`. +- Context: `hash` and `equal` are callbacks consumed by the hashtable functor, + so they can look unreferenced as ordinary values even though table operations + depend on them. + ### `Arnold` ordered-set compare callbacks - Report: `Warning Dead Value`, `analysis/reanalyze/src/arnold.ml`, From 377e201e62e3593744d3e6e39ed59622119aef53 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 12:22:35 +0000 Subject: [PATCH 075/214] dce: remove analyzer helpers --- _dce/report.txt | 74 +------------------ analysis/reanalyze/src/issue.ml | 1 - analysis/reanalyze/src/issues.ml | 1 - analysis/reanalyze/src/liveness.ml | 5 -- analysis/reanalyze/src/liveness.mli | 3 - analysis/reanalyze/src/log_.ml | 2 - analysis/reanalyze/src/optional_args.ml | 3 - analysis/reanalyze/src/reactive_analysis.ml | 3 - .../reanalyze/src/reactive_exception_refs.ml | 28 +------ .../reanalyze/src/reactive_exception_refs.mli | 13 +--- 10 files changed, 3 insertions(+), 130 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index 31852126c29..3743e2dd992 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -1221,24 +1221,6 @@ <-- line 7 let equal (x : t) y = x = y [@@dead "+equal"] - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/issue.ml", line 32, characters 2-33 - description.Circular is a variant case which is never constructed - <-- line 32 - | Circular of {message: string} [@dead "description.Circular"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/liveness.ml", line 259, characters 0-113 - +is_live_forward is never used - <-- line 259 - Pos_hash.mem live pos [@@dead "+is_live_forward"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/liveness.mli", line 33, characters 0-76 - +is_live_forward is never used - <-- line 33 - val is_live_forward : live:live_reason Pos_hash.t -> Lexing.position -> bool [@@dead "+is_live_forward"] - Warning Dead Module File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/loc_set.ml", line 1, characters 0-0 +loc_set is a dead module as all its items are dead. @@ -1261,18 +1243,6 @@ <-- line 3 val compare : t -> t -> int [@@dead "+compare"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/optional_args.ml", line 40, characters 0-48 - +iter_unused is never used - <-- line 40 - let iter_unused f x = String_set.iter f x.unused [@@dead "+iter_unused"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/optional_args.ml", line 41, characters 0-79 - +iter_always_used is never used - <-- line 41 - let iter_always_used f x = String_set.iter (fun s -> f s x.count) x.always_used [@@dead "+iter_always_used"] - Warning Dead Module File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/pos_hash.ml", line 1, characters 0-0 +pos_hash is a dead module as all its items are dead. @@ -1299,48 +1269,6 @@ <-- line 7 let compare = compare [@@dead "+compare"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reactive_analysis.ml", line 135, characters 0-72 - +length is never used - <-- line 135 - let length (collection : t) = Reactive_file_collection.length collection [@@dead "+length"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reactive_exception_refs.ml", line 13, characters 2-55 - t.exception_decls is a record label never used to read a value - <-- line 13 - exception_decls: (Dce_path.t, Location.t) Reactive.t; [@dead "t.exception_decls"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reactive_exception_refs.ml", line 75, characters 0-252 - +add_to_refs_builder is never used - <-- line 75 - t.resolved_refs [@@dead "+add_to_refs_builder"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reactive_exception_refs.ml", line 84, characters 0-418 - +add_to_file_deps_builder is never used - <-- line 84 - t.resolved_refs [@@dead "+add_to_file_deps_builder"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reactive_exception_refs.mli", line 35, characters 2-55 - t.exception_decls is a record label never used to read a value - <-- line 35 - exception_decls: (Dce_path.t, Location.t) Reactive.t; [@dead "t.exception_decls"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reactive_exception_refs.mli", line 55, characters 0-62 - +add_to_refs_builder is never used - <-- line 55 - val add_to_refs_builder : t -> refs:References.builder -> unit [@@dead "+add_to_refs_builder"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reactive_exception_refs.mli", line 58, characters 0-71 - +add_to_file_deps_builder is never used - <-- line 58 - val add_to_file_deps_builder : t -> file_deps:File_deps.builder -> unit [@@dead "+add_to_file_deps_builder"] - Warning Dead Type File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reactive_merge.ml", line 14, characters 2-49 t.file_deps_map is a record label never used to read a value @@ -16899,4 +16827,4 @@ <-- line 38 val peek_minus : t -> bool [@@dead "+peek_minus"] - Analysis reported 2952 issues (Warning Dead Module:150, Warning Dead Type:383, Warning Dead Value:2163, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:195, Warning Unused Argument:24) + Analysis reported 2940 issues (Warning Dead Module:150, Warning Dead Type:380, Warning Dead Value:2154, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:195, Warning Unused Argument:24) diff --git a/analysis/reanalyze/src/issue.ml b/analysis/reanalyze/src/issue.ml index 4aa9bb76a69..767922a0fa1 100644 --- a/analysis/reanalyze/src/issue.ml +++ b/analysis/reanalyze/src/issue.ml @@ -29,7 +29,6 @@ type dead_warning = | IncorrectDeadAnnotation type description = - | Circular of {message: string} | ExceptionAnalysis of {message: string} | ExceptionAnalysisMissing of missing_throw_info | DeadModule of {message: string} diff --git a/analysis/reanalyze/src/issues.ml b/analysis/reanalyze/src/issues.ml index 62f64523703..0218f472a50 100644 --- a/analysis/reanalyze/src/issues.ml +++ b/analysis/reanalyze/src/issues.ml @@ -4,7 +4,6 @@ let error_termination = "Error Termination" let exception_analysis = "Exception Analysis" let incorrect_dead_annotation = "Incorrect Dead Annotation" let termination_analysis_internal = "Termination Analysis Internal" -let warning_dead_analysis_cycle = "Warning Dead Analysis Cycle" let warning_dead_exception = "Warning Dead Exception" let warning_dead_module = "Warning Dead Module" let warning_dead_type = "Warning Dead Type" diff --git a/analysis/reanalyze/src/liveness.ml b/analysis/reanalyze/src/liveness.ml index c40f4b3426e..2e4615718c2 100644 --- a/analysis/reanalyze/src/liveness.ml +++ b/analysis/reanalyze/src/liveness.ml @@ -255,11 +255,6 @@ let compute_forward ~debug ~(decl_store : Declaration_store.t) (live, decl_refs_index) -(** Check if a position is live according to forward-computed liveness *) -let is_live_forward ~(live : live_reason Pos_hash.t) (pos : Lexing.position) : - bool = - Pos_hash.mem live pos - (** Get the reason why a position is live, if it is *) let get_live_reason ~(live : live_reason Pos_hash.t) (pos : Lexing.position) : live_reason option = diff --git a/analysis/reanalyze/src/liveness.mli b/analysis/reanalyze/src/liveness.mli index c2a3c2b3e77..d467fc9354a 100644 --- a/analysis/reanalyze/src/liveness.mli +++ b/analysis/reanalyze/src/liveness.mli @@ -30,9 +30,6 @@ val compute_forward : decl_pos -> (value_targets, type_targets). Pass [~debug:true] for verbose output. *) -val is_live_forward : live:live_reason Pos_hash.t -> Lexing.position -> bool -(** Check if a position is live according to forward-computed liveness *) - val get_live_reason : live:live_reason Pos_hash.t -> Lexing.position -> live_reason option (** Get the reason why a position is live, if it is *) diff --git a/analysis/reanalyze/src/log_.ml b/analysis/reanalyze/src/log_.ml index f365b1f1c6c..85254b4af67 100644 --- a/analysis/reanalyze/src/log_.ml +++ b/analysis/reanalyze/src/log_.ml @@ -125,7 +125,6 @@ let missing_throw_info_to_message let description_to_message (description : Issue.description) = match description with - | Circular {message} -> message | DeadModule {message} -> message | DeadOptional {message} -> message | DeadWarning {path; message} -> @@ -137,7 +136,6 @@ let description_to_message (description : Issue.description) = let description_to_name (description : Issue.description) = match description with - | Circular _ -> Issues.warning_dead_analysis_cycle | DeadModule _ -> Issues.warning_dead_module | DeadOptional {dead_optional = WarningUnusedArgument} -> Issues.warning_unused_argument diff --git a/analysis/reanalyze/src/optional_args.ml b/analysis/reanalyze/src/optional_args.ml index 6974f1580ec..a98d4cbe406 100644 --- a/analysis/reanalyze/src/optional_args.ml +++ b/analysis/reanalyze/src/optional_args.ml @@ -37,9 +37,6 @@ let combine_pair x y = let always_used = String_set.inter x.always_used y.always_used in ({x with unused; always_used}, {y with unused; always_used}) -let iter_unused f x = String_set.iter f x.unused -let iter_always_used f x = String_set.iter (fun s -> f s x.count) x.always_used - let fold_unused f x init = String_set.fold f x.unused init let fold_always_used f x init = diff --git a/analysis/reanalyze/src/reactive_analysis.ml b/analysis/reanalyze/src/reactive_analysis.ml index be535742286..38a0d213011 100644 --- a/analysis/reanalyze/src/reactive_analysis.ml +++ b/analysis/reanalyze/src/reactive_analysis.ml @@ -131,9 +131,6 @@ let process_files ~(collection : t) ~config:_ cmt_file_paths : }, stats )) -(** Get collection length *) -let length (collection : t) = Reactive_file_collection.length collection - (** Get the underlying reactive collection for composition. Returns (path, file_data option) suitable for ReactiveMerge. *) let to_file_data_collection (collection : t) : diff --git a/analysis/reanalyze/src/reactive_exception_refs.ml b/analysis/reanalyze/src/reactive_exception_refs.ml index bafd2673f06..b0cd3c21331 100644 --- a/analysis/reanalyze/src/reactive_exception_refs.ml +++ b/analysis/reanalyze/src/reactive_exception_refs.ml @@ -10,8 +10,6 @@ (** {1 Types} *) type t = { - exception_decls: (Dce_path.t, Location.t) Reactive.t; - resolved_refs: (Lexing.position, Pos_set.t) Reactive.t; resolved_refs_from: (Lexing.position, Pos_set.t) Reactive.t; } (** Reactive exception ref collections *) @@ -67,28 +65,4 @@ let create ~(decls : (Lexing.position, Decl.t) Reactive.t) ~merge:Pos_set.union () in - {exception_decls; resolved_refs; resolved_refs_from} - -(** {1 Freezing} *) - -(** Add all resolved exception refs to a References.builder *) -let add_to_refs_builder (t : t) ~(refs : References.builder) : unit = - Reactive.iter - (fun pos_to pos_from_set -> - Pos_set.iter - (fun pos_from -> References.add_value_ref refs ~pos_to ~pos_from) - pos_from_set) - t.resolved_refs - -(** Add file dependencies for resolved refs *) -let add_to_file_deps_builder (t : t) ~(file_deps : File_deps.builder) : unit = - Reactive.iter - (fun pos_to pos_from_set -> - Pos_set.iter - (fun pos_from -> - let from_file = pos_from.Lexing.pos_fname in - let to_file = pos_to.Lexing.pos_fname in - if from_file <> to_file then - File_deps.add_dep file_deps ~from_file ~to_file) - pos_from_set) - t.resolved_refs + {resolved_refs_from} diff --git a/analysis/reanalyze/src/reactive_exception_refs.mli b/analysis/reanalyze/src/reactive_exception_refs.mli index c418057c598..cd58ca4b0c3 100644 --- a/analysis/reanalyze/src/reactive_exception_refs.mli +++ b/analysis/reanalyze/src/reactive_exception_refs.mli @@ -26,15 +26,12 @@ ~decls:merged.decls ~exception_refs:(flatMap cross_file ~f:extract_exception_refs ()) in - ReactiveExceptionRefs.add_to_refs_builder exc_refs ~refs:my_refs_builder + Reactive.iter (fun pos refs -> ...) exc_refs.resolved_refs_from ]} *) (** {1 Types} *) type t = { - exception_decls: (Dce_path.t, Location.t) Reactive.t; - resolved_refs: (Lexing.position, Pos_set.t) Reactive.t; - (** refs_to direction: target -> sources *) resolved_refs_from: (Lexing.position, Pos_set.t) Reactive.t; (** refs_from direction: source -> targets (for forward solver) *) } @@ -49,11 +46,3 @@ val create : (** Create reactive exception refs from decls and cross-file exception refs. When the source collections change, resolved refs automatically update. *) - -(** {1 Freezing} *) - -val add_to_refs_builder : t -> refs:References.builder -> unit -(** Add all resolved exception refs to a References.builder. *) - -val add_to_file_deps_builder : t -> file_deps:File_deps.builder -> unit -(** Add file dependencies for resolved refs. *) From ff2f8fe0e00cd4347bcbac4713d2b6d8da9d4070 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 12:27:59 +0000 Subject: [PATCH 076/214] dce: trim reactive exports --- _dce/report.txt | 230 +----------------- analysis/reanalyze/src/declarations.ml | 2 - analysis/reanalyze/src/declarations.mli | 3 - analysis/reanalyze/src/file_annotations.ml | 2 - analysis/reanalyze/src/file_annotations.mli | 3 - analysis/reanalyze/src/file_deps.ml | 9 - analysis/reanalyze/src/file_deps.mli | 11 +- analysis/reanalyze/src/reactive_merge.ml | 115 --------- analysis/reanalyze/src/reactive_merge.mli | 19 -- analysis/reanalyze/src/reactive_type_deps.ml | 37 +-- analysis/reanalyze/src/reactive_type_deps.mli | 19 +- analysis/reanalyze/src/references.ml | 15 -- analysis/reanalyze/src/references.mli | 14 -- scripts/dce/live-findings.md | 30 +-- 14 files changed, 21 insertions(+), 488 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index 3743e2dd992..b90413071a8 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -1153,18 +1153,6 @@ <-- line 72 let compare = Stdlib.compare [@@dead "Path_map.+compare"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/declarations.ml", line 38, characters 0-55 - +create_from_hashtbl is never used - <-- line 38 - let create_from_hashtbl (h : Decl.t Pos_hash.t) : t = h [@@dead "+create_from_hashtbl"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/declarations.mli", line 33, characters 0-48 - +create_from_hashtbl is never used - <-- line 33 - val create_from_hashtbl : Decl.t Pos_hash.t -> t [@@dead "+create_from_hashtbl"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/exn.ml", line 3, characters 0-28 +compare is never used @@ -1177,18 +1165,6 @@ <-- line 3 val compare : t -> t -> int [@@dead "+compare"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/file_annotations.ml", line 41, characters 0-61 - +create_from_hashtbl is never used - <-- line 41 - let create_from_hashtbl (h : annotated_as Pos_hash.t) : t = h [@@dead "+create_from_hashtbl"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/file_annotations.mli", line 35, characters 0-54 - +create_from_hashtbl is never used - <-- line 35 - val create_from_hashtbl : annotated_as Pos_hash.t -> t [@@dead "+create_from_hashtbl"] - Warning Dead Module File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/file_deps.ml", line 6, characters 0-129 +file_deps.File_hash is a dead module as all its items are dead. @@ -1269,78 +1245,6 @@ <-- line 7 let compare = compare [@@dead "+compare"] - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reactive_merge.ml", line 14, characters 2-49 - t.file_deps_map is a record label never used to read a value - <-- line 14 - file_deps_map: (string, File_set.t) Reactive.t; [@dead "t.file_deps_map"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reactive_merge.ml", line 15, characters 2-35 - t.files is a record label never used to read a value - <-- line 15 - files: (string, unit) Reactive.t; [@dead "t.files"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reactive_merge.ml", line 159, characters 0-199 - +freeze_decls is never used - <-- line 159 - Declarations.create_from_hashtbl result [@@dead "+freeze_decls"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reactive_merge.ml", line 165, characters 0-217 - +freeze_annotations is never used - <-- line 165 - File_annotations.create_from_hashtbl result [@@dead "+freeze_annotations"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reactive_merge.ml", line 172, characters 0-1474 - +freeze_refs is never used - <-- line 172 - References.create ~value_refs_from ~type_refs_from [@@dead "+freeze_refs"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reactive_merge.ml", line 224, characters 0-630 - +collect_cross_file_items is never used - <-- line 224 - } [@@dead "+collect_cross_file_items"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reactive_merge.mli", line 35, characters 2-49 - t.file_deps_map is a record label never used to read a value - <-- line 35 - file_deps_map: (string, File_set.t) Reactive.t; [@dead "t.file_deps_map"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reactive_merge.mli", line 36, characters 2-35 - t.files is a record label never used to read a value - <-- line 36 - files: (string, unit) Reactive.t; [@dead "t.files"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reactive_merge.mli", line 51, characters 0-38 - +freeze_decls is never used - <-- line 51 - val freeze_decls : t -> Declarations.t [@@dead "+freeze_decls"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reactive_merge.mli", line 54, characters 0-48 - +freeze_annotations is never used - <-- line 54 - val freeze_annotations : t -> File_annotations.t [@@dead "+freeze_annotations"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reactive_merge.mli", line 57, characters 0-35 - +freeze_refs is never used - <-- line 57 - val freeze_refs : t -> References.t [@@dead "+freeze_refs"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reactive_merge.mli", line 60, characters 0-54 - +collect_cross_file_items is never used - <-- line 60 - val collect_cross_file_items : t -> Cross_file_items.t [@@dead "+collect_cross_file_items"] - Warning Dead Type File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reactive_solver.ml", line 30, characters 2-75 t.annotations is a record label never used to read a value @@ -1353,90 +1257,6 @@ <-- line 44 config: Dce_config.t; [@dead "t.config"] - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reactive_type_deps.ml", line 14, characters 2-27 - decl_info.pos_end is a record label never used to read a value - <-- line 14 - pos_end: Lexing.position; [@dead "decl_info.pos_end"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reactive_type_deps.ml", line 36, characters 2-56 - t.decl_by_path is a record label never used to read a value - <-- line 36 - decl_by_path: (Dce_path.t, decl_info list) Reactive.t; [@dead "t.decl_by_path"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reactive_type_deps.ml", line 38, characters 2-58 - t.same_path_refs is a record label never used to read a value - <-- line 38 - same_path_refs: (Lexing.position, Pos_set.t) Reactive.t; [@dead "t.same_path_refs"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reactive_type_deps.ml", line 39, characters 2-59 - t.cross_file_refs is a record label never used to read a value - <-- line 39 - cross_file_refs: (Lexing.position, Pos_set.t) Reactive.t; [@dead "t.cross_file_refs"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reactive_type_deps.ml", line 41, characters 2-67 - t.impl_to_intf_refs_path2 is a record label never used to read a value - <-- line 41 - impl_to_intf_refs_path2: (Lexing.position, Pos_set.t) Reactive.t; [@dead "t.impl_to_intf_refs_path2"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reactive_type_deps.ml", line 42, characters 2-61 - t.intf_to_impl_refs is a record label never used to read a value - <-- line 42 - intf_to_impl_refs: (Lexing.position, Pos_set.t) Reactive.t; [@dead "t.intf_to_impl_refs"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reactive_type_deps.ml", line 242, characters 0-251 - +add_to_refs_builder is never used - <-- line 242 - t.all_type_refs [@@dead "+add_to_refs_builder"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reactive_type_deps.mli", line 33, characters 2-56 - t.decl_by_path is a record label never used to read a value - <-- line 33 - decl_by_path: (Dce_path.t, decl_info list) Reactive.t; [@dead "t.decl_by_path"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reactive_type_deps.mli", line 35, characters 2-58 - t.same_path_refs is a record label never used to read a value - <-- line 35 - same_path_refs: (Lexing.position, Pos_set.t) Reactive.t; [@dead "t.same_path_refs"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reactive_type_deps.mli", line 36, characters 2-59 - t.cross_file_refs is a record label never used to read a value - <-- line 36 - cross_file_refs: (Lexing.position, Pos_set.t) Reactive.t; [@dead "t.cross_file_refs"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reactive_type_deps.mli", line 38, characters 2-67 - t.impl_to_intf_refs_path2 is a record label never used to read a value - <-- line 38 - impl_to_intf_refs_path2: (Lexing.position, Pos_set.t) Reactive.t; [@dead "t.impl_to_intf_refs_path2"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reactive_type_deps.mli", line 39, characters 2-61 - t.intf_to_impl_refs is a record label never used to read a value - <-- line 39 - intf_to_impl_refs: (Lexing.position, Pos_set.t) Reactive.t; [@dead "t.intf_to_impl_refs"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reactive_type_deps.mli", line 47, characters 2-27 - decl_info.pos_end is a record label never used to read a value - <-- line 47 - pos_end: Lexing.position; [@dead "decl_info.pos_end"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reactive_type_deps.mli", line 68, characters 0-62 - +add_to_refs_builder is never used - <-- line 68 - val add_to_refs_builder : t -> refs:References.builder -> unit [@@dead "+add_to_refs_builder"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reanalyze_server.ml", line 74, characters 2-79 Server.+let* is never used @@ -1449,54 +1269,6 @@ <-- line 108 parse_argv: string array -> string option; [@dead "Server.server_state.parse_argv"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/references.ml", line 47, characters 0-269 - +merge_all is never used - <-- line 47 - } [@@dead "+merge_all"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/references.ml", line 77, characters 0-85 - +create is never used - <-- line 77 - {value_refs_from; type_refs_from} [@@dead "+create"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/references.ml", line 85, characters 0-70 - +value_refs_from_length is never used - <-- line 85 - let value_refs_from_length (t : t) = Pos_hash.length t.value_refs_from [@@dead "+value_refs_from_length"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/references.ml", line 86, characters 0-68 - +type_refs_from_length is never used - <-- line 86 - let type_refs_from_length (t : t) = Pos_hash.length t.type_refs_from [@@dead "+type_refs_from_length"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/references.mli", line 35, characters 0-33 - +merge_all is never used - <-- line 35 - val merge_all : builder list -> t [@@dead "+merge_all"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/references.mli", line 49, characters 0-99 - +create is never used - <-- line 49 - t [@@dead "+create"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/references.mli", line 65, characters 0-37 - +value_refs_from_length is never used - <-- line 65 - val value_refs_from_length : t -> int [@@dead "+value_refs_from_length"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/references.mli", line 66, characters 0-36 - +type_refs_from_length is never used - <-- line 66 - val type_refs_from_length : t -> int [@@dead "+type_refs_from_length"] - Warning Dead Type File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/run_config.ml", line 44, characters 2-12 snapshot.dce is a record label never used to read a value @@ -16827,4 +16599,4 @@ <-- line 38 val peek_minus : t -> bool [@@dead "+peek_minus"] - Analysis reported 2940 issues (Warning Dead Module:150, Warning Dead Type:380, Warning Dead Value:2154, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:195, Warning Unused Argument:24) + Analysis reported 2902 issues (Warning Dead Module:150, Warning Dead Type:364, Warning Dead Value:2132, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:195, Warning Unused Argument:24) diff --git a/analysis/reanalyze/src/declarations.ml b/analysis/reanalyze/src/declarations.ml index 5672666beeb..ef78f8a89c7 100644 --- a/analysis/reanalyze/src/declarations.ml +++ b/analysis/reanalyze/src/declarations.ml @@ -35,8 +35,6 @@ let merge_all (builders : builder list) : t = let builder_to_list (builder : builder) : (Lexing.position * Decl.t) list = Pos_hash.fold (fun pos decl acc -> (pos, decl) :: acc) builder [] -let create_from_hashtbl (h : Decl.t Pos_hash.t) : t = h - (* ===== Read-only API ===== *) let find_opt (t : t) pos = Pos_hash.find_opt t pos diff --git a/analysis/reanalyze/src/declarations.mli b/analysis/reanalyze/src/declarations.mli index c957172a0ce..6470942e639 100644 --- a/analysis/reanalyze/src/declarations.mli +++ b/analysis/reanalyze/src/declarations.mli @@ -30,9 +30,6 @@ val merge_all : builder list -> t val builder_to_list : builder -> (Lexing.position * Decl.t) list (** Extract all declarations as a list for reactive merge *) -val create_from_hashtbl : Decl.t Pos_hash.t -> t -(** Create from hashtable for reactive merge *) - (** {2 Read-only API for t - for solver} *) val find_opt : t -> Lexing.position -> Decl.t option diff --git a/analysis/reanalyze/src/file_annotations.ml b/analysis/reanalyze/src/file_annotations.ml index 69ade081ac1..da19061a0e0 100644 --- a/analysis/reanalyze/src/file_annotations.ml +++ b/analysis/reanalyze/src/file_annotations.ml @@ -38,8 +38,6 @@ let builder_to_list (builder : builder) : (Lexing.position * annotated_as) list = Pos_hash.fold (fun pos value acc -> (pos, value) :: acc) builder [] -let create_from_hashtbl (h : annotated_as Pos_hash.t) : t = h - (* ===== Read-only API ===== *) let is_annotated_dead (state : t) pos = Pos_hash.find_opt state pos = Some Dead diff --git a/analysis/reanalyze/src/file_annotations.mli b/analysis/reanalyze/src/file_annotations.mli index c64f9f984e5..e2751bf01e5 100644 --- a/analysis/reanalyze/src/file_annotations.mli +++ b/analysis/reanalyze/src/file_annotations.mli @@ -32,9 +32,6 @@ val merge_all : builder list -> t val builder_to_list : builder -> (Lexing.position * annotated_as) list (** Extract all annotations as a list for reactive merge *) -val create_from_hashtbl : annotated_as Pos_hash.t -> t -(** Create from hashtable for reactive merge *) - (** {2 Read-only API for t - for solver} *) val is_annotated_dead : t -> Lexing.position -> bool diff --git a/analysis/reanalyze/src/file_deps.ml b/analysis/reanalyze/src/file_deps.ml index 126ae51fc7b..65cb6234bb8 100644 --- a/analysis/reanalyze/src/file_deps.ml +++ b/analysis/reanalyze/src/file_deps.ml @@ -44,12 +44,3 @@ let merge_into_builder ~(from : builder) ~(into : builder) = in File_hash.replace into.deps from_file (File_set.union existing to_files)) from.deps - -(** {2 Builder extraction for reactive merge} *) - -let builder_files (builder : builder) : File_set.t = builder.files - -let builder_deps_to_list (builder : builder) : (string * File_set.t) list = - File_hash.fold - (fun from_file to_files acc -> (from_file, to_files) :: acc) - builder.deps [] diff --git a/analysis/reanalyze/src/file_deps.mli b/analysis/reanalyze/src/file_deps.mli index db83dc51246..aa359a828dd 100644 --- a/analysis/reanalyze/src/file_deps.mli +++ b/analysis/reanalyze/src/file_deps.mli @@ -1,7 +1,6 @@ (** File dependencies collected during AST processing. - Tracks which files reference which other files with a mutable [builder]. - Reactive merge consumes builders through extraction helpers. *) + Tracks which files reference which other files with a mutable [builder]. *) type builder (** Mutable builder - for AST processing *) @@ -20,11 +19,3 @@ val add_dep : builder -> from_file:string -> to_file:string -> unit val merge_into_builder : from:builder -> into:builder -> unit (** Merge one builder into another. *) - -(** {2 Builder extraction for reactive merge} *) - -val builder_files : builder -> File_set.t -(** Get files set from builder *) - -val builder_deps_to_list : builder -> (string * File_set.t) list -(** Extract all deps as a list for reactive merge *) diff --git a/analysis/reanalyze/src/reactive_merge.ml b/analysis/reanalyze/src/reactive_merge.ml index d197630b9a7..8b1158759b1 100644 --- a/analysis/reanalyze/src/reactive_merge.ml +++ b/analysis/reanalyze/src/reactive_merge.ml @@ -11,8 +11,6 @@ type t = { value_refs_from: (Lexing.position, Pos_set.t) Reactive.t; type_refs_from: (Lexing.position, Pos_set.t) Reactive.t; cross_file_items: (string, Cross_file_items.t) Reactive.t; - file_deps_map: (string, File_set.t) Reactive.t; - files: (string, unit) Reactive.t; (* Reactive type/exception dependencies *) type_deps: Reactive_type_deps.t; exception_refs: Reactive_exception_refs.t; @@ -92,32 +90,6 @@ let create (source : (string, Dce_file_processing.file_data option) Reactive.t) () in - (* File deps map: (from_file, FileSet of to_files) with FileSet.union merge *) - let file_deps_map = - Reactive.flat_map ~name:"file_deps_map" source - ~f:(fun _path file_data_opt -> - match file_data_opt with - | None -> [] - | Some file_data -> - File_deps.builder_deps_to_list file_data.Dce_file_processing.file_deps) - ~merge:File_set.union () - in - - (* Files set: (source_path, ()) - just track which source files exist *) - let files = - Reactive.flat_map ~name:"files" source - ~f:(fun _cmt_path file_data_opt -> - match file_data_opt with - | None -> [] - | Some file_data -> - (* Include all source files from file_deps (NOT the CMT path) *) - let file_set = - File_deps.builder_files file_data.Dce_file_processing.file_deps - in - File_set.fold (fun f acc -> (f, ()) :: acc) file_set []) - () - in - (* Extract exception_refs from cross_file_items for ReactiveExceptionRefs *) let exception_refs_collection = Reactive.flat_map ~name:"exception_refs_collection" cross_file_items @@ -147,93 +119,6 @@ let create (source : (string, Dce_file_processing.file_data option) Reactive.t) value_refs_from; type_refs_from; cross_file_items; - file_deps_map; - files; type_deps; exception_refs; } - -(** {1 Conversion to solver-ready format} *) - -(** Convert reactive decls to Declarations.t for solver *) -let freeze_decls (t : t) : Declarations.t = - let result = Pos_hash.create 256 in - Reactive.iter (fun pos decl -> Pos_hash.replace result pos decl) t.decls; - Declarations.create_from_hashtbl result - -(** Convert reactive annotations to FileAnnotations.t for solver *) -let freeze_annotations (t : t) : File_annotations.t = - let result = Pos_hash.create 256 in - Reactive.iter (fun pos ann -> Pos_hash.replace result pos ann) t.annotations; - File_annotations.create_from_hashtbl result - -(** Convert reactive refs to References.t for solver. - Includes type-label deps and exception refs from reactive computations. *) -let freeze_refs (t : t) : References.t = - let value_refs_from = Pos_hash.create 256 in - let type_refs_from = Pos_hash.create 256 in - - (* Helper to add to refs_from hashtable *) - let add_to_from tbl pos_from pos_to = - let existing = - match Pos_hash.find_opt tbl pos_from with - | Some s -> s - | None -> Pos_set.empty - in - Pos_hash.replace tbl pos_from (Pos_set.add pos_to existing) - in - - (* Merge per-file value refs_from *) - Reactive.iter - (fun pos_from pos_to_set -> - Pos_set.iter - (fun pos_to -> add_to_from value_refs_from pos_from pos_to) - pos_to_set) - t.value_refs_from; - - (* Merge per-file type refs_from *) - Reactive.iter - (fun pos_from pos_to_set -> - Pos_set.iter - (fun pos_to -> add_to_from type_refs_from pos_from pos_to) - pos_to_set) - t.type_refs_from; - - (* Add type-label dependency refs from all sources *) - let add_type_refs_from reactive = - Reactive.iter - (fun pos_from pos_to_set -> - Pos_set.iter - (fun pos_to -> add_to_from type_refs_from pos_from pos_to) - pos_to_set) - reactive - in - add_type_refs_from t.type_deps.all_type_refs_from; - - (* Add exception refs (to value refs_from) *) - Reactive.iter - (fun pos_from pos_to_set -> - Pos_set.iter - (fun pos_to -> add_to_from value_refs_from pos_from pos_to) - pos_to_set) - t.exception_refs.resolved_refs_from; - - References.create ~value_refs_from ~type_refs_from - -(** Collect all cross-file items *) -let collect_cross_file_items (t : t) : Cross_file_items.t = - let exception_refs = ref [] in - let optional_arg_calls = ref [] in - let function_refs = ref [] in - Reactive.iter - (fun _path items -> - exception_refs := items.Cross_file_items.exception_refs @ !exception_refs; - optional_arg_calls := - items.Cross_file_items.optional_arg_calls @ !optional_arg_calls; - function_refs := items.Cross_file_items.function_refs @ !function_refs) - t.cross_file_items; - { - Cross_file_items.exception_refs = !exception_refs; - optional_arg_calls = !optional_arg_calls; - function_refs = !function_refs; - } diff --git a/analysis/reanalyze/src/reactive_merge.mli b/analysis/reanalyze/src/reactive_merge.mli index ffc0be52328..2f1c6e15a6c 100644 --- a/analysis/reanalyze/src/reactive_merge.mli +++ b/analysis/reanalyze/src/reactive_merge.mli @@ -17,9 +17,6 @@ (* Access derived collections *) Reactive.iter (fun pos decl -> ...) merged.decls; - - (* Or freeze for solver *) - let decls = ReactiveMerge.freeze_decls merged in ]} *) (** {1 Types} *) @@ -32,8 +29,6 @@ type t = { type_refs_from: (Lexing.position, Pos_set.t) Reactive.t; (** Type refs: source -> targets *) cross_file_items: (string, Cross_file_items.t) Reactive.t; - file_deps_map: (string, File_set.t) Reactive.t; - files: (string, unit) Reactive.t; (* Reactive type/exception dependencies *) type_deps: Reactive_type_deps.t; exception_refs: Reactive_exception_refs.t; @@ -45,17 +40,3 @@ type t = { val create : (string, Dce_file_processing.file_data option) Reactive.t -> t (** Create reactive merge from a file data collection. All derived collections update automatically when source changes. *) - -(** {1 Conversion to solver-ready format} *) - -val freeze_decls : t -> Declarations.t -(** Convert reactive decls to Declarations.t for solver *) - -val freeze_annotations : t -> File_annotations.t -(** Convert reactive annotations to FileAnnotations.t for solver *) - -val freeze_refs : t -> References.t -(** Convert reactive refs to References.t for solver *) - -val collect_cross_file_items : t -> Cross_file_items.t -(** Collect all cross-file items *) diff --git a/analysis/reanalyze/src/reactive_type_deps.ml b/analysis/reanalyze/src/reactive_type_deps.ml index 233f37e67b6..a3775e33704 100644 --- a/analysis/reanalyze/src/reactive_type_deps.ml +++ b/analysis/reanalyze/src/reactive_type_deps.ml @@ -11,7 +11,6 @@ type decl_info = { pos: Lexing.position; - pos_end: Lexing.position; path: Dce_path.t; is_interface: bool; } @@ -26,21 +25,12 @@ let decl_to_info (decl : Decl.t) : decl_info option = | module_name_tag :: _ -> ( try (module_name_tag |> Name.to_string).[0] <> '+' with _ -> true) in - Some - {pos = decl.pos; pos_end = decl.pos_end; path = decl.path; is_interface} + Some {pos = decl.pos; path = decl.path; is_interface} | _ -> None (** {1 Reactive Collections} *) type t = { - decl_by_path: (Dce_path.t, decl_info list) Reactive.t; - (* refs_to direction: target -> sources *) - same_path_refs: (Lexing.position, Pos_set.t) Reactive.t; - cross_file_refs: (Lexing.position, Pos_set.t) Reactive.t; - all_type_refs: (Lexing.position, Pos_set.t) Reactive.t; - impl_to_intf_refs_path2: (Lexing.position, Pos_set.t) Reactive.t; - intf_to_impl_refs: (Lexing.position, Pos_set.t) Reactive.t; - (* refs_from direction: source -> targets (for forward solver) *) all_type_refs_from: (Lexing.position, Pos_set.t) Reactive.t; } (** All reactive collections for type-label dependencies *) @@ -198,10 +188,6 @@ let create ~(decls : (Lexing.position, Decl.t) Reactive.t) - intf_to_impl_refs *) let cross_file_refs = impl_to_intf_refs in - (* All type refs = same_path_refs + all cross-file sources. - We expose these separately and merge in freeze_refs. *) - let all_type_refs = same_path_refs in - (* Create refs_from by combining and inverting all refs_to sources. We use a single flatMap that iterates all sources once. *) let all_type_refs_from = @@ -226,23 +212,4 @@ let create ~(decls : (Lexing.position, Decl.t) Reactive.t) ~merge:Pos_set.union () in - { - decl_by_path; - same_path_refs; - cross_file_refs; - all_type_refs; - impl_to_intf_refs_path2; - intf_to_impl_refs; - all_type_refs_from; - } - -(** {1 Freezing for solver} *) - -(** Add all type refs to a References.builder *) -let add_to_refs_builder (t : t) ~(refs : References.builder) : unit = - Reactive.iter - (fun pos_to pos_from_set -> - Pos_set.iter - (fun pos_from -> References.add_type_ref refs ~pos_to ~pos_from) - pos_from_set) - t.all_type_refs + {all_type_refs_from} diff --git a/analysis/reanalyze/src/reactive_type_deps.mli b/analysis/reanalyze/src/reactive_type_deps.mli index c563ec19717..6423e4f0161 100644 --- a/analysis/reanalyze/src/reactive_type_deps.mli +++ b/analysis/reanalyze/src/reactive_type_deps.mli @@ -24,27 +24,18 @@ ~report_types_dead_only_in_interface:true in (* Type refs update automatically when decls change *) - ReactiveTypeDeps.add_to_refs_builder type_deps ~refs:my_refs_builder + Reactive.iter (fun pos refs -> ...) type_deps.all_type_refs_from ]} *) (** {1 Types} *) type t = { - decl_by_path: (Dce_path.t, decl_info list) Reactive.t; - (* refs_to direction: target -> sources *) - same_path_refs: (Lexing.position, Pos_set.t) Reactive.t; - cross_file_refs: (Lexing.position, Pos_set.t) Reactive.t; - all_type_refs: (Lexing.position, Pos_set.t) Reactive.t; - impl_to_intf_refs_path2: (Lexing.position, Pos_set.t) Reactive.t; - intf_to_impl_refs: (Lexing.position, Pos_set.t) Reactive.t; - (* refs_from direction: source -> targets (for forward solver) *) all_type_refs_from: (Lexing.position, Pos_set.t) Reactive.t; } (** Reactive type-label dependency collections *) and decl_info = { pos: Lexing.position; - pos_end: Lexing.position; path: Dce_path.t; is_interface: bool; } @@ -62,11 +53,3 @@ val create : [report_types_dead_only_in_interface] controls whether refs are bidirectional (false) or only intf->impl (true). *) - -(** {1 Freezing} *) - -val add_to_refs_builder : t -> refs:References.builder -> unit -(** Add all computed type refs to a References.builder. - - Call this after processing files to get the current type refs. - The builder will contain all type-label dependency refs. *) diff --git a/analysis/reanalyze/src/references.ml b/analysis/reanalyze/src/references.ml index 8b917dce9e0..110ef4e7f0e 100644 --- a/analysis/reanalyze/src/references.ml +++ b/analysis/reanalyze/src/references.ml @@ -44,15 +44,6 @@ let merge_into_builder ~(from : builder) ~(into : builder) = |> Pos_set.iter (fun to_pos -> add_set into.type_refs_from pos to_pos)) from.type_refs_from -let merge_all (builders : builder list) : t = - let result = create_builder () in - builders - |> List.iter (fun builder -> merge_into_builder ~from:builder ~into:result); - { - value_refs_from = result.value_refs_from; - type_refs_from = result.type_refs_from; - } - let freeze_builder (builder : builder) : t = (* Zero-copy freeze - builder should not be used after this *) { @@ -74,13 +65,7 @@ let builder_type_refs_from_list (builder : builder) : (fun pos refs acc -> (pos, refs) :: acc) builder.type_refs_from [] -let create ~value_refs_from ~type_refs_from : t = - {value_refs_from; type_refs_from} - (* ===== Read-only API ===== *) let iter_value_refs_from (t : t) f = Pos_hash.iter f t.value_refs_from let iter_type_refs_from (t : t) f = Pos_hash.iter f t.type_refs_from - -let value_refs_from_length (t : t) = Pos_hash.length t.value_refs_from -let type_refs_from_length (t : t) = Pos_hash.length t.type_refs_from diff --git a/analysis/reanalyze/src/references.mli b/analysis/reanalyze/src/references.mli index d4b9ef9b762..2a13ef71930 100644 --- a/analysis/reanalyze/src/references.mli +++ b/analysis/reanalyze/src/references.mli @@ -32,9 +32,6 @@ val add_type_ref : val merge_into_builder : from:builder -> into:builder -> unit (** Merge one builder into another. *) -val merge_all : builder list -> t -(** Merge all builders into one immutable result. Order doesn't matter. *) - val freeze_builder : builder -> t (** Convert builder to immutable t. Builder should not be used after this. *) @@ -46,12 +43,6 @@ val builder_value_refs_from_list : builder -> (Lexing.position * Pos_set.t) list val builder_type_refs_from_list : builder -> (Lexing.position * Pos_set.t) list (** Extract type refs (posFrom -> targets) *) -val create : - value_refs_from:Pos_set.t Pos_hash.t -> - type_refs_from:Pos_set.t Pos_hash.t -> - t -(** Create a References.t from hashtables *) - (** {2 Read-only API - for liveness} *) val iter_value_refs_from : t -> (Lexing.position -> Pos_set.t -> unit) -> unit @@ -59,8 +50,3 @@ val iter_value_refs_from : t -> (Lexing.position -> Pos_set.t -> unit) -> unit val iter_type_refs_from : t -> (Lexing.position -> Pos_set.t -> unit) -> unit (** Iterate all type refs *) - -(** {2 Length} *) - -val value_refs_from_length : t -> int -val type_refs_from_length : t -> int diff --git a/scripts/dce/live-findings.md b/scripts/dce/live-findings.md index cb5cac22c37..4619e354d50 100644 --- a/scripts/dce/live-findings.md +++ b/scripts/dce/live-findings.md @@ -128,26 +128,28 @@ live after manual validation. ### `Reactive_file_collection` live helpers - Report: `Warning Dead Value`, `analysis/reactive/src/reactive_file_collection.ml` - and `.mli`, currently including `length`. + and `.mli`, for collection operations used by the reactive analyzer. - Verdict: live; false positive. - Validation: `analysis/reanalyze/src/reactive_analysis.ml` uses - `Reactive_file_collection.create`, `process_files_batch`, `mem`, `iter`, - `length`, and `to_collection`; `analysis/reanalyze/src/reanalyze.ml` uses + `Reactive_file_collection.create`, `process_files_batch`, `mem`, `iter`, and + `to_collection`; `analysis/reanalyze/src/reanalyze.ml` uses `process_files_batch` and `remove_batch` directly for churn tests. - Context: the single-file/cache-management helpers were removed, but the remaining collection operations are part of the live reactive analyzer path. -### Reactive merge freeze helpers +### Reanalyze collection functor callbacks -- Report: `Warning Dead Value`, `analysis/reanalyze/src/declarations.ml` and - `file_annotations.ml`, `create_from_hashtbl`. +- Report: `Warning Dead Module` and `Warning Dead Value`, + `analysis/reanalyze/src/file_hash.ml`, `loc_set.ml`, `pos_hash.ml`, + `pos_set.ml`, and `Name.compare` in `name.ml` / `.mli`. - Verdict: live; false positive. -- Validation: `analysis/reanalyze/src/reactive_merge.ml` calls - `Declarations.create_from_hashtbl` from `freeze_decls` and - `File_annotations.create_from_hashtbl` from `freeze_annotations`. -- Context: the freeze helpers bridge reactive hashtable aggregation back to the - immutable store types. Reanalyze reports them because the caller sits in the - reactive pipeline, which is affected by the cross-module liveness blind spot. +- Validation: `Pos_hash` and `Pos_set` are used throughout the DCE liveness, + reference, declaration, annotation, and reactive pipelines. `Loc_set` is used + by exception analysis, `File_hash` is the file-keyed table helper, and + `module_path.ml` builds `Name_map = Map.Make (Name)`. +- Context: `hash`, `equal`, and `compare` are callbacks consumed by + `Hashtbl.Make`, `Set.Make`, or `Map.Make`. Reanalyze can miss those callback + edges and report the callback definitions as ordinary unused values. ### `File_deps.File_hash` callbacks @@ -155,8 +157,8 @@ live after manual validation. `analysis/reanalyze/src/file_deps.ml`, `File_hash.hash` and `File_hash.equal`. - Verdict: live; false positive. - Validation: `File_deps.create_builder`, `add_file`, `add_dep`, - `merge_into_builder`, and the reactive merge extraction helpers all use the - `File_hash` table produced by `Hashtbl.Make`. + and `merge_into_builder` all use the `File_hash` table produced by + `Hashtbl.Make`. - Context: `hash` and `equal` are callbacks consumed by the hashtable functor, so they can look unreferenced as ordinary values even though table operations depend on them. From f5a9ffc70375b32ae82682242813baeb3665be6d Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 12:29:36 +0000 Subject: [PATCH 077/214] dce: trim reanalyze state --- _dce/report.txt | 62 +--------------------- analysis/reanalyze/src/reactive_solver.ml | 6 +-- analysis/reanalyze/src/reanalyze_server.ml | 7 --- analysis/reanalyze/src/run_config.ml | 23 +++----- 4 files changed, 9 insertions(+), 89 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index b90413071a8..d77b57d5b30 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -1245,66 +1245,6 @@ <-- line 7 let compare = compare [@@dead "+compare"] - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reactive_solver.ml", line 30, characters 2-75 - t.annotations is a record label never used to read a value - <-- line 30 - annotations: (Lexing.position, File_annotations.annotated_as) Reactive.t; [@dead "t.annotations"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reactive_solver.ml", line 44, characters 2-23 - t.config is a record label never used to read a value - <-- line 44 - config: Dce_config.t; [@dead "t.config"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reanalyze_server.ml", line 74, characters 2-79 - Server.+let* is never used - <-- line 74 - | Error _ as e -> e [@@dead "Server.+let*"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reanalyze_server.ml", line 108, characters 4-46 - Server.server_state.parse_argv is a record label never used to read a value - <-- line 108 - parse_argv: string array -> string option; [@dead "Server.server_state.parse_argv"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/run_config.ml", line 44, characters 2-12 - snapshot.dce is a record label never used to read a value - <-- line 44 - dce: bool; [@dead "snapshot.dce"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/run_config.ml", line 45, characters 2-19 - snapshot.exception_ is a record label never used to read a value - <-- line 45 - exception_: bool; [@dead "snapshot.exception_"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/run_config.ml", line 46, characters 2-24 - snapshot.suppress is a record label never used to read a value - <-- line 46 - suppress: string list; [@dead "snapshot.suppress"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/run_config.ml", line 47, characters 2-20 - snapshot.termination is a record label never used to read a value - <-- line 47 - termination: bool; [@dead "snapshot.termination"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/run_config.ml", line 48, characters 2-19 - snapshot.transitive is a record label never used to read a value - <-- line 48 - transitive: bool; [@dead "snapshot.transitive"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/run_config.ml", line 49, characters 2-26 - snapshot.unsuppress is a record label never used to read a value - <-- line 49 - unsuppress: string list; [@dead "snapshot.unsuppress"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/completion_back_end.ml", line 903, characters 0-252 +completions_get_type_env is never used @@ -16599,4 +16539,4 @@ <-- line 38 val peek_minus : t -> bool [@@dead "+peek_minus"] - Analysis reported 2902 issues (Warning Dead Module:150, Warning Dead Type:364, Warning Dead Value:2132, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:195, Warning Unused Argument:24) + Analysis reported 2892 issues (Warning Dead Module:150, Warning Dead Type:355, Warning Dead Value:2131, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:195, Warning Unused Argument:24) diff --git a/analysis/reanalyze/src/reactive_solver.ml b/analysis/reanalyze/src/reactive_solver.ml index e0b7456b555..61614bc245e 100644 --- a/analysis/reanalyze/src/reactive_solver.ml +++ b/analysis/reanalyze/src/reactive_solver.ml @@ -27,7 +27,6 @@ type t = { live: (Lexing.position, unit) Reactive.t; dead_decls: (Lexing.position, Decl.t) Reactive.t; live_decls: (Lexing.position, Decl.t) Reactive.t; - annotations: (Lexing.position, File_annotations.annotated_as) Reactive.t; value_refs_from: (Lexing.position, Pos_set.t) Reactive.t option; dead_modules: (Name.t, Location.t * string) Reactive.t; (** Modules where all declarations are dead. Value is (loc, fileName). Reactive anti-join. *) @@ -41,7 +40,6 @@ type t = { (** Live declarations with @dead annotation. Reactive join of live_decls + annotations. *) dead_module_issues: (Name.t, Issue.t) Reactive.t; (** Dead module issues. Reactive join of dead_modules + modules_with_reported. *) - config: Dce_config.t; } (** Extract module name from a declaration *) @@ -241,14 +239,12 @@ let create ~(decls : (Lexing.position, Decl.t) Reactive.t) live; dead_decls; live_decls; - annotations; value_refs_from; dead_modules; dead_decls_by_file; issues_by_file; incorrect_dead_decls; dead_module_issues; - config; } (** Check if a module is dead using reactive collection. Returns issue if dead. @@ -280,7 +276,7 @@ let check_module_dead ~(dead_modules : (Name.t, Location.t * string) Reactive.t) let collect_issues ~(t : t) ~(config : Dce_config.t) ~(ann_store : Annotation_store.t) : Issue.t list = ignore (config, ann_store); - (* config is stored in t, ann_store used via reactive annotations *) + (* Kept for call-site parity with the non-reactive solver. *) let t0 = Unix.gettimeofday () in (* Track reported modules to avoid duplicates across files *) let reported_modules = Hashtbl.create 64 in diff --git a/analysis/reanalyze/src/reanalyze_server.ml b/analysis/reanalyze/src/reanalyze_server.ml index 5e17554ca61..6448577b1dc 100644 --- a/analysis/reanalyze/src/reanalyze_server.ml +++ b/analysis/reanalyze/src/reanalyze_server.ml @@ -71,11 +71,6 @@ let try_request_default () : response option = try_request ~socket_dir:(Some socket_dir) ~socket_path module Server = struct - let ( let* ) x f = - match x with - | Ok v -> f v - | Error _ as e -> e - let errorf fmt = Printf.ksprintf (fun s -> Error s) fmt type server_config = {socket_path: string; cwd: string option} @@ -105,7 +100,6 @@ module Server = struct } type server_state = { - parse_argv: string array -> string option; run_analysis: dce_config:Dce_config.t -> cmt_root:string option -> @@ -325,7 +319,6 @@ Examples: let pipeline = create_reactive_pipeline () in Ok { - parse_argv; run_analysis; config; cmt_root; diff --git a/analysis/reanalyze/src/run_config.ml b/analysis/reanalyze/src/run_config.ml index 1fe02a6d445..f372fd209fa 100644 --- a/analysis/reanalyze/src/run_config.ml +++ b/analysis/reanalyze/src/run_config.ml @@ -40,23 +40,14 @@ let termination () = run_config.termination <- true let transitive b = run_config.transitive <- b -type snapshot = { - dce: bool; - exception_: bool; - suppress: string list; - termination: bool; - transitive: bool; - unsuppress: string list; -} +type snapshot = bool * bool * string list * bool * bool * string list let snapshot () = - { - dce = run_config.dce; - exception_ = run_config.exception_; - suppress = run_config.suppress; - termination = run_config.termination; - transitive = run_config.transitive; - unsuppress = run_config.unsuppress; - } + ( run_config.dce, + run_config.exception_, + run_config.suppress, + run_config.termination, + run_config.transitive, + run_config.unsuppress ) let equal_snapshot (a : snapshot) (b : snapshot) = a = b From 0b2084e473237d93544da5d62a1ea249e5f0c416 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 12:32:16 +0000 Subject: [PATCH 078/214] dce: trim analysis helpers --- _dce/report.txt | 66 +++-------------------------- analysis/src/completion_back_end.ml | 36 ++++++---------- analysis/src/debug.ml | 5 --- analysis/src/process_cmt.ml | 8 ---- analysis/src/semantic_tokens.ml | 3 -- analysis/src/shared_types.ml | 18 +------- analysis/src/type_utils.ml | 5 --- scripts/dce/live-findings.md | 12 ++++++ 8 files changed, 33 insertions(+), 120 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index d77b57d5b30..5743d890e42 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -1245,76 +1245,22 @@ <-- line 7 let compare = compare [@@dead "+compare"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/completion_back_end.ml", line 903, characters 0-252 - +completions_get_type_env is never used - <-- line 903 - | _ -> None [@@dead "+completions_get_type_env"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/debug.ml", line 5, characters 0-92 - +log is never used - <-- line 5 - | Off -> () [@@dead "+log"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/process_cmt.ml", line 421, characters 0-247 - +for_tree_module_type is never used - <-- line 421 - | _ -> None [@@dead "+for_tree_module_type"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/semantic_tokens.ml", line 94, characters 2-136 - Token.+array_to_json_string is never used - <-- line 94 - "[" ^ String.concat "," items ^ "]" [@@dead "Token.+array_to_json_string"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/shared_types.ml", line 29, characters 2-365 - Module_path.+to_path_with_prefix is never used - <-- line 29 - prefix :: loop module_path [] [@@dead "Module_path.+to_path_with_prefix"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/shared_types.ml", line 313, characters 2-29 - Query_env.+to_string is never used - <-- line 313 - val to_string : t -> string [@@dead "Query_env.+to_string"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/shared_types.ml", line 322, characters 2-97 - Query_env.+to_string is never used - <-- line 322 - file.module_name :: List.rev path_rev |> String.concat "." [@@dead "Query_env.+to_string"] - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/shared_types.ml", line 502, characters 0-149 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/shared_types.ml", line 488, characters 0-149 +shared_types.Location_set is a dead module as all its items are dead. Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/shared_types.ml", line 505, characters 2-43 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/shared_types.ml", line 491, characters 2-43 Location_set.+compare is never used - <-- line 505 + <-- line 491 let compare loc1 loc2 = compare loc2 loc1 [@@dead "Location_set.+compare"] Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/shared_types.ml", line 537, characters 2-30 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/shared_types.ml", line 523, characters 2-30 package.rescript_version is a record label never used to read a value - <-- line 537 + <-- line 523 rescript_version: int * int; [@dead "package.rescript_version"] - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/shared_types.ml", line 855, characters 4-46 - Completion.t.type_arg_context is a record label never used to read a value - <-- line 855 - type_arg_context: type_arg_context option; [@dead "Completion.t.type_arg_context"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/type_utils.ml", line 979, characters 0-153 - +unwrap_completion_type_if_option is never used - <-- line 979 - | _ -> t [@@dead "+unwrap_completion_type_if_option"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/common/bs_loc.ml", line 31, characters 0-28 +is_ghost is never used @@ -16539,4 +16485,4 @@ <-- line 38 val peek_minus : t -> bool [@@dead "+peek_minus"] - Analysis reported 2892 issues (Warning Dead Module:150, Warning Dead Type:355, Warning Dead Value:2131, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:195, Warning Unused Argument:24) + Analysis reported 2883 issues (Warning Dead Module:150, Warning Dead Type:354, Warning Dead Value:2123, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:195, Warning Unused Argument:24) diff --git a/analysis/src/completion_back_end.ml b/analysis/src/completion_back_end.ml index aa43c3e9b63..24456a17a47 100644 --- a/analysis/src/completion_back_end.ml +++ b/analysis/src/completion_back_end.ml @@ -900,12 +900,6 @@ let completion_to_item ~state filterText = filter_text; } -let completions_get_type_env = function - | {Completion.kind = Value typ; env} :: _ -> Some (typ, env) - | {Completion.kind = ObjLabel typ; env} :: _ -> Some (typ, env) - | {Completion.kind = Field ({typ}, _); env} :: _ -> Some (typ, env) - | _ -> None - type get_completions_for_context_path_mode = Regular | Pipe let completions_get_completion_type ~full ~state completions = @@ -1587,14 +1581,13 @@ let print_constructor_args ~mode ~as_snippet args_len = if List.length !args > 0 then "(" ^ (!args |> String.concat ", ") ^ ")" else "" -let rec complete_typed_value ?(type_arg_context : type_arg_context option) - ~raw_opens ~full ~state ~prefix ~completion_context ~mode +let rec complete_typed_value ~raw_opens ~full ~state ~prefix ~completion_context ~mode (t : Shared_types.completion_type) = let empty_case = empty_case ~mode in let print_constructor_args = print_constructor_args ~mode in let create ?deprecated ?(docstring = []) ?(includes_snippets = false) ?insert_text ?sort_text name ~kind ~env = - Completion.create ?type_arg_context ?deprecated ~docstring ~includes_snippets + Completion.create ?deprecated ~docstring ~includes_snippets ?insert_text ?sort_text name ~kind ~env in let get_record_completions ~env ~fields ~extracted_type = @@ -2152,10 +2145,10 @@ let rec process_completable ~state ~debug ~full ~scope ~env ~pos ~for_hover in match typ |> Type_utils.resolve_nested ~env ~full ~nested ~state with | None -> [] - | Some (typ, _env, completion_context, type_arg_context) -> + | Some (typ, _env, completion_context, _type_arg_context) -> typ - |> complete_typed_value ?type_arg_context ~raw_opens ~mode:Expression - ~full ~prefix ~completion_context ~state) + |> complete_typed_value ~raw_opens ~mode:Expression ~full ~prefix + ~completion_context ~state) | CdecoratorPayload (ModuleWithImportAttributes {prefix; nested}) -> ( let mk_field ~name ~primitive = { @@ -2195,10 +2188,10 @@ let rec process_completable ~state ~debug ~full ~scope ~env ~pos ~for_hover in match typ |> Type_utils.resolve_nested ~env ~full ~nested ~state with | None -> [] - | Some (typ, _env, completion_context, type_arg_context) -> + | Some (typ, _env, completion_context, _type_arg_context) -> typ - |> complete_typed_value ?type_arg_context ~raw_opens ~mode:Expression - ~full ~prefix ~completion_context ~state) + |> complete_typed_value ~raw_opens ~mode:Expression ~full ~prefix + ~completion_context ~state) | CdecoratorPayload (Module prefix) -> let package_json_path = Utils.find_package_json (full.package.root_path |> Uri.from_path) @@ -2367,12 +2360,11 @@ let rec process_completable ~state ~debug ~full ~scope ~env ~pos ~for_hover ~state) with | None -> fallback_or_empty () - | Some (typ, _env, completion_context, type_arg_context) -> + | Some (typ, _env, completion_context, _type_arg_context) -> let items = typ - |> complete_typed_value ?type_arg_context ~raw_opens - ~mode:(Pattern pattern_mode) ~full ~prefix ~completion_context - ~state + |> complete_typed_value ~raw_opens ~mode:(Pattern pattern_mode) ~full + ~prefix ~completion_context ~state in fallback_or_empty ~items ()) | None -> fallback_or_empty ()) @@ -2433,7 +2425,7 @@ let rec process_completable ~state ~debug ~full ~scope ~env ~pos ~for_hover in items_for_raw_jsx_prop_value @ regular_completions) else regular_completions - | Some (typ, _env, completion_context, type_arg_context) -> ( + | Some (typ, _env, completion_context, _type_arg_context) -> ( if Debug.verbose () then print_endline "[process_completable]--> found type in nested expression \ @@ -2449,8 +2441,8 @@ let rec process_completable ~state ~debug ~full ~scope ~env ~pos ~for_hover in let items = typ - |> complete_typed_value ?type_arg_context ~raw_opens ~mode:Expression - ~full ~prefix ~completion_context ~state + |> complete_typed_value ~raw_opens ~mode:Expression ~full ~prefix + ~completion_context ~state |> List.map (fun (c : Completion.t) -> if wrap_insert_text_in_braces then { diff --git a/analysis/src/debug.ml b/analysis/src/debug.ml index a7002fa56cd..1a795545b3c 100644 --- a/analysis/src/debug.ml +++ b/analysis/src/debug.ml @@ -2,11 +2,6 @@ type debug_level = Off | Regular | Verbose let debug_level = ref Off -let log s = - match !debug_level with - | Regular | Verbose -> print_endline s - | Off -> () - let debug_print_env (env : Shared_types.Query_env.t) = env.path_rev @ [env.file.module_name] |> List.rev |> String.concat "." diff --git a/analysis/src/process_cmt.ml b/analysis/src/process_cmt.ml index 4e6cca03bf5..f7098b84555 100644 --- a/analysis/src/process_cmt.ml +++ b/analysis/src/process_cmt.ml @@ -418,14 +418,6 @@ let for_signature ~name ~env sig_items = let deprecated = Process_attributes.find_deprecated_attribute attributes in {Module.name; docstring; exported; items; deprecated} -let for_tree_module_type ~name ~env {Typedtree.mty_desc} = - match mty_desc with - | Tmty_ident _ -> None - | Tmty_signature {sig_items} -> - let contents = for_signature ~name ~env sig_items in - Some (Module.Structure contents) - | _ -> None - let rec get_module_path mod_desc = match mod_desc with | Typedtree.Tmod_ident (path, _lident) -> Some path diff --git a/analysis/src/semantic_tokens.ml b/analysis/src/semantic_tokens.ml index 10532f81ee6..8e1337483c5 100644 --- a/analysis/src/semantic_tokens.ml +++ b/analysis/src/semantic_tokens.ml @@ -91,9 +91,6 @@ module Token = struct in Array.concat arrays - let array_to_json_string arr = - let items = Array.map string_of_int arr |> Array.to_list in - "[" ^ String.concat "," items ^ "]" end let is_lowercase_id id = diff --git a/analysis/src/shared_types.ml b/analysis/src/shared_types.ml index afcc9a1f374..eae298d726e 100644 --- a/analysis/src/shared_types.ml +++ b/analysis/src/shared_types.ml @@ -26,16 +26,6 @@ module Module_path = struct in loop module_path [tip_name] - let to_path_with_prefix module_path prefix : path = - let rec loop module_path current = - match module_path with - | File _ -> current - | IncludedModule (_, inner) -> loop inner current - | ExportedModule {name; module_path = inner} -> - loop inner (name :: current) - | NotVisible -> current - in - prefix :: loop module_path [] end type field = { @@ -310,7 +300,6 @@ module Query_env : sig Or A.B.D or A.D or D if it's in one of its parents. *) val path_from_env : t -> path -> bool * path - val to_string : t -> string end = struct type t = { file: File.t; @@ -319,9 +308,6 @@ end = struct parent: t option; } - let to_string {file; path_rev} = - file.module_name :: List.rev path_rev |> String.concat "." - let from_file (file : File.t) = {file; exported = file.structure.exported; path_rev = []; parent = None} @@ -852,13 +838,12 @@ module Completion = struct docstring: string list; kind: kind; detail: string option; - type_arg_context: type_arg_context option; additional_text_edits: Lsp.Types.TextEdit.t list option; synthetic: bool; (** Whether this item is an made up, synthetic item or not. *) } - let create ?(synthetic = false) ?additional_text_edits ?type_arg_context + let create ?(synthetic = false) ?additional_text_edits ?(includes_snippets = false) ?insert_text ~kind ~env ?sort_text ?deprecated ?detail ?(docstring = []) name = { @@ -874,7 +859,6 @@ module Completion = struct else None); filter_text = None; detail; - type_arg_context; additional_text_edits; synthetic; } diff --git a/analysis/src/type_utils.ml b/analysis/src/type_utils.ml index 70f46b60aec..91c64377779 100644 --- a/analysis/src/type_utils.ml +++ b/analysis/src/type_utils.ml @@ -976,11 +976,6 @@ let rec context_path_from_core_type (core_type : Parsetree.core_type) = }) | _ -> None -let unwrap_completion_type_if_option (t : Shared_types.completion_type) = - match t with - | Toption (_, ExtractedType unwrapped) -> unwrapped - | _ -> t - module Codegen = struct let mk_fail_with_exp () = Ast_helper.Exp.apply diff --git a/scripts/dce/live-findings.md b/scripts/dce/live-findings.md index 4619e354d50..43919ce0495 100644 --- a/scripts/dce/live-findings.md +++ b/scripts/dce/live-findings.md @@ -151,6 +151,18 @@ live after manual validation. `Hashtbl.Make`, `Set.Make`, or `Map.Make`. Reanalyze can miss those callback edges and report the callback definitions as ordinary unused values. +### Analysis collection functor callbacks + +- Report: `Warning Dead Module` and `Warning Dead Value`, + `analysis/src/shared_types.ml`, `Location_set.compare`. +- Verdict: live; false positive. +- Validation: `Shared_types.Location_set` stores file references in + `Shared_types.extra.file_references`; `analysis/src/process_extra.ml` adds + locations with `Location_set.add` / `singleton`, and + `analysis/src/references.ml` reads them with `Location_set.elements`. +- Context: the `compare` function is consumed by `Set.Make`, so it can look + unused as a plain value even though every set operation depends on it. + ### `File_deps.File_hash` callbacks - Report: `Warning Dead Module` and `Warning Dead Value`, From 0d9d4cfdc1ae839b07ddc5c06e685ce76c1d448c Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 12:32:57 +0000 Subject: [PATCH 079/214] dce: note package version state --- scripts/dce/live-findings.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/scripts/dce/live-findings.md b/scripts/dce/live-findings.md index 43919ce0495..863a6c80922 100644 --- a/scripts/dce/live-findings.md +++ b/scripts/dce/live-findings.md @@ -163,6 +163,18 @@ live after manual validation. - Context: the `compare` function is consumed by `Set.Make`, so it can look unused as a plain value even though every set operation depends on it. +### `Shared_types.package.rescript_version` + +- Report: `Warning Dead Type`, `analysis/src/shared_types.ml`, + `package.rescript_version`. +- Verdict: live compatibility state; leave in place for now. +- Validation: `analysis/src/packages.ml` populates this from + `Packages.get_rescript_version`, which honors `RESCRIPT_VERSION` and the + analysis-test `// ^ve+` / `// ^ve-` commands parsed in `analysis/src/cli.ml`. +- Context: no current reader was found, but removing the field cascades into the + version override test-command surface. Keep this documented until the version + override path is intentionally retired or reconnected to feature gating. + ### `File_deps.File_hash` callbacks - Report: `Warning Dead Module` and `Warning Dead Value`, From 992ede9b23dcc73870d7e43240584177bf9cabf5 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 12:34:51 +0000 Subject: [PATCH 080/214] dce: trim common helpers --- _dce/report.txt | 76 +++++++++++++++++++++-------------- compiler/common/bs_loc.ml | 10 ----- compiler/common/bs_loc.mli | 2 - compiler/common/js_config.ml | 1 - compiler/common/js_config.mli | 2 - scripts/dce/live-findings.md | 18 +++++++++ 6 files changed, 63 insertions(+), 46 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index 5743d890e42..b243a717f8d 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -1261,23 +1261,49 @@ <-- line 523 rescript_version: int * int; [@dead "package.rescript_version"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/common/bs_loc.ml", line 31, characters 0-28 - +is_ghost is never used - <-- line 31 - let is_ghost x = x.loc_ghost [@@dead "+is_ghost"] + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/common/bs_loc.ml", line 1, characters 0-0 + +bs_loc is a dead module as all its items are dead. - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/common/bs_loc.ml", line 33, characters 0-210 - +merge is never used - <-- line 33 - {loc_start; loc_end; loc_ghost = false} [@@dead "+merge"] + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/common/bs_loc.ml", line 26, characters 2-29 + t.loc_start is a record label never used to read a value + <-- line 26 + loc_start: Lexing.position; [@dead "t.loc_start"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/common/bs_loc.mli", line 32, characters 0-23 - +merge is never used - <-- line 32 - val merge : t -> t -> t [@@dead "+merge"] + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/common/bs_loc.ml", line 27, characters 2-27 + t.loc_end is a record label never used to read a value + <-- line 27 + loc_end: Lexing.position; [@dead "t.loc_end"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/common/bs_loc.ml", line 28, characters 2-18 + t.loc_ghost is a record label never used to read a value + <-- line 28 + loc_ghost: bool; [@dead "t.loc_ghost"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/common/bs_loc.mli", line 1, characters 0-0 + bs_loc is a dead module as all its items are dead. + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/common/bs_loc.mli", line 26, characters 2-29 + t.loc_start is a record label never used to read a value + <-- line 26 + loc_start: Lexing.position; [@dead "t.loc_start"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/common/bs_loc.mli", line 27, characters 2-27 + t.loc_end is a record label never used to read a value + <-- line 27 + loc_end: Lexing.position; [@dead "t.loc_end"] + + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/common/bs_loc.mli", line 28, characters 2-18 + t.loc_ghost is a record label never used to read a value + <-- line 28 + loc_ghost: bool; [@dead "t.loc_ghost"] Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/common/bs_version.ml", line 25, characters 0-62 @@ -1311,26 +1337,14 @@ <-- line 35 val dwarn : ?__POS__:string * int * int * int -> 'a logging [@@dead "+dwarn"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/common/js_config.ml", line 43, characters 0-49 - +get_check_div_by_zero is never used - <-- line 43 - let get_check_div_by_zero () = !check_div_by_zero [@@dead "+get_check_div_by_zero"] - Warning Dead Value With Side Effects - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/common/js_config.ml", line 55, characters 0-24 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/common/js_config.ml", line 54, characters 0-24 +js_stdout is never used and could have side effects Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/common/js_config.mli", line 60, characters 0-40 - +get_check_div_by_zero is never used - <-- line 60 - val get_check_div_by_zero : unit -> bool [@@dead "+get_check_div_by_zero"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/common/js_config.mli", line 87, characters 0-24 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/common/js_config.mli", line 85, characters 0-24 +js_stdout is never used - <-- line 87 + <-- line 85 val js_stdout : bool ref [@@dead "+js_stdout"] Warning Dead Type @@ -16485,4 +16499,4 @@ <-- line 38 val peek_minus : t -> bool [@@dead "+peek_minus"] - Analysis reported 2883 issues (Warning Dead Module:150, Warning Dead Type:354, Warning Dead Value:2123, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:195, Warning Unused Argument:24) + Analysis reported 2886 issues (Warning Dead Module:152, Warning Dead Type:360, Warning Dead Value:2118, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:195, Warning Unused Argument:24) diff --git a/compiler/common/bs_loc.ml b/compiler/common/bs_loc.ml index ff7df2bf54c..9e0a8a6d425 100644 --- a/compiler/common/bs_loc.ml +++ b/compiler/common/bs_loc.ml @@ -28,14 +28,4 @@ type t = Location.t = { loc_ghost: bool; } -let is_ghost x = x.loc_ghost - -let merge (l : t) (r : t) = - if is_ghost l then r - else if is_ghost r then l - else - match (l, r) with - | {loc_start; _}, {loc_end; _} (* TODO: improve*) -> - {loc_start; loc_end; loc_ghost = false} - (* let none = Location.none *) diff --git a/compiler/common/bs_loc.mli b/compiler/common/bs_loc.mli index de22c2d9806..34147fadbd0 100644 --- a/compiler/common/bs_loc.mli +++ b/compiler/common/bs_loc.mli @@ -28,6 +28,4 @@ type t = Location.t = { loc_ghost: bool; } -(* val is_ghost : t -> bool *) -val merge : t -> t -> t (* val none : t *) diff --git a/compiler/common/js_config.ml b/compiler/common/js_config.ml index 9e2b6f598ca..9ce10a50fbd 100644 --- a/compiler/common/js_config.ml +++ b/compiler/common/js_config.ml @@ -40,7 +40,6 @@ let diagnose = ref false let no_builtin_ppx = ref false let tool_name = "ReScript" let check_div_by_zero = ref true -let get_check_div_by_zero () = !check_div_by_zero let syntax_only = ref false let binary_ast = ref false let test_ast_conversion = ref false diff --git a/compiler/common/js_config.mli b/compiler/common/js_config.mli index f19b3c6126c..c4b353bae96 100644 --- a/compiler/common/js_config.mli +++ b/compiler/common/js_config.mli @@ -57,8 +57,6 @@ val no_builtin_ppx : bool ref val check_div_by_zero : bool ref (** check-div-by-zero option *) -val get_check_div_by_zero : unit -> bool - val tool_name : string val syntax_only : bool ref diff --git a/scripts/dce/live-findings.md b/scripts/dce/live-findings.md index 863a6c80922..7380abb02ae 100644 --- a/scripts/dce/live-findings.md +++ b/scripts/dce/live-findings.md @@ -175,6 +175,24 @@ live after manual validation. version override test-command surface. Keep this documented until the version override path is intentionally retired or reconnected to feature gating. +### Compiler-common cross-module hooks + +- Report: `Warning Dead Value` / `Warning Dead Module`, + `compiler/common/bs_loc.ml` and `.mli` (`t` fields), + `compiler/common/bs_version.ml` and `.mli` (`header`), + `compiler/common/ext_log.ml` and `.mli` (`dwarn`), and + `compiler/common/js_config.ml` and `.mli` (`js_stdout`). +- Verdict: live; false positive. +- Validation: `compiler/frontend/ast_external_process.ml` and `.mli` use + `Bs_loc.t`; `compiler/core/js_dump_program.ml` emits `Bs_version.header`; + `compiler/core/lam_compile_main.cppo.ml`, `lam_util.cppo.ml`, + `lam_stats_export.ml`, and `js_pass_debug.cppo.ml` call `Ext_log.dwarn`; + `compiler/core/lam_compile_main.cppo.ml` and `lam_compile_primitive.ml` read + `Js_config.js_stdout`. +- Context: these are cross-module and, for several callers, `.cppo.ml` paths. + They are live in the compiler pipeline even though the current DCE report + misses those edges. + ### `File_deps.File_hash` callbacks - Report: `Warning Dead Module` and `Warning Dead Value`, From 06b4ff670720f3f9595d8c1d8438a9ae5be8fbfd Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 12:35:49 +0000 Subject: [PATCH 081/214] dce: note js analyzer liveness --- scripts/dce/live-findings.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/scripts/dce/live-findings.md b/scripts/dce/live-findings.md index 7380abb02ae..a282d94d24f 100644 --- a/scripts/dce/live-findings.md +++ b/scripts/dce/live-findings.md @@ -193,6 +193,22 @@ live after manual validation. They are live in the compiler pipeline even though the current DCE report misses those edges. +### Core JS analyzer and delimiters + +- Report: `Warning Dead Type`, `compiler/core/j.ml`, `delim.DBackQuotes`; and + many `Warning Dead Value` entries in `compiler/core/js_analyzer.ml` / `.mli`. +- Verdict: live; false positive. +- Validation: `DBackQuotes` is constructed by + `compiler/frontend/ast_utf8_string_interp.ml` for the processed `"bq"` + delimiter and printed by `compiler/core/js_dump.ml`. `Js_analyzer` helpers are + used from `js_pass_flatten.ml`, `js_shake.ml`, `js_exp_make.ml`, + `js_output.ml`, `js_pass_flatten_and_mark_dead.ml`, + `lam_compile_external_obj.ml`, `lam_compile_external_call.ml`, + `lam_compile_primitive.ml`, `lam_compile.ml`, and related JS passes. +- Context: these are cross-module compiler pipeline edges. The warning cluster + is consistent with the known DCE limitation where anything referenced only + across modules can appear dead. + ### `File_deps.File_hash` callbacks - Report: `Warning Dead Module` and `Warning Dead Value`, From 42bf7d51de0212d0412da4a5b693ec59376ba3e4 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 12:38:19 +0000 Subject: [PATCH 082/214] dce: trim cmj readers --- _dce/report.txt | 62 ++++++++++----------------------- compiler/core/js_cmj_format.ml | 9 ----- compiler/core/js_cmj_format.mli | 4 --- 3 files changed, 19 insertions(+), 56 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index b243a717f8d..59c6fa139f7 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -1652,63 +1652,51 @@ let _digest = Digest.input ic [@@dead "+_digest"] in Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_cmj_format.ml", line 77, characters 0-173 - +from_file_with_digest is never used - <-- line 77 - (v, digest) [@@dead "+from_file_with_digest"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_cmj_format.ml", line 84, characters 0-63 - +from_string is never used - <-- line 84 - let from_string s : t = Marshal.from_string s Ext_digest.length [@@dead "+from_string"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_cmj_format.ml", line 86, characters 0-238 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_cmj_format.ml", line 77, characters 0-238 +for_sure_not_changed is never used - <-- line 86 + <-- line 77 else false [@@dead "+for_sure_not_changed"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_cmj_format.ml", line 97, characters 0-315 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_cmj_format.ml", line 88, characters 0-315 +to_file is never used - <-- line 97 + <-- line 88 close_out oc) [@@dead "+to_file"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_cmj_format.ml", line 107, characters 0-61 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_cmj_format.ml", line 98, characters 0-61 +key_comp is never used - <-- line 107 + <-- line 98 let key_comp (a : string) b = Map_string.compare_key a b.name [@@dead "+key_comp"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_cmj_format.ml", line 109, characters 0-86 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_cmj_format.ml", line 100, characters 0-86 +not_found is never used - <-- line 109 + <-- line 100 {name = key; arity = single_na; persistent_closed_lambda = None} [@@dead "+not_found"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_cmj_format.ml", line 112, characters 0-320 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_cmj_format.ml", line 103, characters 0-320 +get_result is never used - <-- line 112 + <-- line 103 else {mid_val with persistent_closed_lambda = None} [@@dead "+get_result"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_cmj_format.ml", line 123, characters 0-658 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_cmj_format.ml", line 114, characters 0-658 +binary_search_aux is never used - <-- line 123 + <-- line 114 else binary_search_aux arr mid hi key [@@dead "+binary_search_aux"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_cmj_format.ml", line 142, characters 0-435 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_cmj_format.ml", line 133, characters 0-435 +binary_search is never used - <-- line 142 + <-- line 133 if c2 > 0 then not_found key else binary_search_aux sorted 0 (len - 1) key [@@dead "+binary_search"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_cmj_format.ml", line 157, characters 0-121 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_cmj_format.ml", line 148, characters 0-121 +query_by_name is never used - <-- line 157 + <-- line 148 binary_search values name [@@dead "+query_by_name"] Warning Dead Value @@ -1730,21 +1718,9 @@ val single_na : arity [@@dead "+single_na"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_cmj_format.mli", line 83, characters 0-50 - +from_file_with_digest is never used - <-- line 83 - val from_file_with_digest : string -> t * Digest.t [@@dead "+from_file_with_digest"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_cmj_format.mli", line 85, characters 0-29 - +from_string is never used - <-- line 85 - val from_string : string -> t [@@dead "+from_string"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_cmj_format.mli", line 90, characters 0-54 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_cmj_format.mli", line 86, characters 0-54 +to_file is never used - <-- line 90 + <-- line 86 val to_file : string -> check_exists:bool -> t -> unit [@@dead "+to_file"] Warning Dead Value With Side Effects @@ -16499,4 +16475,4 @@ <-- line 38 val peek_minus : t -> bool [@@dead "+peek_minus"] - Analysis reported 2886 issues (Warning Dead Module:152, Warning Dead Type:360, Warning Dead Value:2118, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:195, Warning Unused Argument:24) + Analysis reported 2882 issues (Warning Dead Module:152, Warning Dead Type:360, Warning Dead Value:2114, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:195, Warning Unused Argument:24) diff --git a/compiler/core/js_cmj_format.ml b/compiler/core/js_cmj_format.ml index e17a41ef3e0..a9d4b23af3c 100644 --- a/compiler/core/js_cmj_format.ml +++ b/compiler/core/js_cmj_format.ml @@ -74,15 +74,6 @@ let from_file name : t = close_in ic; v -let from_file_with_digest name : t * Digest.t = - let ic = open_in_bin name in - let digest = Digest.input ic in - let v : t = input_value ic in - close_in ic; - (v, digest) - -let from_string s : t = Marshal.from_string s Ext_digest.length - let for_sure_not_changed (name : string) (header : string) = if Sys.file_exists name then ( let ic = open_in_bin name in diff --git a/compiler/core/js_cmj_format.mli b/compiler/core/js_cmj_format.mli index d55872968f5..1ad879c6eff 100644 --- a/compiler/core/js_cmj_format.mli +++ b/compiler/core/js_cmj_format.mli @@ -80,10 +80,6 @@ val single_na : arity val from_file : string -> t -val from_file_with_digest : string -> t * Digest.t - -val from_string : string -> t - (* Note writing the file if its content is not changed *) From fca06e9a2f0201505fcebc17d382ec4c82ddef6e Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 12:38:49 +0000 Subject: [PATCH 083/214] dce: note core js liveness --- scripts/dce/live-findings.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/scripts/dce/live-findings.md b/scripts/dce/live-findings.md index a282d94d24f..395bed662a7 100644 --- a/scripts/dce/live-findings.md +++ b/scripts/dce/live-findings.md @@ -209,6 +209,28 @@ live after manual validation. is consistent with the known DCE limitation where anything referenced only across modules can appear dead. +### Core JS utility and CMJ helpers + +- Report: `Warning Dead Module` / `Warning Dead Value`, + `compiler/core/js_arr.ml`, `js_ast_util.ml`, `js_block_runtime.ml`, + `js_call_info.ml`, and `js_cmj_format.ml` / `.mli`. +- Verdict: live; false positive for the remaining reported helpers. +- Validation: `Js_arr.ref_array` and `set_array` are used by + `compiler/core/lam_compile_external_call.ml`. `Js_ast_util.named_expression` + is used by `lam_compile_external_obj.ml` and `lam_compile.ml`. + `Js_block_runtime.check_additional_id` is used by `js_fold_basic.ml` and + `js_pass_scope.ml`; its reported local ids feed that exported helper. + `Js_call_info.dummy`, `ml_full_call`, and `na_full_call` are used by + `lam_compile.ml`, `js_exp_make.ml`, and `lam_compile_external_call.ml`. + `Js_cmj_format.single_na`, `make`, `to_file`, and `query_by_name` are used by + `lam_stats_export.ml`, `lam_compile_main.cppo.ml`, and + `lam_compile_env.ml`; the binary-search helpers are local dependencies of + `query_by_name`, and `for_sure_not_changed` is a local dependency of + `to_file`. +- Context: `Js_cmj_format.from_file_with_digest` and `from_string` had no + callers and were removed. The remaining entries are live through cross-module + compiler and `.cppo.ml` call sites. + ### `File_deps.File_hash` callbacks - Report: `Warning Dead Module` and `Warning Dead Value`, From 549bbcc8cfa1cfabe7ea96b951a47f10b21cd677 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 12:41:10 +0000 Subject: [PATCH 084/214] dce: trim js dump literals --- _dce/report.txt | 108 +---------------------------------- compiler/core/js_dump.mli | 4 +- compiler/core/js_dump_lit.ml | 34 ----------- 3 files changed, 4 insertions(+), 142 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index 59c6fa139f7..3c3dfb7c8bb 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -1759,12 +1759,6 @@ <-- line 28 val string_of_block : J.block -> string [@@dead "+string_of_block"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump.mli", line 31, characters 0-49 - +string_of_expression is never used - <-- line 31 - val string_of_expression : J.expression -> string [@@dead "+string_of_expression"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_import_export.ml", line 30, characters 0-38 +es_module is never used @@ -1874,107 +1868,11 @@ let exports = "exports" [@@dead "+exports"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_lit.ml", line 77, characters 0-19 - +array is never used - <-- line 77 - let array = "Array" [@@dead "+array"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_lit.ml", line 81, characters 0-19 - +plusplus is never used - <-- line 81 - let plusplus = "++" [@@dead "+plusplus"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_lit.ml", line 83, characters 0-21 - +minusminus is never used - <-- line 83 - let minusminus = "--" [@@dead "+minusminus"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_lit.ml", line 109, characters 0-17 - +json is never used - <-- line 109 - let json = "JSON" [@@dead "+json"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_lit.ml", line 111, characters 0-27 - +stringify is never used - <-- line 111 - let stringify = "stringify" [@@dead "+stringify"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_lit.ml", line 113, characters 0-23 - +console is never used - <-- line 113 - let console = "console" [@@dead "+console"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_lit.ml", line 115, characters 0-21 - +define is never used - <-- line 115 - let define = "define" [@@dead "+define"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_lit.ml", line 123, characters 0-38 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_lit.ml", line 109, characters 0-38 +strict_directive is never used - <-- line 123 + <-- line 109 let strict_directive = "'use strict';" [@@dead "+strict_directive"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_lit.ml", line 133, characters 0-17 - +bind is never used - <-- line 133 - let bind = "bind" [@@dead "+bind"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_lit.ml", line 135, characters 0-17 - +math is never used - <-- line 135 - let math = "Math" [@@dead "+math"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_lit.ml", line 143, characters 0-25 - +string_cap is never used - <-- line 143 - let string_cap = "String" [@@dead "+string_cap"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_lit.ml", line 145, characters 0-34 - +from_charcode is never used - <-- line 145 - let from_charcode = "fromCharCode" [@@dead "+from_charcode"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_lit.ml", line 155, characters 0-12 - +gt is never used - <-- line 155 - let gt = ">" [@@dead "+gt"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_lit.ml", line 162, characters 0-28 - +caml_block_create is never used - <-- line 162 - let caml_block_create = "__" [@@dead "+caml_block_create"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_lit.ml", line 166, characters 0-30 - +block_poly_var is never used - <-- line 166 - let block_poly_var = "polyVar" [@@dead "+block_poly_var"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_lit.ml", line 168, characters 0-29 - +block_variant is never used - <-- line 168 - let block_variant = "variant" [@@dead "+block_variant"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_lit.ml", line 170, characters 0-42 - +block_simple_variant is never used - <-- line 170 - let block_simple_variant = "simpleVariant" [@@dead "+block_simple_variant"] - Warning Dead Module File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_program.ml", line 1, characters 0-0 +js_dump_program is a dead module as all its items are dead. @@ -16475,4 +16373,4 @@ <-- line 38 val peek_minus : t -> bool [@@dead "+peek_minus"] - Analysis reported 2882 issues (Warning Dead Module:152, Warning Dead Type:360, Warning Dead Value:2114, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:195, Warning Unused Argument:24) + Analysis reported 2865 issues (Warning Dead Module:152, Warning Dead Type:360, Warning Dead Value:2097, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:195, Warning Unused Argument:24) diff --git a/compiler/core/js_dump.mli b/compiler/core/js_dump.mli index 469a79ff5d5..0db4b4a2483 100644 --- a/compiler/core/js_dump.mli +++ b/compiler/core/js_dump.mli @@ -26,6 +26,4 @@ val statements : bool -> Ext_pp_scope.t -> Ext_pp.t -> J.block -> Ext_pp_scope.t *) val string_of_block : J.block -> string -(** 2 functions Only used for debugging *) - -val string_of_expression : J.expression -> string +(** Only used for debugging *) diff --git a/compiler/core/js_dump_lit.ml b/compiler/core/js_dump_lit.ml index a3ac8452465..996b4cf8e70 100644 --- a/compiler/core/js_dump_lit.ml +++ b/compiler/core/js_dump_lit.ml @@ -74,14 +74,8 @@ let code_point_at = "codePointAt" let new_ = "new" -let array = "Array" - let question = "?" -let plusplus = "++" - -let minusminus = "--" - let semi = ";" let else_ = "else" @@ -106,14 +100,6 @@ let start_block = "start_block" let end_block = "end_block" -let json = "JSON" - -let stringify = "stringify" - -let console = "console" - -let define = "define" - let break = "break" let continue = "continue" @@ -130,20 +116,12 @@ let debugger = "debugger" let tag = "TAG" -let bind = "bind" - -let math = "Math" - let apply = "apply" let null = "null" let undefined = "undefined" -let string_cap = "String" - -let from_charcode = "fromCharCode" - let eq = "=" let le = "<=" @@ -152,21 +130,9 @@ let lt = "<" let ge = ">=" -let gt = ">" - let plus_plus = "++" (* FIXME: use (i = i + 1 | 0) instead *) let minus_minus = "--" -let caml_block_create = "__" - -(** debug symbols *) - -let block_poly_var = "polyVar" - -let block_variant = "variant" - -let block_simple_variant = "simpleVariant" - let case = "case" From 0628a797fa99a3cf561b3e67aec75ddd2bef28c8 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 12:41:26 +0000 Subject: [PATCH 085/214] dce: note js dump liveness --- scripts/dce/live-findings.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/scripts/dce/live-findings.md b/scripts/dce/live-findings.md index 395bed662a7..173a530e3cb 100644 --- a/scripts/dce/live-findings.md +++ b/scripts/dce/live-findings.md @@ -231,6 +231,26 @@ live after manual validation. callers and were removed. The remaining entries are live through cross-module compiler and `.cppo.ml` call sites. +### Core JS dumping pipeline + +- Report: `Warning Dead Module` / `Warning Dead Value`, + `compiler/core/js_cmj_load.ml`, `js_dump.ml`, `js_dump_import_export.ml`, + `js_dump_lit.ml`, and `js_dump_program.ml` / `.mli`. +- Verdict: live; false positive for the remaining reported helpers. +- Validation: `compiler/core/lam_compile_env.ml` reads + `Js_cmj_load.load_unit`. `compiler/core/js_output.ml` calls + `Js_dump.string_of_block`, and `compiler/core/js_dump_program.ml` calls + `Js_dump.statements`. `compiler/core/js_dump_program.ml` calls + `Js_dump_import_export.exports`, `requires`, `imports`, and + `esmodule_export`; those helpers use the reported `Js_dump_lit` strings + through `module L = Js_dump_lit`. `Js_dump_program.dump_deps_program` is used + by `lam_compile_main.cppo.ml`, `dump_program` by `js_pass_debug.cppo.ml`, and + `pp_deps_program` by `compiler/jsoo/jsoo_playground_main.ml`. +- Context: unused `Js_dump_lit` strings and the unused + `Js_dump.string_of_expression` signature export were removed. The remaining + dumper warnings are cross-module compiler output paths, including `.cppo.ml` + and jsoo entry points that this DCE run misses. + ### `File_deps.File_hash` callbacks - Report: `Warning Dead Module` and `Warning Dead Value`, From cb69c208a90fe6a1bcb819ed6ecc5ecac38013f2 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 12:44:46 +0000 Subject: [PATCH 086/214] dce: trim js exp helpers --- _dce/report.txt | 920 ++++++++++++++++------------------ compiler/core/js_exp_make.ml | 5 - compiler/core/js_exp_make.mli | 19 - 3 files changed, 445 insertions(+), 499 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index 3c3dfb7c8bb..eaa07c2edd5 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -2032,687 +2032,675 @@ args [@@dead "+pure_runtime_call"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 157, characters 0-73 - +runtime_ref is never used - <-- line 157 - let runtime_ref module_name fn_name = runtime_var_dot module_name fn_name [@@dead "+runtime_ref"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 162, characters 0-134 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 160, characters 0-134 +raw_js_code is never used - <-- line 162 + <-- line 160 } [@@dead "+raw_js_code"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 169, characters 0-23 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 167, characters 0-23 +some_comment is never used - <-- line 169 + <-- line 167 let some_comment = None [@@dead "+some_comment"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 171, characters 0-109 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 169, characters 0-109 +optional_block is never used - <-- line 171 + <-- line 169 {expression_desc = Optional_block (e, false); comment = some_comment} [@@dead "+optional_block"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 174, characters 0-109 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 172, characters 0-109 +optional_not_nest_block is never used - <-- line 174 + <-- line 172 {expression_desc = Optional_block (e, true); comment = None} [@@dead "+optional_not_nest_block"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 180, characters 0-104 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 178, characters 0-104 +dot is never used - <-- line 180 + <-- line 178 {expression_desc = Static_index (e0, e1, None); comment} [@@dead "+dot"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 183, characters 0-421 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 181, characters 0-421 +module_access is never used - <-- line 183 + <-- line 181 | _ -> {expression_desc = Static_index (e, name, Some pos); comment = None} [@@dead "+module_access"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 193, characters 0-189 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 191, characters 0-189 +make_block is never used - <-- line 193 + <-- line 191 {expression_desc = Caml_block (es, mutable_flag, tag, tag_info); comment} [@@dead "+make_block"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 200, characters 0-301 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 198, characters 0-301 +typeof is never used - <-- line 200 + <-- line 198 | _ -> {expression_desc = Typeof e; comment} [@@dead "+typeof"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 208, characters 0-103 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 206, characters 0-103 +instanceof is never used - <-- line 208 + <-- line 206 {expression_desc = Bin (InstanceOf, e0, e1); comment} [@@dead "+instanceof"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 211, characters 0-157 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 209, characters 0-157 +is_array is never used - <-- line 211 + <-- line 209 {expression_desc = Call (f, [e0], Js_call_info.ml_full_call); comment = None} [@@dead "+is_array"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 217, characters 0-77 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 215, characters 0-77 +unit is never used - <-- line 217 + <-- line 215 let unit : t = {expression_desc = Undefined {is_unit = true}; comment = None} [@@dead "+unit"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 238, characters 0-444 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 236, characters 0-444 +ocaml_fun is never used - <-- line 238 + <-- line 236 } [@@dead "+ocaml_fun"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 257, characters 0-365 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 255, characters 0-365 +method_ is never used - <-- line 257 + <-- line 255 } [@@dead "+method_"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 275, characters 0-465 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 273, characters 0-465 +dummy_obj is never used - <-- line 275 + <-- line 273 | Blk_some | Blk_some_not_nested -> assert false [@@dead "+dummy_obj"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 291, characters 0-622 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 289, characters 0-622 +seq is never used - <-- line 291 + <-- line 289 | _ -> {expression_desc = Seq (e0, e1); comment} [@@dead "+seq"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 306, characters 0-73 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 304, characters 0-73 +fuse_to_seq is never used - <-- line 306 + <-- line 304 let fuse_to_seq x xs = if xs = [] then x else Ext_list.fold_left xs x seq [@@dead "+fuse_to_seq"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 349, characters 0-127 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 347, characters 0-127 +zero_bigint_literal is never used - <-- line 349 + <-- line 347 } [@@dead "+zero_bigint_literal"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 375, characters 0-88 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 373, characters 0-88 +zero_float_lit is never used - <-- line 375 + <-- line 373 {expression_desc = Number (Float {f = "0."}); comment = None} [@@dead "+zero_float_lit"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 378, characters 0-94 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 376, characters 0-94 +float_mod is never used - <-- line 378 + <-- line 376 {comment; expression_desc = Bin (Mod, e1, e2)} [@@dead "+float_mod"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 381, characters 0-422 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 379, characters 0-422 +array_index is never used - <-- line 381 + <-- line 379 | _ -> {expression_desc = Array_index (e0, e1); comment} [@@dead "+array_index"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 391, characters 0-447 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 389, characters 0-447 +array_index_by_int is never used - <-- line 391 + <-- line 389 | _ -> {expression_desc = Array_index (e, int ?comment pos); comment = None} [@@dead "+array_index_by_int"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 402, characters 0-489 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 400, characters 0-489 +record_access is never used - <-- line 402 + <-- line 400 | _ -> {expression_desc = Static_index (e, name, Some pos); comment = None} [@@dead "+record_access"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 415, characters 0-40 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 413, characters 0-40 +inline_record_access is never used - <-- line 415 + <-- line 413 let inline_record_access = record_access [@@dead "+inline_record_access"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 417, characters 0-99 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 415, characters 0-99 +variant_access is never used - <-- line 417 + <-- line 415 inline_record_access e ("_" ^ Int32.to_string pos) pos [@@dead "+variant_access"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 420, characters 0-178 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 418, characters 0-178 +cons_access is never used - <-- line 420 + <-- line 418 pos [@@dead "+cons_access"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 428, characters 0-297 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 426, characters 0-297 +poly_var_tag_access is never used - <-- line 428 + <-- line 426 } [@@dead "+poly_var_tag_access"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 440, characters 0-304 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 438, characters 0-304 +poly_var_value_access is never used - <-- line 440 + <-- line 438 } [@@dead "+poly_var_value_access"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 452, characters 0-665 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 450, characters 0-665 +extension_access is never used - <-- line 452 + <-- line 450 {expression_desc = Static_index (e, name, Some pos); comment = None} [@@dead "+extension_access"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 474, characters 0-487 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 472, characters 0-487 +string_index is never used - <-- line 474 + <-- line 472 | _ -> {expression_desc = String_index (e0, e1); comment} [@@dead "+string_index"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 487, characters 0-77 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 485, characters 0-77 +assign is never used - <-- line 487 + <-- line 485 let assign ?comment e0 e1 : t = {expression_desc = Bin (Eq, e0, e1); comment} [@@dead "+assign"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 489, characters 0-419 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 487, characters 0-419 +assign_by_exp is never used - <-- line 489 + <-- line 487 | _ -> assign {expression_desc = Array_index (e, index); comment = None} value [@@dead "+assign_by_exp"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 504, characters 0-99 - +assign_by_int is never used - <-- line 504 - assign_by_exp e0 (int ?comment index) value [@@dead "+assign_by_int"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 507, characters 0-447 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 502, characters 0-447 +record_assign is never used - <-- line 507 + <-- line 502 value [@@dead "+record_assign"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 525, characters 0-457 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 520, characters 0-457 +extension_assign is never used - <-- line 525 + <-- line 520 value [@@dead "+extension_assign"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 545, characters 0-277 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 540, characters 0-277 +array_length is never used - <-- line 545 + <-- line 540 | _ -> {expression_desc = Length (e, Array); comment} [@@dead "+array_length"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 552, characters 0-242 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 547, characters 0-242 +string_length is never used - <-- line 552 + <-- line 547 | _ -> {expression_desc = Length (e, String); comment} [@@dead "+string_length"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 558, characters 0-304 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 553, characters 0-304 +function_length is never used - <-- line 558 + <-- line 553 | _ -> {expression_desc = Length (e, Function); comment} [@@dead "+function_length"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 571, characters 0-1023 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 566, characters 0-1023 +string_append is never used - <-- line 571 + <-- line 566 | _, _ -> {comment; expression_desc = String_append (e, el)} [@@dead "+string_append"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 592, characters 0-94 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 587, characters 0-94 +obj is never used - <-- line 592 + <-- line 587 {expression_desc = Object (dup, properties); comment} [@@dead "+obj"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 595, characters 0-304 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 590, characters 0-304 +str_equal is never used - <-- line 595 + <-- line 590 else None [@@dead "+str_equal"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 605, characters 0-824 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 600, characters 0-824 +triple_equal is never used - <-- line 605 + <-- line 600 | _ -> {expression_desc = Bin (EqEqEq, e0, e1); comment} [@@dead "+triple_equal"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 626, characters 0-493 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 621, characters 0-493 +bin is never used - <-- line 626 + <-- line 621 | _ -> {expression_desc = Bin (op, e0, e1); comment} [@@dead "+bin"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 660, characters 0-17 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 655, characters 0-17 +debug is never used - <-- line 660 + <-- line 655 let debug = false [@@dead "+debug"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 676, characters 0-634 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 671, characters 0-634 +push_negation is never used - <-- line 676 + <-- line 671 | _ -> None [@@dead "+push_negation"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 693, characters 0-27 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 688, characters 0-27 +simplify_max_depth is never used - <-- line 693 + <-- line 688 let simplify_max_depth = 10 [@@dead "+simplify_max_depth"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 735, characters 0-12453 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 730, characters 0-12453 +simplify_and_ is never used - <-- line 735 + <-- line 730 res [@@dead "+simplify_and_"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1044, characters 0-174 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1039, characters 0-174 +simplify_and_force is never used - <-- line 1044 + <-- line 1039 | x -> x [@@dead "+simplify_and_force"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1069, characters 0-818 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1064, characters 0-818 +simplify_or_ is never used - <-- line 1069 + <-- line 1064 res [@@dead "+simplify_or_"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1098, characters 0-171 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1093, characters 0-171 +simplify_or_force is never used - <-- line 1098 + <-- line 1093 | x -> x [@@dead "+simplify_or_force"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1103, characters 0-133 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1098, characters 0-133 +simplify_and is never used - <-- line 1103 + <-- line 1098 else None [@@dead "+simplify_and"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1107, characters 0-131 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1102, characters 0-131 +simplify_or is never used - <-- line 1107 + <-- line 1102 else None [@@dead "+simplify_or"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1111, characters 0-751 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1106, characters 0-751 +and_ is never used - <-- line 1111 + <-- line 1106 | None -> {expression_desc = Bin (And, e1, e2); comment}) [@@dead "+and_"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1131, characters 0-516 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1126, characters 0-516 +or_ is never used - <-- line 1131 + <-- line 1126 | None -> {expression_desc = Bin (Or, e1, e2); comment}) [@@dead "+or_"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1145, characters 0-87 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1140, characters 0-87 +in_ is never used - <-- line 1145 + <-- line 1140 {expression_desc = In (prop, obj); comment = None} [@@dead "+in_"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1148, characters 0-685 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1143, characters 0-685 +not is never used - <-- line 1148 + <-- line 1143 | None -> {expression_desc = Js_not e; comment = None}) [@@dead "+not"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1164, characters 0-124 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1159, characters 0-124 +not_empty_branch is never used - <-- line 1164 + <-- line 1159 | _ -> true [@@dead "+not_empty_branch"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1169, characters 0-1851 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1164, characters 0-1851 +econd is never used - <-- line 1169 + <-- line 1164 | _ -> default () [@@dead "+econd"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1218, characters 0-1526 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1213, characters 0-1526 +float_equal is never used - <-- line 1218 + <-- line 1213 | _ -> {expression_desc = Bin (EqEqEq, e0, e1); comment} [@@dead "+float_equal"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1256, characters 0-27 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1251, characters 0-27 +int_equal is never used - <-- line 1256 + <-- line 1251 let int_equal = float_equal [@@dead "+int_equal"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1281, characters 0-636 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1276, characters 0-636 +emit_check is never used - <-- line 1281 + <-- line 1276 | Expr x -> x [@@dead "+emit_check"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1301, characters 0-199 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1296, characters 0-199 +is_a_literal_case is never used - <-- line 1301 + <-- line 1296 emit_check check [@@dead "+is_a_literal_case"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1308, characters 0-175 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1303, characters 0-175 +is_int_tag is never used - <-- line 1308 + <-- line 1303 emit_check check [@@dead "+is_int_tag"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1320, characters 0-106 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1315, characters 0-106 +tag is never used - <-- line 1320 + <-- line 1315 {expression_desc = Caml_block_tag (e, name); comment} [@@dead "+tag"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1336, characters 0-726 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1331, characters 0-726 +int32_bor is never used - <-- line 1336 + <-- line 1331 | _ -> {comment; expression_desc = Bin (Bor, e1, e2)} [@@dead "+int32_bor"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1354, characters 0-97 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1349, characters 0-97 +to_int32 is never used - <-- line 1354 + <-- line 1349 int32_bor ?comment e zero_int_literal [@@dead "+to_int32"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1358, characters 0-434 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1353, characters 0-434 +string_comp is never used - <-- line 1358 + <-- line 1353 | _ -> bin ?comment (Lam_compile_util.jsop_of_comp cmp) e0 e1 [@@dead "+string_comp"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1367, characters 0-80 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1362, characters 0-80 +string_equal is never used - <-- line 1367 + <-- line 1362 let string_equal ?comment (e0 : t) (e1 : t) : t = string_comp Ceq ?comment e0 e1 [@@dead "+string_equal"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1369, characters 0-91 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1364, characters 0-91 +is_type_number is never used - <-- line 1369 + <-- line 1364 string_equal ?comment (typeof e) (str "number") [@@dead "+is_type_number"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1372, characters 0-91 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1367, characters 0-91 +is_type_string is never used - <-- line 1372 + <-- line 1367 string_equal ?comment (typeof e) (str "string") [@@dead "+is_type_string"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1375, characters 0-71 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1370, characters 0-71 +is_type_object is never used - <-- line 1375 + <-- line 1370 let is_type_object (e : t) : t = string_equal (typeof e) (str "object") [@@dead "+is_type_object"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1377, characters 0-94 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1372, characters 0-94 +obj_length is never used - <-- line 1377 + <-- line 1372 to_int32 {expression_desc = Length (e, Caml_block); comment} [@@dead "+obj_length"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1380, characters 0-186 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1375, characters 0-186 +compare_int_aux is never used - <-- line 1380 + <-- line 1375 | Cge -> l >= r [@@dead "+compare_int_aux"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1389, characters 0-990 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1384, characters 0-990 +int_comp is never used - <-- line 1389 + <-- line 1384 | _ -> bin ?comment (Lam_compile_util.jsop_of_comp cmp) e0 e1 [@@dead "+int_comp"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1417, characters 0-901 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1412, characters 0-901 +bool_comp is never used - <-- line 1417 + <-- line 1412 | _, _ -> bin ?comment (Lam_compile_util.jsop_of_comp cmp) e0 e1 [@@dead "+bool_comp"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1444, characters 0-92 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1439, characters 0-92 +float_comp is never used - <-- line 1444 + <-- line 1439 bin ?comment (Lam_compile_util.jsop_of_comp cmp) e0 e1 [@@dead "+float_comp"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1447, characters 0-89 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1442, characters 0-89 +js_comp is never used - <-- line 1447 + <-- line 1442 bin ?comment (Lam_compile_util.jsop_of_comp cmp) e0 e1 [@@dead "+js_comp"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1450, characters 0-555 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1445, characters 0-555 +int32_lsr is never used - <-- line 1450 + <-- line 1445 | _, _ -> {comment; expression_desc = Bin (Lsr, e1, e2)} [@@dead "+int32_lsr"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1466, characters 0-1966 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1461, characters 0-1966 +is_out is never used - <-- line 1466 + <-- line 1461 | _, _ -> int_comp ?comment Cgt e range [@@dead "+is_out"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1520, characters 0-1244 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1515, characters 0-1244 +float_add is never used - <-- line 1520 + <-- line 1515 | _ -> {comment; expression_desc = Bin (Plus, e1, e2)} [@@dead "+float_add"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1550, characters 0-241 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1545, characters 0-241 +float_minus is never used - <-- line 1550 + <-- line 1545 | _ -> {comment; expression_desc = Bin (Minus, e1, e2)} [@@dead "+float_minus"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1556, characters 0-65 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1551, characters 0-65 +unchecked_int32_add is never used - <-- line 1556 + <-- line 1551 let unchecked_int32_add ?comment e1 e2 = float_add ?comment e1 e2 [@@dead "+unchecked_int32_add"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1557, characters 0-66 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1552, characters 0-66 +int32_add is never used - <-- line 1557 + <-- line 1552 let int32_add ?comment e1 e2 = to_int32 (float_add ?comment e1 e2) [@@dead "+int32_add"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1559, characters 0-91 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1554, characters 0-91 +offset is never used - <-- line 1559 + <-- line 1554 if offset = 0 then e1 else int32_add e1 (small_int offset) [@@dead "+offset"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1562, characters 0-87 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1557, characters 0-87 +int32_minus is never used - <-- line 1562 + <-- line 1557 to_int32 (float_minus ?comment e1 e2) [@@dead "+int32_minus"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1565, characters 0-86 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1560, characters 0-86 +unchecked_int32_minus is never used - <-- line 1565 + <-- line 1560 float_minus ?comment e1 e2 [@@dead "+unchecked_int32_minus"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1568, characters 0-53 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1563, characters 0-53 +float_div is never used - <-- line 1568 + <-- line 1563 let float_div ?comment e1 e2 = bin ?comment Div e1 e2 [@@dead "+float_div"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1569, characters 0-53 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1564, characters 0-53 +float_pow is never used - <-- line 1569 + <-- line 1564 let float_pow ?comment e1 e2 = bin ?comment Pow e1 e2 [@@dead "+float_pow"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1570, characters 0-62 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1565, characters 0-62 +float_notequal is never used - <-- line 1570 + <-- line 1565 let float_notequal ?comment e1 e2 = bin ?comment NotEqEq e1 e2 [@@dead "+float_notequal"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1572, characters 0-94 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1567, characters 0-94 +int32_asr is never used - <-- line 1572 + <-- line 1567 {comment; expression_desc = Bin (Asr, e1, e2)} [@@dead "+int32_asr"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1576, characters 0-482 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1571, characters 0-482 +int32_div is never used - <-- line 1576 + <-- line 1571 else to_int32 (float_div ?comment e1 e2) [@@dead "+int32_div"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1587, characters 0-316 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1582, characters 0-316 +int32_mod is never used - <-- line 1587 + <-- line 1582 else {comment; expression_desc = Bin (Mod, e1, e2)} [@@dead "+int32_mod"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1595, characters 0-53 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1590, characters 0-53 +float_mul is never used - <-- line 1595 + <-- line 1590 let float_mul ?comment e1 e2 = bin ?comment Mul e1 e2 [@@dead "+float_mul"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1597, characters 0-316 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1592, characters 0-316 +int32_lsl is never used - <-- line 1597 + <-- line 1592 | _ -> {comment; expression_desc = Bin (Lsl, e1, e2)} [@@dead "+int32_lsl"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1604, characters 0-253 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1599, characters 0-253 +is_pos_pow is never used - <-- line 1604 + <-- line 1599 try aux 0 n with E -> -1 [@@dead "+is_pos_pow"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1614, characters 0-702 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1609, characters 0-702 +int32_mul is never used - <-- line 1614 + <-- line 1609 | _ -> to_int32 (float_mul ?comment e1 e2) [@@dead "+int32_mul"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1630, characters 0-104 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1625, characters 0-104 +unchecked_int32_mul is never used - <-- line 1630 + <-- line 1625 {comment; expression_desc = Bin (Mul, e1, e2)} [@@dead "+unchecked_int32_mul"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1633, characters 0-179 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1628, characters 0-179 +int_bnot is never used - <-- line 1633 + <-- line 1628 | _ -> {comment; expression_desc = Js_bnot e} [@@dead "+int_bnot"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1638, characters 0-251 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1633, characters 0-251 +int32_pow is never used - <-- line 1638 + <-- line 1633 | _ -> to_int32 (float_pow ?comment e1 e2) [@@dead "+int32_pow"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1644, characters 0-445 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1639, characters 0-445 +int32_bxor is never used - <-- line 1644 + <-- line 1639 | _ -> {comment; expression_desc = Bin (Bxor, e1, e2)} [@@dead "+int32_bxor"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1654, characters 0-384 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1649, characters 0-384 +int32_band is never used - <-- line 1654 + <-- line 1649 | _ -> {comment; expression_desc = Bin (Band, e1, e2)} [@@dead "+int32_band"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1668, characters 0-67 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1663, characters 0-67 +bigint_op is never used - <-- line 1668 + <-- line 1663 let bigint_op ?comment op (e1 : t) (e2 : t) = bin ?comment op e1 e2 [@@dead "+bigint_op"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1670, characters 0-992 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1665, characters 0-992 +bigint_comp is never used - <-- line 1670 + <-- line 1665 | _ -> bin ?comment (Lam_compile_util.jsop_of_comp cmp) e0 e1 [@@dead "+bigint_comp"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1697, characters 0-159 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1692, characters 0-159 +bigint_div is never used - <-- line 1697 + <-- line 1692 else bigint_op ?comment Div e0 e1 [@@dead "+bigint_div"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1701, characters 0-160 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1696, characters 0-160 +bigint_mod is never used - <-- line 1701 + <-- line 1696 else bigint_op ?comment Mod e0 e1 [@@dead "+bigint_mod"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1708, characters 0-596 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1703, characters 0-596 +of_block is never used - <-- line 1708 + <-- line 1703 [] [@@dead "+of_block"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1732, characters 0-58 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1727, characters 0-58 +is_null is never used - <-- line 1732 + <-- line 1727 let is_null ?comment (x : t) = triple_equal ?comment x nil [@@dead "+is_null"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1733, characters 0-59 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1728, characters 0-59 +is_undef is never used - <-- line 1733 + <-- line 1728 let is_undef ?comment x = triple_equal ?comment x undefined [@@dead "+is_undef"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1735, characters 0-117 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1730, characters 0-117 +is_null_undefined_constant is never used - <-- line 1735 + <-- line 1730 | _ -> false [@@dead "+is_null_undefined_constant"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1740, characters 0-216 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1735, characters 0-216 +is_null_undefined is never used - <-- line 1740 + <-- line 1735 | _ -> {comment; expression_desc = Is_null_or_undefined x} [@@dead "+is_null_undefined"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1746, characters 0-605 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1741, characters 0-605 +eq_null_undefined_boolean is never used - <-- line 1746 + <-- line 1741 | _ -> {expression_desc = Bin (EqEqEq, a, b); comment} [@@dead "+eq_null_undefined_boolean"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1761, characters 0-605 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1756, characters 0-605 +neq_null_undefined_boolean is never used - <-- line 1761 + <-- line 1756 | _ -> {expression_desc = Bin (NotEqEq, a, b); comment} [@@dead "+neq_null_undefined_boolean"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1776, characters 0-106 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1771, characters 0-106 +make_exception is never used - <-- line 1776 + <-- line 1771 pure_runtime_call Primitive_modules.exceptions Literals.create [str s] [@@dead "+make_exception"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1779, characters 0-173 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1774, characters 0-173 +variadic_args is never used - <-- line 1779 + <-- line 1774 | arg :: args -> arg :: variadic_args args [@@dead "+variadic_args"] Warning Dead Value @@ -2752,681 +2740,663 @@ val ml_module_as_var : ?comment:string -> ?dynamic_import:bool -> Ident.t -> t [@@dead "+ml_module_as_var"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 87, characters 0-112 - +pure_runtime_call is never used - <-- line 87 - t [@@dead "+pure_runtime_call"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 96, characters 0-39 - +runtime_ref is never used - <-- line 96 - val runtime_ref : string -> string -> t [@@dead "+runtime_ref"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 100, characters 0-187 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 89, characters 0-187 +ocaml_fun is never used - <-- line 100 + <-- line 89 t [@@dead "+ocaml_fun"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 111, characters 0-139 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 100, characters 0-139 +method_ is never used - <-- line 111 + <-- line 100 t [@@dead "+method_"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 120, characters 0-47 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 109, characters 0-47 +econd is never used - <-- line 120 + <-- line 109 val econd : ?comment:string -> t -> t -> t -> t [@@dead "+econd"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 122, characters 0-49 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 111, characters 0-49 +int is never used - <-- line 122 + <-- line 111 val int : ?comment:string -> ?c:int -> int32 -> t [@@dead "+int"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 124, characters 0-24 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 113, characters 0-24 +small_int is never used - <-- line 124 + <-- line 113 val small_int : int -> t [@@dead "+small_int"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 126, characters 0-32 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 115, characters 0-32 +bigint is never used - <-- line 126 + <-- line 115 val bigint : bool -> string -> t [@@dead "+bigint"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 128, characters 0-23 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 117, characters 0-23 +float is never used - <-- line 128 + <-- line 117 val float : string -> t [@@dead "+float"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 132, characters 0-24 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 121, characters 0-24 +zero_int_literal is never used - <-- line 132 + <-- line 121 val zero_int_literal : t [@@dead "+zero_int_literal"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 135, characters 0-22 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 124, characters 0-22 +zero_float_lit is never used - <-- line 135 + <-- line 124 val zero_float_lit : t [@@dead "+zero_float_lit"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 137, characters 0-27 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 126, characters 0-27 +zero_bigint_literal is never used - <-- line 137 + <-- line 126 val zero_bigint_literal : t [@@dead "+zero_bigint_literal"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 139, characters 0-43 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 128, characters 0-43 +is_out is never used - <-- line 139 + <-- line 128 val is_out : ?comment:string -> t -> t -> t [@@dead "+is_out"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 144, characters 0-45 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 133, characters 0-45 +dot is never used - <-- line 144 + <-- line 133 val dot : ?comment:string -> t -> string -> t [@@dead "+dot"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 146, characters 0-45 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 135, characters 0-45 +module_access is never used - <-- line 146 + <-- line 135 val module_access : t -> string -> int32 -> t [@@dead "+module_access"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 148, characters 0-44 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 137, characters 0-44 +array_length is never used - <-- line 148 + <-- line 137 val array_length : ?comment:string -> t -> t [@@dead "+array_length"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 150, characters 0-45 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 139, characters 0-45 +string_length is never used - <-- line 150 + <-- line 139 val string_length : ?comment:string -> t -> t [@@dead "+string_length"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 152, characters 0-47 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 141, characters 0-47 +function_length is never used - <-- line 152 + <-- line 141 val function_length : ?comment:string -> t -> t [@@dead "+function_length"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 154, characters 0-50 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 143, characters 0-50 +string_append is never used - <-- line 154 + <-- line 143 val string_append : ?comment:string -> t -> t -> t [@@dead "+string_append"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 167, characters 0-49 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 156, characters 0-49 +string_index is never used - <-- line 167 + <-- line 156 val string_index : ?comment:string -> t -> t -> t [@@dead "+string_index"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 169, characters 0-48 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 158, characters 0-48 +array_index is never used - <-- line 169 + <-- line 158 val array_index : ?comment:string -> t -> t -> t [@@dead "+array_index"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 171, characters 0-61 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 160, characters 0-61 +array_index_by_int is never used - <-- line 171 + <-- line 160 val array_index_by_int : ?comment:string -> t -> Int32.t -> t [@@dead "+array_index_by_int"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 173, characters 0-47 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 162, characters 0-47 +record_access is never used - <-- line 173 + <-- line 162 val record_access : t -> string -> Int32.t -> t [@@dead "+record_access"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 175, characters 0-54 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 164, characters 0-54 +inline_record_access is never used - <-- line 175 + <-- line 164 val inline_record_access : t -> string -> Int32.t -> t [@@dead "+inline_record_access"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 177, characters 0-36 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 166, characters 0-36 +variant_access is never used - <-- line 177 + <-- line 166 val variant_access : t -> int32 -> t [@@dead "+variant_access"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 179, characters 0-33 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 168, characters 0-33 +cons_access is never used - <-- line 179 + <-- line 168 val cons_access : t -> int32 -> t [@@dead "+cons_access"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 181, characters 0-57 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 170, characters 0-57 +extension_access is never used - <-- line 181 + <-- line 170 val extension_access : t -> string option -> Int32.t -> t [@@dead "+extension_access"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 183, characters 0-50 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 172, characters 0-50 +record_assign is never used - <-- line 183 + <-- line 172 val record_assign : t -> int32 -> string -> t -> t [@@dead "+record_assign"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 185, characters 0-32 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 174, characters 0-32 +poly_var_tag_access is never used - <-- line 185 + <-- line 174 val poly_var_tag_access : t -> t [@@dead "+poly_var_tag_access"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 187, characters 0-34 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 176, characters 0-34 +poly_var_value_access is never used - <-- line 187 + <-- line 176 val poly_var_value_access : t -> t [@@dead "+poly_var_value_access"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 189, characters 0-53 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 178, characters 0-53 +extension_assign is never used - <-- line 189 + <-- line 178 val extension_assign : t -> int32 -> string -> t -> t [@@dead "+extension_assign"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 191, characters 0-59 - +assign_by_int is never used - <-- line 191 - val assign_by_int : ?comment:string -> t -> int32 -> t -> t [@@dead "+assign_by_int"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 199, characters 0-36 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 180, characters 0-36 +assign_by_exp is never used - <-- line 199 + <-- line 180 val assign_by_exp : t -> t -> t -> t [@@dead "+assign_by_exp"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 201, characters 0-43 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 182, characters 0-43 +assign is never used - <-- line 201 + <-- line 182 val assign : ?comment:string -> t -> t -> t [@@dead "+assign"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 205, characters 0-62 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 186, characters 0-62 +emit_check is never used - <-- line 205 + <-- line 186 val emit_check : t Ast_untagged_variants.Dynamic_checks.t -> t [@@dead "+emit_check"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 207, characters 0-49 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 188, characters 0-49 +triple_equal is never used - <-- line 207 + <-- line 188 val triple_equal : ?comment:string -> t -> t -> t [@@dead "+triple_equal"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 210, characters 0-48 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 191, characters 0-48 +float_equal is never used - <-- line 210 + <-- line 191 val float_equal : ?comment:string -> t -> t -> t [@@dead "+float_equal"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 212, characters 0-46 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 193, characters 0-46 +int_equal is never used - <-- line 212 + <-- line 193 val int_equal : ?comment:string -> t -> t -> t [@@dead "+int_equal"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 214, characters 0-40 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 195, characters 0-40 +int_bnot is never used - <-- line 214 + <-- line 195 val int_bnot : ?comment:string -> t -> t [@@dead "+int_bnot"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 216, characters 0-49 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 197, characters 0-49 +string_equal is never used - <-- line 216 + <-- line 197 val string_equal : ?comment:string -> t -> t -> t [@@dead "+string_equal"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 218, characters 0-62 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 199, characters 0-62 +eq_null_undefined_boolean is never used - <-- line 218 + <-- line 199 val eq_null_undefined_boolean : ?comment:string -> t -> t -> t [@@dead "+eq_null_undefined_boolean"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 220, characters 0-63 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 201, characters 0-63 +neq_null_undefined_boolean is never used - <-- line 220 + <-- line 201 val neq_null_undefined_boolean : ?comment:string -> t -> t -> t [@@dead "+neq_null_undefined_boolean"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 222, characters 0-46 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 203, characters 0-46 +is_type_number is never used - <-- line 222 + <-- line 203 val is_type_number : ?comment:string -> t -> t [@@dead "+is_type_number"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 224, characters 0-71 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 205, characters 0-71 +is_int_tag is never used - <-- line 224 + <-- line 205 val is_int_tag : ?has_null_undefined_other:bool * bool * bool -> t -> t [@@dead "+is_int_tag"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 226, characters 0-144 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 207, characters 0-144 +is_a_literal_case is never used - <-- line 226 + <-- line 207 t [@@dead "+is_a_literal_case"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 232, characters 0-46 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 213, characters 0-46 +is_type_string is never used - <-- line 232 + <-- line 213 val is_type_string : ?comment:string -> t -> t [@@dead "+is_type_string"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 234, characters 0-27 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 215, characters 0-27 +is_type_object is never used - <-- line 234 + <-- line 215 val is_type_object : t -> t [@@dead "+is_type_object"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 236, characters 0-38 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 217, characters 0-38 +typeof is never used - <-- line 236 + <-- line 217 val typeof : ?comment:string -> t -> t [@@dead "+typeof"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 237, characters 0-47 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 218, characters 0-47 +instanceof is never used - <-- line 237 + <-- line 218 val instanceof : ?comment:string -> t -> t -> t [@@dead "+instanceof"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 238, characters 0-21 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 219, characters 0-21 +is_array is never used - <-- line 238 + <-- line 219 val is_array : t -> t [@@dead "+is_array"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 240, characters 0-40 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 221, characters 0-40 +to_int32 is never used - <-- line 240 + <-- line 221 val to_int32 : ?comment:string -> t -> t [@@dead "+to_int32"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 242, characters 0-56 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 223, characters 0-56 +unchecked_int32_add is never used - <-- line 242 + <-- line 223 val unchecked_int32_add : ?comment:string -> t -> t -> t [@@dead "+unchecked_int32_add"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 244, characters 0-46 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 225, characters 0-46 +int32_add is never used - <-- line 244 + <-- line 225 val int32_add : ?comment:string -> t -> t -> t [@@dead "+int32_add"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 246, characters 0-26 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 227, characters 0-26 +offset is never used - <-- line 246 + <-- line 227 val offset : t -> int -> t [@@dead "+offset"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 248, characters 0-58 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 229, characters 0-58 +unchecked_int32_minus is never used - <-- line 248 + <-- line 229 val unchecked_int32_minus : ?comment:string -> t -> t -> t [@@dead "+unchecked_int32_minus"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 250, characters 0-48 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 231, characters 0-48 +int32_minus is never used - <-- line 250 + <-- line 231 val int32_minus : ?comment:string -> t -> t -> t [@@dead "+int32_minus"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 252, characters 0-46 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 233, characters 0-46 +int32_mul is never used - <-- line 252 + <-- line 233 val int32_mul : ?comment:string -> t -> t -> t [@@dead "+int32_mul"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 254, characters 0-56 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 235, characters 0-56 +unchecked_int32_mul is never used - <-- line 254 + <-- line 235 val unchecked_int32_mul : ?comment:string -> t -> t -> t [@@dead "+unchecked_int32_mul"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 256, characters 0-62 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 237, characters 0-62 +int32_div is never used - <-- line 256 + <-- line 237 val int32_div : checked:bool -> ?comment:string -> t -> t -> t [@@dead "+int32_div"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 258, characters 0-62 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 239, characters 0-62 +int32_mod is never used - <-- line 258 + <-- line 239 val int32_mod : checked:bool -> ?comment:string -> t -> t -> t [@@dead "+int32_mod"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 260, characters 0-46 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 241, characters 0-46 +int32_pow is never used - <-- line 260 + <-- line 241 val int32_pow : ?comment:string -> t -> t -> t [@@dead "+int32_pow"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 262, characters 0-46 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 243, characters 0-46 +int32_lsl is never used - <-- line 262 + <-- line 243 val int32_lsl : ?comment:string -> t -> t -> t [@@dead "+int32_lsl"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 264, characters 0-46 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 245, characters 0-46 +int32_lsr is never used - <-- line 264 + <-- line 245 val int32_lsr : ?comment:string -> t -> t -> t [@@dead "+int32_lsr"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 266, characters 0-46 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 247, characters 0-46 +int32_asr is never used - <-- line 266 + <-- line 247 val int32_asr : ?comment:string -> t -> t -> t [@@dead "+int32_asr"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 268, characters 0-47 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 249, characters 0-47 +int32_bxor is never used - <-- line 268 + <-- line 249 val int32_bxor : ?comment:string -> t -> t -> t [@@dead "+int32_bxor"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 270, characters 0-47 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 251, characters 0-47 +int32_band is never used - <-- line 270 + <-- line 251 val int32_band : ?comment:string -> t -> t -> t [@@dead "+int32_band"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 272, characters 0-46 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 253, characters 0-46 +int32_bor is never used - <-- line 272 + <-- line 253 val int32_bor : ?comment:string -> t -> t -> t [@@dead "+int32_bor"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 274, characters 0-46 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 255, characters 0-46 +float_add is never used - <-- line 274 + <-- line 255 val float_add : ?comment:string -> t -> t -> t [@@dead "+float_add"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 276, characters 0-48 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 257, characters 0-48 +float_minus is never used - <-- line 276 + <-- line 257 val float_minus : ?comment:string -> t -> t -> t [@@dead "+float_minus"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 278, characters 0-46 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 259, characters 0-46 +float_mul is never used - <-- line 278 + <-- line 259 val float_mul : ?comment:string -> t -> t -> t [@@dead "+float_mul"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 280, characters 0-46 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 261, characters 0-46 +float_div is never used - <-- line 280 + <-- line 261 val float_div : ?comment:string -> t -> t -> t [@@dead "+float_div"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 282, characters 0-51 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 263, characters 0-51 +float_notequal is never used - <-- line 282 + <-- line 263 val float_notequal : ?comment:string -> t -> t -> t [@@dead "+float_notequal"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 284, characters 0-46 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 265, characters 0-46 +float_mod is never used - <-- line 284 + <-- line 265 val float_mod : ?comment:string -> t -> t -> t [@@dead "+float_mod"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 286, characters 0-46 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 267, characters 0-46 +float_pow is never used - <-- line 286 + <-- line 267 val float_pow : ?comment:string -> t -> t -> t [@@dead "+float_pow"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 288, characters 0-70 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 269, characters 0-70 +int_comp is never used - <-- line 288 + <-- line 269 val int_comp : Lam_compat.comparison -> ?comment:string -> t -> t -> t [@@dead "+int_comp"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 290, characters 0-71 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 271, characters 0-71 +bool_comp is never used - <-- line 290 + <-- line 271 val bool_comp : Lam_compat.comparison -> ?comment:string -> t -> t -> t [@@dead "+bool_comp"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 292, characters 0-73 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 273, characters 0-73 +string_comp is never used - <-- line 292 + <-- line 273 val string_comp : Lam_compat.comparison -> ?comment:string -> t -> t -> t [@@dead "+string_comp"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 294, characters 0-72 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 275, characters 0-72 +float_comp is never used - <-- line 294 + <-- line 275 val float_comp : Lam_compat.comparison -> ?comment:string -> t -> t -> t [@@dead "+float_comp"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 296, characters 0-61 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 277, characters 0-61 +bigint_op is never used - <-- line 296 + <-- line 277 val bigint_op : ?comment:string -> Js_op.binop -> t -> t -> t [@@dead "+bigint_op"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 298, characters 0-73 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 279, characters 0-73 +bigint_comp is never used - <-- line 298 + <-- line 279 val bigint_comp : Lam_compat.comparison -> ?comment:string -> t -> t -> t [@@dead "+bigint_comp"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 300, characters 0-63 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 281, characters 0-63 +bigint_div is never used - <-- line 300 + <-- line 281 val bigint_div : checked:bool -> ?comment:string -> t -> t -> t [@@dead "+bigint_div"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 302, characters 0-63 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 283, characters 0-63 +bigint_mod is never used - <-- line 302 + <-- line 283 val bigint_mod : checked:bool -> ?comment:string -> t -> t -> t [@@dead "+bigint_mod"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 304, characters 0-69 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 285, characters 0-69 +js_comp is never used - <-- line 304 + <-- line 285 val js_comp : Lam_compat.comparison -> ?comment:string -> t -> t -> t [@@dead "+js_comp"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 306, characters 0-16 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 287, characters 0-16 +not is never used - <-- line 306 + <-- line 287 val not : t -> t [@@dead "+not"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 308, characters 0-69 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 289, characters 0-69 +call is never used - <-- line 308 + <-- line 289 val call : ?comment:string -> info:Js_call_info.t -> t -> t list -> t [@@dead "+call"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 310, characters 0-46 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 291, characters 0-46 +flat_call is never used - <-- line 310 + <-- line 291 val flat_call : ?comment:string -> t -> t -> t [@@dead "+flat_call"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 312, characters 0-67 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 293, characters 0-67 +tagged_template is never used - <-- line 312 + <-- line 293 val tagged_template : ?comment:string -> t -> t list -> t list -> t [@@dead "+tagged_template"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 318, characters 0-49 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 299, characters 0-49 +optional_block is never used - <-- line 318 + <-- line 299 val optional_block : J.expression -> J.expression [@@dead "+optional_block"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 320, characters 0-58 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 301, characters 0-58 +optional_not_nest_block is never used - <-- line 320 + <-- line 301 val optional_not_nest_block : J.expression -> J.expression [@@dead "+optional_not_nest_block"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 322, characters 0-147 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 303, characters 0-147 +make_block is never used - <-- line 322 + <-- line 303 t [@@dead "+make_block"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 332, characters 0-40 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 313, characters 0-40 +seq is never used - <-- line 332 + <-- line 313 val seq : ?comment:string -> t -> t -> t [@@dead "+seq"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 334, characters 0-34 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 315, characters 0-34 +fuse_to_seq is never used - <-- line 334 + <-- line 315 val fuse_to_seq : t -> t list -> t [@@dead "+fuse_to_seq"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 336, characters 0-69 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 317, characters 0-69 +obj is never used - <-- line 336 + <-- line 317 val obj : ?comment:string -> ?dup:J.expression -> J.property_map -> t [@@dead "+obj"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 338, characters 0-13 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 319, characters 0-13 +true_ is never used - <-- line 338 + <-- line 319 val true_ : t [@@dead "+true_"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 340, characters 0-14 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 321, characters 0-14 +false_ is never used - <-- line 340 + <-- line 321 val false_ : t [@@dead "+false_"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 342, characters 0-20 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 323, characters 0-20 +bool is never used - <-- line 342 + <-- line 323 val bool : bool -> t [@@dead "+bool"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 344, characters 0-12 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 325, characters 0-12 +unit is never used - <-- line 344 + <-- line 325 val unit : t [@@dead "+unit"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 347, characters 0-17 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 328, characters 0-17 +undefined is never used - <-- line 347 + <-- line 328 val undefined : t [@@dead "+undefined"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 349, characters 0-62 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 330, characters 0-62 +tag is never used - <-- line 349 + <-- line 330 val tag : ?comment:string -> ?name:string -> J.expression -> t [@@dead "+tag"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 356, characters 0-53 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 337, characters 0-53 +obj_length is never used - <-- line 356 + <-- line 337 val obj_length : ?comment:string -> J.expression -> t [@@dead "+obj_length"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 358, characters 0-41 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 339, characters 0-41 +and_ is never used - <-- line 358 + <-- line 339 val and_ : ?comment:string -> t -> t -> t [@@dead "+and_"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 360, characters 0-40 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 341, characters 0-40 +or_ is never used - <-- line 360 + <-- line 341 val or_ : ?comment:string -> t -> t -> t [@@dead "+or_"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 362, characters 0-21 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 343, characters 0-21 +in_ is never used - <-- line 362 + <-- line 343 val in_ : t -> t -> t [@@dead "+in_"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 366, characters 0-54 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 347, characters 0-54 +dummy_obj is never used - <-- line 366 + <-- line 347 val dummy_obj : ?comment:string -> Lam_tag_info.t -> t [@@dead "+dummy_obj"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 369, characters 0-74 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 350, characters 0-74 +of_block is never used - <-- line 369 + <-- line 350 val of_block : ?comment:string -> ?e:J.expression -> J.statement list -> t [@@dead "+of_block"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 372, characters 0-73 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 353, characters 0-73 +raw_js_code is never used - <-- line 372 + <-- line 353 val raw_js_code : ?comment:string -> Js_raw_info.code_info -> string -> t [@@dead "+raw_js_code"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 374, characters 0-11 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 355, characters 0-11 +nil is never used - <-- line 374 + <-- line 355 val nil : t [@@dead "+nil"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 376, characters 0-39 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 357, characters 0-39 +is_null is never used - <-- line 376 + <-- line 357 val is_null : ?comment:string -> t -> t [@@dead "+is_null"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 378, characters 0-40 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 359, characters 0-40 +is_undef is never used - <-- line 378 + <-- line 359 val is_undef : ?comment:string -> t -> t [@@dead "+is_undef"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 380, characters 0-53 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 361, characters 0-53 +is_null_undefined_constant is never used - <-- line 380 + <-- line 361 val is_null_undefined_constant : J.expression -> bool [@@dead "+is_null_undefined_constant"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 382, characters 0-49 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 363, characters 0-49 +is_null_undefined is never used - <-- line 382 + <-- line 363 val is_null_undefined : ?comment:string -> t -> t [@@dead "+is_null_undefined"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 384, characters 0-32 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 365, characters 0-32 +make_exception is never used - <-- line 384 + <-- line 365 val make_exception : string -> t [@@dead "+make_exception"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 386, characters 0-36 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 367, characters 0-36 +variadic_args is never used - <-- line 386 + <-- line 367 val variadic_args : t list -> t list [@@dead "+variadic_args"] Warning Dead Module @@ -16373,4 +16343,4 @@ <-- line 38 val peek_minus : t -> bool [@@dead "+peek_minus"] - Analysis reported 2865 issues (Warning Dead Module:152, Warning Dead Type:360, Warning Dead Value:2097, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:195, Warning Unused Argument:24) + Analysis reported 2860 issues (Warning Dead Module:152, Warning Dead Type:360, Warning Dead Value:2092, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:195, Warning Unused Argument:24) diff --git a/compiler/core/js_exp_make.ml b/compiler/core/js_exp_make.ml index 51d9c9c4cbf..812016b1c2f 100644 --- a/compiler/core/js_exp_make.ml +++ b/compiler/core/js_exp_make.ml @@ -154,8 +154,6 @@ let pure_runtime_call module_name fn_name args = (runtime_var_dot module_name fn_name) args -let runtime_ref module_name fn_name = runtime_var_dot module_name fn_name - let str ?(delim = J.DNone) ?comment txt : t = {expression_desc = Str {txt; delim}; comment} @@ -501,9 +499,6 @@ let assign_by_exp (e : t) index value : t = value | _ -> assign {expression_desc = Array_index (e, index); comment = None} value -let assign_by_int ?comment e0 (index : int32) value = - assign_by_exp e0 (int ?comment index) value - let record_assign (e : t) (pos : int32) (name : string) (value : t) = match e.expression_desc with | Array _ diff --git a/compiler/core/js_exp_make.mli b/compiler/core/js_exp_make.mli index d0042c9c7f9..d61cd812fcb 100644 --- a/compiler/core/js_exp_make.mli +++ b/compiler/core/js_exp_make.mli @@ -84,17 +84,6 @@ val runtime_call : (* args *) t -val pure_runtime_call : - string -> - (* module_name *) - string -> - (* fn_name *) - t list -> - (* args *) - t - -val runtime_ref : string -> string -> t - val str : ?delim:J.delim -> ?comment:string -> string -> t val ocaml_fun : @@ -188,14 +177,6 @@ val poly_var_value_access : t -> t val extension_assign : t -> int32 -> string -> t -> t -val assign_by_int : ?comment:string -> t -> int32 -> t -> t -(** - [assign_by_int e i v] - if the expression [e] is a temporay block - which has no side effect, - write to it does not really make sense, - optimize it away *) - val assign_by_exp : t -> t -> t -> t val assign : ?comment:string -> t -> t -> t From f6c704eec3007bc3c25273cecedc8f7c46dfcdcb Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 12:45:06 +0000 Subject: [PATCH 087/214] dce: note js exp liveness --- scripts/dce/live-findings.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/scripts/dce/live-findings.md b/scripts/dce/live-findings.md index 173a530e3cb..5adbabde056 100644 --- a/scripts/dce/live-findings.md +++ b/scripts/dce/live-findings.md @@ -251,6 +251,29 @@ live after manual validation. dumper warnings are cross-module compiler output paths, including `.cppo.ml` and jsoo entry points that this DCE run misses. +### `Js_exp_make` expression builders + +- Report: large `Warning Dead Value` cluster in + `compiler/core/js_exp_make.ml` / `.mli`. +- Verdict: live; false positive for the remaining reported builders and their + local helper chains. +- Validation: the module is imported as `module E = Js_exp_make` across core + lowering and JS passes, including `lam_compile.ml`, + `lam_compile_primitive.ml`, `lam_compile_external_call.ml`, + `lam_compile_external_obj.ml`, `js_stmt_make.ml`, `js_output.ml`, + `js_of_lam_array.ml`, `js_of_lam_block.ml`, `js_of_lam_option.ml`, + `js_of_lam_string.ml`, `js_of_lam_variant.ml`, `js_pass_flatten.ml`, + `js_pass_flatten_and_mark_dead.ml`, and `js_pass_external_shadow.ml`. Direct + `Js_exp_make.remove_pure_sub_exp` calls also exist in `lam_compile.ml`, and + tests use `Js_exp_make.var`. +- Context: `runtime_ref`, `assign_by_int`, and the public signature export for + `pure_runtime_call` had no callers and were removed. The remaining zero + direct-call entries, such as `bin`, `str_equal`, `push_negation`, and the + `simplify_*` helpers, are local dependencies of exported builders that are + used through `E.*`. The debug-printer ref is intentionally left because + removing its `Js_dump` hook unroots a large live dump-printer subgraph in the + current DCE report. + ### `File_deps.File_hash` callbacks - Report: `Warning Dead Module` and `Warning Dead Value`, From 5813dfe29e9b2442489e527941584837435d4245 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 12:46:39 +0000 Subject: [PATCH 088/214] dce: trim option helpers --- _dce/report.txt | 110 ++++++++++------------------- compiler/core/js_of_lam_option.ml | 4 -- compiler/core/js_of_lam_option.mli | 4 -- 3 files changed, 37 insertions(+), 81 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index eaa07c2edd5..5bbc08f2049 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -3629,152 +3629,116 @@ File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.ml", line 1, characters 0-0 +js_of_lam_option is a dead module as all its items are dead. - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.ml", line 27, characters 26-42 - option_unwrap_time.Static_unwrapped is a variant case which is never constructed - <-- line 27 - type option_unwrap_time = Static_unwrapped [@dead "option_unwrap_time.Static_unwrapped"] | Runtime_maybe_unwrapped - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.ml", line 27, characters 43-68 - option_unwrap_time.Runtime_maybe_unwrapped is a variant case which is never constructed - <-- line 27 - type option_unwrap_time = Static_unwrapped [@dead "option_unwrap_time.Static_unwrapped"] | Runtime_maybe_unwrapped [@dead "option_unwrap_time.Runtime_maybe_unwrapped"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.ml", line 37, characters 0-37 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.ml", line 35, characters 0-37 +none is never used - <-- line 37 + <-- line 35 let none : J.expression = E.undefined [@@dead "+none"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.ml", line 39, characters 0-102 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.ml", line 37, characters 0-102 +is_none_static is never used - <-- line 39 + <-- line 37 | _ -> false [@@dead "+is_none_static"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.ml", line 44, characters 0-226 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.ml", line 42, characters 0-226 +is_not_none is never used - <-- line 44 + <-- line 42 | _ -> E.not (E.triple_equal e none) [@@dead "+is_not_none"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.ml", line 67, characters 0-177 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.ml", line 65, characters 0-177 +val_from_option is never used - <-- line 67 + <-- line 65 | _ -> E.runtime_call Primitive_modules.option "valFromOption" [arg] [@@dead "+val_from_option"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.ml", line 72, characters 0-496 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.ml", line 70, characters 0-496 +get_default_undefined_from_optional is never used - <-- line 72 + <-- line 70 else E.runtime_call Primitive_modules.option "valFromOption" [arg] [@@dead "+get_default_undefined_from_optional"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.ml", line 84, characters 0-327 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.ml", line 82, characters 0-327 +option_unwrap is never used - <-- line 84 + <-- line 82 | _ -> E.runtime_call Primitive_modules.option "unwrapPolyVar" [arg] [@@dead "+option_unwrap"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.ml", line 93, characters 0-265 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.ml", line 91, characters 0-265 +destruct_optional is never used - <-- line 93 + <-- line 91 | _ -> not_sure () [@@dead "+destruct_optional"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.ml", line 102, characters 0-27 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.ml", line 100, characters 0-27 +some is never used - <-- line 102 + <-- line 100 let some = E.optional_block [@@dead "+some"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.ml", line 104, characters 0-55 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.ml", line 102, characters 0-55 +null_to_opt is never used - <-- line 104 + <-- line 102 let null_to_opt e = E.econd (E.is_null e) none (some e) [@@dead "+null_to_opt"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.ml", line 106, characters 0-57 - +undef_to_opt is never used - <-- line 106 - let undef_to_opt e = E.econd (E.is_undef e) none (some e) [@@dead "+undef_to_opt"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.ml", line 108, characters 0-71 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.ml", line 104, characters 0-71 +null_undef_to_opt is never used - <-- line 108 + <-- line 104 let null_undef_to_opt e = E.econd (E.is_null_undefined e) none (some e) [@@dead "+null_undef_to_opt"] Warning Dead Module File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.mli", line 1, characters 0-0 js_of_lam_option is a dead module as all its items are dead. - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.mli", line 25, characters 26-42 - option_unwrap_time.Static_unwrapped is a variant case which is never constructed - <-- line 25 - type option_unwrap_time = Static_unwrapped [@dead "option_unwrap_time.Static_unwrapped"] | Runtime_maybe_unwrapped - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.mli", line 25, characters 43-68 - option_unwrap_time.Runtime_maybe_unwrapped is a variant case which is never constructed - <-- line 25 - type option_unwrap_time = Static_unwrapped [@dead "option_unwrap_time.Static_unwrapped"] | Runtime_maybe_unwrapped [@dead "option_unwrap_time.Runtime_maybe_unwrapped"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.mli", line 27, characters 0-50 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.mli", line 25, characters 0-50 +val_from_option is never used - <-- line 27 + <-- line 25 val val_from_option : J.expression -> J.expression [@@dead "+val_from_option"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.mli", line 30, characters 0-70 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.mli", line 28, characters 0-70 +get_default_undefined_from_optional is never used - <-- line 30 + <-- line 28 val get_default_undefined_from_optional : J.expression -> J.expression [@@dead "+get_default_undefined_from_optional"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.mli", line 33, characters 0-48 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.mli", line 31, characters 0-48 +option_unwrap is never used - <-- line 33 + <-- line 31 val option_unwrap : J.expression -> J.expression [@@dead "+option_unwrap"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.mli", line 37, characters 0-135 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.mli", line 35, characters 0-135 +destruct_optional is never used - <-- line 37 + <-- line 35 'a [@@dead "+destruct_optional"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.mli", line 44, characters 0-39 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.mli", line 42, characters 0-39 +some is never used - <-- line 44 + <-- line 42 val some : J.expression -> J.expression [@@dead "+some"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.mli", line 46, characters 0-46 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.mli", line 44, characters 0-46 +is_not_none is never used - <-- line 46 + <-- line 44 val is_not_none : J.expression -> J.expression [@@dead "+is_not_none"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.mli", line 48, characters 0-46 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.mli", line 46, characters 0-46 +null_to_opt is never used - <-- line 48 + <-- line 46 val null_to_opt : J.expression -> J.expression [@@dead "+null_to_opt"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.mli", line 50, characters 0-47 - +undef_to_opt is never used - <-- line 50 - val undef_to_opt : J.expression -> J.expression [@@dead "+undef_to_opt"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.mli", line 52, characters 0-52 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.mli", line 48, characters 0-52 +null_undef_to_opt is never used - <-- line 52 + <-- line 48 val null_undef_to_opt : J.expression -> J.expression [@@dead "+null_undef_to_opt"] Warning Dead Module @@ -16343,4 +16307,4 @@ <-- line 38 val peek_minus : t -> bool [@@dead "+peek_minus"] - Analysis reported 2860 issues (Warning Dead Module:152, Warning Dead Type:360, Warning Dead Value:2092, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:195, Warning Unused Argument:24) + Analysis reported 2854 issues (Warning Dead Module:152, Warning Dead Type:356, Warning Dead Value:2090, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:195, Warning Unused Argument:24) diff --git a/compiler/core/js_of_lam_option.ml b/compiler/core/js_of_lam_option.ml index 61cbcae2723..ef9afc1fa3e 100644 --- a/compiler/core/js_of_lam_option.ml +++ b/compiler/core/js_of_lam_option.ml @@ -24,8 +24,6 @@ module E = Js_exp_make -type option_unwrap_time = Static_unwrapped | Runtime_maybe_unwrapped - (** Another way: {[ | Var _ -> @@ -103,6 +101,4 @@ let some = E.optional_block let null_to_opt e = E.econd (E.is_null e) none (some e) -let undef_to_opt e = E.econd (E.is_undef e) none (some e) - let null_undef_to_opt e = E.econd (E.is_null_undefined e) none (some e) diff --git a/compiler/core/js_of_lam_option.mli b/compiler/core/js_of_lam_option.mli index c09d0f5fdf8..c4b6285099a 100644 --- a/compiler/core/js_of_lam_option.mli +++ b/compiler/core/js_of_lam_option.mli @@ -22,8 +22,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *) -type option_unwrap_time = Static_unwrapped | Runtime_maybe_unwrapped - val val_from_option : J.expression -> J.expression (** Given [Some a ], return [a] *) @@ -47,6 +45,4 @@ val is_not_none : J.expression -> J.expression val null_to_opt : J.expression -> J.expression -val undef_to_opt : J.expression -> J.expression - val null_undef_to_opt : J.expression -> J.expression From 5da36b65a320ddab9584993dc4cbe67597c22599 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 12:46:58 +0000 Subject: [PATCH 089/214] dce: note js lowering liveness --- scripts/dce/live-findings.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/scripts/dce/live-findings.md b/scripts/dce/live-findings.md index 5adbabde056..a629174d27a 100644 --- a/scripts/dce/live-findings.md +++ b/scripts/dce/live-findings.md @@ -274,6 +274,30 @@ live after manual validation. removing its `Js_dump` hook unroots a large live dump-printer subgraph in the current DCE report. +### Core JS lowering helpers + +- Report: `Warning Dead Module`, `Warning Dead Value`, and constructor warnings + in `compiler/core/js_fold_basic.ml`, `js_fun_env.ml`, + `js_name_of_module_id.mli`, `js_of_lam_array.ml`, + `js_of_lam_block.ml`, `js_of_lam_option.ml`, `js_of_lam_string.ml`, and + `js_of_lam_variant.ml` / `.mli`. +- Verdict: live; false positive for the remaining reported helpers. +- Validation: `lam_compile_main.cppo.ml` calls + `Js_fold_basic.calculate_hard_dependencies`. `Js_fun_env.make` is used while + building JS functions in `Js_exp_make`; `js_pass_scope.ml` and + `js_pass_tailcall_inline.ml` use `set_unbounded`, `mark_unused`, + `get_mutable_params`, and `no_tailcall`. `Js_name_of_module_id` is used by + `lam_compile_primitive.ml` and `js_dump_program.ml`. Array, block, option, + string, and variant lowering helpers are called from `lam_compile.ml`, + `lam_compile_const.ml`, `lam_compile_primitive.ml`, + `lam_compile_external_obj.ml`, and `lam_compile_external_call.ml`. +- Context: `Js_of_lam_option.option_unwrap_time` and `undef_to_opt` had no + callers and were removed. The `Js_of_lam_variant.arg_expression` constructor + warnings are false positives: `lam_compile_external_call.ml` re-exports the + same constructors with + `type arg_expression = Js_of_lam_variant.arg_expression = ...`, then + constructs and pattern matches `Splice0`, `Splice1`, and `Splice2`. + ### `File_deps.File_hash` callbacks - Report: `Warning Dead Module` and `Warning Dead Value`, From 678bb37509372602f4cd706448c8a571486d13b1 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 12:48:58 +0000 Subject: [PATCH 090/214] dce: trim js op types --- _dce/report.txt | 220 +++++------------------------------ compiler/core/j.ml | 4 - compiler/core/js_op.ml | 44 +------ compiler/core/js_op_util.ml | 26 ----- compiler/core/js_op_util.mli | 4 - 5 files changed, 30 insertions(+), 268 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index 5bbc08f2049..680fcc2213f 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -1348,9 +1348,9 @@ val js_stdout : bool ref [@@dead "+js_stdout"] Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/j.ml", line 78, characters 65-78 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/j.ml", line 77, characters 65-78 delim.DBackQuotes is a variant case which is never constructed - <-- line 78 + <-- line 77 and delim = External_arg_spec.delim = DNone | DStarJ | DNoQuotes | DBackQuotes [@dead "delim.DBackQuotes"] Warning Dead Value With Side Effects @@ -3846,243 +3846,81 @@ val eval_as_unwrap : J.expression -> J.expression [@@dead "+eval_as_unwrap"] Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op.ml", line 41, characters 2-8 - binop.Bnot is a variant case which is never constructed - <-- line 41 - | Bnot [@dead "binop.Bnot"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op.ml", line 92, characters 2-7 - int_op.Bor is a variant case which is never constructed - <-- line 92 - | Bor [@dead "int_op.Bor"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op.ml", line 93, characters 2-8 - int_op.Bxor is a variant case which is never constructed - <-- line 93 - | Bxor [@dead "int_op.Bxor"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op.ml", line 94, characters 2-8 - int_op.Band is a variant case which is never constructed - <-- line 94 - | Band [@dead "int_op.Band"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op.ml", line 95, characters 2-7 - int_op.Lsl is a variant case which is never constructed - <-- line 95 - | Lsl [@dead "int_op.Lsl"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op.ml", line 96, characters 2-7 - int_op.Lsr is a variant case which is never constructed - <-- line 96 - | Lsr [@dead "int_op.Lsr"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op.ml", line 97, characters 2-7 - int_op.Asr is a variant case which is never constructed - <-- line 97 - | Asr [@dead "int_op.Asr"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op.ml", line 98, characters 2-8 - int_op.Plus is a variant case which is never constructed - <-- line 98 - | Plus [@dead "int_op.Plus"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op.ml", line 102, characters 2-9 - int_op.Minus is a variant case which is never constructed - <-- line 102 - | Minus [@dead "int_op.Minus"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op.ml", line 104, characters 2-7 - int_op.Mul is a variant case which is never constructed - <-- line 104 - | Mul [@dead "int_op.Mul"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op.ml", line 106, characters 2-7 - int_op.Div is a variant case which is never constructed - <-- line 106 - | Div [@dead "int_op.Div"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op.ml", line 108, characters 2-7 - int_op.Mod is a variant case which is never constructed - <-- line 108 - | Mod [@dead "int_op.Mod"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op.ml", line 110, characters 2-7 - int_op.Pow is a variant case which is never constructed - <-- line 110 - | Pow [@dead "int_op.Pow"] (* x ** y | 0 *) - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op.ml", line 119, characters 13-16 - level.Log is a variant case which is never constructed - <-- line 119 - type level = Log [@dead "level.Log"] | Info | Warn | Error - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op.ml", line 119, characters 17-23 - level.Info is a variant case which is never constructed - <-- line 119 - type level = Log [@dead "level.Log"] | Info [@dead "level.Info"] | Warn | Error - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op.ml", line 119, characters 24-30 - level.Warn is a variant case which is never constructed - <-- line 119 - type level = Log [@dead "level.Log"] | Info [@dead "level.Info"] | Warn [@dead "level.Warn"] | Error - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op.ml", line 119, characters 31-38 - level.Error is a variant case which is never constructed - <-- line 119 - type level = Log [@dead "level.Log"] | Info [@dead "level.Info"] | Warn [@dead "level.Warn"] | Error [@dead "level.Error"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op.ml", line 130, characters 38-44 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op.ml", line 99, characters 38-44 property.Strict is a variant case which is never constructed - <-- line 130 + <-- line 99 type property = Lam_compat.let_kind = Strict [@dead "property.Strict"] | Alias | StrictOpt | Variable Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op.ml", line 130, characters 45-52 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op.ml", line 99, characters 45-52 property.Alias is a variant case which is never constructed - <-- line 130 + <-- line 99 type property = Lam_compat.let_kind = Strict [@dead "property.Strict"] | Alias [@dead "property.Alias"] | StrictOpt | Variable Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op.ml", line 130, characters 53-64 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op.ml", line 99, characters 53-64 property.StrictOpt is a variant case which is never constructed - <-- line 130 + <-- line 99 type property = Lam_compat.let_kind = Strict [@dead "property.Strict"] | Alias [@dead "property.Alias"] | StrictOpt [@dead "property.StrictOpt"] | Variable Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op.ml", line 130, characters 65-75 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op.ml", line 99, characters 65-75 property.Variable is a variant case which is never constructed - <-- line 130 + <-- line 99 type property = Lam_compat.let_kind = Strict [@dead "property.Strict"] | Alias [@dead "property.Alias"] | StrictOpt [@dead "property.StrictOpt"] | Variable [@dead "property.Variable"] - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op.ml", line 134, characters 17-23 - access.Getter is a variant case which is never constructed - <-- line 134 - type 'a access = Getter [@dead "access.Getter"] | Setter - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op.ml", line 134, characters 24-32 - access.Setter is a variant case which is never constructed - <-- line 134 - type 'a access = Getter [@dead "access.Getter"] | Setter [@dead "access.Setter"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op.ml", line 162, characters 22-37 - recursive_info.SingleRecursive is a variant case which is never constructed - <-- line 162 - type recursive_info = SingleRecursive [@dead "recursive_info.SingleRecursive"] | NonRecursie | NA - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op.ml", line 162, characters 38-51 - recursive_info.NonRecursie is a variant case which is never constructed - <-- line 162 - type recursive_info = SingleRecursive [@dead "recursive_info.SingleRecursive"] | NonRecursie [@dead "recursive_info.NonRecursie"] | NA - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op.ml", line 162, characters 52-56 - recursive_info.NA is a variant case which is never constructed - <-- line 162 - type recursive_info = SingleRecursive [@dead "recursive_info.SingleRecursive"] | NonRecursie [@dead "recursive_info.NonRecursie"] | NA [@dead "recursive_info.NA"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op.ml", line 197, characters 36-43 - length_object.Bytes is a variant case which is never constructed - <-- line 197 - type length_object = Array | String | Bytes [@dead "length_object.Bytes"] | Function | Caml_block - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op_util.ml", line 46, characters 0-247 - +op_int_prec is never used - <-- line 46 - | Pow -> (13, 14, 12) [@@dead "+op_int_prec"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op_util.ml", line 82, characters 0-242 - +op_int_str is never used - <-- line 82 - | Pow -> "**" [@@dead "+op_int_str"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op_util.ml", line 97, characters 0-305 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op_util.ml", line 71, characters 0-305 +str_of_used_stats is never used - <-- line 97 + <-- line 71 | NA -> "NA" [@@dead "+str_of_used_stats"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op_util.ml", line 108, characters 0-249 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op_util.ml", line 82, characters 0-249 +update_used_stats is never used - <-- line 108 + <-- line 82 ident_info.used_stats <- used_stats [@@dead "+update_used_stats"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op_util.ml", line 114, characters 0-174 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op_util.ml", line 88, characters 0-174 +same_str_opt is never used - <-- line 114 + <-- line 88 | None, Some _ | Some _, None -> false [@@dead "+same_str_opt"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op_util.ml", line 120, characters 0-576 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op_util.ml", line 94, characters 0-576 +same_vident is never used - <-- line 120 + <-- line 94 | Id _, Qualified _ | Qualified _, Id _ -> false [@@dead "+same_vident"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op_util.ml", line 135, characters 0-139 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op_util.ml", line 109, characters 0-139 +of_lam_mutable_flag is never used - <-- line 135 + <-- line 109 | Mutable -> Mutable [@@dead "+of_lam_mutable_flag"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op_util.mli", line 31, characters 0-49 - +op_int_prec is never used - <-- line 31 - val op_int_prec : Js_op.int_op -> int * int * int [@@dead "+op_int_prec"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op_util.mli", line 33, characters 0-39 - +op_int_str is never used - <-- line 33 - val op_int_str : Js_op.int_op -> string [@@dead "+op_int_str"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op_util.mli", line 35, characters 0-50 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op_util.mli", line 31, characters 0-50 +str_of_used_stats is never used - <-- line 35 + <-- line 31 val str_of_used_stats : Js_op.used_stats -> string [@@dead "+str_of_used_stats"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op_util.mli", line 37, characters 0-64 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op_util.mli", line 33, characters 0-64 +update_used_stats is never used - <-- line 37 + <-- line 33 val update_used_stats : J.ident_info -> Js_op.used_stats -> unit [@@dead "+update_used_stats"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op_util.mli", line 39, characters 0-46 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op_util.mli", line 35, characters 0-46 +same_vident is never used - <-- line 39 + <-- line 35 val same_vident : J.vident -> J.vident -> bool [@@dead "+same_vident"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op_util.mli", line 41, characters 0-69 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op_util.mli", line 37, characters 0-69 +of_lam_mutable_flag is never used - <-- line 41 + <-- line 37 val of_lam_mutable_flag : Asttypes.mutable_flag -> Js_op.mutable_flag [@@dead "+of_lam_mutable_flag"] Warning Dead Value @@ -16307,4 +16145,4 @@ <-- line 38 val peek_minus : t -> bool [@@dead "+peek_minus"] - Analysis reported 2854 issues (Warning Dead Module:152, Warning Dead Type:356, Warning Dead Value:2090, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:195, Warning Unused Argument:24) + Analysis reported 2827 issues (Warning Dead Module:152, Warning Dead Type:333, Warning Dead Value:2086, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:195, Warning Unused Argument:24) diff --git a/compiler/core/j.ml b/compiler/core/j.ml index f20b22ec727..cbb4c7214ee 100644 --- a/compiler/core/j.ml +++ b/compiler/core/j.ml @@ -33,7 +33,6 @@ type mutable_flag = Js_op.mutable_flag type binop = Js_op.binop -type int_op = Js_op.int_op type kind = Js_op.kind type property = Js_op.property type number = Js_op.number @@ -93,9 +92,6 @@ and expression_desc = | Seq of expression * expression | Cond of expression * expression * expression | Bin of binop * expression * expression - (* [int_op] will guarantee return [int32] bits - https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Operators/Bitwise_Operators *) - (* | Int32_bin of int_op * expression * expression *) | FlatCall of expression * expression (* f.apply(null,args) -- Fully applied guaranteed TODO: once we know args's shape -- diff --git a/compiler/core/js_op.ml b/compiler/core/js_op.ml index 769af321afc..9c83ef9128d 100644 --- a/compiler/core/js_op.ml +++ b/compiler/core/js_op.ml @@ -38,7 +38,6 @@ type binop = | Le | Gt | Ge - | Bnot | Bor | Bxor | Band @@ -88,36 +87,6 @@ type binop = So in Js, [-1 >>>0] will be the largest Uint32, while [-1>>0] will remain [-1] and [-1 >>> 0 >> 0 ] will be [-1] *) -type int_op = - | Bor - | Bxor - | Band - | Lsl - | Lsr - | Asr - | Plus - (* for [+], given two numbers - x + y | 0 - *) - | Minus - (* x - y | 0 *) - | Mul - (* *) - | Div - (* x / y | 0 *) - | Mod - (* x % y *) - | Pow (* x ** y | 0 *) - -(* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Expressions_and_Operators#Bitwise_operators - {[ - ~ - ]} - ~0xff -> -256 - design; make sure each operation type is consistent -*) -type level = Log | Info | Warn | Error - type kind = | Ml | Runtime @@ -131,8 +100,6 @@ type property = Lam_compat.let_kind = Strict | Alias | StrictOpt | Variable type property_name = Lit of string | Symbol_name -type 'a access = Getter | Setter - (* literal char *) type float_lit = {f: string} [@@unboxed] @@ -153,14 +120,6 @@ type mutable_flag = Mutable | Immutable | NA type direction_flag = Upto | Downto | Up -(* - {[ - let rec x = 1 :: y - and y = 1 :: x - ]} -*) -type recursive_info = SingleRecursive | NonRecursie | NA - type used_stats = | Dead_pure (* only [Dead] should be taken serious, @@ -186,7 +145,6 @@ type used_stats = | NA type ident_info = { - (* mutable recursive_info : recursive_info; *) mutable used_stats: used_stats; } @@ -194,7 +152,7 @@ type exports = Ident.t list type tag_info = Lam_tag_info.t -type length_object = Array | String | Bytes | Function | Caml_block +type length_object = Array | String | Function | Caml_block (** TODO: define constant - for better constant folding *) (* type constant = *) diff --git a/compiler/core/js_op_util.ml b/compiler/core/js_op_util.ml index 8d2d8636396..195b54d8b34 100644 --- a/compiler/core/js_op_util.ml +++ b/compiler/core/js_op_util.ml @@ -39,23 +39,12 @@ let op_prec (op : Js_op.binop) = | Bxor -> (6, 6, 6) | Band -> (7, 7, 7) | Lsl | Lsr | Asr -> (10, 10, 11) - | Bnot | Plus | Minus -> (11, 11, 12) - | Mul | Div | Mod -> (12, 12, 13) - | Pow -> (13, 14, 12) - -let op_int_prec (op : Js_op.int_op) = - match op with - | Bor -> (5, 5, 5) - | Bxor -> (6, 6, 6) - | Band -> (7, 7, 7) - | Lsl | Lsr | Asr -> (10, 10, 11) | Plus | Minus -> (11, 11, 12) | Mul | Div | Mod -> (12, 12, 13) | Pow -> (13, 14, 12) let op_str (op : Js_op.binop) = match op with - | Bnot -> "~" | Bor -> "|" | Bxor -> "^" | Band -> "&" @@ -79,21 +68,6 @@ let op_str (op : Js_op.binop) = | Ge -> ">=" | InstanceOf -> "instanceof" -let op_int_str (op : Js_op.int_op) = - match op with - | Bor -> "|" - | Bxor -> "^" - | Band -> "&" - | Lsl -> "<<" - | Lsr -> ">>>" - | Asr -> ">>" - | Plus -> "+" - | Minus -> "-" - | Mul -> "*" - | Div -> "/" - | Mod -> "%" - | Pow -> "**" - let str_of_used_stats x = match (x : Js_op.used_stats) with | Js_op.Dead_pure -> "Dead_pure" diff --git a/compiler/core/js_op_util.mli b/compiler/core/js_op_util.mli index db11b3ec08c..16ad8ad6e11 100644 --- a/compiler/core/js_op_util.mli +++ b/compiler/core/js_op_util.mli @@ -28,10 +28,6 @@ val op_prec : Js_op.binop -> int * int * int val op_str : Js_op.binop -> string -val op_int_prec : Js_op.int_op -> int * int * int - -val op_int_str : Js_op.int_op -> string - val str_of_used_stats : Js_op.used_stats -> string val update_used_stats : J.ident_info -> Js_op.used_stats -> unit From 75b47045a050db97b7e7bdbde8770ad4eb94c33c Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 12:49:59 +0000 Subject: [PATCH 091/214] dce: trim js debug helpers --- _dce/report.txt | 54 ++++++++++-------------------------- compiler/core/js_op_util.ml | 11 -------- compiler/core/js_op_util.mli | 2 -- compiler/core/js_output.ml | 2 -- compiler/core/js_output.mli | 2 -- 5 files changed, 15 insertions(+), 56 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index 680fcc2213f..bcf1a41e71d 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -3870,57 +3870,45 @@ type property = Lam_compat.let_kind = Strict [@dead "property.Strict"] | Alias [@dead "property.Alias"] | StrictOpt [@dead "property.StrictOpt"] | Variable [@dead "property.Variable"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op_util.ml", line 71, characters 0-305 - +str_of_used_stats is never used - <-- line 71 - | NA -> "NA" [@@dead "+str_of_used_stats"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op_util.ml", line 82, characters 0-249 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op_util.ml", line 71, characters 0-249 +update_used_stats is never used - <-- line 82 + <-- line 71 ident_info.used_stats <- used_stats [@@dead "+update_used_stats"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op_util.ml", line 88, characters 0-174 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op_util.ml", line 77, characters 0-174 +same_str_opt is never used - <-- line 88 + <-- line 77 | None, Some _ | Some _, None -> false [@@dead "+same_str_opt"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op_util.ml", line 94, characters 0-576 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op_util.ml", line 83, characters 0-576 +same_vident is never used - <-- line 94 + <-- line 83 | Id _, Qualified _ | Qualified _, Id _ -> false [@@dead "+same_vident"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op_util.ml", line 109, characters 0-139 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op_util.ml", line 98, characters 0-139 +of_lam_mutable_flag is never used - <-- line 109 + <-- line 98 | Mutable -> Mutable [@@dead "+of_lam_mutable_flag"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op_util.mli", line 31, characters 0-50 - +str_of_used_stats is never used - <-- line 31 - val str_of_used_stats : Js_op.used_stats -> string [@@dead "+str_of_used_stats"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op_util.mli", line 33, characters 0-64 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op_util.mli", line 31, characters 0-64 +update_used_stats is never used - <-- line 33 + <-- line 31 val update_used_stats : J.ident_info -> Js_op.used_stats -> unit [@@dead "+update_used_stats"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op_util.mli", line 35, characters 0-46 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op_util.mli", line 33, characters 0-46 +same_vident is never used - <-- line 35 + <-- line 33 val same_vident : J.vident -> J.vident -> bool [@@dead "+same_vident"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op_util.mli", line 37, characters 0-69 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op_util.mli", line 35, characters 0-69 +of_lam_mutable_flag is never used - <-- line 37 + <-- line 35 val of_lam_mutable_flag : Asttypes.mutable_flag -> Js_op.mutable_flag [@@dead "+of_lam_mutable_flag"] Warning Dead Value @@ -3989,12 +3977,6 @@ <-- line 141 Ext_list.fold_right xs dummy (fun x acc -> append_output x acc) [@@dead "+concat"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_output.ml", line 144, characters 0-61 - +to_string is never used - <-- line 144 - let to_string x = Js_dump.string_of_block (output_as_block x) [@@dead "+to_string"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_output.mli", line 41, characters 0-75 +make is never used @@ -4043,12 +4025,6 @@ <-- line 77 val concat : t list -> t [@@dead "+concat"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_output.mli", line 79, characters 0-27 - +to_string is never used - <-- line 79 - val to_string : t -> string [@@dead "+to_string"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_packages_info.ml", line 31, characters 0-143 +compatible is never used @@ -16145,4 +16121,4 @@ <-- line 38 val peek_minus : t -> bool [@@dead "+peek_minus"] - Analysis reported 2827 issues (Warning Dead Module:152, Warning Dead Type:333, Warning Dead Value:2086, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:195, Warning Unused Argument:24) + Analysis reported 2823 issues (Warning Dead Module:152, Warning Dead Type:333, Warning Dead Value:2082, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:195, Warning Unused Argument:24) diff --git a/compiler/core/js_op_util.ml b/compiler/core/js_op_util.ml index 195b54d8b34..38cad31bf89 100644 --- a/compiler/core/js_op_util.ml +++ b/compiler/core/js_op_util.ml @@ -68,17 +68,6 @@ let op_str (op : Js_op.binop) = | Ge -> ">=" | InstanceOf -> "instanceof" -let str_of_used_stats x = - match (x : Js_op.used_stats) with - | Js_op.Dead_pure -> "Dead_pure" - | Dead_non_pure -> "Dead_non_pure" - | Exported -> "Exported" - | Once_pure -> "Once_pure" - | Used -> "Used" - | Scanning_pure -> "Scanning_pure" - | Scanning_non_pure -> "Scanning_non_pure" - | NA -> "NA" - let update_used_stats (ident_info : J.ident_info) used_stats = match ident_info.used_stats with | Dead_pure | Dead_non_pure | Exported -> () diff --git a/compiler/core/js_op_util.mli b/compiler/core/js_op_util.mli index 16ad8ad6e11..8ed1ba9b4ef 100644 --- a/compiler/core/js_op_util.mli +++ b/compiler/core/js_op_util.mli @@ -28,8 +28,6 @@ val op_prec : Js_op.binop -> int * int * int val op_str : Js_op.binop -> string -val str_of_used_stats : Js_op.used_stats -> string - val update_used_stats : J.ident_info -> Js_op.used_stats -> unit val same_vident : J.vident -> J.vident -> bool diff --git a/compiler/core/js_output.ml b/compiler/core/js_output.ml index 0269ff1c17a..c11f5d80a2f 100644 --- a/compiler/core/js_output.ml +++ b/compiler/core/js_output.ml @@ -140,5 +140,3 @@ let append_output (x : t) (y : t) : t = (* Fold right is more efficient *) let concat (xs : t list) : t = Ext_list.fold_right xs dummy (fun x acc -> append_output x acc) - -let to_string x = Js_dump.string_of_block (output_as_block x) diff --git a/compiler/core/js_output.mli b/compiler/core/js_output.mli index 19204e18772..1fe7430ce81 100644 --- a/compiler/core/js_output.mli +++ b/compiler/core/js_output.mli @@ -75,5 +75,3 @@ val output_of_block_and_expression : *) val concat : t list -> t - -val to_string : t -> string From 25390c6084093b3fefab98e6a545de50c309a884 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 12:50:19 +0000 Subject: [PATCH 092/214] dce: note js op liveness --- scripts/dce/live-findings.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/scripts/dce/live-findings.md b/scripts/dce/live-findings.md index a629174d27a..1ca84780c80 100644 --- a/scripts/dce/live-findings.md +++ b/scripts/dce/live-findings.md @@ -298,6 +298,26 @@ live after manual validation. `type arg_expression = Js_of_lam_variant.arg_expression = ...`, then constructs and pattern matches `Splice0`, `Splice1`, and `Splice2`. +### Core JS operators and output state + +- Report: constructor warnings in `compiler/core/js_op.ml` for + `property.Strict`, `Alias`, `StrictOpt`, and `Variable`; and + `Warning Dead Value` entries in `js_op_util.ml` / `.mli` and + `js_output.ml` / `.mli`. +- Verdict: live; false positive for the remaining reported entries. +- Validation: the property constructors are the shared + `Lam_compat.let_kind` constructors used by lambda DCE, conversion, scope, and + JS statement generation. `Js_op_util.update_used_stats` is used by + `js_pass_flatten_and_mark_dead.ml`, `js_pass_tailcall_inline.ml`, and + `js_pass_get_used.ml`; `same_vident` is used by `js_analyzer.ml` and + `Js_exp_make`; `of_lam_mutable_flag` is used by `lam_compile_primitive.ml`. + `Js_output` is central to `lam_compile.ml`, and `lam_compile_main.cppo.ml` + calls `Js_output.concat` and `output_as_block`. +- Context: unused operator model types/cases (`binop.Bnot`, `int_op`, `level`, + `access`, `recursive_info`, and `length_object.Bytes`) were removed, along + with the unused `Js_op_util.str_of_used_stats` and `Js_output.to_string` + debug exports. + ### `File_deps.File_hash` callbacks - Report: `Warning Dead Module` and `Warning Dead Value`, From dec8c5dadffa3fc6ddf9a953bc83507e40debda4 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 12:51:33 +0000 Subject: [PATCH 093/214] dce: trim package helpers --- _dce/report.txt | 82 +++++++----------------------- compiler/core/js_packages_info.ml | 37 -------------- compiler/core/js_packages_info.mli | 4 -- 3 files changed, 17 insertions(+), 106 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index bcf1a41e71d..c92ea9299f6 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -4073,66 +4073,30 @@ <-- line 69 let map (x : t) cb = Ext_list.map x.module_systems cb [@@dead "+map"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_packages_info.ml", line 91, characters 0-120 - +string_of_module_system is never used - <-- line 91 - | Esmodule -> "ESModule" [@@dead "+string_of_module_system"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_packages_info.ml", line 102, characters 0-190 - +dump_package_info is never used - <-- line 102 - Format.fprintf fmt "@[%s@ %s@ %s@]" (string_of_module_system ms) name suffix [@@dead "+dump_package_info"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_packages_info.ml", line 106, characters 0-217 - +dump_package_name is never used - <-- line 106 - | Pkg_runtime -> Format.pp_print_string fmt "@runtime" [@@dead "+dump_package_name"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_packages_info.ml", line 112, characters 0-268 - +dump_packages_info is never used - <-- line 112 - ls [@@dead "+dump_packages_info"] - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_packages_info.ml", line 121, characters 2-19 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_packages_info.ml", line 98, characters 2-19 package_found_info.rel_path is a record label never used to read a value - <-- line 121 + <-- line 98 rel_path: string; [@dead "package_found_info.rel_path"] Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_packages_info.ml", line 122, characters 2-23 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_packages_info.ml", line 99, characters 2-23 package_found_info.pkg_rel_path is a record label never used to read a value - <-- line 122 + <-- line 99 pkg_rel_path: string; [@dead "package_found_info.pkg_rel_path"] Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_packages_info.ml", line 123, characters 2-17 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_packages_info.ml", line 100, characters 2-17 package_found_info.suffix is a record label never used to read a value - <-- line 123 + <-- line 100 suffix: string; [@dead "package_found_info.suffix"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_packages_info.ml", line 133, characters 0-884 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_packages_info.ml", line 110, characters 0-884 +query_package_infos is never used - <-- line 133 + <-- line 110 | None -> Package_not_found) [@@dead "+query_package_infos"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_packages_info.ml", line 159, characters 0-228 - +get_js_path is never used - <-- line 159 - | None -> assert false [@@dead "+get_js_path"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_packages_info.ml", line 170, characters 0-121 - +get_output_dir is never used - <-- line 170 - Filename.concat package_dir (get_js_path info module_system) [@@dead "+get_output_dir"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_packages_info.mli", line 27, characters 0-58 +runtime_dir_of_module_system is never used @@ -4169,40 +4133,28 @@ <-- line 43 val map : t -> (package_info -> 'a) -> 'a list [@@dead "+map"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_packages_info.mli", line 51, characters 0-54 - +dump_packages_info is never used - <-- line 51 - val dump_packages_info : Format.formatter -> t -> unit [@@dead "+dump_packages_info"] - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_packages_info.mli", line 59, characters 2-19 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_packages_info.mli", line 57, characters 2-19 package_found_info.rel_path is a record label never used to read a value - <-- line 59 + <-- line 57 rel_path: string; [@dead "package_found_info.rel_path"] Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_packages_info.mli", line 60, characters 2-23 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_packages_info.mli", line 58, characters 2-23 package_found_info.pkg_rel_path is a record label never used to read a value - <-- line 60 + <-- line 58 pkg_rel_path: string; [@dead "package_found_info.pkg_rel_path"] Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_packages_info.mli", line 61, characters 2-17 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_packages_info.mli", line 59, characters 2-17 package_found_info.suffix is a record label never used to read a value - <-- line 61 + <-- line 59 suffix: string; [@dead "package_found_info.suffix"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_packages_info.mli", line 69, characters 0-71 - +get_output_dir is never used - <-- line 69 - val get_output_dir : t -> package_dir:string -> module_system -> string [@@dead "+get_output_dir"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_packages_info.mli", line 71, characters 0-58 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_packages_info.mli", line 67, characters 0-58 +query_package_infos is never used - <-- line 71 + <-- line 67 val query_package_infos : t -> module_system -> info_query [@@dead "+query_package_infos"] Warning Dead Value @@ -16121,4 +16073,4 @@ <-- line 38 val peek_minus : t -> bool [@@dead "+peek_minus"] - Analysis reported 2823 issues (Warning Dead Module:152, Warning Dead Type:333, Warning Dead Value:2082, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:195, Warning Unused Argument:24) + Analysis reported 2815 issues (Warning Dead Module:152, Warning Dead Type:333, Warning Dead Value:2074, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:195, Warning Unused Argument:24) diff --git a/compiler/core/js_packages_info.ml b/compiler/core/js_packages_info.ml index dccb649c5a6..12579018ac7 100644 --- a/compiler/core/js_packages_info.ml +++ b/compiler/core/js_packages_info.ml @@ -88,35 +88,12 @@ let from_name (name : string) : t = let is_empty (x : t) = x.name = Pkg_empty -let string_of_module_system (ms : module_system) = - match ms with - | Commonjs -> "CommonJS" - | Esmodule -> "ESModule" - let module_system_of_string package_name : module_system option = match package_name with | "commonjs" -> Some Commonjs | "esmodule" -> Some Esmodule | _ -> None -let dump_package_info (fmt : Format.formatter) - ({module_system = ms; path = name; suffix} : package_info) = - Format.fprintf fmt "@[%s@ %s@ %s@]" (string_of_module_system ms) name suffix - -let dump_package_name fmt (x : package_name) = - match x with - | Pkg_empty -> Format.fprintf fmt "@empty_pkg@" - | Pkg_normal s -> Format.pp_print_string fmt s - | Pkg_runtime -> Format.pp_print_string fmt "@runtime" - -let dump_packages_info (fmt : Format.formatter) - ({name; module_systems = ls} : t) = - Format.fprintf fmt "@[%a;@ @[%a@]@]" dump_package_name name - (Format.pp_print_list - ~pp_sep:(fun fmt () -> Format.pp_print_space fmt ()) - dump_package_info) - ls - type package_found_info = { rel_path: string; pkg_rel_path: string; @@ -156,20 +133,6 @@ let query_package_infos ({name; module_systems} : t) Package_found {rel_path; pkg_rel_path; suffix = k.suffix} | None -> Package_not_found) -let get_js_path (x : t) (module_system : module_system) : string = - match - Ext_list.find_first x.module_systems (fun k -> - compatible k.module_system module_system) - with - | Some k -> k.path - | None -> assert false - -(* for a single pass compilation, [output_dir] - can be cached -*) -let get_output_dir (info : t) ~package_dir module_system = - Filename.concat package_dir (get_js_path info module_system) - let add_npm_package_path (packages_info : t) (s : string) : t = if is_empty packages_info then Bsc_args.bad_arg "Set package name first using -bs-package-name" diff --git a/compiler/core/js_packages_info.mli b/compiler/core/js_packages_info.mli index 6e5c551df88..78c77b7a707 100644 --- a/compiler/core/js_packages_info.mli +++ b/compiler/core/js_packages_info.mli @@ -48,8 +48,6 @@ val from_name : string -> t val is_empty : t -> bool -val dump_packages_info : Format.formatter -> t -> unit - val add_npm_package_path : t -> string -> t (** used by command line option e.g [-bs-package-output commonjs:xx/path] @@ -66,8 +64,6 @@ type info_query = | Package_not_found | Package_found of package_found_info -val get_output_dir : t -> package_dir:string -> module_system -> string - val query_package_infos : t -> module_system -> info_query (** Note here we compare the package info by order in theory, we can compare it by set semantics From 78806880ae627f3a809ff2431517c50f6dfad8af Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 12:51:49 +0000 Subject: [PATCH 094/214] dce: note package liveness --- scripts/dce/live-findings.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/scripts/dce/live-findings.md b/scripts/dce/live-findings.md index 1ca84780c80..626920e5f84 100644 --- a/scripts/dce/live-findings.md +++ b/scripts/dce/live-findings.md @@ -318,6 +318,25 @@ live after manual validation. with the unused `Js_op_util.str_of_used_stats` and `Js_output.to_string` debug exports. +### Core JS package path helpers + +- Report: `Warning Dead Value` and record-field warnings in + `compiler/core/js_packages_info.ml` / `.mli`, plus + `Js_packages_state.get_packages_info`. +- Verdict: live; false positive for the remaining reported package helpers and + `package_found_info` fields. +- Validation: `compiler/core/js_name_of_module_id.cppo.ml` calls + `query_package_infos`, `runtime_package_path`, + `runtime_dir_of_module_system`, `same_package_by_name`, and + `is_runtime_package`, then reads `package_found_info.rel_path`, + `pkg_rel_path`, and `suffix`. `lam_compile_main.cppo.ml` uses + `Js_packages_info.iter`, `lam_compile_primitive.ml` uses + `Js_packages_info.map`, and `js_name_of_module_id.cppo.ml` reads + `Js_packages_state.get_packages_info`. +- Context: the unused package dump formatter and old `get_output_dir` helper + were removed. The remaining warnings are `.cppo.ml` call sites and record + fields read by package path generation. + ### `File_deps.File_hash` callbacks - Report: `Warning Dead Module` and `Warning Dead Value`, From 420664c43de456d04d81f386396c2ce3448590d9 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 12:52:21 +0000 Subject: [PATCH 095/214] dce: note js pass liveness --- scripts/dce/live-findings.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/scripts/dce/live-findings.md b/scripts/dce/live-findings.md index 626920e5f84..c5eef930b25 100644 --- a/scripts/dce/live-findings.md +++ b/scripts/dce/live-findings.md @@ -337,6 +337,25 @@ live after manual validation. were removed. The remaining warnings are `.cppo.ml` call sites and record fields read by package path generation. +### Core JS pass pipeline and traversals + +- Report: `Warning Dead Module` / `Warning Dead Value` clusters in + `compiler/core/js_pass_debug.mli`, `js_pass_external_shadow.ml`, + `js_pass_flatten.ml`, `js_pass_flatten_and_mark_dead.ml`, + `js_pass_get_used.ml`, `js_pass_scope.ml`, `js_pass_tailcall_inline.ml`, and + the generated traversal helpers `js_record_fold.ml`, `js_record_iter.ml`, and + `js_record_map.ml`. +- Verdict: live; false positive. +- Validation: `compiler/core/lam_compile_main.cppo.ml` runs the JS pass + pipeline through `Js_pass_debug.dump`, `Js_pass_flatten.program`, + `Js_pass_external_shadow.program`, `Js_pass_tailcall_inline.tailcall_inline`, + `Js_pass_flatten_and_mark_dead.program`, and `Js_pass_scope.program`. + `js_pass_tailcall_inline.ml` calls `Js_pass_get_used.get_stats`. These passes + instantiate and call the `Js_record_*` traversal records, so the large helper + clusters under the traversal modules are live through the pass pipeline. +- Context: the DCE report misses `.cppo.ml` roots and therefore treats entire + passes and their generated traversal helper methods as dead. + ### `File_deps.File_hash` callbacks - Report: `Warning Dead Module` and `Warning Dead Value`, From 88ebcf55c716404ef647337f264fd66e5efd4693 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 12:54:49 +0000 Subject: [PATCH 096/214] dce: note stmt builder liveness --- scripts/dce/live-findings.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/scripts/dce/live-findings.md b/scripts/dce/live-findings.md index c5eef930b25..e5f5886ce0e 100644 --- a/scripts/dce/live-findings.md +++ b/scripts/dce/live-findings.md @@ -274,6 +274,22 @@ live after manual validation. removing its `Js_dump` hook unroots a large live dump-printer subgraph in the current DCE report. +### `Js_stmt_make` statement builders + +- Report: large `Warning Dead Value` cluster in + `compiler/core/js_stmt_make.ml` / `.mli`. +- Verdict: live; false positive. +- Validation: the module is imported as `module S = Js_stmt_make` across the JS + lowering and pass pipeline. Direct callers cover the reported statement + builders in `lam_compile.ml`, `lam_compile_external_obj.ml`, + `js_ast_util.ml`, `js_dump.ml`, `js_of_lam_variant.ml`, `js_output.ml`, + `js_pass_flatten.ml`, `js_pass_flatten_and_mark_dead.ml`, and + `js_pass_tailcall_inline.ml`. `debugger_block` is used for the `Pdebugger` + primitive in `lam_compile.ml`. +- Context: DCE misses the cross-module builder calls through `module S`, so it + reports exported constructors even though they are part of normal JS statement + generation. + ### Core JS lowering helpers - Report: `Warning Dead Module`, `Warning Dead Value`, and constructor warnings From a7e0b1455dd427291d0a233561ef11625058e7e0 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 12:56:03 +0000 Subject: [PATCH 097/214] dce: trim lam alias --- _dce/report.txt | 410 +++++++++---------------------------------- compiler/core/lam.ml | 62 +------ 2 files changed, 89 insertions(+), 383 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index c92ea9299f6..a2a2146918a 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -5011,498 +5011,260 @@ <-- line 177 val debugger_block : t list [@@dead "+debugger_block"] - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 117, characters 0-1453 - +lam.X is a dead module as all its items are dead. - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 119, characters 4-25 - X.lambda_switch.sw_consts_full is a record label never used to read a value - <-- line 119 - sw_consts_full: bool; [@dead "X.lambda_switch.sw_consts_full"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 120, characters 4-30 - X.lambda_switch.sw_consts is a record label never used to read a value - <-- line 120 - sw_consts: (int * t) list; [@dead "X.lambda_switch.sw_consts"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 121, characters 4-25 - X.lambda_switch.sw_blocks_full is a record label never used to read a value - <-- line 121 - sw_blocks_full: bool; [@dead "X.lambda_switch.sw_blocks_full"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 122, characters 4-30 - X.lambda_switch.sw_blocks is a record label never used to read a value - <-- line 122 - sw_blocks: (int * t) list; [@dead "X.lambda_switch.sw_blocks"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 123, characters 4-28 - X.lambda_switch.sw_failaction is a record label never used to read a value - <-- line 123 - sw_failaction: t option; [@dead "X.lambda_switch.sw_failaction"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 124, characters 4-56 - X.lambda_switch.sw_names is a record label never used to read a value - <-- line 124 - sw_names: Ast_untagged_variants.switch_names option; [@dead "X.lambda_switch.sw_names"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 128, characters 4-31 - X.prim_info.primitive is a record label never used to read a value - <-- line 128 - primitive: Lam_primitive.t; [@dead "X.prim_info.primitive"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 129, characters 4-17 - X.prim_info.args is a record label never used to read a value - <-- line 129 - args: t list; [@dead "X.prim_info.args"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 130, characters 4-20 - X.prim_info.loc is a record label never used to read a value - <-- line 130 - loc: Location.t; [@dead "X.prim_info.loc"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 134, characters 4-15 - X.apply.ap_func is a record label never used to read a value - <-- line 134 - ap_func: t; [@dead "X.apply.ap_func"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 135, characters 4-20 - X.apply.ap_args is a record label never used to read a value - <-- line 135 - ap_args: t list; [@dead "X.apply.ap_args"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 136, characters 4-21 - X.apply.ap_info is a record label never used to read a value - <-- line 136 - ap_info: ap_info; [@dead "X.apply.ap_info"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 137, characters 4-29 - X.apply.ap_transformed_jsx is a record label never used to read a value - <-- line 137 - ap_transformed_jsx: bool; [@dead "X.apply.ap_transformed_jsx"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 141, characters 4-15 - X.lfunction.arity is a record label never used to read a value - <-- line 141 - arity: int; [@dead "X.lfunction.arity"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 142, characters 4-23 - X.lfunction.params is a record label never used to read a value - <-- line 142 - params: ident list; [@dead "X.lfunction.params"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 143, characters 4-12 - X.lfunction.body is a record label never used to read a value - <-- line 143 - body: t; [@dead "X.lfunction.body"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 144, characters 4-36 - X.lfunction.attr is a record label never used to read a value - <-- line 144 - attr: Lambda.function_attribute; [@dead "X.lfunction.attr"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 148, characters 4-19 - X.t.Lvar is a variant case which is never constructed - <-- line 148 - | Lvar of ident [@dead "X.t.Lvar"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 149, characters 4-36 - X.t.Lglobal_module is a variant case which is never constructed - <-- line 149 - | Lglobal_module of ident * bool [@dead "X.t.Lglobal_module"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 150, characters 4-30 - X.t.Lconst is a variant case which is never constructed - <-- line 150 - | Lconst of Lam_constant.t [@dead "X.t.Lconst"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 151, characters 4-21 - X.t.Lapply is a variant case which is never constructed - <-- line 151 - | Lapply of apply [@dead "X.t.Lapply"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 152, characters 4-28 - X.t.Lfunction is a variant case which is never constructed - <-- line 152 - | Lfunction of lfunction [@dead "X.t.Lfunction"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 153, characters 4-49 - X.t.Llet is a variant case which is never constructed - <-- line 153 - | Llet of Lam_compat.let_kind * ident * t * t [@dead "X.t.Llet"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 154, characters 4-37 - X.t.Lletrec is a variant case which is never constructed - <-- line 154 - | Lletrec of (ident * t) list * t [@dead "X.t.Lletrec"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 155, characters 4-24 - X.t.Lprim is a variant case which is never constructed - <-- line 155 - | Lprim of prim_info [@dead "X.t.Lprim"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 156, characters 4-34 - X.t.Lswitch is a variant case which is never constructed - <-- line 156 - | Lswitch of t * lambda_switch [@dead "X.t.Lswitch"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 157, characters 4-55 - X.t.Lstringswitch is a variant case which is never constructed - <-- line 157 - | Lstringswitch of t * (string * t) list * t option [@dead "X.t.Lstringswitch"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 158, characters 4-34 - X.t.Lstaticraise is a variant case which is never constructed - <-- line 158 - | Lstaticraise of int * t list [@dead "X.t.Lstaticraise"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 159, characters 4-48 - X.t.Lstaticcatch is a variant case which is never constructed - <-- line 159 - | Lstaticcatch of t * (int * ident list) * t [@dead "X.t.Lstaticcatch"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 160, characters 4-31 - X.t.Ltrywith is a variant case which is never constructed - <-- line 160 - | Ltrywith of t * ident * t [@dead "X.t.Ltrywith"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 161, characters 4-30 - X.t.Lifthenelse is a variant case which is never constructed - <-- line 161 - | Lifthenelse of t * t * t [@dead "X.t.Lifthenelse"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 162, characters 4-24 - X.t.Lsequence is a variant case which is never constructed - <-- line 162 - | Lsequence of t * t [@dead "X.t.Lsequence"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 163, characters 4-12 - X.t.Lbreak is a variant case which is never constructed - <-- line 163 - | Lbreak [@dead "X.t.Lbreak"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 164, characters 4-15 - X.t.Lcontinue is a variant case which is never constructed - <-- line 164 - | Lcontinue [@dead "X.t.Lcontinue"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 165, characters 4-21 - X.t.Lwhile is a variant case which is never constructed - <-- line 165 - | Lwhile of t * t [@dead "X.t.Lwhile"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 166, characters 4-57 - X.t.Lfor is a variant case which is never constructed - <-- line 166 - | Lfor of ident * t * t * Asttypes.direction_flag * t [@dead "X.t.Lfor"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 167, characters 4-30 - X.t.Lfor_of is a variant case which is never constructed - <-- line 167 - | Lfor_of of ident * t * t [@dead "X.t.Lfor_of"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 168, characters 4-36 - X.t.Lfor_await_of is a variant case which is never constructed - <-- line 168 - | Lfor_await_of of ident * t * t [@dead "X.t.Lfor_await_of"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 169, characters 4-26 - X.t.Lassign is a variant case which is never constructed - <-- line 169 - | Lassign of ident * t [@dead "X.t.Lassign"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 177, characters 0-2614 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 121, characters 0-2578 +inner_map is never used - <-- line 177 + <-- line 121 Lassign (id, e) [@@dead "+inner_map"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 295, characters 0-513 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 239, characters 0-513 +is_eta_conversion_exn is never used - <-- line 295 + <-- line 239 | _, _, _ -> raise_notrace Not_simple_form [@@dead "+is_eta_conversion_exn"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 310, characters 0-2145 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 254, characters 0-2145 +apply is never used - <-- line 310 + <-- line 254 | _ -> Lapply {ap_func = fn; ap_args = args; ap_info; ap_transformed_jsx} [@@dead "+apply"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 365, characters 0-1950 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 309, characters 0-1950 +eq_approx is never used - <-- line 365 + <-- line 309 false [@@dead "+eq_approx"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 429, characters 0-148 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 373, characters 0-148 +eq_option is never used - <-- line 429 + <-- line 373 | None -> false) [@@dead "+eq_option"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 437, characters 0-69 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 381, characters 0-69 +eq_approx_list is never used - <-- line 437 + <-- line 381 and eq_approx_list ls ls1 = Ext_list.for_all2_no_exn ls ls1 eq_approx [@@dead "+eq_approx_list"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 439, characters 0-596 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 383, characters 0-596 +switch is never used - <-- line 439 + <-- line 383 | _ -> Lswitch (lam, lam_switch) [@@dead "+switch"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 453, characters 0-217 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 397, characters 0-217 +stringswitch is never used - <-- line 453 + <-- line 397 | _ -> Lstringswitch (lam, cases, default) [@@dead "+stringswitch"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 459, characters 0-36 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 403, characters 0-36 +true_ is never used - <-- line 459 + <-- line 403 let true_ : t = Lconst Const_js_true [@@dead "+true_"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 460, characters 0-38 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 404, characters 0-38 +false_ is never used - <-- line 460 + <-- line 404 let false_ : t = Lconst Const_js_false [@@dead "+false_"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 461, characters 0-59 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 405, characters 0-59 +unit is never used - <-- line 461 + <-- line 405 let unit : t = Lconst (Const_js_undefined {is_unit = true}) [@@dead "+unit"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 462, characters 0-22 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 406, characters 0-22 +break is never used - <-- line 462 + <-- line 406 let break : t = Lbreak [@@dead "+break"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 463, characters 0-28 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 407, characters 0-28 +continue is never used - <-- line 463 + <-- line 407 let continue : t = Lcontinue [@@dead "+continue"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 465, characters 0-253 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 409, characters 0-253 +seq is never used - <-- line 465 + <-- line 409 | _ -> Lsequence (a, b) [@@dead "+seq"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 473, characters 0-24 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 417, characters 0-24 +var is never used - <-- line 473 + <-- line 417 let var id : t = Lvar id [@@dead "+var"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 474, characters 0-86 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 418, characters 0-86 +global_module is never used - <-- line 474 + <-- line 418 Lglobal_module (id, dynamic_import) [@@dead "+global_module"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 476, characters 0-28 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 420, characters 0-28 +const is never used - <-- line 476 + <-- line 420 let const ct : t = Lconst ct [@@dead "+const"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 478, characters 0-86 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 422, characters 0-86 +function_ is never used - <-- line 478 + <-- line 422 Lfunction {arity; params; body; attr} [@@dead "+function_"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 481, characters 0-54 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 425, characters 0-54 +let_ is never used - <-- line 481 + <-- line 425 let let_ kind id e body : t = Llet (kind, id, e, body) [@@dead "+let_"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 482, characters 0-55 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 426, characters 0-55 +letrec is never used - <-- line 482 + <-- line 426 let letrec bindings body : t = Lletrec (bindings, body) [@@dead "+letrec"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 483, characters 0-34 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 427, characters 0-34 +while_ is never used - <-- line 483 + <-- line 427 let while_ a b : t = Lwhile (a, b) [@@dead "+while_"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 484, characters 0-59 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 428, characters 0-59 +try_ is never used - <-- line 484 + <-- line 428 let try_ body id handler : t = Ltrywith (body, id, handler) [@@dead "+try_"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 485, characters 0-55 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 429, characters 0-55 +for_ is never used - <-- line 485 + <-- line 429 let for_ v e1 e2 dir e3 : t = Lfor (v, e1, e2, dir, e3) [@@dead "+for_"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 486, characters 0-44 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 430, characters 0-44 +for_of is never used - <-- line 486 + <-- line 430 let for_of v e1 e2 : t = Lfor_of (v, e1, e2) [@@dead "+for_of"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 487, characters 0-56 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 431, characters 0-56 +for_await_of is never used - <-- line 487 + <-- line 431 let for_await_of v e1 e2 : t = Lfor_await_of (v, e1, e2) [@@dead "+for_await_of"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 488, characters 0-35 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 432, characters 0-35 +assign is never used - <-- line 488 + <-- line 432 let assign v l : t = Lassign (v, l) [@@dead "+assign"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 489, characters 0-50 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 433, characters 0-50 +staticcatch is never used - <-- line 489 + <-- line 433 let staticcatch a b c : t = Lstaticcatch (a, b, c) [@@dead "+staticcatch"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 490, characters 0-45 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 434, characters 0-45 +staticraise is never used - <-- line 490 + <-- line 434 let staticraise a b : t = Lstaticraise (a, b) [@@dead "+staticraise"] Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 492, characters 0-286 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 436, characters 0-286 +lam.Lift is a dead module as all its items are dead. Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 493, characters 2-56 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 437, characters 2-56 Lift.+int is never used - <-- line 493 + <-- line 437 let int i : t = Lconst (Const_int {i; comment = None}) [@@dead "Lift.+int"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 498, characters 2-42 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 442, characters 2-42 Lift.+bool is never used - <-- line 498 + <-- line 442 let bool b = if b then true_ else false_ [@@dead "Lift.+bool"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 500, characters 2-60 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 444, characters 2-60 Lift.+string is never used - <-- line 500 + <-- line 444 let string s : t = Lconst (Const_string {s; delim = None}) [@@dead "Lift.+string"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 502, characters 2-40 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 446, characters 2-40 Lift.+char is never used - <-- line 502 + <-- line 446 let char b : t = Lconst (Const_char b) [@@dead "Lift.+char"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 505, characters 0-4192 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 449, characters 0-4192 +prim is never used - <-- line 505 + <-- line 449 | _ -> default ()) [@@dead "+prim"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 610, characters 0-177 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 554, characters 0-177 +not_ is never used - <-- line 610 + <-- line 554 | _ -> prim ~primitive:Pnot ~args:[x] loc [@@dead "+not_"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 616, characters 0-308 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 560, characters 0-308 +has_boolean_type is never used - <-- line 616 + <-- line 560 | _ -> None [@@dead "+has_boolean_type"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 632, characters 0-233 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 576, characters 0-233 +complete_range is never used - <-- line 632 + <-- line 576 && complete_range rest ~start:(start + 1) ~finish [@@dead "+complete_range"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 639, characters 0-384 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 583, characters 0-384 +eval_const_as_bool is never used - <-- line 639 + <-- line 583 | Const_some b -> eval_const_as_bool b [@@dead "+eval_const_as_bool"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 651, characters 0-2862 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 595, characters 0-2862 +if_ is never used - <-- line 651 + <-- line 595 | _ -> Lifthenelse (a, b, c))) [@@dead "+if_"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 733, characters 0-30 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 677, characters 0-30 +sequor is never used - <-- line 733 + <-- line 677 let sequor l r = if_ l true_ r [@@dead "+sequor"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 736, characters 0-32 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 680, characters 0-32 +sequand is never used - <-- line 736 + <-- line 680 let sequand l r = if_ l r false_ [@@dead "+sequand"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 738, characters 0-369 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 682, characters 0-369 +result_wrap is never used - <-- line 738 + <-- line 682 | Return_unset | Return_identity -> result [@@dead "+result_wrap"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 746, characters 0-352 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 690, characters 0-352 +handle_bs_non_obj_ffi is never used - <-- line 746 + <-- line 690 ~args loc) [@@dead "+handle_bs_non_obj_ffi"] Warning Dead Value @@ -16073,4 +15835,4 @@ <-- line 38 val peek_minus : t -> bool [@@dead "+peek_minus"] - Analysis reported 2815 issues (Warning Dead Module:152, Warning Dead Type:333, Warning Dead Value:2074, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:195, Warning Unused Argument:24) + Analysis reported 2775 issues (Warning Dead Module:151, Warning Dead Type:294, Warning Dead Value:2074, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:195, Warning Unused Argument:24) diff --git a/compiler/core/lam.ml b/compiler/core/lam.ml index 15875608b97..9845751047b 100644 --- a/compiler/core/lam.ml +++ b/compiler/core/lam.ml @@ -114,69 +114,13 @@ module Types = struct (* | Lsend of Lam_compat.meth_kind * t * t * t list * Location.t *) end -module X = struct - type lambda_switch = Types.lambda_switch = { - sw_consts_full: bool; - sw_consts: (int * t) list; - sw_blocks_full: bool; - sw_blocks: (int * t) list; - sw_failaction: t option; - sw_names: Ast_untagged_variants.switch_names option; - } - - and prim_info = Types.prim_info = { - primitive: Lam_primitive.t; - args: t list; - loc: Location.t; - } - - and apply = Types.apply = { - ap_func: t; - ap_args: t list; - ap_info: ap_info; - ap_transformed_jsx: bool; - } - - and lfunction = Types.lfunction = { - arity: int; - params: ident list; - body: t; - attr: Lambda.function_attribute; - } - - and t = Types.t = - | Lvar of ident - | Lglobal_module of ident * bool - | Lconst of Lam_constant.t - | Lapply of apply - | Lfunction of lfunction - | Llet of Lam_compat.let_kind * ident * t * t - | Lletrec of (ident * t) list * t - | Lprim of prim_info - | Lswitch of t * lambda_switch - | Lstringswitch of t * (string * t) list * t option - | Lstaticraise of int * t list - | Lstaticcatch of t * (int * ident list) * t - | Ltrywith of t * ident * t - | Lifthenelse of t * t * t - | Lsequence of t * t - | Lbreak - | Lcontinue - | Lwhile of t * t - | Lfor of ident * t * t * Asttypes.direction_flag * t - | Lfor_of of ident * t * t - | Lfor_await_of of ident * t * t - | Lassign of ident * t - (* | Lsend of Lam_compat.meth_kind * t * t * t list * Location.t *) -end - include Types (** apply [f] to direct successor which has type [Lam.t] *) -let inner_map (l : t) (f : t -> X.t) : X.t = +let inner_map (l : t) (f : t -> t) : t = match l with - | Lvar (_ : ident) | Lconst (_ : Lam_constant.t) -> ((* Obj.magic *) l : X.t) + | Lvar (_ : ident) | Lconst (_ : Lam_constant.t) -> l | Lapply {ap_func; ap_args; ap_info; ap_transformed_jsx} -> let ap_func = f ap_func in let ap_args = Ext_list.map ap_args f in @@ -192,7 +136,7 @@ let inner_map (l : t) (f : t -> X.t) : X.t = let body = f body in let decl = Ext_list.map_snd decl f in Lletrec (decl, body) - | Lglobal_module _ -> (l : X.t) + | Lglobal_module _ -> l | Lprim {args; primitive; loc} -> let args = Ext_list.map args f in Lprim {args; primitive; loc} From efd1fe481e5544ec0fa1d196b184f35dec7c479f Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 12:58:04 +0000 Subject: [PATCH 098/214] dce: trim lam inner map --- _dce/report.txt | 296 ++++++++++++++++++++---------------------- compiler/core/lam.ml | 101 -------------- compiler/core/lam.mli | 2 - 3 files changed, 142 insertions(+), 257 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index a2a2146918a..6063399aad7 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -5012,439 +5012,427 @@ val debugger_block : t list [@@dead "+debugger_block"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 121, characters 0-2578 - +inner_map is never used - <-- line 121 - Lassign (id, e) [@@dead "+inner_map"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 239, characters 0-513 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 138, characters 0-513 +is_eta_conversion_exn is never used - <-- line 239 + <-- line 138 | _, _, _ -> raise_notrace Not_simple_form [@@dead "+is_eta_conversion_exn"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 254, characters 0-2145 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 153, characters 0-2145 +apply is never used - <-- line 254 + <-- line 153 | _ -> Lapply {ap_func = fn; ap_args = args; ap_info; ap_transformed_jsx} [@@dead "+apply"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 309, characters 0-1950 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 208, characters 0-1950 +eq_approx is never used - <-- line 309 + <-- line 208 false [@@dead "+eq_approx"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 373, characters 0-148 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 272, characters 0-148 +eq_option is never used - <-- line 373 + <-- line 272 | None -> false) [@@dead "+eq_option"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 381, characters 0-69 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 280, characters 0-69 +eq_approx_list is never used - <-- line 381 + <-- line 280 and eq_approx_list ls ls1 = Ext_list.for_all2_no_exn ls ls1 eq_approx [@@dead "+eq_approx_list"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 383, characters 0-596 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 282, characters 0-596 +switch is never used - <-- line 383 + <-- line 282 | _ -> Lswitch (lam, lam_switch) [@@dead "+switch"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 397, characters 0-217 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 296, characters 0-217 +stringswitch is never used - <-- line 397 + <-- line 296 | _ -> Lstringswitch (lam, cases, default) [@@dead "+stringswitch"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 403, characters 0-36 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 302, characters 0-36 +true_ is never used - <-- line 403 + <-- line 302 let true_ : t = Lconst Const_js_true [@@dead "+true_"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 404, characters 0-38 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 303, characters 0-38 +false_ is never used - <-- line 404 + <-- line 303 let false_ : t = Lconst Const_js_false [@@dead "+false_"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 405, characters 0-59 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 304, characters 0-59 +unit is never used - <-- line 405 + <-- line 304 let unit : t = Lconst (Const_js_undefined {is_unit = true}) [@@dead "+unit"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 406, characters 0-22 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 305, characters 0-22 +break is never used - <-- line 406 + <-- line 305 let break : t = Lbreak [@@dead "+break"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 407, characters 0-28 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 306, characters 0-28 +continue is never used - <-- line 407 + <-- line 306 let continue : t = Lcontinue [@@dead "+continue"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 409, characters 0-253 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 308, characters 0-253 +seq is never used - <-- line 409 + <-- line 308 | _ -> Lsequence (a, b) [@@dead "+seq"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 417, characters 0-24 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 316, characters 0-24 +var is never used - <-- line 417 + <-- line 316 let var id : t = Lvar id [@@dead "+var"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 418, characters 0-86 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 317, characters 0-86 +global_module is never used - <-- line 418 + <-- line 317 Lglobal_module (id, dynamic_import) [@@dead "+global_module"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 420, characters 0-28 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 319, characters 0-28 +const is never used - <-- line 420 + <-- line 319 let const ct : t = Lconst ct [@@dead "+const"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 422, characters 0-86 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 321, characters 0-86 +function_ is never used - <-- line 422 + <-- line 321 Lfunction {arity; params; body; attr} [@@dead "+function_"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 425, characters 0-54 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 324, characters 0-54 +let_ is never used - <-- line 425 + <-- line 324 let let_ kind id e body : t = Llet (kind, id, e, body) [@@dead "+let_"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 426, characters 0-55 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 325, characters 0-55 +letrec is never used - <-- line 426 + <-- line 325 let letrec bindings body : t = Lletrec (bindings, body) [@@dead "+letrec"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 427, characters 0-34 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 326, characters 0-34 +while_ is never used - <-- line 427 + <-- line 326 let while_ a b : t = Lwhile (a, b) [@@dead "+while_"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 428, characters 0-59 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 327, characters 0-59 +try_ is never used - <-- line 428 + <-- line 327 let try_ body id handler : t = Ltrywith (body, id, handler) [@@dead "+try_"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 429, characters 0-55 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 328, characters 0-55 +for_ is never used - <-- line 429 + <-- line 328 let for_ v e1 e2 dir e3 : t = Lfor (v, e1, e2, dir, e3) [@@dead "+for_"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 430, characters 0-44 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 329, characters 0-44 +for_of is never used - <-- line 430 + <-- line 329 let for_of v e1 e2 : t = Lfor_of (v, e1, e2) [@@dead "+for_of"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 431, characters 0-56 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 330, characters 0-56 +for_await_of is never used - <-- line 431 + <-- line 330 let for_await_of v e1 e2 : t = Lfor_await_of (v, e1, e2) [@@dead "+for_await_of"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 432, characters 0-35 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 331, characters 0-35 +assign is never used - <-- line 432 + <-- line 331 let assign v l : t = Lassign (v, l) [@@dead "+assign"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 433, characters 0-50 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 332, characters 0-50 +staticcatch is never used - <-- line 433 + <-- line 332 let staticcatch a b c : t = Lstaticcatch (a, b, c) [@@dead "+staticcatch"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 434, characters 0-45 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 333, characters 0-45 +staticraise is never used - <-- line 434 + <-- line 333 let staticraise a b : t = Lstaticraise (a, b) [@@dead "+staticraise"] Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 436, characters 0-286 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 335, characters 0-286 +lam.Lift is a dead module as all its items are dead. Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 437, characters 2-56 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 336, characters 2-56 Lift.+int is never used - <-- line 437 + <-- line 336 let int i : t = Lconst (Const_int {i; comment = None}) [@@dead "Lift.+int"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 442, characters 2-42 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 341, characters 2-42 Lift.+bool is never used - <-- line 442 + <-- line 341 let bool b = if b then true_ else false_ [@@dead "Lift.+bool"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 444, characters 2-60 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 343, characters 2-60 Lift.+string is never used - <-- line 444 + <-- line 343 let string s : t = Lconst (Const_string {s; delim = None}) [@@dead "Lift.+string"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 446, characters 2-40 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 345, characters 2-40 Lift.+char is never used - <-- line 446 + <-- line 345 let char b : t = Lconst (Const_char b) [@@dead "Lift.+char"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 449, characters 0-4192 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 348, characters 0-4192 +prim is never used - <-- line 449 + <-- line 348 | _ -> default ()) [@@dead "+prim"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 554, characters 0-177 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 453, characters 0-177 +not_ is never used - <-- line 554 + <-- line 453 | _ -> prim ~primitive:Pnot ~args:[x] loc [@@dead "+not_"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 560, characters 0-308 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 459, characters 0-308 +has_boolean_type is never used - <-- line 560 + <-- line 459 | _ -> None [@@dead "+has_boolean_type"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 576, characters 0-233 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 475, characters 0-233 +complete_range is never used - <-- line 576 + <-- line 475 && complete_range rest ~start:(start + 1) ~finish [@@dead "+complete_range"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 583, characters 0-384 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 482, characters 0-384 +eval_const_as_bool is never used - <-- line 583 + <-- line 482 | Const_some b -> eval_const_as_bool b [@@dead "+eval_const_as_bool"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 595, characters 0-2862 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 494, characters 0-2862 +if_ is never used - <-- line 595 + <-- line 494 | _ -> Lifthenelse (a, b, c))) [@@dead "+if_"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 677, characters 0-30 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 576, characters 0-30 +sequor is never used - <-- line 677 + <-- line 576 let sequor l r = if_ l true_ r [@@dead "+sequor"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 680, characters 0-32 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 579, characters 0-32 +sequand is never used - <-- line 680 + <-- line 579 let sequand l r = if_ l r false_ [@@dead "+sequand"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 682, characters 0-369 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 581, characters 0-369 +result_wrap is never used - <-- line 682 + <-- line 581 | Return_unset | Return_identity -> result [@@dead "+result_wrap"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 690, characters 0-352 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 589, characters 0-352 +handle_bs_non_obj_ffi is never used - <-- line 690 + <-- line 589 ~args loc) [@@dead "+handle_bs_non_obj_ffi"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 94, characters 0-34 - +inner_map is never used - <-- line 94 - val inner_map : t -> (t -> t) -> t [@@dead "+inner_map"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 96, characters 0-230 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 94, characters 0-230 +handle_bs_non_obj_ffi is never used - <-- line 96 + <-- line 94 t [@@dead "+handle_bs_non_obj_ffi"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 109, characters 0-20 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 107, characters 0-20 +var is never used - <-- line 109 + <-- line 107 val var : ident -> t [@@dead "+var"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 112, characters 0-54 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 110, characters 0-54 +global_module is never used - <-- line 112 + <-- line 110 val global_module : ?dynamic_import:bool -> ident -> t [@@dead "+global_module"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 114, characters 0-31 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 112, characters 0-31 +const is never used - <-- line 114 + <-- line 112 val const : Lam_constant.t -> t [@@dead "+const"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 116, characters 0-67 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 114, characters 0-67 +apply is never used - <-- line 116 + <-- line 114 val apply : ?ap_transformed_jsx:bool -> t -> t list -> ap_info -> t [@@dead "+apply"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 118, characters 0-105 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 116, characters 0-105 +function_ is never used - <-- line 118 + <-- line 116 t [@@dead "+function_"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 125, characters 0-54 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 123, characters 0-54 +let_ is never used - <-- line 125 + <-- line 123 val let_ : Lam_compat.let_kind -> ident -> t -> t -> t [@@dead "+let_"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 127, characters 0-39 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 125, characters 0-39 +letrec is never used - <-- line 127 + <-- line 125 val letrec : (ident * t) list -> t -> t [@@dead "+letrec"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 129, characters 0-26 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 127, characters 0-26 +if_ is never used - <-- line 129 + <-- line 127 val if_ : t -> t -> t -> t [@@dead "+if_"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 132, characters 0-36 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 130, characters 0-36 +switch is never used - <-- line 132 + <-- line 130 val switch : t -> lambda_switch -> t [@@dead "+switch"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 135, characters 0-58 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 133, characters 0-58 +stringswitch is never used - <-- line 135 + <-- line 133 val stringswitch : t -> (string * t) list -> t option -> t [@@dead "+stringswitch"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 139, characters 0-14 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 137, characters 0-14 +false_ is never used - <-- line 139 + <-- line 137 val false_ : t [@@dead "+false_"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 141, characters 0-12 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 139, characters 0-12 +unit is never used - <-- line 141 + <-- line 139 val unit : t [@@dead "+unit"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 143, characters 0-24 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 141, characters 0-24 +sequor is never used - <-- line 143 + <-- line 141 val sequor : t -> t -> t [@@dead "+sequor"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 146, characters 0-25 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 144, characters 0-25 +sequand is never used - <-- line 146 + <-- line 144 val sequand : t -> t -> t [@@dead "+sequand"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 149, characters 0-31 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 147, characters 0-31 +not_ is never used - <-- line 149 + <-- line 147 val not_ : Location.t -> t -> t [@@dead "+not_"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 152, characters 0-21 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 150, characters 0-21 +seq is never used - <-- line 152 + <-- line 150 val seq : t -> t -> t [@@dead "+seq"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 155, characters 0-13 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 153, characters 0-13 +break is never used - <-- line 155 + <-- line 153 val break : t [@@dead "+break"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 157, characters 0-16 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 155, characters 0-16 +continue is never used - <-- line 157 + <-- line 155 val continue : t [@@dead "+continue"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 159, characters 0-24 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 157, characters 0-24 +while_ is never used - <-- line 159 + <-- line 157 val while_ : t -> t -> t [@@dead "+while_"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 162, characters 0-31 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 160, characters 0-31 +try_ is never used - <-- line 162 + <-- line 160 val try_ : t -> ident -> t -> t [@@dead "+try_"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 164, characters 0-28 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 162, characters 0-28 +assign is never used - <-- line 164 + <-- line 162 val assign : ident -> t -> t [@@dead "+assign"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 166, characters 0-70 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 164, characters 0-70 +prim is never used - <-- line 166 + <-- line 164 val prim : primitive:Lam_primitive.t -> args:t list -> Location.t -> t [@@dead "+prim"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 169, characters 0-49 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 167, characters 0-49 +staticcatch is never used - <-- line 169 + <-- line 167 val staticcatch : t -> int * ident list -> t -> t [@@dead "+staticcatch"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 171, characters 0-36 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 169, characters 0-36 +staticraise is never used - <-- line 171 + <-- line 169 val staticraise : int -> t list -> t [@@dead "+staticraise"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 173, characters 0-63 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 171, characters 0-63 +for_ is never used - <-- line 173 + <-- line 171 val for_ : ident -> t -> t -> Asttypes.direction_flag -> t -> t [@@dead "+for_"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 175, characters 0-33 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 173, characters 0-33 +for_of is never used - <-- line 175 + <-- line 173 val for_of : ident -> t -> t -> t [@@dead "+for_of"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 177, characters 0-39 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 175, characters 0-39 +for_await_of is never used - <-- line 177 + <-- line 175 val for_await_of : ident -> t -> t -> t [@@dead "+for_await_of"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 181, characters 0-30 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 179, characters 0-30 +eq_approx is never used - <-- line 181 + <-- line 179 val eq_approx : t -> t -> bool [@@dead "+eq_approx"] Warning Dead Module @@ -15835,4 +15823,4 @@ <-- line 38 val peek_minus : t -> bool [@@dead "+peek_minus"] - Analysis reported 2775 issues (Warning Dead Module:151, Warning Dead Type:294, Warning Dead Value:2074, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:195, Warning Unused Argument:24) + Analysis reported 2773 issues (Warning Dead Module:151, Warning Dead Type:294, Warning Dead Value:2072, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:195, Warning Unused Argument:24) diff --git a/compiler/core/lam.ml b/compiler/core/lam.ml index 9845751047b..7ba275d1071 100644 --- a/compiler/core/lam.ml +++ b/compiler/core/lam.ml @@ -116,107 +116,6 @@ end include Types -(** apply [f] to direct successor which has type [Lam.t] *) - -let inner_map (l : t) (f : t -> t) : t = - match l with - | Lvar (_ : ident) | Lconst (_ : Lam_constant.t) -> l - | Lapply {ap_func; ap_args; ap_info; ap_transformed_jsx} -> - let ap_func = f ap_func in - let ap_args = Ext_list.map ap_args f in - Lapply {ap_func; ap_args; ap_info; ap_transformed_jsx} - | Lfunction {body; arity; params; attr} -> - let body = f body in - Lfunction {body; arity; params; attr} - | Llet (str, id, arg, body) -> - let arg = f arg in - let body = f body in - Llet (str, id, arg, body) - | Lletrec (decl, body) -> - let body = f body in - let decl = Ext_list.map_snd decl f in - Lletrec (decl, body) - | Lglobal_module _ -> l - | Lprim {args; primitive; loc} -> - let args = Ext_list.map args f in - Lprim {args; primitive; loc} - | Lswitch - ( arg, - { - sw_consts; - sw_consts_full; - sw_blocks; - sw_blocks_full; - sw_failaction; - sw_names; - } ) -> - let arg = f arg in - let sw_consts = Ext_list.map_snd sw_consts f in - let sw_blocks = Ext_list.map_snd sw_blocks f in - let sw_failaction = Ext_option.map sw_failaction f in - Lswitch - ( arg, - { - sw_consts; - sw_blocks; - sw_failaction; - sw_blocks_full; - sw_consts_full; - sw_names; - } ) - | Lstringswitch (arg, cases, default) -> - let arg = f arg in - let cases = Ext_list.map_snd cases f in - let default = Ext_option.map default f in - Lstringswitch (arg, cases, default) - | Lstaticraise (id, args) -> - let args = Ext_list.map args f in - Lstaticraise (id, args) - | Lstaticcatch (e1, vars, e2) -> - let e1 = f e1 in - let e2 = f e2 in - Lstaticcatch (e1, vars, e2) - | Ltrywith (e1, exn, e2) -> - let e1 = f e1 in - let e2 = f e2 in - Ltrywith (e1, exn, e2) - | Lifthenelse (e1, e2, e3) -> - let e1 = f e1 in - let e2 = f e2 in - let e3 = f e3 in - Lifthenelse (e1, e2, e3) - | Lsequence (e1, e2) -> - let e1 = f e1 in - let e2 = f e2 in - Lsequence (e1, e2) - | Lbreak -> Lbreak - | Lcontinue -> Lcontinue - | Lwhile (e1, e2) -> - let e1 = f e1 in - let e2 = f e2 in - Lwhile (e1, e2) - | Lfor (v, e1, e2, dir, e3) -> - let e1 = f e1 in - let e2 = f e2 in - let e3 = f e3 in - Lfor (v, e1, e2, dir, e3) - | Lfor_of (v, e1, e2) -> - let e1 = f e1 in - let e2 = f e2 in - Lfor_of (v, e1, e2) - | Lfor_await_of (v, e1, e2) -> - let e1 = f e1 in - let e2 = f e2 in - Lfor_await_of (v, e1, e2) - | Lassign (id, e) -> - let e = f e in - Lassign (id, e) -(* | Lsend (k, met, obj, args, loc) -> - let met = f met in - let obj = f obj in - let args = Ext_list.map args f in - Lsend(k,met,obj,args,loc) *) - exception Not_simple_form (** diff --git a/compiler/core/lam.mli b/compiler/core/lam.mli index f6a398d677b..2285dee941e 100644 --- a/compiler/core/lam.mli +++ b/compiler/core/lam.mli @@ -91,8 +91,6 @@ and t = private we should use record for trivial debugger info *) -val inner_map : t -> (t -> t) -> t - val handle_bs_non_obj_ffi : ?transformed_jsx:bool -> External_arg_spec.params -> From 7a00407c155b2fd619c9429e05b29c7c6dc086d0 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 12:58:50 +0000 Subject: [PATCH 099/214] dce: note lam liveness --- scripts/dce/live-findings.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/scripts/dce/live-findings.md b/scripts/dce/live-findings.md index e5f5886ce0e..9a91a5d1e64 100644 --- a/scripts/dce/live-findings.md +++ b/scripts/dce/live-findings.md @@ -290,6 +290,28 @@ live after manual validation. reports exported constructors even though they are part of normal JS statement generation. +### `Lam` smart constructors + +- Report: `Warning Dead Value` cluster in `compiler/core/lam.ml` / `.mli`, + including `apply`, `eq_approx`, `switch`, `stringswitch`, `prim`, `if_`, + sequence/control-flow constructors, and local helper chains. +- Verdict: live; false positive for the remaining reported helpers. +- Validation: the reported `Lam.*` smart constructors are used throughout lambda + conversion and optimization passes, including `lam_convert.ml`, + `lam_pass_lets_dce.ml`, `lam_bounded_vars.ml`, + `lam_pass_eliminate_ref.ml`, `lam_pass_remove_alias.ml`, + `lam_pass_exits.ml`, `lam_pass_deep_flatten.ml`, `lam_subst.ml`, + `lam_eta_conversion.ml`, `lam_pass_alpha_conversion.ml`, `lam_analysis.ml`, + `lam_compile.ml`, and `lam_util.cppo.ml`. Local helpers are live through those + constructors: `is_eta_conversion_exn` through `apply`, `eq_option` and + `eq_approx_list` through `eq_approx`, `Lift.*` through `prim`, + `has_boolean_type`, `complete_range`, and `eval_const_as_bool` through `if_`, + and `result_wrap` through `handle_bs_non_obj_ffi`. +- Context: the duplicate `Lam.X` type alias module and the unused public + `inner_map` helper were removed. The remaining `Lam` warnings are exported + smart constructors used cross-module, which this DCE run does not root + correctly. + ### Core JS lowering helpers - Report: `Warning Dead Module`, `Warning Dead Value`, and constructor warnings From d40e758ba18c566fc272742d2aeaed62d3be5ed7 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 13:00:35 +0000 Subject: [PATCH 100/214] dce: trim arity debug --- _dce/report.txt | 120 ++++++++++++------------------------ compiler/core/lam_arity.ml | 30 --------- compiler/core/lam_arity.mli | 6 -- 3 files changed, 39 insertions(+), 117 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index 6063399aad7..370ff85eb18 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -5564,159 +5564,117 @@ val safe_to_inline : Lam.t -> bool [@@dead "+safe_to_inline"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity.ml", line 35, characters 0-228 - +equal is never used - <-- line 35 - | Arity_na -> false) [@@dead "+equal"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity.ml", line 44, characters 0-23 - +pp is never used - <-- line 44 - let pp = Format.fprintf [@@dead "+pp"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity.ml", line 46, characters 0-323 - +print is never used - <-- line 46 - pp fmt "]@]" [@@dead "+print"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity.ml", line 59, characters 0-210 - +print_arities_tbl is never used - <-- line 59 - arities_tbl () [@@dead "+print_arities_tbl"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity.ml", line 65, characters 0-144 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity.ml", line 35, characters 0-144 +merge is never used - <-- line 65 + <-- line 35 | Arity_info (xs, tail) -> Arity_info (n :: xs, tail) [@@dead "+merge"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity.ml", line 70, characters 0-52 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity.ml", line 40, characters 0-52 +non_function_arity_info is never used - <-- line 70 + <-- line 40 let non_function_arity_info = Arity_info ([], false) [@@dead "+non_function_arity_info"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity.ml", line 72, characters 0-44 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity.ml", line 42, characters 0-44 +raise_arity_info is never used - <-- line 72 + <-- line 42 let raise_arity_info = Arity_info ([], true) [@@dead "+raise_arity_info"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity.ml", line 74, characters 0-17 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity.ml", line 44, characters 0-17 +na is never used - <-- line 74 + <-- line 44 let na = Arity_na [@@dead "+na"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity.ml", line 76, characters 0-40 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity.ml", line 46, characters 0-40 +info is never used - <-- line 76 + <-- line 46 let info args b1 = Arity_info (args, b1) [@@dead "+info"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity.ml", line 78, characters 0-100 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity.ml", line 48, characters 0-100 +first_arity_na is never used - <-- line 78 + <-- line 48 | _ -> false [@@dead "+first_arity_na"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity.ml", line 83, characters 0-123 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity.ml", line 53, characters 0-123 +get_first_arity is never used - <-- line 83 + <-- line 53 | Arity_info (x :: _, _) -> Some x [@@dead "+get_first_arity"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity.ml", line 88, characters 0-90 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity.ml", line 58, characters 0-90 +extract_arity is never used - <-- line 88 + <-- line 58 | Arity_info (xs, _) -> xs [@@dead "+extract_arity"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity.ml", line 95, characters 0-451 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity.ml", line 65, characters 0-451 +merge_arities_aux is never used - <-- line 95 + <-- line 65 | _, _ -> info (List.rev acc) false [@@dead "+merge_arities_aux"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity.ml", line 104, characters 0-62 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity.ml", line 74, characters 0-62 +merge_arities is never used - <-- line 104 + <-- line 74 let merge_arities xs ys t t2 = merge_arities_aux [] xs ys t t2 [@@dead "+merge_arities"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity.mli", line 35, characters 0-26 - +equal is never used - <-- line 35 - val equal : t -> t -> bool [@@dead "+equal"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity.mli", line 37, characters 0-41 - +print is never used - <-- line 37 - val print : Format.formatter -> t -> unit [@@dead "+print"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity.mli", line 39, characters 0-78 - +print_arities_tbl is never used - <-- line 39 - val print_arities_tbl : Format.formatter -> (Ident.t, t ref) Hashtbl.t -> unit [@@dead "+print_arities_tbl"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity.mli", line 41, characters 0-25 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity.mli", line 35, characters 0-25 +merge is never used - <-- line 41 + <-- line 35 val merge : int -> t -> t [@@dead "+merge"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity.mli", line 43, characters 0-31 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity.mli", line 37, characters 0-31 +non_function_arity_info is never used - <-- line 43 + <-- line 37 val non_function_arity_info : t [@@dead "+non_function_arity_info"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity.mli", line 45, characters 0-24 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity.mli", line 39, characters 0-24 +raise_arity_info is never used - <-- line 45 + <-- line 39 val raise_arity_info : t [@@dead "+raise_arity_info"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity.mli", line 47, characters 0-10 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity.mli", line 41, characters 0-10 +na is never used - <-- line 47 + <-- line 41 val na : t [@@dead "+na"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity.mli", line 49, characters 0-32 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity.mli", line 43, characters 0-32 +info is never used - <-- line 49 + <-- line 43 val info : int list -> bool -> t [@@dead "+info"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity.mli", line 51, characters 0-30 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity.mli", line 45, characters 0-30 +first_arity_na is never used - <-- line 51 + <-- line 45 val first_arity_na : t -> bool [@@dead "+first_arity_na"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity.mli", line 53, characters 0-37 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity.mli", line 47, characters 0-37 +get_first_arity is never used - <-- line 53 + <-- line 47 val get_first_arity : t -> int option [@@dead "+get_first_arity"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity.mli", line 55, characters 0-33 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity.mli", line 49, characters 0-33 +extract_arity is never used - <-- line 55 + <-- line 49 val extract_arity : t -> int list [@@dead "+extract_arity"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity.mli", line 58, characters 0-61 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity.mli", line 52, characters 0-61 +merge_arities is never used - <-- line 58 + <-- line 52 val merge_arities : int list -> int list -> bool -> bool -> t [@@dead "+merge_arities"] Warning Dead Module @@ -15823,4 +15781,4 @@ <-- line 38 val peek_minus : t -> bool [@@dead "+peek_minus"] - Analysis reported 2773 issues (Warning Dead Module:151, Warning Dead Type:294, Warning Dead Value:2072, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:195, Warning Unused Argument:24) + Analysis reported 2766 issues (Warning Dead Module:151, Warning Dead Type:294, Warning Dead Value:2065, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:195, Warning Unused Argument:24) diff --git a/compiler/core/lam_arity.ml b/compiler/core/lam_arity.ml index 7998426f08d..1f407fddf9f 100644 --- a/compiler/core/lam_arity.ml +++ b/compiler/core/lam_arity.ml @@ -32,36 +32,6 @@ type t = *) | Arity_na -let equal (x : t) y = - match x with - | Arity_na -> y = Arity_na - | Arity_info (xs, a) -> ( - match y with - | Arity_info (ys, b) -> - a = b && Ext_list.for_all2_no_exn xs ys (fun x y -> x = y) - | Arity_na -> false) - -let pp = Format.fprintf - -let print (fmt : Format.formatter) (x : t) = - match x with - | Arity_na -> pp fmt "?" - | Arity_info (ls, tail) -> - pp fmt "@["; - pp fmt "["; - Format.pp_print_list - ~pp_sep:(fun fmt () -> pp fmt ",") - (fun fmt x -> Format.pp_print_int fmt x) - fmt ls; - if tail then pp fmt "@ *"; - pp fmt "]@]" - -let print_arities_tbl (fmt : Format.formatter) - (arities_tbl : (Ident.t, t ref) Hashtbl.t) = - Hashtbl.fold - (fun (i : Ident.t) (v : t ref) _ -> pp fmt "@[%s -> %a@]@." i.name print !v) - arities_tbl () - let merge (n : int) (x : t) : t = match x with | Arity_na -> Arity_info ([n], false) diff --git a/compiler/core/lam_arity.mli b/compiler/core/lam_arity.mli index 29772c0dd42..a14d317c463 100644 --- a/compiler/core/lam_arity.mli +++ b/compiler/core/lam_arity.mli @@ -32,12 +32,6 @@ type t = private *) | Arity_na -val equal : t -> t -> bool - -val print : Format.formatter -> t -> unit - -val print_arities_tbl : Format.formatter -> (Ident.t, t ref) Hashtbl.t -> unit - val merge : int -> t -> t val non_function_arity_info : t From 332d29a6c02da8c04c495af756c1143f7fb7d9dc Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 13:01:13 +0000 Subject: [PATCH 101/214] dce: note lambda pass liveness --- scripts/dce/live-findings.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/scripts/dce/live-findings.md b/scripts/dce/live-findings.md index 9a91a5d1e64..62ecc995c60 100644 --- a/scripts/dce/live-findings.md +++ b/scripts/dce/live-findings.md @@ -312,6 +312,28 @@ live after manual validation. smart constructors used cross-module, which this DCE run does not root correctly. +### Core lambda analysis and rewrite passes + +- Report: `Warning Dead Module` / `Warning Dead Value` clusters in + `compiler/core/lam_analysis.ml`, `lam_arity.ml`, `lam_arity_analysis.ml`, + `lam_beta_reduce.ml`, `lam_beta_reduce_util.ml`, `lam_bounded_vars.ml`, + `lam_check.ml`, and `lam_closure.ml` plus their `.mli` files. +- Verdict: live; false positive for the remaining reported helpers. +- Validation: `Lam_analysis` is used by lambda DCE/count/remove-alias passes, + `lam_compile_main.cppo.ml`, `lam_compile.ml`, `lam_stats_export.ml`, + `lam_beta_reduce.ml`, `lam_dce.ml`, `lam_util.cppo.ml`, and + `lam_var_stats.ml`. `Lam_arity` and `Lam_arity_analysis` feed + `lam_pass_alpha_conversion.ml`, `lam_stats_export.ml`, `lam_coercion.ml`, + and `lam_pass_collect.ml`. `Lam_beta_reduce` is called from + `lam_pass_lets_dce.ml`, `lam_pass_count.ml`, `lam_pass_remove_alias.ml`, and + `lam_compile.ml`; it calls `Lam_beta_reduce_util.simple_beta_reduce` and + `Lam_bounded_vars.rewrite`. `Lam_check.check` is called by + `lam_compile_main.cppo.ml`. `Lam_closure` is used by + `lam_pass_remove_alias.ml`, `lam_stats_export.ml`, and `lam_compile.ml`. +- Context: unused `Lam_arity.equal`, `print`, and `print_arities_tbl` exports + were removed. The remaining entries are cross-module pass plumbing and local + helper chains under live pass functions. + ### Core JS lowering helpers - Report: `Warning Dead Module`, `Warning Dead Value`, and constructor warnings From a1a8b1b8974e8c001ec45d7d750037eb5ed4cfea Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 13:02:13 +0000 Subject: [PATCH 102/214] dce: trim int compare --- _dce/report.txt | 62 +++++++++++++++--------------------- compiler/core/lam_compat.ml | 9 ------ compiler/core/lam_compat.mli | 2 -- 3 files changed, 25 insertions(+), 48 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index 370ff85eb18..15befcebb96 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -5917,76 +5917,70 @@ <-- line 45 | Cge -> a >= b [@@dead "+cmp_float"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.ml", line 54, characters 0-174 - +cmp_int is never used - <-- line 54 - | Cge -> a >= b [@@dead "+cmp_int"] - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.ml", line 66, characters 2-69 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.ml", line 57, characters 2-69 field_dbg_info.Fld_record is a variant case which is never constructed - <-- line 66 + <-- line 57 | Fld_record of {name: string; mutable_flag: Asttypes.mutable_flag} [@dead "field_dbg_info.Fld_record"] Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.ml", line 67, characters 2-32 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.ml", line 58, characters 2-32 field_dbg_info.Fld_module is a variant case which is never constructed - <-- line 67 + <-- line 58 | Fld_module of {name: string} [@dead "field_dbg_info.Fld_module"] Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.ml", line 68, characters 2-39 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.ml", line 59, characters 2-39 field_dbg_info.Fld_record_inline is a variant case which is never constructed - <-- line 68 + <-- line 59 | Fld_record_inline of {name: string} [@dead "field_dbg_info.Fld_record_inline"] Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.ml", line 69, characters 2-42 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.ml", line 60, characters 2-42 field_dbg_info.Fld_record_extension is a variant case which is never constructed - <-- line 69 + <-- line 60 | Fld_record_extension of {name: string} [@dead "field_dbg_info.Fld_record_extension"] Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.ml", line 70, characters 2-13 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.ml", line 61, characters 2-13 field_dbg_info.Fld_tuple is a variant case which is never constructed - <-- line 70 + <-- line 61 | Fld_tuple [@dead "field_dbg_info.Fld_tuple"] Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.ml", line 71, characters 2-20 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.ml", line 62, characters 2-20 field_dbg_info.Fld_poly_var_tag is a variant case which is never constructed - <-- line 71 + <-- line 62 | Fld_poly_var_tag [@dead "field_dbg_info.Fld_poly_var_tag"] Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.ml", line 72, characters 2-24 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.ml", line 63, characters 2-24 field_dbg_info.Fld_poly_var_content is a variant case which is never constructed - <-- line 72 + <-- line 63 | Fld_poly_var_content [@dead "field_dbg_info.Fld_poly_var_content"] Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.ml", line 73, characters 2-17 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.ml", line 64, characters 2-17 field_dbg_info.Fld_extension is a variant case which is never constructed - <-- line 73 + <-- line 64 | Fld_extension [@dead "field_dbg_info.Fld_extension"] Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.ml", line 74, characters 2-15 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.ml", line 65, characters 2-15 field_dbg_info.Fld_variant is a variant case which is never constructed - <-- line 74 + <-- line 65 | Fld_variant [@dead "field_dbg_info.Fld_variant"] Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.ml", line 75, characters 2-12 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.ml", line 66, characters 2-12 field_dbg_info.Fld_cons is a variant case which is never constructed - <-- line 75 + <-- line 66 | Fld_cons [@dead "field_dbg_info.Fld_cons"] Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.ml", line 91, characters 2-38 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.ml", line 82, characters 2-38 set_field_dbg_info.Fld_record_extension_set is a variant case which is never constructed - <-- line 91 + <-- line 82 | Fld_record_extension_set of string [@dead "set_field_dbg_info.Fld_record_extension_set"] Warning Dead Type @@ -6068,15 +6062,9 @@ val cmp_float : comparison -> float -> float -> bool [@@dead "+cmp_float"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.mli", line 52, characters 0-46 - +cmp_int is never used - <-- line 52 - val cmp_int : comparison -> int -> int -> bool [@@dead "+cmp_int"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.mli", line 54, characters 0-52 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.mli", line 52, characters 0-52 +eq_comparison is never used - <-- line 54 + <-- line 52 val eq_comparison : comparison -> comparison -> bool [@@dead "+eq_comparison"] Warning Dead Value @@ -15781,4 +15769,4 @@ <-- line 38 val peek_minus : t -> bool [@@dead "+peek_minus"] - Analysis reported 2766 issues (Warning Dead Module:151, Warning Dead Type:294, Warning Dead Value:2065, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:195, Warning Unused Argument:24) + Analysis reported 2764 issues (Warning Dead Module:151, Warning Dead Type:294, Warning Dead Value:2063, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:195, Warning Unused Argument:24) diff --git a/compiler/core/lam_compat.ml b/compiler/core/lam_compat.ml index a652d74ca43..68d52813266 100644 --- a/compiler/core/lam_compat.ml +++ b/compiler/core/lam_compat.ml @@ -51,15 +51,6 @@ let cmp_float (cmp : comparison) (a : float) b : bool = | Clt -> a < b | Cge -> a >= b -let cmp_int (cmp : comparison) (a : int) b : bool = - match cmp with - | Ceq -> a = b - | Cneq -> a <> b - | Cgt -> a > b - | Cle -> a <= b - | Clt -> a < b - | Cge -> a >= b - type let_kind = Lambda.let_kind = Strict | Alias | StrictOpt | Variable type field_dbg_info = Lambda.field_dbg_info = diff --git a/compiler/core/lam_compat.mli b/compiler/core/lam_compat.mli index 4d67d95242e..25cd677eda7 100644 --- a/compiler/core/lam_compat.mli +++ b/compiler/core/lam_compat.mli @@ -49,6 +49,4 @@ val cmp_int32 : comparison -> int32 -> int32 -> bool val cmp_float : comparison -> float -> float -> bool -val cmp_int : comparison -> int -> int -> bool - val eq_comparison : comparison -> comparison -> bool From 07c12155abc469717b658eadea9c8a331af0349b Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 13:02:30 +0000 Subject: [PATCH 103/214] dce: note compat liveness --- scripts/dce/live-findings.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/scripts/dce/live-findings.md b/scripts/dce/live-findings.md index 62ecc995c60..fbf9947d46d 100644 --- a/scripts/dce/live-findings.md +++ b/scripts/dce/live-findings.md @@ -334,6 +334,23 @@ live after manual validation. were removed. The remaining entries are cross-module pass plumbing and local helper chains under live pass functions. +### `Lam_compat` aliases and comparisons + +- Report: constructor warnings for `field_dbg_info` and `set_field_dbg_info` in + `compiler/core/lam_compat.ml` / `.mli`, plus comparison helpers. +- Verdict: live; false positive for the remaining reported entries. +- Validation: `Lam_compat.field_dbg_info` and `set_field_dbg_info` are + manifest aliases of `Lambda` types. Their constructors are produced in the ML + lambda layer (`lambda.ml`, `translcore.ml`, `translmod.ml`, `matching.ml`) and + consumed by core lowering in `lam_convert.ml`, `lam_util.cppo.ml`, + `lam_arity_analysis.ml`, `lam_analysis.ml`, `lam_pass_remove_alias.ml`, + `lam_compile.ml`, `lam_print.ml`, `polyvar_pattern_match.ml`, and + `js_of_lam_block.ml`. `cmp_int32` and `cmp_float` are called by `Lam.prim`; + `eq_comparison` is called by `lam_primitive.ml`. +- Context: unused `cmp_int` was removed. The remaining constructor warnings come + from constructors being built through the aliased `Lambda` type rather than + directly through `Lam_compat`. + ### Core JS lowering helpers - Report: `Warning Dead Module`, `Warning Dead Value`, and constructor warnings From 3c91dee59349120ad186d17d62f0c8b7c574d3f0 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 13:03:07 +0000 Subject: [PATCH 104/214] dce: note compile liveness --- scripts/dce/live-findings.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/scripts/dce/live-findings.md b/scripts/dce/live-findings.md index fbf9947d46d..ff0787de00d 100644 --- a/scripts/dce/live-findings.md +++ b/scripts/dce/live-findings.md @@ -351,6 +351,24 @@ live after manual validation. from constructors being built through the aliased `Lambda` type rather than directly through `Lam_compat`. +### Lambda-to-JS compilation pipeline + +- Report: `Warning Dead Module` / `Warning Dead Value` clusters in + `compiler/core/lam_compile.ml`, `lam_compile_const.ml`, and + `lam_compile_context.ml` plus their `.mli` files. +- Verdict: live; false positive. +- Validation: `lam_compile_main.cppo.ml` calls + `Lam_compile.compile_lambda` and `compile_recursive_lets`. The reported + top-level helpers in `lam_compile.ml` are local dependencies of the recursive + `compile` closure that produces those functions. `Lam_compile_const.translate` + and `translate_arg_cst` are used by `lam_compile.ml`, + `lam_compile_external_call.ml`, and `lam_compile_external_obj.ml`. + `Lam_compile_context` types and helpers are used by `lam_compile.ml`, + `lam_compile_main.cppo.ml`, `lam_compile_primitive.ml`, + `lam_compile_external_call.ml`, and `js_output.ml`. +- Context: DCE does not root the `.cppo.ml` entry point and therefore treats the + compiler backend and its local helper chains as dead. + ### Core JS lowering helpers - Report: `Warning Dead Module`, `Warning Dead Value`, and constructor warnings From 9295a0c9216b29e353af1955b12de8de4d20059a Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 13:03:58 +0000 Subject: [PATCH 105/214] dce: note ffi liveness --- scripts/dce/live-findings.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/scripts/dce/live-findings.md b/scripts/dce/live-findings.md index ff0787de00d..15d8525bf33 100644 --- a/scripts/dce/live-findings.md +++ b/scripts/dce/live-findings.md @@ -369,6 +369,26 @@ live after manual validation. - Context: DCE does not root the `.cppo.ml` entry point and therefore treats the compiler backend and its local helper chains as dead. +### Lambda compile environment and FFI lowering + +- Report: `Warning Dead Value` / `Warning Dead Module` clusters in + `compiler/core/lam_compile_env.ml`, `lam_compile_external_call.ml`, + `lam_compile_external_obj.ml`, and `lam_compile_primitive.ml` plus their + `.mli` files. +- Verdict: live; false positive. +- Validation: `Lam_compile_env` is used by `lam_compile.ml`, + `lam_pass_remove_alias.ml`, `lam_arity_analysis.ml`, + `lam_stats_export.ml`, `js_implementation.ml`, `js_name_of_module_id.cppo.ml`, + and `lam_compile_main.cppo.ml`. `Lam_compile_external_call.translate_ffi` is + called by `lam_compile_primitive.ml`, and `ocaml_to_js_eff` is used by + `lam_compile_external_obj.ml`. `Lam_compile_external_obj.assemble_obj_args` + and `Lam_compile_primitive.translate` are called by `lam_compile.ml`. The + reported helper functions in those modules are local dependencies of those + exported lowering entry points. +- Context: `lam_compile_external_call.arg_expression` is a manifest alias of + `Js_of_lam_variant.arg_expression`; constructor warnings there are false + positives for the same aliasing reason documented in the JS lowering section. + ### Core JS lowering helpers - Report: `Warning Dead Module`, `Warning Dead Value`, and constructor warnings From 5146d1749aaf76ba74defd3c2dc82e6c362d807c Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 13:07:25 +0000 Subject: [PATCH 106/214] dce: trim dead APIs --- _dce/report.txt | 90 +++++-------------- analysis/reactive/src/reactive.mli | 5 -- .../reactive/src/reactive_file_collection.ml | 1 - .../reactive/src/reactive_file_collection.mli | 1 - compiler/core/lam_id_kind.ml | 7 +- compiler/core/lam_id_kind.mli | 4 +- compiler/core/lam_pass_remove_alias.ml | 13 +-- 7 files changed, 27 insertions(+), 94 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index 15befcebb96..764e16cf892 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -1007,30 +1007,6 @@ <-- line 1125 Registry.register ~name ~level:my_level ~process ~stats:my_stats [@@dead "+_info"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.mli", line 21, characters 0-62 - +delta_to_entries is never used - <-- line 21 - val delta_to_entries : ('k, 'v) delta -> ('k * 'v option) list [@@dead "+delta_to_entries"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.mli", line 45, characters 0-32 - +create_stats is never used - <-- line 45 - val create_stats : unit -> stats [@@dead "+create_stats"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive_file_collection.ml", line 77, characters 0-43 - +length is never used - <-- line 77 - let length t = Reactive.length t.collection [@@dead "+length"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive_file_collection.mli", line 55, characters 0-32 - +length is never used - <-- line 55 - val length : ('raw, 'v) t -> int [@@dead "+length"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive_fixpoint.ml", line 16, characters 0-674 +analyze_edge_change is never used @@ -7009,40 +6985,22 @@ <-- line 34 type element = NA [@dead "element.NA"] | SimpleForm of Lam.t [@dead "element.SimpleForm"] - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_id_kind.ml", line 36, characters 22-31 - boxed_nullable.Undefined is a variant case which is never constructed - <-- line 36 - type boxed_nullable = Undefined [@dead "boxed_nullable.Undefined"] | Null | Null_undefined - Warning Dead Type File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_id_kind.ml", line 41, characters 2-35 t.ImmutableBlock is a variant case which is never constructed <-- line 41 | ImmutableBlock of element array [@dead "t.ImmutableBlock"] - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_id_kind.ml", line 42, characters 2-33 - t.MutableBlock is a variant case which is never constructed - <-- line 42 - | MutableBlock of element array [@dead "t.MutableBlock"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_id_kind.ml", line 52, characters 2-13 - t.Exception is a variant case which is never constructed - <-- line 52 - | Exception [@dead "t.Exception"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_id_kind.ml", line 61, characters 0-23 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_id_kind.ml", line 59, characters 0-23 +pp is never used - <-- line 61 + <-- line 59 let pp = Format.fprintf [@@dead "+pp"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_id_kind.ml", line 63, characters 0-590 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_id_kind.ml", line 61, characters 0-434 +print is never used - <-- line 63 + <-- line 61 | NA -> pp fmt "NA" [@@dead "+print"] Warning Dead Type @@ -7057,34 +7015,16 @@ <-- line 34 type element = NA [@dead "element.NA"] | SimpleForm of Lam.t [@dead "element.SimpleForm"] - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_id_kind.mli", line 36, characters 22-31 - boxed_nullable.Undefined is a variant case which is never constructed - <-- line 36 - type boxed_nullable = Undefined [@dead "boxed_nullable.Undefined"] | Null | Null_undefined - Warning Dead Type File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_id_kind.mli", line 53, characters 2-35 t.ImmutableBlock is a variant case which is never constructed <-- line 53 | ImmutableBlock of element array [@dead "t.ImmutableBlock"] - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_id_kind.mli", line 54, characters 2-33 - t.MutableBlock is a variant case which is never constructed - <-- line 54 - | MutableBlock of element array [@dead "t.MutableBlock"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_id_kind.mli", line 61, characters 2-13 - t.Exception is a variant case which is never constructed - <-- line 61 - | Exception [@dead "t.Exception"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_id_kind.mli", line 70, characters 0-41 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_id_kind.mli", line 68, characters 0-41 +print is never used - <-- line 70 + <-- line 68 val print : Format.formatter -> t -> unit [@@dead "+print"] Warning Dead Module @@ -7426,7 +7366,7 @@ val simplify_lets : Lam.t -> Lam.t [@@dead "+simplify_lets"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_remove_alias.ml", line 27, characters 0-692 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_remove_alias.ml", line 27, characters 0-653 +id_is_for_sure_true_in_boolean is never used <-- line 27 Eval_unknown [@@dead "+id_is_for_sure_true_in_boolean"] @@ -7438,7 +7378,7 @@ | _ -> false [@@dead "+is_const_some"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_remove_alias.ml", line 50, characters 0-9886 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_remove_alias.ml", line 50, characters 0-9666 +simplify_alias is never used <-- line 50 simpl lam [@@dead "+simplify_alias"] @@ -7477,6 +7417,12 @@ <-- line 153 | Pjs_runtime_apply [@dead "t.Pjs_runtime_apply"] (* [f; [...]] *) + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_primitive.ml", line 169, characters 2-17 + t.Pis_undefined is a variant case which is never constructed + <-- line 169 + | Pis_undefined [@dead "t.Pis_undefined"] + Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_primitive.ml", line 187, characters 0-99 +eq_field_dbg_info is never used @@ -7525,6 +7471,12 @@ <-- line 147 | Pjs_runtime_apply [@dead "t.Pjs_runtime_apply"] (* [f; [...]] *) + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_primitive.mli", line 159, characters 2-17 + t.Pis_undefined is a variant case which is never constructed + <-- line 159 + | Pis_undefined [@dead "t.Pis_undefined"] + Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_primitive.mli", line 177, characters 0-40 +eq_primitive_approx is never used @@ -15769,4 +15721,4 @@ <-- line 38 val peek_minus : t -> bool [@@dead "+peek_minus"] - Analysis reported 2764 issues (Warning Dead Module:151, Warning Dead Type:294, Warning Dead Value:2063, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:195, Warning Unused Argument:24) + Analysis reported 2756 issues (Warning Dead Module:151, Warning Dead Type:290, Warning Dead Value:2059, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:195, Warning Unused Argument:24) diff --git a/analysis/reactive/src/reactive.mli b/analysis/reactive/src/reactive.mli index 4936c33a3d1..6cb91c1982b 100644 --- a/analysis/reactive/src/reactive.mli +++ b/analysis/reactive/src/reactive.mli @@ -18,9 +18,6 @@ type ('k, 'v) delta = val set : 'k -> 'v -> 'k * 'v option (** Create a batch entry that sets a key *) -val delta_to_entries : ('k, 'v) delta -> ('k * 'v option) list -(** Convert delta to batch entries *) - (** {1 Statistics} *) type stats = { @@ -42,8 +39,6 @@ type stats = { } (** Per-node statistics for diagnostics *) -val create_stats : unit -> stats - (** {1 Collection Interface} *) type ('k, 'v) t = { diff --git a/analysis/reactive/src/reactive_file_collection.ml b/analysis/reactive/src/reactive_file_collection.ml index 89a661beae7..b7cc7c3a859 100644 --- a/analysis/reactive/src/reactive_file_collection.ml +++ b/analysis/reactive/src/reactive_file_collection.ml @@ -74,5 +74,4 @@ let remove_batch t paths = List.length entries let mem t path = Hashtbl.mem t.internal.cache path -let length t = Reactive.length t.collection let iter f t = Reactive.iter f t.collection diff --git a/analysis/reactive/src/reactive_file_collection.mli b/analysis/reactive/src/reactive_file_collection.mli index e3433eae377..058ff74590f 100644 --- a/analysis/reactive/src/reactive_file_collection.mli +++ b/analysis/reactive/src/reactive_file_collection.mli @@ -52,5 +52,4 @@ val remove_batch : ('raw, 'v) t -> string list -> int (** {1 Access} *) val mem : ('raw, 'v) t -> string -> bool -val length : ('raw, 'v) t -> int val iter : (string -> 'v -> unit) -> ('raw, 'v) t -> unit diff --git a/compiler/core/lam_id_kind.ml b/compiler/core/lam_id_kind.ml index b7967fb15ff..759b1317c97 100644 --- a/compiler/core/lam_id_kind.ml +++ b/compiler/core/lam_id_kind.ml @@ -33,13 +33,12 @@ type rec_flag = Lam_rec | Lam_non_rec | Lam_self_rec type element = NA | SimpleForm of Lam.t -type boxed_nullable = Undefined | Null | Null_undefined +type boxed_nullable = Null | Null_undefined type t = | Normal_optional of Lam.t (* Some [x] *) | OptionalBlock of Lam.t * boxed_nullable | ImmutableBlock of element array - | MutableBlock of element array | Constant of Lam_constant.t | Module of Ident.t (** TODO: static module vs first class module *) | FunctionId of { @@ -49,7 +48,6 @@ type t = *) lambda: (Lam.t * rec_flag) option; } - | Exception | Parameter (** For this case, it can help us determine whether it should be inlined or not *) | NA @@ -65,12 +63,9 @@ let print fmt (kind : t) = | ImmutableBlock arr -> pp fmt "Imm(%d)" (Array.length arr) | Normal_optional _ -> pp fmt "Some" | OptionalBlock (_, Null) -> pp fmt "?Null" - | OptionalBlock (_, Undefined) -> pp fmt "?Undefined" | OptionalBlock (_, Null_undefined) -> pp fmt "?Nullable" - | MutableBlock arr -> pp fmt "Mutable(%d)" (Array.length arr) | Constant _ -> pp fmt "Constant" | Module id -> pp fmt "%s/%d" id.name id.stamp | FunctionId _ -> pp fmt "FunctionID" - | Exception -> pp fmt "Exception" | Parameter -> pp fmt "Parameter" | NA -> pp fmt "NA" diff --git a/compiler/core/lam_id_kind.mli b/compiler/core/lam_id_kind.mli index 040a63a417e..b240bd3c3cb 100644 --- a/compiler/core/lam_id_kind.mli +++ b/compiler/core/lam_id_kind.mli @@ -33,7 +33,7 @@ type rec_flag = type element = NA | SimpleForm of Lam.t -type boxed_nullable = Undefined | Null | Null_undefined +type boxed_nullable = Null | Null_undefined (** {[ let v/2 = Pnull_to_opt u]} @@ -51,14 +51,12 @@ type t = | Normal_optional of Lam.t | OptionalBlock of Lam.t * boxed_nullable | ImmutableBlock of element array - | MutableBlock of element array | Constant of Lam_constant.t | Module of Ident.t (** TODO: static module vs first class module *) | FunctionId of { mutable arity: Lam_arity.t; lambda: (Lam.t * rec_flag) option; } - | Exception | Parameter (** For this case, it can help us determine whether it should be inlined or not *) | NA diff --git a/compiler/core/lam_pass_remove_alias.ml b/compiler/core/lam_pass_remove_alias.ml index 52a88ad02eb..30d8a45b2f7 100644 --- a/compiler/core/lam_pass_remove_alias.ml +++ b/compiler/core/lam_pass_remove_alias.ml @@ -35,9 +35,9 @@ let id_is_for_sure_true_in_boolean (tbl : Lam_stats.ident_tbl) id = | Some (Constant (Const_js_false | Const_js_null | Const_js_undefined _)) -> Eval_false | Some - ( Normal_optional _ | ImmutableBlock _ | MutableBlock _ | Constant _ - | Module _ | FunctionId _ | Exception | Parameter | NA - | OptionalBlock (_, (Undefined | Null | Null_undefined)) ) + ( Normal_optional _ | ImmutableBlock _ | Constant _ | Module _ + | FunctionId _ | Parameter | NA | OptionalBlock (_, (Null | Null_undefined)) + ) | None -> Eval_unknown @@ -85,17 +85,12 @@ let simplify_alias (meta : Lam_stats.t) (lam : Lam.t) : Lam.t = -> ( match Hash_ident.find_opt meta.ident_tbl id with | Some (Constant c) when is_const_some c -> simpl l2 - | Some (ImmutableBlock _ | MutableBlock _ | Normal_optional _) -> simpl l2 + | Some (ImmutableBlock _ | Normal_optional _) -> simpl l2 | Some (OptionalBlock (l, Null)) -> Lam.if_ (Lam.not_ Location.none (Lam.prim ~primitive:Pis_null ~args:[l] Location.none)) (simpl l2) (simpl l3) - | Some (OptionalBlock (l, Undefined)) -> - Lam.if_ - (Lam.not_ Location.none - (Lam.prim ~primitive:Pis_undefined ~args:[l] Location.none)) - (simpl l2) (simpl l3) | Some (OptionalBlock (l, Null_undefined)) -> Lam.if_ (Lam.not_ Location.none From aad9a3b1e2fe176bdc7cedd71be6ffb54e061b6e Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 13:08:50 +0000 Subject: [PATCH 107/214] dce: remove undefined primitive --- _dce/report.txt | 98 ++++++++++---------------- compiler/core/js_exp_make.ml | 2 - compiler/core/js_exp_make.mli | 2 - compiler/core/lam_analysis.ml | 2 +- compiler/core/lam_compile_primitive.ml | 1 - compiler/core/lam_primitive.ml | 3 +- compiler/core/lam_primitive.mli | 1 - compiler/core/lam_print.ml | 1 - 8 files changed, 39 insertions(+), 71 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index 764e16cf892..5bed30b278d 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -2638,45 +2638,39 @@ let is_null ?comment (x : t) = triple_equal ?comment x nil [@@dead "+is_null"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1728, characters 0-59 - +is_undef is never used - <-- line 1728 - let is_undef ?comment x = triple_equal ?comment x undefined [@@dead "+is_undef"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1730, characters 0-117 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1728, characters 0-117 +is_null_undefined_constant is never used - <-- line 1730 + <-- line 1728 | _ -> false [@@dead "+is_null_undefined_constant"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1735, characters 0-216 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1733, characters 0-216 +is_null_undefined is never used - <-- line 1735 + <-- line 1733 | _ -> {comment; expression_desc = Is_null_or_undefined x} [@@dead "+is_null_undefined"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1741, characters 0-605 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1739, characters 0-605 +eq_null_undefined_boolean is never used - <-- line 1741 + <-- line 1739 | _ -> {expression_desc = Bin (EqEqEq, a, b); comment} [@@dead "+eq_null_undefined_boolean"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1756, characters 0-605 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1754, characters 0-605 +neq_null_undefined_boolean is never used - <-- line 1756 + <-- line 1754 | _ -> {expression_desc = Bin (NotEqEq, a, b); comment} [@@dead "+neq_null_undefined_boolean"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1771, characters 0-106 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1769, characters 0-106 +make_exception is never used - <-- line 1771 + <-- line 1769 pure_runtime_call Primitive_modules.exceptions Literals.create [str s] [@@dead "+make_exception"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1774, characters 0-173 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1772, characters 0-173 +variadic_args is never used - <-- line 1774 + <-- line 1772 | arg :: args -> arg :: variadic_args args [@@dead "+variadic_args"] Warning Dead Value @@ -3346,33 +3340,27 @@ val is_null : ?comment:string -> t -> t [@@dead "+is_null"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 359, characters 0-40 - +is_undef is never used - <-- line 359 - val is_undef : ?comment:string -> t -> t [@@dead "+is_undef"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 361, characters 0-53 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 359, characters 0-53 +is_null_undefined_constant is never used - <-- line 361 + <-- line 359 val is_null_undefined_constant : J.expression -> bool [@@dead "+is_null_undefined_constant"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 363, characters 0-49 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 361, characters 0-49 +is_null_undefined is never used - <-- line 363 + <-- line 361 val is_null_undefined : ?comment:string -> t -> t [@@dead "+is_null_undefined"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 365, characters 0-32 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 363, characters 0-32 +make_exception is never used - <-- line 365 + <-- line 363 val make_exception : string -> t [@@dead "+make_exception"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 367, characters 0-36 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 365, characters 0-36 +variadic_args is never used - <-- line 367 + <-- line 365 val variadic_args : t list -> t list [@@dead "+variadic_args"] Warning Dead Module @@ -5422,7 +5410,7 @@ | _ -> false [@@dead "+not_zero_constant"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_analysis.ml", line 32, characters 0-4220 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_analysis.ml", line 32, characters 0-4204 +no_side_effects is never used <-- line 32 | Lapply _ -> false [@@dead "+no_side_effects"] @@ -6580,7 +6568,7 @@ ] [@@dead "+wrap_then"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_primitive.ml", line 71, characters 0-19216 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_primitive.ml", line 71, characters 0-19154 +translate is never used <-- line 71 | _ -> assert false) [@@dead "+translate"] @@ -7417,34 +7405,28 @@ <-- line 153 | Pjs_runtime_apply [@dead "t.Pjs_runtime_apply"] (* [f; [...]] *) - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_primitive.ml", line 169, characters 2-17 - t.Pis_undefined is a variant case which is never constructed - <-- line 169 - | Pis_undefined [@dead "t.Pis_undefined"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_primitive.ml", line 187, characters 0-99 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_primitive.ml", line 186, characters 0-99 +eq_field_dbg_info is never used - <-- line 187 + <-- line 186 x = y [@@dead "+eq_field_dbg_info"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_primitive.ml", line 192, characters 0-111 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_primitive.ml", line 191, characters 0-111 +eq_set_field_dbg_info is never used - <-- line 192 + <-- line 191 x = y [@@dead "+eq_set_field_dbg_info"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_primitive.ml", line 197, characters 0-46 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_primitive.ml", line 196, characters 0-46 +eq_tag_info is never used - <-- line 197 + <-- line 196 let eq_tag_info (x : Lam_tag_info.t) y = x = y [@@dead "+eq_tag_info"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_primitive.ml", line 199, characters 0-4149 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_primitive.ml", line 198, characters 0-4133 +eq_primitive_approx is never used - <-- line 199 + <-- line 198 | Praw_js_code _ -> false [@@dead "+eq_primitive_approx"] Warning Dead Type @@ -7471,30 +7453,24 @@ <-- line 147 | Pjs_runtime_apply [@dead "t.Pjs_runtime_apply"] (* [f; [...]] *) - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_primitive.mli", line 159, characters 2-17 - t.Pis_undefined is a variant case which is never constructed - <-- line 159 - | Pis_undefined [@dead "t.Pis_undefined"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_primitive.mli", line 177, characters 0-40 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_primitive.mli", line 176, characters 0-40 +eq_primitive_approx is never used - <-- line 177 + <-- line 176 val eq_primitive_approx : t -> t -> bool [@@dead "+eq_primitive_approx"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_print.ml", line 484, characters 0-343 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_print.ml", line 483, characters 0-343 +serialize is never used - <-- line 484 + <-- line 483 Format.set_margin old [@@dead "+serialize"] Warning Dead Value With Side Effects - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_print.ml", line 495, characters 0-50 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_print.ml", line 494, characters 0-50 +lambda_to_string is never used and could have side effects Warning Dead Value With Side Effects - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_print.ml", line 497, characters 0-56 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_print.ml", line 496, characters 0-56 +primitive_to_string is never used and could have side effects Warning Dead Module @@ -15721,4 +15697,4 @@ <-- line 38 val peek_minus : t -> bool [@@dead "+peek_minus"] - Analysis reported 2756 issues (Warning Dead Module:151, Warning Dead Type:290, Warning Dead Value:2059, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:195, Warning Unused Argument:24) + Analysis reported 2752 issues (Warning Dead Module:151, Warning Dead Type:288, Warning Dead Value:2057, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:195, Warning Unused Argument:24) diff --git a/compiler/core/js_exp_make.ml b/compiler/core/js_exp_make.ml index 812016b1c2f..7a9c85f1917 100644 --- a/compiler/core/js_exp_make.ml +++ b/compiler/core/js_exp_make.ml @@ -1725,8 +1725,6 @@ let of_block ?comment ?e block : t = [] let is_null ?comment (x : t) = triple_equal ?comment x nil -let is_undef ?comment x = triple_equal ?comment x undefined - let is_null_undefined_constant (x : t) = match x.expression_desc with | Null | Undefined _ -> true diff --git a/compiler/core/js_exp_make.mli b/compiler/core/js_exp_make.mli index d61cd812fcb..4bcfd538e2e 100644 --- a/compiler/core/js_exp_make.mli +++ b/compiler/core/js_exp_make.mli @@ -356,8 +356,6 @@ val nil : t val is_null : ?comment:string -> t -> t -val is_undef : ?comment:string -> t -> t - val is_null_undefined_constant : J.expression -> bool val is_null_undefined : ?comment:string -> t -> t diff --git a/compiler/core/lam_analysis.ml b/compiler/core/lam_analysis.ml index 29a8d3a1602..93cbd92c36a 100644 --- a/compiler/core/lam_analysis.ml +++ b/compiler/core/lam_analysis.ml @@ -45,7 +45,7 @@ let rec no_side_effects (lam : Lam.t) : bool = | [_; Lconst cst] -> not_zero_constant cst | _ -> false) | Pcreate_extension _ | Ptypeof | Pis_null | Pis_not_none | Psome - | Psome_not_nest | Pis_undefined | Pis_null_undefined | Pnull_to_opt + | Psome_not_nest | Pis_null_undefined | Pnull_to_opt | Pnull_undefined_to_opt | Pjs_fn_make _ | Pjs_fn_make_unit | Pjs_object_create _ | Pimport (* TODO: check *) diff --git a/compiler/core/lam_compile_primitive.ml b/compiler/core/lam_compile_primitive.ml index e6a7a86a6e3..ddb1cc19905 100644 --- a/compiler/core/lam_compile_primitive.ml +++ b/compiler/core/lam_compile_primitive.ml @@ -146,7 +146,6 @@ let translate output_prefix loc (cxt : Lam_compile_context.t) | Pfn_arity -> E.function_length (Ext_list.singleton_exn args) | Pobjsize -> E.obj_length (Ext_list.singleton_exn args) | Pis_null -> E.is_null (Ext_list.singleton_exn args) - | Pis_undefined -> E.is_undef (Ext_list.singleton_exn args) | Pis_null_undefined -> E.is_null_undefined (Ext_list.singleton_exn args) | Ptypeof -> E.typeof (Ext_list.singleton_exn args) | Pjs_unsafe_downgrade _ | Pdebugger | Pjs_fn_make _ | Pjs_fn_make_unit diff --git a/compiler/core/lam_primitive.ml b/compiler/core/lam_primitive.ml index 974aff095b0..b739daa4873 100644 --- a/compiler/core/lam_primitive.ml +++ b/compiler/core/lam_primitive.ml @@ -166,7 +166,6 @@ type t = | Pnull_to_opt | Pnull_undefined_to_opt | Pis_null - | Pis_undefined | Pis_null_undefined | Pimport | Ptypeof @@ -226,7 +225,7 @@ let eq_primitive_approx (lhs : t) (rhs : t) = (* etc *) | Pjs_apply | Pjs_runtime_apply | Pval_from_option | Pval_from_option_not_nest | Pnull_to_opt | Pnull_undefined_to_opt | Pis_null | Pis_not_none | Psome - | Psome_not_nest | Pis_undefined | Pis_null_undefined | Pimport | Ptypeof + | Psome_not_nest | Pis_null_undefined | Pimport | Ptypeof | Pfn_arity | Pis_poly_var_block | Pdebugger | Pinit_mod | Pupdate_mod | Pduprecord | Pmakearray | Parraylength | Parrayrefu | Parraysetu | Parrayrefs | Parraysets | Pjs_fn_make_unit | Pjs_fn_method | Phash diff --git a/compiler/core/lam_primitive.mli b/compiler/core/lam_primitive.mli index 8c0d26a89e1..9aafb5b8467 100644 --- a/compiler/core/lam_primitive.mli +++ b/compiler/core/lam_primitive.mli @@ -156,7 +156,6 @@ type t = | Pnull_to_opt | Pnull_undefined_to_opt | Pis_null - | Pis_undefined | Pis_null_undefined | Pimport | Ptypeof diff --git a/compiler/core/lam_print.ml b/compiler/core/lam_print.ml index 9408b11aea4..ceb53f6d263 100644 --- a/compiler/core/lam_print.ml +++ b/compiler/core/lam_print.ml @@ -70,7 +70,6 @@ let primitive ppf (prim : Lam_primitive.t) = | Psome_not_nest -> fprintf ppf "[some-not-nest]" | Pval_from_option -> fprintf ppf "[?unbox]" | Pval_from_option_not_nest -> fprintf ppf "[?unbox-not-nest]" - | Pis_undefined -> fprintf ppf "[?undefined]" | Pis_null_undefined -> fprintf ppf "[?null?undefined]" | Pimport -> fprintf ppf "[import]" | Pmakeblock (tag, _, Immutable) -> fprintf ppf "makeblock %i" tag From c13061213066102e15024cc0a199ac9fc18dcbcd Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 13:09:44 +0000 Subject: [PATCH 108/214] dce: note fixpoint liveness --- scripts/dce/live-findings.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/scripts/dce/live-findings.md b/scripts/dce/live-findings.md index 15d8525bf33..15d97bbf07b 100644 --- a/scripts/dce/live-findings.md +++ b/scripts/dce/live-findings.md @@ -137,6 +137,23 @@ live after manual validation. - Context: the single-file/cache-management helpers were removed, but the remaining collection operations are part of the live reactive analyzer path. +### `Reactive_fixpoint` internals + +- Report: `Warning Dead Value`, `analysis/reactive/src/reactive_fixpoint.ml` + and `.mli`, including `analyze_edge_change`, `Metrics.update`, + `Invariants.*`, `has_live_predecessor`, and `apply`. +- Verdict: live; false positive. +- Validation: `analysis/reactive/src/reactive.ml` implements + `Reactive.fixpoint` by calling `Reactive_fixpoint.create`, `initialize`, + `apply`, `iter_current`, `get_current`, and `current_length`. The analyzer + liveness pipeline calls `Reactive.fixpoint` from + `analysis/reanalyze/src/reactive_liveness.ml`, so these private-module helpers + run when the reactive analyzer computes live declarations. +- Context: `reactive_fixpoint` is a private implementation module in the + `reactive` library. Reanalyze misses the cross-module root through + `Reactive.fixpoint`, so the implementation below `apply` looks dead even + though it is the incremental transitive-closure engine. + ### Reanalyze collection functor callbacks - Report: `Warning Dead Module` and `Warning Dead Value`, From 85a76b44cdf410afa6817baf3aae6671957f2edc Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 13:11:16 +0000 Subject: [PATCH 109/214] dce: note id kind liveness --- scripts/dce/live-findings.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/scripts/dce/live-findings.md b/scripts/dce/live-findings.md index 15d97bbf07b..d97b314a1b8 100644 --- a/scripts/dce/live-findings.md +++ b/scripts/dce/live-findings.md @@ -329,6 +329,22 @@ live after manual validation. smart constructors used cross-module, which this DCE run does not root correctly. +### `Lam_id_kind` block metadata + +- Report: `Warning Dead Type` / `Warning Dead Value`, + `compiler/core/lam_id_kind.ml` and `.mli`, including `element.NA`, + `element.SimpleForm`, `t.ImmutableBlock`, and `print`. +- Verdict: live; false positive for the remaining metadata constructors. +- Validation: `compiler/core/lam_util.cppo.ml` constructs + `Lam_id_kind.ImmutableBlock` in `kind_of_lambda_block`, builds + `SimpleForm` / `NA` entries in `element_of_lambda`, and consumes the block + metadata in `field_flatten_get`. These helpers are called by + `lam_beta_reduce.ml`, `lam_pass_collect.ml`, `lam_pass_remove_alias.ml`, and + `lam_coercion.ml`. +- Context: the truly unused `Undefined`, `MutableBlock`, and `Exception` + constructors were removed. The remaining warnings are `.cppo.ml` and + cross-module lambda optimization edges that DCE does not root reliably. + ### Core lambda analysis and rewrite passes - Report: `Warning Dead Module` / `Warning Dead Value` clusters in From 40dbf793292bdfa4cb72dd2fc407b98bb607cf45 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 13:12:02 +0000 Subject: [PATCH 110/214] dce: note lambda pass liveness --- scripts/dce/live-findings.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/scripts/dce/live-findings.md b/scripts/dce/live-findings.md index d97b314a1b8..e48f59b6f0a 100644 --- a/scripts/dce/live-findings.md +++ b/scripts/dce/live-findings.md @@ -350,7 +350,9 @@ live after manual validation. - Report: `Warning Dead Module` / `Warning Dead Value` clusters in `compiler/core/lam_analysis.ml`, `lam_arity.ml`, `lam_arity_analysis.ml`, `lam_beta_reduce.ml`, `lam_beta_reduce_util.ml`, `lam_bounded_vars.ml`, - `lam_check.ml`, and `lam_closure.ml` plus their `.mli` files. + `lam_check.ml`, `lam_closure.ml`, `lam_exit_count.ml`, + `lam_free_variables.ml`, `lam_group.ml`, and `lam_hit.ml` plus their `.mli` + files. - Verdict: live; false positive for the remaining reported helpers. - Validation: `Lam_analysis` is used by lambda DCE/count/remove-alias passes, `lam_compile_main.cppo.ml`, `lam_compile.ml`, `lam_stats_export.ml`, @@ -363,6 +365,12 @@ live after manual validation. `Lam_bounded_vars.rewrite`. `Lam_check.check` is called by `lam_compile_main.cppo.ml`. `Lam_closure` is used by `lam_pass_remove_alias.ml`, `lam_stats_export.ml`, and `lam_compile.ml`. + `Lam_exit_count` is called by `lam_pass_exits.ml`; `Lam_free_variables` is + used by `lam_dce.ml` and `lam_compile.ml`; `Lam_group` is used by + `lam_pass_deep_flatten.ml`, `lam_coercion.ml`, `lam_dce.ml`, and + `lam_compile_main.cppo.ml`; and `Lam_hit` is used by + `lam_pass_eliminate_ref.ml`, `lam_scc.ml`, `lam_pass_remove_alias.ml`, + `lam_convert.ml`, `lam_pass_deep_flatten.ml`, and `lam_util.cppo.ml`. - Context: unused `Lam_arity.equal`, `print`, and `print_arities_tbl` exports were removed. The remaining entries are cross-module pass plumbing and local helper chains under live pass functions. From fba63669036ab379c6b8f8d1a213cc99adec1e4f Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 13:13:29 +0000 Subject: [PATCH 111/214] dce: remove runtime apply primitive --- _dce/report.txt | 46 ++++++++++---------------- compiler/core/lam_analysis.ml | 4 +-- compiler/core/lam_compile_primitive.ml | 4 --- compiler/core/lam_primitive.ml | 3 +- compiler/core/lam_primitive.mli | 1 - compiler/core/lam_print.ml | 1 - 6 files changed, 20 insertions(+), 39 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index 5bed30b278d..8f5deb28497 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -5410,7 +5410,7 @@ | _ -> false [@@dead "+not_zero_constant"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_analysis.ml", line 32, characters 0-4204 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_analysis.ml", line 32, characters 0-4184 +no_side_effects is never used <-- line 32 | Lapply _ -> false [@@dead "+no_side_effects"] @@ -6568,7 +6568,7 @@ ] [@@dead "+wrap_then"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_primitive.ml", line 71, characters 0-19154 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_primitive.ml", line 71, characters 0-19044 +translate is never used <-- line 71 | _ -> assert false) [@@dead "+translate"] @@ -7399,34 +7399,28 @@ <-- line 33 | Record_extension [@dead "record_representation.Record_extension"] - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_primitive.ml", line 153, characters 2-21 - t.Pjs_runtime_apply is a variant case which is never constructed - <-- line 153 - | Pjs_runtime_apply [@dead "t.Pjs_runtime_apply"] (* [f; [...]] *) - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_primitive.ml", line 186, characters 0-99 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_primitive.ml", line 185, characters 0-99 +eq_field_dbg_info is never used - <-- line 186 + <-- line 185 x = y [@@dead "+eq_field_dbg_info"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_primitive.ml", line 191, characters 0-111 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_primitive.ml", line 190, characters 0-111 +eq_set_field_dbg_info is never used - <-- line 191 + <-- line 190 x = y [@@dead "+eq_set_field_dbg_info"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_primitive.ml", line 196, characters 0-46 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_primitive.ml", line 195, characters 0-46 +eq_tag_info is never used - <-- line 196 + <-- line 195 let eq_tag_info (x : Lam_tag_info.t) y = x = y [@@dead "+eq_tag_info"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_primitive.ml", line 198, characters 0-4133 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_primitive.ml", line 197, characters 0-4113 +eq_primitive_approx is never used - <-- line 198 + <-- line 197 | Praw_js_code _ -> false [@@dead "+eq_primitive_approx"] Warning Dead Type @@ -7447,30 +7441,24 @@ <-- line 31 | Record_extension [@dead "record_representation.Record_extension"] - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_primitive.mli", line 147, characters 2-21 - t.Pjs_runtime_apply is a variant case which is never constructed - <-- line 147 - | Pjs_runtime_apply [@dead "t.Pjs_runtime_apply"] (* [f; [...]] *) - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_primitive.mli", line 176, characters 0-40 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_primitive.mli", line 175, characters 0-40 +eq_primitive_approx is never used - <-- line 176 + <-- line 175 val eq_primitive_approx : t -> t -> bool [@@dead "+eq_primitive_approx"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_print.ml", line 483, characters 0-343 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_print.ml", line 482, characters 0-343 +serialize is never used - <-- line 483 + <-- line 482 Format.set_margin old [@@dead "+serialize"] Warning Dead Value With Side Effects - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_print.ml", line 494, characters 0-50 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_print.ml", line 493, characters 0-50 +lambda_to_string is never used and could have side effects Warning Dead Value With Side Effects - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_print.ml", line 496, characters 0-56 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_print.ml", line 495, characters 0-56 +primitive_to_string is never used and could have side effects Warning Dead Module @@ -15697,4 +15685,4 @@ <-- line 38 val peek_minus : t -> bool [@@dead "+peek_minus"] - Analysis reported 2752 issues (Warning Dead Module:151, Warning Dead Type:288, Warning Dead Value:2057, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:195, Warning Unused Argument:24) + Analysis reported 2750 issues (Warning Dead Module:151, Warning Dead Type:286, Warning Dead Value:2057, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:195, Warning Unused Argument:24) diff --git a/compiler/core/lam_analysis.ml b/compiler/core/lam_analysis.ml index 93cbd92c36a..5a9babd5c1d 100644 --- a/compiler/core/lam_analysis.ml +++ b/compiler/core/lam_analysis.ml @@ -93,8 +93,8 @@ let rec no_side_effects (lam : Lam.t) : bool = true (* A tagged template invokes its tag at runtime, so it always has side effects. *) - | Ptagged_template | Pjs_apply | Pjs_runtime_apply | Pjs_call _ | Pinit_mod - | Pupdate_mod | Pjs_unsafe_downgrade _ | Pdebugger | Pjs_fn_method + | Ptagged_template | Pjs_apply | Pjs_call _ | Pinit_mod | Pupdate_mod + | Pjs_unsafe_downgrade _ | Pdebugger | Pjs_fn_method (* Await promise *) | Pawait (* TODO *) diff --git a/compiler/core/lam_compile_primitive.ml b/compiler/core/lam_compile_primitive.ml index ddb1cc19905..5f7b7bc435e 100644 --- a/compiler/core/lam_compile_primitive.ml +++ b/compiler/core/lam_compile_primitive.ml @@ -80,10 +80,6 @@ let translate output_prefix loc (cxt : Lam_compile_context.t) trim can not be done before syntax checking otherwise location is incorrect *) - | Pjs_runtime_apply -> ( - match args with - | [f; args] -> E.flat_call f args - | _ -> assert false) | Pjs_apply -> ( match args with | fn :: rest -> E.call ~info:call_info fn rest diff --git a/compiler/core/lam_primitive.ml b/compiler/core/lam_primitive.ml index b739daa4873..45a172aaeba 100644 --- a/compiler/core/lam_primitive.ml +++ b/compiler/core/lam_primitive.ml @@ -150,7 +150,6 @@ type t = | Pisout of int | Pjscomp of Lam_compat.comparison | Pjs_apply (*[f;arg0;arg1; arg2; ... argN]*) - | Pjs_runtime_apply (* [f; [...]] *) | Pdebugger | Pjs_unsafe_downgrade of {name: string; setter: bool} | Pinit_mod @@ -223,7 +222,7 @@ let eq_primitive_approx (lhs : t) (rhs : t) = (* promise *) | Pawait (* etc *) - | Pjs_apply | Pjs_runtime_apply | Pval_from_option | Pval_from_option_not_nest + | Pjs_apply | Pval_from_option | Pval_from_option_not_nest | Pnull_to_opt | Pnull_undefined_to_opt | Pis_null | Pis_not_none | Psome | Psome_not_nest | Pis_null_undefined | Pimport | Ptypeof | Pfn_arity | Pis_poly_var_block | Pdebugger | Pinit_mod | Pupdate_mod diff --git a/compiler/core/lam_primitive.mli b/compiler/core/lam_primitive.mli index 9aafb5b8467..208433856bf 100644 --- a/compiler/core/lam_primitive.mli +++ b/compiler/core/lam_primitive.mli @@ -144,7 +144,6 @@ type t = | Pisout of int | Pjscomp of Lam_compat.comparison | Pjs_apply (*[f;arg0;arg1; arg2; ... argN]*) - | Pjs_runtime_apply (* [f; [...]] *) | Pdebugger | Pjs_unsafe_downgrade of {name: string; setter: bool} | Pinit_mod diff --git a/compiler/core/lam_print.ml b/compiler/core/lam_print.ml index ceb53f6d263..de50f6e91ca 100644 --- a/compiler/core/lam_print.ml +++ b/compiler/core/lam_print.ml @@ -50,7 +50,6 @@ let primitive ppf (prim : Lam_primitive.t) = | Pinit_mod -> fprintf ppf "init_mod!" | Pupdate_mod -> fprintf ppf "update_mod!" | Pjs_apply -> fprintf ppf "#apply" - | Pjs_runtime_apply -> fprintf ppf "#runtime_apply" (* Debug-only dump, exercised solely under -drawlambda/-dlambda. *) | Ptagged_template -> fprintf ppf "#tagged_template" [@coverage off] | Pjs_unsafe_downgrade {name; setter} -> From 3bfebb26b64a3f78d22cb684c3923aedd8e914df Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 13:16:08 +0000 Subject: [PATCH 112/214] dce: trim misc helpers --- _dce/report.txt | 578 ++---------------------------------------- compiler/ext/misc.ml | 207 +-------------- compiler/ext/misc.mli | 141 +---------- 3 files changed, 29 insertions(+), 897 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index 8f5deb28497..17bef0a8daa 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -10648,595 +10648,67 @@ val concat_or_join : ('a, 'b) t -> 'a -> 'b option -> ('a, 'b) t -> ('a, 'b) t [@@dead "+concat_or_join"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 25, characters 0-55 - +fatal_errorf is never used - <-- line 25 - let fatal_errorf fmt = Format.kasprintf fatal_error fmt [@@dead "+fatal_errorf"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 61, characters 0-117 - +map_left_right is never used - <-- line 61 - res :: map_left_right f tl [@@dead "+map_left_right"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 67, characters 0-156 - +for_all2 is never used - <-- line 67 - | _, _ -> false [@@dead "+for_all2"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 76, characters 0-107 - +list_remove is never used - <-- line 76 - | hd :: tl -> if hd = x then tl else hd :: list_remove x tl [@@dead "+list_remove"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 92, characters 0-361 - +find_in_path is never used - <-- line 92 - try_dir path [@@dead "+find_in_path"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 104, characters 0-477 - +find_in_path_rel is never used - <-- line 104 - try_dir path [@@dead "+find_in_path_rel"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 156, characters 0-203 - +copy_file is never used - <-- line 156 - copy () [@@dead "+copy_file"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 167, characters 0-282 - +copy_file_chunk is never used - <-- line 167 - copy len [@@dead "+copy_file_chunk"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 180, characters 0-267 - +string_of_file is never used - <-- line 180 - copy () [@@dead "+string_of_file"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 192, characters 0-191 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 107, characters 0-191 +output_to_bin_file_directly is never used - <-- line 192 + <-- line 107 raise e [@@dead "+output_to_bin_file_directly"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 202, characters 0-1080 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 117, characters 0-1080 +output_to_file_via_temporary is never used - <-- line 202 + <-- line 117 raise exn [@@dead "+output_to_file_via_temporary"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 234, characters 0-57 - +log2 is never used - <-- line 234 - let rec log2 n = if n <= 1 then 0 else 1 + log2 (n asr 1) [@@dead "+log2"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 236, characters 0-65 - +align is never used - <-- line 236 - let align n a = if n >= 0 then (n + a - 1) land -a else n land -a [@@dead "+align"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 238, characters 0-64 - +no_overflow_add is never used - <-- line 238 - let no_overflow_add a b = a lxor b lor (a lxor lnot (a + b)) < 0 [@@dead "+no_overflow_add"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 240, characters 0-64 - +no_overflow_sub is never used - <-- line 240 - let no_overflow_sub a b = a lxor lnot b lor (b lxor (a - b)) < 0 [@@dead "+no_overflow_sub"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 242, characters 0-49 - +no_overflow_mul is never used - <-- line 242 - let no_overflow_mul a b = b <> 0 && a * b / b = a [@@dead "+no_overflow_mul"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 244, characters 0-99 - +no_overflow_lsl is never used - <-- line 244 - 0 <= k && k < Sys.word_size && min_int asr k <= a && a <= max_int asr k [@@dead "+no_overflow_lsl"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 253, characters 2-55 - Int_literal_converter.+int32 is never used - <-- line 253 - let int32 s = cvt_int_aux s Int32.neg Int32.of_string [@@dead "Int_literal_converter.+int32"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 254, characters 2-55 - Int_literal_converter.+int64 is never used - <-- line 254 - let int64 s = cvt_int_aux s Int64.neg Int64.of_string [@@dead "Int_literal_converter.+int64"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 259, characters 0-361 - +chop_extensions is never used - <-- line 259 - with Not_found -> file [@@dead "+chop_extensions"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 269, characters 0-260 - +search_substring is never used - <-- line 269 - search start 0 [@@dead "+search_substring"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 278, characters 0-417 - +replace_substring is never used - <-- line 278 - String.concat after (search [] 0) [@@dead "+replace_substring"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 290, characters 0-468 - +rev_split_words is never used - <-- line 290 - split1 [] 0 [@@dead "+rev_split_words"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 312, characters 0-22 - +fst3 is never used - <-- line 312 - let fst3 (x, _, _) = x [@@dead "+fst3"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 313, characters 0-22 - +snd3 is never used - <-- line 313 - let snd3 (_, x, _) = x [@@dead "+snd3"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 314, characters 0-22 - +thd3 is never used - <-- line 314 - let thd3 (_, _, x) = x [@@dead "+thd3"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 316, characters 0-25 - +fst4 is never used - <-- line 316 - let fst4 (x, _, _, _) = x [@@dead "+fst4"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 318, characters 0-25 - +thd4 is never used - <-- line 318 - let thd4 (_, _, x, _) = x [@@dead "+thd4"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 319, characters 0-25 - +for4 is never used - <-- line 319 - let for4 (_, _, _, x) = x [@@dead "+for4"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 400, characters 0-123 - +cut_at is never used - <-- line 400 - (String.sub s 0 pos, String.sub s (pos + 1) (String.length s - pos - 1)) [@@dead "+cut_at"] - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 404, characters 0-83 - +misc.String_set is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 406, characters 2-23 - String_set.+compare is never used - <-- line 406 - let compare = compare [@@dead "String_set.+compare"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 408, characters 0-83 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 243, characters 0-83 +misc.String_map is a dead module as all its items are dead. Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 410, characters 2-23 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 245, characters 2-23 String_map.+compare is never used - <-- line 410 + <-- line 245 let compare = compare [@@dead "String_map.+compare"] - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 416, characters 15-20 - Color.color.Black is a variant case which is never constructed - <-- line 416 - type color = Black [@dead "Color.color.Black"] | Red | Green | Yellow | Blue | Magenta | Cyan | White - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 416, characters 27-34 - Color.color.Green is a variant case which is never constructed - <-- line 416 - type color = Black [@dead "Color.color.Black"] | Red | Green [@dead "Color.color.Green"] | Yellow | Blue | Magenta | Cyan | White - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 416, characters 44-50 - Color.color.Blue is a variant case which is never constructed - <-- line 416 - type color = Black [@dead "Color.color.Black"] | Red | Green [@dead "Color.color.Green"] | Yellow | Blue [@dead "Color.color.Blue"] | Magenta | Cyan | White - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 416, characters 68-75 - Color.color.White is a variant case which is never constructed - <-- line 416 - type color = Black [@dead "Color.color.Black"] | Red | Green [@dead "Color.color.Green"] | Yellow | Blue [@dead "Color.color.Blue"] | Magenta | Cyan | White [@dead "Color.color.White"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 420, characters 4-17 - Color.style.BG is a variant case which is never constructed - <-- line 420 - | BG of color [@dead "Color.style.BG"] (* background *) - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 457, characters 2-33 - Color.+get_styles is never used - <-- line 457 - let get_styles () = !cur_styles [@@dead "Color.+get_styles"] + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 247, characters 0-83 + +misc.String_set is a dead module as all its items are dead. Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 458, characters 2-36 - Color.+set_styles is never used - <-- line 458 - let set_styles s = cur_styles := s [@@dead "Color.+set_styles"] + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 249, characters 2-23 + String_set.+compare is never used + <-- line 249 + let compare = compare [@@dead "String_set.+compare"] Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 512, characters 17-21 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 343, characters 17-21 Color.setting.Auto is a variant case which is never constructed - <-- line 512 + <-- line 343 type setting = Auto [@dead "Color.setting.Auto"] | Always | Never Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 512, characters 22-30 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 343, characters 22-30 Color.setting.Always is a variant case which is never constructed - <-- line 512 + <-- line 343 type setting = Auto [@dead "Color.setting.Auto"] | Always [@dead "Color.setting.Always"] | Never Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 512, characters 31-38 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 343, characters 31-38 Color.setting.Never is a variant case which is never constructed - <-- line 512 + <-- line 343 type setting = Auto [@dead "Color.setting.Auto"] | Always [@dead "Color.setting.Always"] | Never [@dead "Color.setting.Never"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 541, characters 0-824 - +delete_eol_spaces is never used - <-- line 541 - Bytes.sub_string dst 0 stop [@@dead "+delete_eol_spaces"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 576, characters 0-47 - +raise_direct_hook_exn is never used - <-- line 576 - let raise_direct_hook_exn e = raise (HookExn e) [@@dead "+raise_direct_hook_exn"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 19, characters 0-65 - +fatal_errorf is never used - <-- line 19 - val fatal_errorf : ('a, Format.formatter, unit, 'b) format4 -> 'a [@@dead "+fatal_errorf"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 27, characters 0-53 - +map_left_right is never used - <-- line 27 - val map_left_right : ('a -> 'b) -> 'a list -> 'b list [@@dead "+map_left_right"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 30, characters 0-63 - +for_all2 is never used - <-- line 30 - val for_all2 : ('a -> 'b -> bool) -> 'a list -> 'b list -> bool [@@dead "+for_all2"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 39, characters 0-42 - +list_remove is never used - <-- line 39 - val list_remove : 'a -> 'a list -> 'a list [@@dead "+list_remove"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 56, characters 0-50 - +find_in_path is never used - <-- line 56 - val find_in_path : string list -> string -> string [@@dead "+find_in_path"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 59, characters 0-54 - +find_in_path_rel is never used - <-- line 59 - val find_in_path_rel : string list -> string -> string [@@dead "+find_in_path_rel"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 78, characters 0-49 - +copy_file is never used - <-- line 78 - val copy_file : in_channel -> out_channel -> unit [@@dead "+copy_file"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 82, characters 0-62 - +copy_file_chunk is never used - <-- line 82 - val copy_file_chunk : in_channel -> out_channel -> int -> unit [@@dead "+copy_file_chunk"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 87, characters 0-41 - +string_of_file is never used - <-- line 87 - val string_of_file : in_channel -> string [@@dead "+string_of_file"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 91, characters 0-79 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 59, characters 0-79 +output_to_bin_file_directly is never used - <-- line 91 + <-- line 59 val output_to_bin_file_directly : string -> (string -> out_channel -> 'a) -> 'a [@@dead "+output_to_bin_file_directly"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 93, characters 0-106 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 61, characters 0-106 +output_to_file_via_temporary is never used - <-- line 93 + <-- line 61 ?mode:open_flag list -> string -> (string -> out_channel -> 'a) -> 'a [@@dead "+output_to_file_via_temporary"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 102, characters 0-21 - +log2 is never used - <-- line 102 - val log2 : int -> int [@@dead "+log2"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 106, characters 0-29 - +align is never used - <-- line 106 - val align : int -> int -> int [@@dead "+align"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 110, characters 0-40 - +no_overflow_add is never used - <-- line 110 - val no_overflow_add : int -> int -> bool [@@dead "+no_overflow_add"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 114, characters 0-40 - +no_overflow_sub is never used - <-- line 114 - val no_overflow_sub : int -> int -> bool [@@dead "+no_overflow_sub"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 118, characters 0-40 - +no_overflow_mul is never used - <-- line 118 - val no_overflow_mul : int -> int -> bool [@@dead "+no_overflow_mul"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 122, characters 0-40 - +no_overflow_lsl is never used - <-- line 122 - val no_overflow_lsl : int -> int -> bool [@@dead "+no_overflow_lsl"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 128, characters 2-29 - Int_literal_converter.+int32 is never used - <-- line 128 - val int32 : string -> int32 [@@dead "Int_literal_converter.+int32"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 129, characters 2-29 - Int_literal_converter.+int64 is never used - <-- line 129 - val int64 : string -> int64 [@@dead "Int_literal_converter.+int64"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 132, characters 0-38 - +chop_extensions is never used - <-- line 132 - val chop_extensions : string -> string [@@dead "+chop_extensions"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 139, characters 0-53 - +search_substring is never used - <-- line 139 - val search_substring : string -> string -> int -> int [@@dead "+search_substring"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 145, characters 0-73 - +replace_substring is never used - <-- line 145 - val replace_substring : before:string -> after:string -> string -> string [@@dead "+replace_substring"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 150, characters 0-43 - +rev_split_words is never used - <-- line 150 - val rev_split_words : string -> string list [@@dead "+rev_split_words"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 158, characters 0-29 - +fst3 is never used - <-- line 158 - val fst3 : 'a * 'b * 'c -> 'a [@@dead "+fst3"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 159, characters 0-29 - +snd3 is never used - <-- line 159 - val snd3 : 'a * 'b * 'c -> 'b [@@dead "+snd3"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 160, characters 0-29 - +thd3 is never used - <-- line 160 - val thd3 : 'a * 'b * 'c -> 'c [@@dead "+thd3"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 162, characters 0-34 - +fst4 is never used - <-- line 162 - val fst4 : 'a * 'b * 'c * 'd -> 'a [@@dead "+fst4"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 164, characters 0-34 - +thd4 is never used - <-- line 164 - val thd4 : 'a * 'b * 'c * 'd -> 'c [@@dead "+thd4"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 165, characters 0-34 - +for4 is never used - <-- line 165 - val for4 : 'a * 'b * 'c * 'd -> 'd [@@dead "+for4"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 167, characters 0-57 - +edit_distance is never used - <-- line 167 - val edit_distance : string -> string -> int -> int option [@@dead "+edit_distance"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 198, characters 0-46 - +cut_at is never used - <-- line 198 - val cut_at : string -> char -> string * string [@@dead "+cut_at"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 216, characters 15-20 - color.Black is a variant case which is never constructed - <-- line 216 - type color = Black [@dead "color.Black"] | Red | Green | Yellow | Blue | Magenta | Cyan | White - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 216, characters 21-26 - color.Red is a variant case which is never constructed - <-- line 216 - type color = Black [@dead "color.Black"] | Red [@dead "color.Red"] | Green | Yellow | Blue | Magenta | Cyan | White - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 216, characters 27-34 - color.Green is a variant case which is never constructed - <-- line 216 - type color = Black [@dead "color.Black"] | Red [@dead "color.Red"] | Green [@dead "color.Green"] | Yellow | Blue | Magenta | Cyan | White - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 216, characters 35-43 - color.Yellow is a variant case which is never constructed - <-- line 216 - type color = Black [@dead "color.Black"] | Red [@dead "color.Red"] | Green [@dead "color.Green"] | Yellow [@dead "color.Yellow"] | Blue | Magenta | Cyan | White - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 216, characters 44-50 - color.Blue is a variant case which is never constructed - <-- line 216 - type color = Black [@dead "color.Black"] | Red [@dead "color.Red"] | Green [@dead "color.Green"] | Yellow [@dead "color.Yellow"] | Blue [@dead "color.Blue"] | Magenta | Cyan | White - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 216, characters 51-60 - color.Magenta is a variant case which is never constructed - <-- line 216 - type color = Black [@dead "color.Black"] | Red [@dead "color.Red"] | Green [@dead "color.Green"] | Yellow [@dead "color.Yellow"] | Blue [@dead "color.Blue"] | Magenta [@dead "color.Magenta"] | Cyan | White - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 216, characters 61-67 - color.Cyan is a variant case which is never constructed - <-- line 216 - type color = Black [@dead "color.Black"] | Red [@dead "color.Red"] | Green [@dead "color.Green"] | Yellow [@dead "color.Yellow"] | Blue [@dead "color.Blue"] | Magenta [@dead "color.Magenta"] | Cyan [@dead "color.Cyan"] | White - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 216, characters 68-75 - color.White is a variant case which is never constructed - <-- line 216 - type color = Black [@dead "color.Black"] | Red [@dead "color.Red"] | Green [@dead "color.Green"] | Yellow [@dead "color.Yellow"] | Blue [@dead "color.Blue"] | Magenta [@dead "color.Magenta"] | Cyan [@dead "color.Cyan"] | White [@dead "color.White"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 219, characters 4-17 - style.FG is a variant case which is never constructed - <-- line 219 - | FG of color [@dead "style.FG"] (* foreground *) - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 220, characters 4-17 - style.BG is a variant case which is never constructed - <-- line 220 - | BG of color [@dead "style.BG"] (* background *) - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 221, characters 4-10 - style.Bold is a variant case which is never constructed - <-- line 221 - | Bold [@dead "style.Bold"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 222, characters 4-11 - style.Reset is a variant case which is never constructed - <-- line 222 - | Reset [@dead "style.Reset"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 223, characters 4-9 - style.Dim is a variant case which is never constructed - <-- line 223 - | Dim [@dead "style.Dim"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 225, characters 2-44 - Color.+ansi_of_style_l is never used - <-- line 225 - val ansi_of_style_l : style list -> string [@@dead "Color.+ansi_of_style_l"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 228, characters 17-35 - styles.error is a record label never used to read a value - <-- line 228 - type styles = {error: style list; [@dead "styles.error"] warning: style list; loc: style list} - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 228, characters 36-56 - styles.warning is a record label never used to read a value - <-- line 228 - type styles = {error: style list; [@dead "styles.error"] warning: style list; [@dead "styles.warning"] loc: style list} - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 228, characters 57-72 - styles.loc is a record label never used to read a value - <-- line 228 - type styles = {error: style list; [@dead "styles.error"] warning: style list; [@dead "styles.warning"] loc: style list [@dead "styles.loc"] } - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 230, characters 2-29 - Color.+default_styles is never used - <-- line 230 - val default_styles : styles [@@dead "Color.+default_styles"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 231, characters 2-33 - Color.+get_styles is never used - <-- line 231 - val get_styles : unit -> styles [@@dead "Color.+get_styles"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 232, characters 2-33 - Color.+set_styles is never used - <-- line 232 - val set_styles : styles -> unit [@@dead "Color.+set_styles"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 250, characters 0-40 - +delete_eol_spaces is never used - <-- line 250 - val delete_eol_spaces : string -> string [@@dead "+delete_eol_spaces"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 270, characters 0-37 - +raise_direct_hook_exn is never used - <-- line 270 - val raise_direct_hook_exn : exn -> 'a [@@dead "+raise_direct_hook_exn"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ordered_hash_map_gen.ml", line 75, characters 0-135 +create is never used @@ -15685,4 +15157,4 @@ <-- line 38 val peek_minus : t -> bool [@@dead "+peek_minus"] - Analysis reported 2750 issues (Warning Dead Module:151, Warning Dead Type:286, Warning Dead Value:2057, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:195, Warning Unused Argument:24) + Analysis reported 2662 issues (Warning Dead Module:151, Warning Dead Type:265, Warning Dead Value:1990, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:195, Warning Unused Argument:24) diff --git a/compiler/ext/misc.ml b/compiler/ext/misc.ml index 46f99d25d3c..a2e99486f93 100644 --- a/compiler/ext/misc.ml +++ b/compiler/ext/misc.ml @@ -22,8 +22,6 @@ let fatal_error msg = prerr_endline msg; raise Fatal_error -let fatal_errorf fmt = Format.kasprintf fatal_error fmt - (* Exceptions *) let try_finally work cleanup = @@ -58,25 +56,9 @@ let rec map_end f l1 l2 = | [] -> l2 | hd :: tl -> f hd :: map_end f tl l2 -let rec map_left_right f = function - | [] -> [] - | hd :: tl -> - let res = f hd in - res :: map_left_right f tl - -let rec for_all2 pred l1 l2 = - match (l1, l2) with - | [], [] -> true - | hd1 :: tl1, hd2 :: tl2 -> pred hd1 hd2 && for_all2 pred tl1 tl2 - | _, _ -> false - let rec replicate_list elem n = if n <= 0 then [] else elem :: replicate_list elem (n - 1) -let rec list_remove x = function - | [] -> [] - | hd :: tl -> if hd = x then tl else hd :: list_remove x tl - let rec split_last = function | [] -> assert false | [x] -> ([], x) @@ -89,35 +71,6 @@ let may_map = Stdlib.Option.map (* File functions *) -let find_in_path path name = - if not (Filename.is_implicit name) then - if Sys.file_exists name then name else raise Not_found - else - let rec try_dir = function - | [] -> raise Not_found - | dir :: rem -> - let fullname = Filename.concat dir name in - if Sys.file_exists fullname then fullname else try_dir rem - in - try_dir path - -let find_in_path_rel path name = - let rec simplify s = - let open Filename in - let base = basename s in - let dir = dirname s in - if dir = s then dir - else if base = current_dir_name then simplify dir - else concat (simplify dir) base - in - let rec try_dir = function - | [] -> raise Not_found - | dir :: rem -> - let fullname = simplify (Filename.concat dir name) in - if Sys.file_exists fullname then fullname else try_dir rem - in - try_dir path - let find_in_path_uncap path name = let uname = String.uncapitalize_ascii name in let rec try_dir = function @@ -151,44 +104,6 @@ let create_hashtable init = Array.iter (fun (key, data) -> Hashtbl.add tbl key data) init; tbl -(* File copy *) - -let copy_file ic oc = - let buff = Bytes.create 0x1000 in - let rec copy () = - let n = input ic buff 0 0x1000 in - if n = 0 then () - else ( - output oc buff 0 n; - copy ()) - in - copy () - -let copy_file_chunk ic oc len = - let buff = Bytes.create 0x1000 in - let rec copy n = - if n <= 0 then () - else - let r = input ic buff 0 (min n 0x1000) in - if r = 0 then raise End_of_file - else ( - output oc buff 0 r; - copy (n - r)) - in - copy len - -let string_of_file ic = - let b = Buffer.create 0x10000 in - let buff = Bytes.create 0x1000 in - let rec copy () = - let n = input ic buff 0 0x1000 in - if n = 0 then Buffer.contents b - else ( - Buffer.add_subbytes b buff 0 n; - copy ()) - in - copy () - let output_to_bin_file_directly filename fn = let oc = open_out_bin filename in match fn filename oc with @@ -229,94 +144,22 @@ let output_to_file_via_temporary ?(mode = [Open_text]) filename fn = remove_file temp_filename; raise exn -(* Integer operations *) - -let rec log2 n = if n <= 1 then 0 else 1 + log2 (n asr 1) - -let align n a = if n >= 0 then (n + a - 1) land -a else n land -a - -let no_overflow_add a b = a lxor b lor (a lxor lnot (a + b)) < 0 - -let no_overflow_sub a b = a lxor lnot b lor (b lxor (a - b)) < 0 - -let no_overflow_mul a b = b <> 0 && a * b / b = a - -let no_overflow_lsl a k = - 0 <= k && k < Sys.word_size && min_int asr k <= a && a <= max_int asr k - module Int_literal_converter = struct (* To convert integer literals, allowing max_int + 1 (PR#4210) *) let cvt_int_aux str neg of_string = if String.length str = 0 || str.[0] = '-' then of_string str else neg (of_string ("-" ^ str)) let int s = cvt_int_aux s ( ~- ) int_of_string - let int32 s = cvt_int_aux s Int32.neg Int32.of_string - let int64 s = cvt_int_aux s Int64.neg Int64.of_string end (* String operations *) -let chop_extensions file = - let dirname = Filename.dirname file and basename = Filename.basename file in - try - let pos = String.index basename '.' in - let basename = String.sub basename 0 pos in - if Filename.is_implicit file && dirname = Filename.current_dir_name then - basename - else Filename.concat dirname basename - with Not_found -> file - -let search_substring pat str start = - let rec search i j = - if j >= String.length pat then i - else if i + j >= String.length str then raise Not_found - else if str.[i + j] = pat.[j] then search i (j + 1) - else search (i + 1) 0 - in - search start 0 - -let replace_substring ~before ~after str = - let rec search acc curr = - match search_substring before str curr with - | next -> - let prefix = String.sub str curr (next - curr) in - search (prefix :: acc) (next + String.length before) - | exception Not_found -> - let suffix = String.sub str curr (String.length str - curr) in - List.rev (suffix :: acc) - in - String.concat after (search [] 0) - -let rev_split_words s = - let rec split1 res i = - if i >= String.length s then res - else - match s.[i] with - | ' ' | '\t' | '\r' | '\n' -> split1 res (i + 1) - | _ -> split2 res i (i + 1) - and split2 res i j = - if j >= String.length s then String.sub s i (j - i) :: res - else - match s.[j] with - | ' ' | '\t' | '\r' | '\n' -> - split1 (String.sub s i (j - i) :: res) (j + 1) - | _ -> split2 res i (j + 1) - in - split1 [] 0 - let get_ref r = let v = !r in r := []; v -let fst3 (x, _, _) = x -let snd3 (_, x, _) = x -let thd3 (_, _, x) = x - -let fst4 (x, _, _, _) = x let snd4 (_, x, _, _) = x -let thd4 (_, _, x, _) = x -let for4 (_, _, _, x) = x let edit_distance a b cutoff = let la, lb = (String.length a, String.length b) in @@ -397,15 +240,11 @@ let did_you_mean ppf get_choices = (if rest = [] then "" else " or ") last -let cut_at s c = - let pos = String.index s c in - (String.sub s 0 pos, String.sub s (pos + 1) (String.length s - pos - 1)) - -module String_set = Set.Make (struct +module String_map = Map.Make (struct type t = string let compare = compare end) -module String_map = Map.Make (struct +module String_set = Set.Make (struct type t = string let compare = compare end) @@ -413,28 +252,22 @@ end) (* Color handling *) module Color = struct (* use ANSI color codes, see https://en.wikipedia.org/wiki/ANSI_escape_code *) - type color = Black | Red | Green | Yellow | Blue | Magenta | Cyan | White + type color = Red | Yellow | Magenta | Cyan type style = | FG of color (* foreground *) - | BG of color (* background *) | Bold | Reset | Dim let ansi_of_color = function - | Black -> "0" | Red -> "1" - | Green -> "2" | Yellow -> "3" - | Blue -> "4" | Magenta -> "5" | Cyan -> "6" - | White -> "7" let code_of_style = function | FG c -> "3" ^ ansi_of_color c - | BG c -> "4" ^ ansi_of_color c | Bold -> "1" | Reset -> "0" | Dim -> "2" @@ -454,8 +287,6 @@ module Color = struct {warning = [Bold; FG Magenta]; error = [Bold; FG Red]; loc = [Bold]} let cur_styles = ref default_styles - let get_styles () = !cur_styles - let set_styles s = cur_styles := s (* map a tag to a style, if the tag is known. @raise Not_found otherwise *) @@ -538,43 +369,11 @@ let normalise_eol s = done; Buffer.contents b -let delete_eol_spaces src = - let len_src = String.length src in - let dst = Bytes.create len_src in - let rec loop i_src i_dst = - if i_src = len_src then i_dst - else - match src.[i_src] with - | ' ' | '\t' -> loop_spaces 1 (i_src + 1) i_dst - | c -> - Bytes.set dst i_dst c; - loop (i_src + 1) (i_dst + 1) - and loop_spaces spaces i_src i_dst = - if i_src = len_src then i_dst - else - match src.[i_src] with - | ' ' | '\t' -> loop_spaces (spaces + 1) (i_src + 1) i_dst - | '\n' -> - Bytes.set dst i_dst '\n'; - loop (i_src + 1) (i_dst + 1) - | _ -> - for n = 0 to spaces do - Bytes.set dst (i_dst + n) src.[i_src - spaces + n] - done; - loop (i_src + 1) (i_dst + spaces + 1) - in - let stop = loop 0 0 in - Bytes.sub_string dst 0 stop - type hook_info = {sourcefile: string} exception HookExnWrapper of {error: exn; hook_name: string; hook_info: hook_info} -exception HookExn of exn - -let raise_direct_hook_exn e = raise (HookExn e) - module type HookSig = sig type t diff --git a/compiler/ext/misc.mli b/compiler/ext/misc.mli index 6dc9294833a..9f4425b8244 100644 --- a/compiler/ext/misc.mli +++ b/compiler/ext/misc.mli @@ -16,7 +16,6 @@ (* Miscellaneous useful types and functions *) val fatal_error : string -> 'a -val fatal_errorf : ('a, Format.formatter, unit, 'b) format4 -> 'a exception Fatal_error val try_finally : (unit -> 'a) -> (unit -> unit) -> 'a @@ -24,22 +23,10 @@ val try_finally : (unit -> 'a) -> (unit -> unit) -> 'a val map_end : ('a -> 'b) -> 'a list -> 'b list -> 'b list (* [map_end f l t] is [map f l @ t], just more efficient. *) -val map_left_right : ('a -> 'b) -> 'a list -> 'b list -(* Like [List.map], with guaranteed left-to-right evaluation order *) - -val for_all2 : ('a -> 'b -> bool) -> 'a list -> 'b list -> bool -(* Same as [List.for_all] but for a binary predicate. - In addition, this [for_all2] never fails: given two lists - with different lengths, it returns false. *) - val replicate_list : 'a -> int -> 'a list (* [replicate_list elem n] is the list with [n] elements all identical to [elem]. *) -val list_remove : 'a -> 'a list -> 'a list -(* [list_remove x l] returns a copy of [l] with the first - element equal to [x] removed. *) - val split_last : 'a list -> 'a list * 'a (* Return the last element and the other elements of the given list. *) @@ -53,12 +40,6 @@ val protect_refs : ref_and_value list -> (unit -> 'a) -> 'a while executing [f]. The previous contents of the references is restored even if [f] raises an exception. *) -val find_in_path : string list -> string -> string -(* Search a file in a list of directories. *) - -val find_in_path_rel : string list -> string -> string -(* Search a relative file in a list of directories. *) - val find_in_path_uncap : string list -> string -> string (* Same, but search also for uncapitalized name, i.e. if name is Foo.ml, allow /path/Foo.ml and /path/foo.ml @@ -75,19 +56,6 @@ val create_hashtable : ('a * 'b) array -> ('a, 'b) Hashtbl.t (* Create a hashtable of the given size and fills it with the given bindings. *) -val copy_file : in_channel -> out_channel -> unit -(* [copy_file ic oc] reads the contents of file [ic] and copies - them to [oc]. It stops when encountering EOF on [ic]. *) - -val copy_file_chunk : in_channel -> out_channel -> int -> unit -(* [copy_file_chunk ic oc n] reads [n] bytes from [ic] and copies - them to [oc]. It raises [End_of_file] when encountering - EOF on [ic]. *) - -val string_of_file : in_channel -> string -(* [string_of_file ic] reads the contents of file [ic] and copies - them to a string. It stops when encountering EOF on [ic]. *) - val output_to_bin_file_directly : string -> (string -> out_channel -> 'a) -> 'a val output_to_file_via_temporary : @@ -99,82 +67,15 @@ val output_to_file_via_temporary : the channel is closed and the temporary file is renamed to [filename]. *) -val log2 : int -> int -(* [log2 n] returns [s] such that [n = 1 lsl s] - if [n] is a power of 2*) - -val align : int -> int -> int -(* [align n a] rounds [n] upwards to a multiple of [a] - (a power of 2). *) - -val no_overflow_add : int -> int -> bool -(* [no_overflow_add n1 n2] returns [true] if the computation of - [n1 + n2] does not overflow. *) - -val no_overflow_sub : int -> int -> bool -(* [no_overflow_sub n1 n2] returns [true] if the computation of - [n1 - n2] does not overflow. *) - -val no_overflow_mul : int -> int -> bool -(* [no_overflow_mul n1 n2] returns [true] if the computation of - [n1 * n2] does not overflow. *) - -val no_overflow_lsl : int -> int -> bool -(* [no_overflow_lsl n k] returns [true] if the computation of - [n lsl k] does not overflow. *) - module Int_literal_converter : sig val int : string -> int - val int32 : string -> int32 - val int64 : string -> int64 end -val chop_extensions : string -> string -(* Return the given file name without its extensions. The extensions - is the longest suffix starting with a period and not including - a directory separator, [.xyz.uvw] for instance. - - Return the given name if it does not contain an extension. *) - -val search_substring : string -> string -> int -> int -(* [search_substring pat str start] returns the position of the first - occurrence of string [pat] in string [str]. Search starts - at offset [start] in [str]. Raise [Not_found] if [pat] - does not occur. *) - -val replace_substring : before:string -> after:string -> string -> string -(* [replace_substring ~before ~after str] replaces all - occurrences of [before] with [after] in [str] and returns - the resulting string. *) - -val rev_split_words : string -> string list -(* [rev_split_words s] splits [s] in blank-separated words, and returns - the list of words in reverse order. *) - val get_ref : 'a list ref -> 'a list (* [get_ref lr] returns the content of the list reference [lr] and reset its content to the empty list. *) -val fst3 : 'a * 'b * 'c -> 'a -val snd3 : 'a * 'b * 'c -> 'b -val thd3 : 'a * 'b * 'c -> 'c - -val fst4 : 'a * 'b * 'c * 'd -> 'a val snd4 : 'a * 'b * 'c * 'd -> 'b -val thd4 : 'a * 'b * 'c * 'd -> 'c -val for4 : 'a * 'b * 'c * 'd -> 'd - -val edit_distance : string -> string -> int -> int option -(** [edit_distance a b cutoff] computes the edit distance between - strings [a] and [b]. To help efficiency, it uses a cutoff: if the - distance [d] is smaller than [cutoff], it returns [Some d], else - [None]. - - The distance algorithm currently used is Damerau-Levenshtein: it - computes the number of insertion, deletion, substitution of - letters, or swapping of adjacent letters to go from one word to the - other. The particular algorithm may change in the future. -*) val spellcheck : string list -> string -> string list (** [spellcheck env name] takes a list of names [env] that exist in @@ -195,42 +96,11 @@ val did_you_mean : Format.formatter -> (unit -> string list) -> unit the failure even if producing the hint is slow. *) -val cut_at : string -> char -> string * string -(** [String.cut_at s c] returns a pair containing the sub-string before - the first occurrence of [c] in [s], and the sub-string after the - first occurrence of [c] in [s]. - [let (before, after) = String.cut_at s c in - before ^ String.make 1 c ^ after] is the identity if [s] contains [c]. - - Raise [Not_found] if the character does not appear in the string - @since 4.01 -*) - -module String_set : Set.S with type elt = string module String_map : Map.S with type key = string -(* TODO: replace all custom instantiations of StringSet/StringMap in various - compiler modules with this one. *) +module String_set : Set.S with type elt = string (* Color handling *) module Color : sig - type color = Black | Red | Green | Yellow | Blue | Magenta | Cyan | White - - type style = - | FG of color (* foreground *) - | BG of color (* background *) - | Bold - | Reset - | Dim - - val ansi_of_style_l : style list -> string - (* ANSI escape sequence for the given style *) - - type styles = {error: style list; warning: style list; loc: style list} - - val default_styles : styles - val get_styles : unit -> styles - val set_styles : styles -> unit - type setting = Auto | Always | Never val setup : setting option -> unit @@ -247,11 +117,6 @@ val normalise_eol : string -> string removed. Intended for pre-processing text which will subsequently be printed on a channel which performs EOL transformations (i.e. Windows) *) -val delete_eol_spaces : string -> string -(** [delete_eol_spaces s] returns a fresh copy of [s] with any end of - line spaces removed. Intended to normalize the output of the - toplevel for tests. *) - (** {1 Hook machinery} Hooks machinery: @@ -267,10 +132,6 @@ exception (** An exception raised by a hook will be wrapped into a [HookExnWrapper] constructor by the hook machinery. *) -val raise_direct_hook_exn : exn -> 'a -(** A hook can use [raise_unwrapped_hook_exn] to raise an exception that will - not be wrapped into a {!HookExnWrapper}. *) - module type HookSig = sig type t val add_hook : string -> (hook_info -> t -> t) -> unit From d16ca328028a860f6679987e49ba5fc6596a9eaa Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 13:16:37 +0000 Subject: [PATCH 113/214] dce: note misc liveness --- scripts/dce/live-findings.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/scripts/dce/live-findings.md b/scripts/dce/live-findings.md index e48f59b6f0a..fef30afba31 100644 --- a/scripts/dce/live-findings.md +++ b/scripts/dce/live-findings.md @@ -210,6 +210,24 @@ live after manual validation. They are live in the compiler pipeline even though the current DCE report misses those edges. +### `Misc` live utility surface + +- Report: remaining `Warning Dead Value`, `Warning Dead Module`, and constructor + warnings in `compiler/ext/misc.ml` / `.mli`, including + `output_to_bin_file_directly`, `output_to_file_via_temporary`, `String_map`, + `String_set`, and `Color.setting`. +- Verdict: live; false positive for the remaining reported entries. +- Validation: `compiler/ml/cmt_format.cppo.ml` calls + `Misc.output_to_bin_file_directly`, and `compiler/ml/stypes.ml` calls + `Misc.output_to_file_via_temporary`. `Misc.String_map` is used by the + analysis package metadata and completion paths; `Misc.String_set` is used + through `open Misc` in `compiler/ml/printtyp.ml`. `Color.Auto`, `Always`, and + `Never` are constructed by `compiler/ml/clflags.ml`, while `Color.setup` is + used by `compiler/ml/location.ml` and `analysis/reanalyze/src/log_.ml`. +- Context: the truly unused inherited helpers were removed. The survivors are + `.cppo.ml`, open-module, functor-callback, or cross-module edges that the DCE + report does not root correctly. + ### Core JS analyzer and delimiters - Report: `Warning Dead Type`, `compiler/core/j.ml`, `delim.DBackQuotes`; and From fdbe9c33fc03a458e4eaecc76758637744b5b164 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 13:19:44 +0000 Subject: [PATCH 114/214] dce: trim literal constants --- _dce/report.txt | 228 +++++---------------------------------- compiler/ext/literals.ml | 61 ----------- 2 files changed, 28 insertions(+), 261 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index 17bef0a8daa..cec5cf27b4c 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -10012,257 +10012,85 @@ val is_js_special_word : string -> bool [@@dead "+is_js_special_word"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 25, characters 0-27 - +js_array_ctor is never used - <-- line 25 - let js_array_ctor = "Array" [@@dead "+js_array_ctor"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 27, characters 0-29 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 25, characters 0-29 +js_type_number is never used - <-- line 27 + <-- line 25 let js_type_number = "number" [@@dead "+js_type_number"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 29, characters 0-29 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 27, characters 0-29 +js_type_string is never used - <-- line 29 + <-- line 27 let js_type_string = "string" [@@dead "+js_type_string"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 31, characters 0-29 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 29, characters 0-29 +js_type_object is never used - <-- line 31 + <-- line 29 let js_type_object = "object" [@@dead "+js_type_object"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 33, characters 0-31 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 31, characters 0-31 +js_type_boolean is never used - <-- line 33 + <-- line 31 let js_type_boolean = "boolean" [@@dead "+js_type_boolean"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 35, characters 0-30 - +js_undefined is never used - <-- line 35 - let js_undefined = "undefined" [@@dead "+js_undefined"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 37, characters 0-29 - +js_prop_length is never used - <-- line 37 - let js_prop_length = "length" [@@dead "+js_prop_length"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 39, characters 0-17 - +prim is never used - <-- line 39 - let prim = "prim" [@@dead "+prim"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 41, characters 0-19 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 33, characters 0-19 +param is never used - <-- line 41 + <-- line 33 let param = "param" [@@dead "+param"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 43, characters 0-31 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 35, characters 0-31 +partial_arg is never used - <-- line 43 + <-- line 35 let partial_arg = "partial_arg" [@@dead "+partial_arg"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 45, characters 0-15 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 37, characters 0-15 +tmp is never used - <-- line 45 + <-- line 37 let tmp = "tmp" [@@dead "+tmp"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 47, characters 0-21 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 39, characters 0-21 +create is never used - <-- line 47 + <-- line 39 let create = "create" [@@dead "+create"] (* {!Caml_exceptions.create}*) - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 49, characters 0-23 - +runtime is never used - <-- line 49 - let runtime = "runtime" [@@dead "+runtime"] (* runtime directory *) - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 51, characters 0-21 - +stdlib is never used - <-- line 51 - let stdlib = "stdlib" [@@dead "+stdlib"] - Warning Dead Value With Side Effects - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 55, characters 0-51 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 43, characters 0-51 +setter_suffix_len is never used and could have side effects Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 57, characters 0-25 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 45, characters 0-25 +debugger is never used - <-- line 57 + <-- line 45 let debugger = "debugger" [@@dead "+debugger"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 59, characters 0-21 - +fn_run is never used - <-- line 59 - let fn_run = "fn_run" [@@dead "+fn_run"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 61, characters 0-29 - +method_run is never used - <-- line 61 - let method_run = "method_run" [@@dead "+method_run"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 63, characters 0-27 - +fn_method is never used - <-- line 63 - let fn_method = "fn_method" [@@dead "+fn_method"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 65, characters 0-19 - +fn_mk is never used - <-- line 65 - let fn_mk = "fn_mk" [@@dead "+fn_mk"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 69, characters 0-33 - +node_modules is never used - <-- line 69 - let node_modules = "node_modules" [@@dead "+node_modules"] - - Warning Dead Value With Side Effects - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 71, characters 0-54 - +node_modules_length is never used and could have side effects - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 73, characters 0-33 - +package_json is never used - <-- line 73 - let package_json = "package.json" [@@dead "+package_json"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 76, characters 0-24 - +library_file is never used - <-- line 76 - let library_file = "lib" [@@dead "+library_file"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 78, characters 0-19 - +suffix_a is never used - <-- line 78 - let suffix_a = ".a" [@@dead "+suffix_a"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 82, characters 0-23 - +suffix_cmo is never used - <-- line 82 - let suffix_cmo = ".cmo" [@@dead "+suffix_cmo"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 84, characters 0-23 - +suffix_cma is never used - <-- line 84 - let suffix_cma = ".cma" [@@dead "+suffix_cma"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 88, characters 0-23 - +suffix_cmx is never used - <-- line 88 - let suffix_cmx = ".cmx" [@@dead "+suffix_cmx"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 90, characters 0-25 - +suffix_cmxa is never used - <-- line 90 - let suffix_cmxa = ".cmxa" [@@dead "+suffix_cmxa"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 92, characters 0-23 - +suffix_mll is never used - <-- line 92 - let suffix_mll = ".mll" [@@dead "+suffix_mll"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 100, characters 0-23 - +suffix_cmt is never used - <-- line 100 - let suffix_cmt = ".cmt" [@@dead "+suffix_cmt"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 102, characters 0-25 - +suffix_cmti is never used - <-- line 102 - let suffix_cmti = ".cmti" [@@dead "+suffix_cmti"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 108, characters 0-19 - +suffix_d is never used - <-- line 108 - let suffix_d = ".d" [@@dead "+suffix_d"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 112, characters 0-29 - +suffix_gen_js is never used - <-- line 112 - let suffix_gen_js = ".gen.js" [@@dead "+suffix_gen_js"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 114, characters 0-31 - +suffix_gen_tsx is never used - <-- line 114 - let suffix_gen_tsx = ".gen.tsx" [@@dead "+suffix_gen_tsx"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 116, characters 0-25 - +esmodule is never used - <-- line 116 - let esmodule = "esmodule" [@@dead "+esmodule"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 118, characters 0-25 - +commonjs is never used - <-- line 118 - let commonjs = "commonjs" [@@dead "+commonjs"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 120, characters 0-42 - +unused_attribute is never used - <-- line 120 - let unused_attribute = "Unused attribute " [@@dead "+unused_attribute"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 123, characters 0-18 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 64, characters 0-18 +node_sep is never used - <-- line 123 + <-- line 64 let node_sep = "/" [@@dead "+node_sep"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 125, characters 0-22 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 66, characters 0-22 +node_parent is never used - <-- line 125 + <-- line 66 let node_parent = ".." [@@dead "+node_parent"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 127, characters 0-22 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 68, characters 0-22 +node_current is never used - <-- line 127 + <-- line 68 let node_current = "." [@@dead "+node_current"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 132, characters 0-40 - +sourcedirs_meta is never used - <-- line 132 - let sourcedirs_meta = ".sourcedirs.json" [@@dead "+sourcedirs_meta"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 153, characters 0-22 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 92, characters 0-22 +pure is never used - <-- line 153 + <-- line 92 let pure = "@__PURE__" [@@dead "+pure"] Warning Dead Value @@ -15157,4 +14985,4 @@ <-- line 38 val peek_minus : t -> bool [@@dead "+peek_minus"] - Analysis reported 2662 issues (Warning Dead Module:151, Warning Dead Type:265, Warning Dead Value:1990, Warning Dead Value With Side Effects:37, Warning Redundant Optional Argument:195, Warning Unused Argument:24) + Analysis reported 2633 issues (Warning Dead Module:151, Warning Dead Type:265, Warning Dead Value:1962, Warning Dead Value With Side Effects:36, Warning Redundant Optional Argument:195, Warning Unused Argument:24) diff --git a/compiler/ext/literals.ml b/compiler/ext/literals.ml index 884a1934b90..c7008e8772b 100644 --- a/compiler/ext/literals.ml +++ b/compiler/ext/literals.ml @@ -22,8 +22,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *) -let js_array_ctor = "Array" - let js_type_number = "number" let js_type_string = "string" @@ -32,12 +30,6 @@ let js_type_object = "object" let js_type_boolean = "boolean" -let js_undefined = "undefined" - -let js_prop_length = "length" - -let prim = "prim" - let param = "param" let partial_arg = "partial_arg" @@ -46,79 +38,28 @@ let tmp = "tmp" let create = "create" (* {!Caml_exceptions.create}*) -let runtime = "runtime" (* runtime directory *) - -let stdlib = "stdlib" - let setter_suffix = "#=" let setter_suffix_len = String.length setter_suffix let debugger = "debugger" -let fn_run = "fn_run" - -let method_run = "method_run" - -let fn_method = "fn_method" - -let fn_mk = "fn_mk" -(*let js_fn_runmethod = "js_fn_runmethod"*) - -(** nodejs *) -let node_modules = "node_modules" - -let node_modules_length = String.length "node_modules" - -let package_json = "package.json" - -(* Name of the library file created for each external dependency. *) -let library_file = "lib" - -let suffix_a = ".a" - let suffix_cmj = ".cmj" -let suffix_cmo = ".cmo" - -let suffix_cma = ".cma" - let suffix_cmi = ".cmi" -let suffix_cmx = ".cmx" - -let suffix_cmxa = ".cmxa" - -let suffix_mll = ".mll" - let suffix_res = ".res" let suffix_resi = ".resi" let suffix_mlmap = ".mlmap" -let suffix_cmt = ".cmt" - -let suffix_cmti = ".cmti" - let suffix_ast = ".ast" let suffix_iast = ".iast" -let suffix_d = ".d" - let suffix_js = ".js" -let suffix_gen_js = ".gen.js" - -let suffix_gen_tsx = ".gen.tsx" - -let esmodule = "esmodule" - -let commonjs = "commonjs" - -let unused_attribute = "Unused attribute " - (** Used when produce node compatible paths *) let node_sep = "/" @@ -129,8 +70,6 @@ let node_current = "." let gentype_import1 = "genType.import" let gentype_import2 = "gentype.import" -let sourcedirs_meta = ".sourcedirs.json" - (* Note the build system should check the validity of filenames espeically, it should not contain '-' *) From cab9f6b9a14925a3d605a68ac8e2b8f028fc44ed Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 13:20:06 +0000 Subject: [PATCH 115/214] dce: note literal liveness --- scripts/dce/live-findings.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/scripts/dce/live-findings.md b/scripts/dce/live-findings.md index fef30afba31..21685c3e4fa 100644 --- a/scripts/dce/live-findings.md +++ b/scripts/dce/live-findings.md @@ -228,6 +228,23 @@ live after manual validation. `.cppo.ml`, open-module, functor-callback, or cross-module edges that the DCE report does not root correctly. +### `Literals` shared constants + +- Report: remaining `Warning Dead Value` entries in + `compiler/ext/literals.ml`, including `js_type_*`, `param`, `partial_arg`, + `tmp`, `create`, `setter_suffix_len`, `debugger`, node path constants, and + `pure`. +- Verdict: live; false positive for the remaining reported constants. +- Validation: `compiler/core/js_exp_make.ml` imports + `module L = Literals` and reads the `js_type_*` constants; `js_dump.ml` + imports the same alias for `debugger`. `Lam_eta_conversion` uses `param` and + `partial_arg`, `Ext_ident.create_tmp` uses `tmp`, `Js_exp_make` uses `create` + and `pure`, `Lam_convert` uses `setter_suffix_len`, and `Ext_path` uses + `node_sep`, `node_parent`, and `node_current`. +- Context: unused constants with no `Literals.*` or alias callers were removed. + The survivors are cross-module or alias-qualified uses that DCE reports as + unrooted. + ### Core JS analyzer and delimiters - Report: `Warning Dead Type`, `compiler/core/j.ml`, `delim.DBackQuotes`; and From 776dddae7015b9f2c2df5616a4edc209f6559b37 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 13:23:16 +0000 Subject: [PATCH 116/214] dce: trim list helpers --- _dce/report.txt | 352 ++++++++------------------- compiler/ext/ext_list.ml | 120 --------- compiler/ext/ext_list.mli | 39 --- tests/ounit_tests/ounit_list_test.ml | 37 --- 4 files changed, 107 insertions(+), 441 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index cec5cf27b4c..985ce7b81d6 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -8608,461 +8608,323 @@ type t = {case: case; [@dead "t.case"] suffix: string [@dead "t.suffix"] } [@@warning "-69"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 78, characters 0-114 - +combine_array_append is never used - <-- line 78 - arr_list_combine_unsafe arr l 0 len acc f [@@dead "+combine_array_append"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 100, characters 0-343 - +map_split_opt is never used - <-- line 100 - | None -> ds )) [@@dead "+map_split_opt"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 114, characters 0-767 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 96, characters 0-767 +map_snd is never used - <-- line 114 + <-- line 96 (v1, y1) :: (v2, y2) :: (v3, y3) :: (v4, y4) :: (v5, y5) :: map_snd tail f [@@dead "+map_snd"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 189, characters 0-355 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 171, characters 0-355 +append_aux is never used - <-- line 189 + <-- line 171 a0 :: a1 :: a2 :: a3 :: a4 :: append_aux rest l2 [@@dead "+append_aux"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 200, characters 0-73 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 182, characters 0-73 +append is never used - <-- line 200 + <-- line 182 | _ -> append_aux l1 l2 [@@dead "+append"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 205, characters 0-39 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 187, characters 0-39 +append_one is never used - <-- line 205 + <-- line 187 let append_one l1 x = append_aux l1 [x] [@@dead "+append_one"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 267, characters 0-856 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 249, characters 0-856 +fold_right3 is never used - <-- line 267 + <-- line 249 | _, _, _ -> invalid_arg "Ext_list.fold_right2" [@@dead "+fold_right3"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 287, characters 0-984 - +map2i is never used - <-- line 287 - | _, _ -> invalid_arg "Ext_list.map2" [@@dead "+map2i"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 357, characters 0-133 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 304, characters 0-133 +fold_left_with_offset is never used - <-- line 357 + <-- line 304 | a :: l -> fold_left_with_offset l (f a accu i) (i + 1) f [@@dead "+fold_left_with_offset"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 370, characters 0-151 - +exclude is never used - <-- line 370 - | x :: xs -> if p x then exclude xs p else x :: exclude xs p [@@dead "+exclude"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 375, characters 0-370 - +exclude_with_val is never used - <-- line 375 - | Some rest -> Some (a0 :: a1 :: rest))) [@@dead "+exclude_with_val"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 435, characters 0-183 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 362, characters 0-183 +small_split_at is never used - <-- line 435 + <-- line 362 | _ -> invalid_arg "Ext_list.split_at" [@@dead "+small_split_at"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 442, characters 0-40 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 369, characters 0-40 +split_at is never used - <-- line 442 + <-- line 369 let split_at l n = small_split_at n [] l [@@dead "+split_at"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 444, characters 0-168 - +split_at_last_aux is never used - <-- line 444 - | y0 :: ys -> split_at_last_aux (y0 :: acc) ys [@@dead "+split_at_last_aux"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 450, characters 0-409 - +split_at_last is never used - <-- line 450 - (a0 :: a1 :: a2 :: a3 :: a4 :: rev, last) [@@dead "+split_at_last"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 465, characters 0-204 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 374, characters 0-204 +filter_mapi is never used - <-- line 465 + <-- line 374 aux 0 xs [@@dead "+filter_mapi"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 476, characters 0-294 - +filter_map2 is never used - <-- line 476 - | _ -> invalid_arg "Ext_list.filter_map2" [@@dead "+filter_map2"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 509, characters 0-61 - +flat_map_append is never used - <-- line 509 - let flat_map_append lx append f = flat_map_aux f [] append lx [@@dead "+flat_map_append"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 511, characters 0-154 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 409, characters 0-154 +length_compare is never used - <-- line 511 + <-- line 409 | [] -> if n = 0 then `Eq else `Lt [@@dead "+length_compare"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 518, characters 0-124 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 416, characters 0-124 +length_ge is never used - <-- line 518 + <-- line 416 else true [@@dead "+length_ge"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 528, characters 0-171 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 426, characters 0-171 +length_larger_than_n is never used - <-- line 528 + <-- line 426 | [], _ -> false [@@dead "+length_larger_than_n"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 534, characters 0-111 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 432, characters 0-111 +group is never used - <-- line 534 + <-- line 432 | x :: xs -> aux eq x (group eq xs) [@@dead "+group"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 539, characters 0-228 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 437, characters 0-228 +aux is never used - <-- line 539 + <-- line 437 | _ :: _ -> assert false [@@dead "+aux"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 547, characters 0-45 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 445, characters 0-45 +stable_group is never used - <-- line 547 + <-- line 445 let stable_group lst eq = group eq lst |> rev [@@dead "+stable_group"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 549, characters 0-182 - +drop is never used - <-- line 549 - | _ :: tl -> drop tl (n - 1) [@@dead "+drop"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 562, characters 0-117 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 452, characters 0-117 +find_first_not is never used - <-- line 562 + <-- line 452 | a :: l -> if p a then find_first_not l p else Some a [@@dead "+find_first_not"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 620, characters 0-101 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 510, characters 0-101 +for_all_snd is never used - <-- line 620 + <-- line 510 | (_, a) :: l -> p a && for_all_snd l p [@@dead "+for_all_snd"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 647, characters 0-776 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 537, characters 0-776 +split_map is never used - <-- line 647 + <-- line 537 (a1 :: a2 :: a3 :: a4 :: a5 :: ass, b1 :: b2 :: b3 :: b4 :: b5 :: bss) [@@dead "+split_map"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 677, characters 0-103 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 567, characters 0-103 +sort_via_array is never used - <-- line 677 + <-- line 567 Array.to_list arr [@@dead "+sort_via_array"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 687, characters 0-214 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 577, characters 0-214 +assoc_by_string is never used - <-- line 687 + <-- line 577 | (k1, v1) :: rest -> if k1 = k then v1 else assoc_by_string rest k def [@@dead "+assoc_by_string"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 695, characters 0-205 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 585, characters 0-205 +assoc_by_int is never used - <-- line 695 + <-- line 585 | (k1, v1) :: rest -> if k1 = k then v1 else assoc_by_int rest k def [@@dead "+assoc_by_int"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 703, characters 0-109 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 593, characters 0-109 +nth_aux is never used - <-- line 703 + <-- line 593 | a :: l -> if n = 0 then Some a else nth_aux l (n - 1) [@@dead "+nth_aux"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 708, characters 0-53 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 598, characters 0-53 +nth_opt is never used - <-- line 708 + <-- line 598 let nth_opt l n = if n < 0 then None else nth_aux l n [@@dead "+nth_opt"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 710, characters 0-101 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 600, characters 0-101 +iter_snd is never used - <-- line 710 + <-- line 600 iter_snd xs f [@@dead "+iter_snd"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 717, characters 0-101 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 607, characters 0-101 +iter_fst is never used - <-- line 717 + <-- line 607 iter_fst xs f [@@dead "+iter_fst"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 734, characters 0-96 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 624, characters 0-96 +exists_snd is never used - <-- line 734 + <-- line 624 | (_, a) :: l -> p a || exists_snd l p [@@dead "+exists_snd"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 739, characters 0-143 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 629, characters 0-143 +concat_append is never used - <-- line 739 + <-- line 629 | l :: r -> append l (concat_append r xs) [@@dead "+concat_append"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 749, characters 0-140 - +reduce_from_left is never used - <-- line 749 - | _ -> invalid_arg "Ext_list.reduce_from_left" [@@dead "+reduce_from_left"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 754, characters 0-180 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 639, characters 0-180 +fold_left2 is never used - <-- line 754 + <-- line 639 | _, _ -> invalid_arg "Ext_list.fold_left2" [@@dead "+fold_left2"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 760, characters 0-73 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 645, characters 0-73 +singleton_exn is never used - <-- line 760 + <-- line 645 | _ -> assert false [@@dead "+singleton_exn"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 765, characters 0-122 - +mem_string is never used - <-- line 765 - | a :: l -> a = x || mem_string l x [@@dead "+mem_string"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 31, characters 0-98 - +combine_array_append is never used - <-- line 31 - 'a array -> 'b list -> ('c * 'b) list -> ('a -> 'c) -> ('c * 'b) list [@@dead "+combine_array_append"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 36, characters 0-83 - +map_split_opt is never used - <-- line 36 - 'a list -> ('a -> 'b option * 'c option) -> 'b list * 'c list [@@dead "+map_split_opt"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 43, characters 0-60 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 37, characters 0-60 +map_snd is never used - <-- line 43 + <-- line 37 val map_snd : ('a * 'b) list -> ('b -> 'c) -> ('a * 'c) list [@@dead "+map_snd"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 58, characters 0-42 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 52, characters 0-42 +append is never used - <-- line 58 + <-- line 52 val append : 'a list -> 'a list -> 'a list [@@dead "+append"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 60, characters 0-41 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 54, characters 0-41 +append_one is never used - <-- line 60 + <-- line 54 val append_one : 'a list -> 'a -> 'a list [@@dead "+append_one"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 68, characters 0-93 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 62, characters 0-93 +fold_right3 is never used - <-- line 68 + <-- line 62 'a list -> 'b list -> 'c list -> 'd -> ('a -> 'b -> 'c -> 'd -> 'd) -> 'd [@@dead "+fold_right3"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 73, characters 0-68 - +map2i is never used - <-- line 73 - val map2i : 'a list -> 'b list -> (int -> 'a -> 'b -> 'c) -> 'c list [@@dead "+map2i"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 75, characters 0-91 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 67, characters 0-91 +fold_left_with_offset is never used - <-- line 75 + <-- line 67 'a list -> 'acc -> int -> ('a -> 'acc -> int -> 'acc) -> 'acc [@@dead "+fold_left_with_offset"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 81, characters 0-48 - +exclude is never used - <-- line 81 - val exclude : 'a list -> ('a -> bool) -> 'a list [@@dead "+exclude"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 84, characters 0-64 - +exclude_with_val is never used - <-- line 84 - val exclude_with_val : 'a list -> ('a -> bool) -> 'a list option [@@dead "+exclude_with_val"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 96, characters 0-50 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 77, characters 0-50 +split_at is never used - <-- line 96 + <-- line 77 val split_at : 'a list -> int -> 'a list * 'a list [@@dead "+split_at"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 102, characters 0-43 - +split_at_last is never used - <-- line 102 - val split_at_last : 'a list -> 'a list * 'a [@@dead "+split_at_last"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 107, characters 0-64 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 83, characters 0-64 +filter_mapi is never used - <-- line 107 + <-- line 83 val filter_mapi : 'a list -> ('a -> int -> 'b option) -> 'b list [@@dead "+filter_mapi"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 109, characters 0-74 - +filter_map2 is never used - <-- line 109 - val filter_map2 : 'a list -> 'b list -> ('a -> 'b -> 'c option) -> 'c list [@@dead "+filter_map2"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 111, characters 0-56 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 85, characters 0-56 +length_compare is never used - <-- line 111 + <-- line 85 val length_compare : 'a list -> int -> [`Gt | `Eq | `Lt] [@@dead "+length_compare"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 113, characters 0-38 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 87, characters 0-38 +length_ge is never used - <-- line 113 + <-- line 87 val length_ge : 'a list -> int -> bool [@@dead "+length_ge"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 122, characters 0-60 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 96, characters 0-60 +length_larger_than_n is never used - <-- line 122 + <-- line 96 val length_larger_than_n : 'a list -> 'a list -> int -> bool [@@dead "+length_larger_than_n"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 134, characters 0-70 - +flat_map_append is never used - <-- line 134 - val flat_map_append : 'a list -> 'b list -> ('a -> 'b list) -> 'b list [@@dead "+flat_map_append"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 136, characters 0-64 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 108, characters 0-64 +stable_group is never used - <-- line 136 + <-- line 108 val stable_group : 'a list -> ('a -> 'a -> bool) -> 'a list list [@@dead "+stable_group"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 152, characters 0-36 - +drop is never used - <-- line 152 - val drop : 'a list -> int -> 'a list [@@dead "+drop"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 160, characters 0-57 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 126, characters 0-57 +find_first_not is never used - <-- line 160 + <-- line 126 val find_first_not : 'a list -> ('a -> bool) -> 'a option [@@dead "+find_first_not"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 181, characters 0-56 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 147, characters 0-56 +for_all_snd is never used - <-- line 181 + <-- line 147 val for_all_snd : ('a * 'b) list -> ('b -> bool) -> bool [@@dead "+for_all_snd"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 189, characters 0-63 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 155, characters 0-63 +split_map is never used - <-- line 189 + <-- line 155 val split_map : 'a list -> ('a -> 'b * 'c) -> 'b list * 'c list [@@dead "+split_map"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 192, characters 0-56 - +reduce_from_left is never used - <-- line 192 - val reduce_from_left : 'a list -> ('a -> 'a -> 'a) -> 'a [@@dead "+reduce_from_left"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 195, characters 0-60 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 158, characters 0-60 +sort_via_array is never used - <-- line 195 + <-- line 158 val sort_via_array : 'a list -> ('a -> 'a -> int) -> 'a list [@@dead "+sort_via_array"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 199, characters 0-69 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 162, characters 0-69 +assoc_by_string is never used - <-- line 199 + <-- line 162 val assoc_by_string : (string * 'a) list -> string -> 'a option -> 'a [@@dead "+assoc_by_string"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 206, characters 0-60 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 169, characters 0-60 +assoc_by_int is never used - <-- line 206 + <-- line 169 val assoc_by_int : (int * 'a) list -> int -> 'a option -> 'a [@@dead "+assoc_by_int"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 208, characters 0-41 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 171, characters 0-41 +nth_opt is never used - <-- line 208 + <-- line 171 val nth_opt : 'a list -> int -> 'a option [@@dead "+nth_opt"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 210, characters 0-53 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 173, characters 0-53 +iter_snd is never used - <-- line 210 + <-- line 173 val iter_snd : ('a * 'b) list -> ('b -> unit) -> unit [@@dead "+iter_snd"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 212, characters 0-53 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 175, characters 0-53 +iter_fst is never used - <-- line 212 + <-- line 175 val iter_fst : ('a * 'b) list -> ('a -> unit) -> unit [@@dead "+iter_fst"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 218, characters 0-55 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 181, characters 0-55 +exists_snd is never used - <-- line 218 + <-- line 181 val exists_snd : ('a * 'b) list -> ('b -> bool) -> bool [@@dead "+exists_snd"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 220, characters 0-54 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 183, characters 0-54 +concat_append is never used - <-- line 220 + <-- line 183 val concat_append : 'a list list -> 'a list -> 'a list [@@dead "+concat_append"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 222, characters 0-73 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 185, characters 0-73 +fold_left2 is never used - <-- line 222 + <-- line 185 val fold_left2 : 'a list -> 'b list -> 'c -> ('a -> 'b -> 'c -> 'c) -> 'c [@@dead "+fold_left2"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 226, characters 0-33 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 189, characters 0-33 +singleton_exn is never used - <-- line 226 + <-- line 189 val singleton_exn : 'a list -> 'a [@@dead "+singleton_exn"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 228, characters 0-46 - +mem_string is never used - <-- line 228 - val mem_string : string list -> string -> bool [@@dead "+mem_string"] - Warning Dead Module File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_modulename.ml", line 1, characters 0-0 +ext_modulename is a dead module as all its items are dead. @@ -14985,4 +14847,4 @@ <-- line 38 val peek_minus : t -> bool [@@dead "+peek_minus"] - Analysis reported 2633 issues (Warning Dead Module:151, Warning Dead Type:265, Warning Dead Value:1962, Warning Dead Value With Side Effects:36, Warning Redundant Optional Argument:195, Warning Unused Argument:24) + Analysis reported 2610 issues (Warning Dead Module:151, Warning Dead Type:265, Warning Dead Value:1939, Warning Dead Value With Side Effects:36, Warning Redundant Optional Argument:195, Warning Unused Argument:24) diff --git a/compiler/ext/ext_list.ml b/compiler/ext/ext_list.ml index e7681aee305..bdb72042c5e 100644 --- a/compiler/ext/ext_list.ml +++ b/compiler/ext/ext_list.ml @@ -75,10 +75,6 @@ let rec arr_list_combine_unsafe arr l i j acc f = | h :: tl -> (f arr.!(i), h) :: arr_list_combine_unsafe arr tl (i + 1) j acc f -let combine_array_append arr l acc f = - let len = Array.length arr in - arr_list_combine_unsafe arr l 0 len acc f - let combine_array arr l f = let len = Array.length arr in arr_list_combine_unsafe arr l 0 len [] f @@ -97,20 +93,6 @@ let array_list_filter_map arr l f = let len = Array.length arr in arr_list_filter_map_unasfe arr l 0 len [] f -let rec map_split_opt (xs : 'a list) (f : 'a -> 'b option * 'c option) : - 'b list * 'c list = - match xs with - | [] -> ([], []) - | x :: xs -> ( - let c, d = f x in - let cs, ds = map_split_opt xs f in - ( (match c with - | Some c -> c :: cs - | None -> cs), - match d with - | Some d -> d :: ds - | None -> ds )) - let rec map_snd l f = match l with | [] -> [] @@ -284,41 +266,6 @@ let rec fold_right3 l r last acc f = (f a3 b3 c3 (f a4 b4 c4 (fold_right3 arest brest crest acc f))))) | _, _, _ -> invalid_arg "Ext_list.fold_right2" -let rec map2i l r f = - match (l, r) with - | [], [] -> [] - | [a0], [b0] -> [f 0 a0 b0] - | [a0; a1], [b0; b1] -> - let c0 = f 0 a0 b0 in - let c1 = f 1 a1 b1 in - [c0; c1] - | [a0; a1; a2], [b0; b1; b2] -> - let c0 = f 0 a0 b0 in - let c1 = f 1 a1 b1 in - let c2 = f 2 a2 b2 in - [c0; c1; c2] - | [a0; a1; a2; a3], [b0; b1; b2; b3] -> - let c0 = f 0 a0 b0 in - let c1 = f 1 a1 b1 in - let c2 = f 2 a2 b2 in - let c3 = f 3 a3 b3 in - [c0; c1; c2; c3] - | [a0; a1; a2; a3; a4], [b0; b1; b2; b3; b4] -> - let c0 = f 0 a0 b0 in - let c1 = f 1 a1 b1 in - let c2 = f 2 a2 b2 in - let c3 = f 3 a3 b3 in - let c4 = f 4 a4 b4 in - [c0; c1; c2; c3; c4] - | a0 :: a1 :: a2 :: a3 :: a4 :: arest, b0 :: b1 :: b2 :: b3 :: b4 :: brest -> - let c0 = f 0 a0 b0 in - let c1 = f 1 a1 b1 in - let c2 = f 2 a2 b2 in - let c3 = f 3 a3 b3 in - let c4 = f 4 a4 b4 in - c0 :: c1 :: c2 :: c3 :: c4 :: map2i arest brest f - | _, _ -> invalid_arg "Ext_list.map2" - let rec map2 l r f = match (l, r) with | [], [] -> [] @@ -367,26 +314,6 @@ let rec filter_map xs (f : 'a -> 'b option) = | None -> filter_map ys f | Some z -> z :: filter_map ys f) -let rec exclude (xs : 'a list) (p : 'a -> bool) : 'a list = - match xs with - | [] -> [] - | x :: xs -> if p x then exclude xs p else x :: exclude xs p - -let rec exclude_with_val l p = - match l with - | [] -> None - | a0 :: xs -> ( - if p a0 then Some (exclude xs p) - else - match xs with - | [] -> None - | a1 :: rest -> ( - if p a1 then Some (a0 :: exclude rest p) - else - match exclude_with_val rest p with - | None -> None - | Some rest -> Some (a0 :: a1 :: rest))) - let rec same_length xs ys = match (xs, ys) with | [], [] -> true @@ -441,24 +368,6 @@ let rec small_split_at n acc l = let split_at l n = small_split_at n [] l -let rec split_at_last_aux acc x = - match x with - | [] -> invalid_arg "Ext_list.split_at_last" - | [x] -> (rev acc, x) - | y0 :: ys -> split_at_last_aux (y0 :: acc) ys - -let split_at_last (x : 'a list) = - match x with - | [] -> invalid_arg "Ext_list.split_at_last" - | [a0] -> ([], a0) - | [a0; a1] -> ([a0], a1) - | [a0; a1; a2] -> ([a0; a1], a2) - | [a0; a1; a2; a3] -> ([a0; a1; a2], a3) - | [a0; a1; a2; a3; a4] -> ([a0; a1; a2; a3], a4) - | a0 :: a1 :: a2 :: a3 :: a4 :: rest -> - let rev, last = split_at_last_aux [] rest in - (a0 :: a1 :: a2 :: a3 :: a4 :: rev, last) - (** can not do loop unroll due to state combination *) @@ -473,15 +382,6 @@ let filter_mapi xs f = in aux 0 xs -let rec filter_map2 xs ys (f : 'a -> 'b -> 'c option) = - match (xs, ys) with - | [], [] -> [] - | u :: us, v :: vs -> ( - match f u v with - | None -> filter_map2 us vs f (* idea: rec f us vs instead? *) - | Some z -> z :: filter_map2 us vs f) - | _ -> invalid_arg "Ext_list.filter_map2" - let rec rev_map_append l1 l2 f = match l1 with | [] -> l2 @@ -506,8 +406,6 @@ let rec flat_map_aux f acc append lx = let flat_map lx f = flat_map_aux f [] [] lx -let flat_map_append lx append f = flat_map_aux f [] append lx - let rec length_compare l n = if n < 0 then `Gt else @@ -546,14 +444,6 @@ and aux eq (x : 'a) (xss : 'a list list) : 'a list list = let stable_group lst eq = group eq lst |> rev -let rec drop h n = - if n < 0 then invalid_arg "Ext_list.drop" - else if n = 0 then h - else - match h with - | [] -> invalid_arg "Ext_list.drop" - | _ :: tl -> drop tl (n - 1) - let rec find_first x p = match x with | [] -> None @@ -746,11 +636,6 @@ let rec fold_left l accu f = | [] -> accu | a :: l -> fold_left l (f accu a) f -let reduce_from_left lst fn = - match lst with - | first :: rest -> fold_left rest first fn - | _ -> invalid_arg "Ext_list.reduce_from_left" - let rec fold_left2 l1 l2 accu f = match (l1, l2) with | [], [] -> accu @@ -762,11 +647,6 @@ let singleton_exn xs = | [x] -> x | _ -> assert false -let rec mem_string (xs : string list) (x : string) = - match xs with - | [] -> false - | a :: l -> a = x || mem_string l x - let filter lst p = let rec find ~p accu lst = match lst with diff --git a/compiler/ext/ext_list.mli b/compiler/ext/ext_list.mli index c5e65149e96..fba672eabff 100644 --- a/compiler/ext/ext_list.mli +++ b/compiler/ext/ext_list.mli @@ -28,14 +28,8 @@ val map_combine : 'a list -> 'b list -> ('a -> 'c) -> ('c * 'b) list val combine_array : 'a array -> 'b list -> ('a -> 'c) -> ('c * 'b) list -val combine_array_append : - 'a array -> 'b list -> ('c * 'b) list -> ('a -> 'c) -> ('c * 'b) list - val has_string : string list -> string -> bool -val map_split_opt : - 'a list -> ('a -> 'b option * 'c option) -> 'b list * 'c list - val mapi : 'a list -> (int -> 'a -> 'b) -> 'b list val mapi_append : 'a list -> (int -> 'a -> 'b) -> 'b list -> 'b list @@ -70,25 +64,12 @@ val fold_right3 : val map2 : 'a list -> 'b list -> ('a -> 'b -> 'c) -> 'c list -val map2i : 'a list -> 'b list -> (int -> 'a -> 'b -> 'c) -> 'c list - val fold_left_with_offset : 'a list -> 'acc -> int -> ('a -> 'acc -> int -> 'acc) -> 'acc val filter_map : 'a list -> ('a -> 'b option) -> 'b list (** @unused *) -val exclude : 'a list -> ('a -> bool) -> 'a list -(** [exclude p l] is the opposite of [filter p l] *) - -val exclude_with_val : 'a list -> ('a -> bool) -> 'a list option -(** [excludes p l] - return a tuple [excluded,newl] - where [exluded] is true indicates that at least one - element is removed,[newl] is the new list where all [p x] for [x] is false - -*) - val same_length : 'a list -> 'b list -> bool val init : int -> (int -> 'a) -> 'a list @@ -99,15 +80,8 @@ val split_at : 'a list -> int -> 'a list * 'a list otherwise, it will raise *) -val split_at_last : 'a list -> 'a list * 'a -(** [split_at_last l] - It is equivalent to [split_at (List.length l - 1) l ] -*) - val filter_mapi : 'a list -> ('a -> int -> 'b option) -> 'b list -val filter_map2 : 'a list -> 'b list -> ('a -> 'b -> 'c option) -> 'c list - val length_compare : 'a list -> int -> [`Gt | `Eq | `Lt] val length_ge : 'a list -> int -> bool @@ -131,8 +105,6 @@ val rev_map_append : 'a list -> 'b list -> ('a -> 'b) -> 'b list val flat_map : 'a list -> ('a -> 'b list) -> 'b list -val flat_map_append : 'a list -> 'b list -> ('a -> 'b list) -> 'b list - val stable_group : 'a list -> ('a -> 'a -> bool) -> 'a list list (** [stable_group eq lst] @@ -149,12 +121,6 @@ val stable_group : 'a list -> ('a -> 'a -> bool) -> 'a list list which could be improved later *) -val drop : 'a list -> int -> 'a list -(** [drop n list] - raise when [n] is negative - raise when list's length is less than [n] -*) - val find_first : 'a list -> ('a -> bool) -> 'a option val find_first_not : 'a list -> ('a -> bool) -> 'a option @@ -189,9 +155,6 @@ val for_all2_no_exn : 'a list -> 'b list -> ('a -> 'b -> bool) -> bool val split_map : 'a list -> ('a -> 'b * 'c) -> 'b list * 'c list (** [f] is applied follow the list order *) -val reduce_from_left : 'a list -> ('a -> 'a -> 'a) -> 'a -(** [fn] is applied from left to right *) - val sort_via_array : 'a list -> ('a -> 'a -> int) -> 'a list val sort_via_arrayf : 'a list -> ('a -> 'a -> int) -> ('a -> 'b) -> 'b list @@ -225,8 +188,6 @@ val fold_left : 'a list -> 'b -> ('b -> 'a -> 'b) -> 'b val singleton_exn : 'a list -> 'a -val mem_string : string list -> string -> bool - val filter : 'a list -> ('a -> bool) -> 'a list val array_list_filter_map : diff --git a/tests/ounit_tests/ounit_list_test.ml b/tests/ounit_tests/ounit_list_test.ml index c08725ddab8..7860b51baf9 100644 --- a/tests/ounit_tests/ounit_list_test.ml +++ b/tests/ounit_tests/ounit_list_test.ml @@ -12,10 +12,6 @@ let suites = OUnit.assert_equal (Ext_list.flat_map [1; 2] (fun x -> [x; x])) [1; 1; 2; 2] ); - ( __LOC__ >:: fun _ -> - OUnit.assert_equal - (Ext_list.flat_map_append [1; 2] [3; 4] (fun x -> [x; x])) - [1; 1; 2; 2; 3; 4] ); ( __LOC__ >:: fun _ -> let ( =~ ) = OUnit.assert_equal ~printer:printer_int_list in Ext_list.flat_map [] (fun x -> [succ x]) =~ []; @@ -38,11 +34,6 @@ let suites = Ext_list.map_last [0; 0; 0; 0; 0] f =~ [0; 0; 0; 0; 1]; Ext_list.map_last [0; 0; 0; 0; 0; 0] f =~ [0; 0; 0; 0; 0; 1]; Ext_list.map_last [0; 0; 0; 0; 0; 0; 0] f =~ [0; 0; 0; 0; 0; 0; 1] ); - ( __LOC__ >:: fun _ -> - OUnit.assert_equal - (Ext_list.flat_map_append [1; 2] [false; false] (fun x -> - if x mod 2 = 0 then [true] else [])) - [true; false; false] ); ( __LOC__ >:: fun _ -> OUnit.assert_equal (Ext_list.map_append [0; 1; 2] ["1"; "2"; "3"] (fun x -> @@ -53,18 +44,6 @@ let suites = OUnit.assert_equal (a, b) ([1; 2; 3], [4; 5; 6]); OUnit.assert_equal (Ext_list.split_at [1] 1) ([1], []); OUnit.assert_equal (Ext_list.split_at [1; 2; 3] 2) ([1; 2], [3]) ); - ( __LOC__ >:: fun _ -> - let printer (a, b) = - Format.asprintf "([%a],%d)" - (Format.pp_print_list Format.pp_print_int) - a b - in - let ( =~ ) = OUnit.assert_equal ~printer in - Ext_list.split_at_last [1; 2; 3] =~ ([1; 2], 3); - Ext_list.split_at_last [1; 2; 3; 4; 5; 6; 7; 8] - =~ ([1; 2; 3; 4; 5; 6; 7], 8); - Ext_list.split_at_last [1; 2; 3; 4; 5; 6; 7] - =~ ([1; 2; 3; 4; 5; 6], 7) ); ( __LOC__ >:: fun _ -> OUnit.assert_equal (Ext_list.assoc_by_int [(2, "x"); (3, "y"); (1, "z")] 1 None) @@ -72,12 +51,6 @@ let suites = ( __LOC__ >:: fun _ -> Ounit_tests_util.assert_raise_any (fun _ -> Ext_list.assoc_by_int [(2, "x"); (3, "y"); (1, "z")] 11 None) ); - ( __LOC__ >:: fun _ -> - OUnit.assert_equal (Ext_list.length_compare [0; 0; 0] 3) `Eq; - OUnit.assert_equal (Ext_list.length_compare [0; 0; 0] 1) `Gt; - OUnit.assert_equal (Ext_list.length_compare [0; 0; 0] 4) `Lt; - OUnit.assert_equal (Ext_list.length_compare [] (-1)) `Gt; - OUnit.assert_equal (Ext_list.length_compare [] 0) `Eq ); ( __LOC__ >:: fun _ -> OUnit.assert_bool __LOC__ (Ext_list.length_larger_than_n [1; 2] [1] 1); @@ -89,14 +62,4 @@ let suites = OUnit.assert_bool __LOC__ (Ext_list.length_ge [1; 2; 3] 3); OUnit.assert_bool __LOC__ (Ext_list.length_ge [] 0); OUnit.assert_bool __LOC__ (not (Ext_list.length_ge [] 1)) ); - ( __LOC__ >:: fun _ -> - let ( =~ ) = OUnit.assert_equal in - - let f p x = Ext_list.exclude_with_val x p in - f (fun x -> x = 1) [1; 2; 3] =~ Some [2; 3]; - f (fun x -> x = 4) [1; 2; 3] =~ None; - f (fun x -> x = 2) [1; 2; 3; 2] =~ Some [1; 3]; - f (fun x -> x = 2) [1; 2; 2; 3; 2] =~ Some [1; 3]; - f (fun x -> x = 2) [2; 2; 2] =~ Some []; - f (fun x -> x = 3) [2; 2; 2] =~ None ); ] From 480e708936b7858d1d85e25d287a97f09fa63aa9 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 13:23:45 +0000 Subject: [PATCH 117/214] dce: note list liveness --- scripts/dce/live-findings.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/scripts/dce/live-findings.md b/scripts/dce/live-findings.md index 21685c3e4fa..448cc8dc658 100644 --- a/scripts/dce/live-findings.md +++ b/scripts/dce/live-findings.md @@ -245,6 +245,25 @@ live after manual validation. The survivors are cross-module or alias-qualified uses that DCE reports as unrooted. +### `Ext_list` production helpers + +- Report: remaining `Warning Dead Value` entries in + `compiler/ext/ext_list.ml` / `.mli`, including `map_snd`, `append`, + `append_one`, `fold_right3`, `split_at`, `length_ge`, + `length_larger_than_n`, `stable_group`, `nth_opt`, `iter_snd`, + `exists_snd`, `fold_left2`, and `singleton_exn`. +- Verdict: live; false positive for the remaining reported helpers. +- Validation: the remaining helpers have production callers across the lambda + and JS pipelines. Examples include `Lam_convert` using `append_one`, + `length_ge`, `length_larger_than_n`, and `singleton_exn`; + `Lam_eta_conversion`, `Lam_compile`, and `Lam_pass_alpha_conversion` using + `split_at`; `Js_fun_env` using `filter_mapi`; `Js_pass_tailcall_inline` using + `fold_right3`; and many lambda/JS passes using `map_snd`, `iter_snd`, + `exists_snd`, `nth_opt`, and `fold_left2`. +- Context: helper functions with no production callers were removed, along with + unit tests that only exercised that dead helper surface. The remaining + warnings are ordinary cross-module `Ext_list.*` uses missed by DCE. + ### Core JS analyzer and delimiters - Report: `Warning Dead Type`, `compiler/core/j.ml`, `delim.DBackQuotes`; and From 61ce615fff47bd8c6d0d7f2bc7d1974231e395b2 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 13:24:33 +0000 Subject: [PATCH 118/214] dce: note collection liveness --- scripts/dce/live-findings.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/scripts/dce/live-findings.md b/scripts/dce/live-findings.md index 448cc8dc658..f2a6a90e723 100644 --- a/scripts/dce/live-findings.md +++ b/scripts/dce/live-findings.md @@ -264,6 +264,25 @@ live after manual validation. unit tests that only exercised that dead helper surface. The remaining warnings are ordinary cross-module `Ext_list.*` uses missed by DCE. +### `Map_gen` and `Set_gen` collection cores + +- Report: `Warning Dead Module`, `Warning Dead Value`, and constructor warnings + across `compiler/ext/map_gen.ml` / `.mli` and + `compiler/ext/set_gen.ml` / `.mli`. +- Verdict: live; false positive. +- Validation: `compiler/ext/map.cppo.ml` defines concrete map modules by + wrapping `Map_gen.empty`, `is_empty`, `iter`, `fold`, `for_all`, `exists`, + `singleton`, `cardinal`, `bindings`, sorted-array helpers, `map`, `mapi`, + balancing helpers, `merge`, `join`, and tree constructors. Similarly, + `compiler/ext/set.cppo.ml` wraps `Set_gen.empty`, `iter`, `fold`, + `singleton`, `cardinal`, `elements`, `choose`, balancing and join/concat + helpers, and validation helpers. `map_ident.mli`, `map_int.mli`, + `map_string.mli`, `set_ident.mli`, `set_int.mli`, and `set_string.mli` + expose those generated concrete modules. +- Context: this is a `.cppo.ml` rooting issue. The report sees the generic tree + implementation as dead, but those functions are the shared implementation of + the compiler's generated map and set modules. + ### Core JS analyzer and delimiters - Report: `Warning Dead Type`, `compiler/core/j.ml`, `delim.DBackQuotes`; and From 86ea981ce1de3ffbed1dbc1a29cb520c8457c572 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 13:27:31 +0000 Subject: [PATCH 119/214] dce: trim array helpers --- _dce/report.txt | 204 ++----------------------- compiler/ext/ext_array.ml | 121 --------------- compiler/ext/ext_array.mli | 30 ---- tests/ounit_tests/ounit_array_tests.ml | 38 ----- 4 files changed, 9 insertions(+), 384 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index 985ce7b81d6..77aa37c4e01 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -7958,119 +7958,17 @@ done [@@dead "+reverse_range"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.ml", line 38, characters 0-59 - +reverse_in_place is never used - <-- line 38 - let reverse_in_place a = reverse_range a 0 (Array.length a) [@@dead "+reverse_in_place"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.ml", line 40, characters 0-217 - +reverse is never used - <-- line 40 - b [@@dead "+reverse"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.ml", line 63, characters 0-241 - +filter is never used - <-- line 63 - aux [] 0 [@@dead "+filter"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.ml", line 73, characters 0-295 - +filter_map is never used - <-- line 73 - aux [] 0 [@@dead "+filter_map"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.ml", line 85, characters 0-303 - +filter_mapi is never used - <-- line 85 - aux [] 0 [@@dead "+filter_mapi"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.ml", line 97, characters 0-126 - +range is never used - <-- line 97 - else Array.init (to_ - from + 1) (fun i -> i + from) [@@dead "+range"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.ml", line 101, characters 0-171 - +map2i is never used - <-- line 101 - else Array.mapi (fun i a -> f i a (Array.unsafe_get b i)) a [@@dead "+map2i"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.ml", line 114, characters 0-159 - +tolist_aux is never used - <-- line 114 - | None -> res) [@@dead "+tolist_aux"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.ml", line 122, characters 0-60 - +to_list_map is never used - <-- line 122 - let to_list_map a f = tolist_aux a f (Array.length a - 1) [] [@@dead "+to_list_map"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.ml", line 124, characters 0-69 - +to_list_map_acc is never used - <-- line 124 - let to_list_map_acc a acc f = tolist_aux a f (Array.length a - 1) acc [@@dead "+to_list_map_acc"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.ml", line 126, characters 0-1053 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.ml", line 59, characters 0-1053 +of_list_map is never used - <-- line 126 + <-- line 59 fill 5 tl [@@dead "+of_list_map"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.ml", line 186, characters 0-194 - +rfind_with_index is never used - <-- line 186 - aux (len - 1) [@@dead "+rfind_with_index"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.ml", line 197, characters 0-201 - +find_with_index is never used - <-- line 197 - aux 0 len [@@dead "+find_with_index"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.ml", line 206, characters 0-191 - +find_and_split is never used - <-- line 206 - Split (Array.sub arr 0 i, Array.sub arr (i + 1) (Array.length arr - i - 1)) [@@dead "+find_and_split"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.ml", line 223, characters 0-39 - +is_empty is never used - <-- line 223 - let is_empty arr = Array.length arr = 0 [@@dead "+is_empty"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.ml", line 225, characters 0-180 - +unsafe_loop is never used - <-- line 225 - && unsafe_loop (succ index) len p xs ys [@@dead "+unsafe_loop"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.ml", line 240, characters 0-147 - +for_all2_no_exn is never used - <-- line 240 - len_xs = len_ys && unsafe_loop 0 len_xs p xs ys [@@dead "+for_all2_no_exn"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.ml", line 262, characters 0-135 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.ml", line 144, characters 0-135 +fold_left is never used - <-- line 262 + <-- line 144 !r [@@dead "+fold_left"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.ml", line 270, characters 0-96 - +get_or is never used - <-- line 270 - if i >= 0 && i < Array.length arr then Array.unsafe_get arr i else cb () [@@dead "+get_or"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.mli", line 25, characters 0-50 +reverse_range is never used @@ -8078,101 +7976,17 @@ val reverse_range : 'a array -> int -> int -> unit [@@dead "+reverse_range"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.mli", line 28, characters 0-39 - +reverse_in_place is never used - <-- line 28 - val reverse_in_place : 'a array -> unit [@@dead "+reverse_in_place"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.mli", line 30, characters 0-34 - +reverse is never used - <-- line 30 - val reverse : 'a array -> 'a array [@@dead "+reverse"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.mli", line 34, characters 0-49 - +filter is never used - <-- line 34 - val filter : 'a array -> ('a -> bool) -> 'a array [@@dead "+filter"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.mli", line 36, characters 0-58 - +filter_map is never used - <-- line 36 - val filter_map : 'a array -> ('a -> 'b option) -> 'b array [@@dead "+filter_map"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.mli", line 38, characters 0-66 - +filter_mapi is never used - <-- line 38 - val filter_mapi : 'a array -> (int -> 'a -> 'b option) -> 'b array [@@dead "+filter_mapi"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.mli", line 40, characters 0-35 - +range is never used - <-- line 40 - val range : int -> int -> int array [@@dead "+range"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.mli", line 42, characters 0-71 - +map2i is never used - <-- line 42 - val map2i : (int -> 'a -> 'b -> 'c) -> 'a array -> 'b array -> 'c array [@@dead "+map2i"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.mli", line 46, characters 0-58 - +to_list_map is never used - <-- line 46 - val to_list_map : 'a array -> ('a -> 'b option) -> 'b list [@@dead "+to_list_map"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.mli", line 48, characters 0-73 - +to_list_map_acc is never used - <-- line 48 - val to_list_map_acc : 'a array -> 'b list -> ('a -> 'b option) -> 'b list [@@dead "+to_list_map_acc"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.mli", line 50, characters 0-51 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.mli", line 32, characters 0-51 +of_list_map is never used - <-- line 50 + <-- line 32 val of_list_map : 'a list -> ('a -> 'b) -> 'b array [@@dead "+of_list_map"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.mli", line 52, characters 0-66 - +rfind_with_index is never used - <-- line 52 - val rfind_with_index : 'a array -> ('a -> 'b -> bool) -> 'b -> int [@@dead "+rfind_with_index"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.mli", line 56, characters 0-69 - +find_and_split is never used - <-- line 56 - val find_and_split : 'a array -> ('a -> 'b -> bool) -> 'b -> 'a split [@@dead "+find_and_split"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.mli", line 60, characters 0-31 - +is_empty is never used - <-- line 60 - val is_empty : 'a array -> bool [@@dead "+is_empty"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.mli", line 62, characters 0-72 - +for_all2_no_exn is never used - <-- line 62 - val for_all2_no_exn : 'a array -> 'b array -> ('a -> 'b -> bool) -> bool [@@dead "+for_all2_no_exn"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.mli", line 70, characters 0-56 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.mli", line 42, characters 0-56 +fold_left is never used - <-- line 70 + <-- line 42 val fold_left : 'b array -> 'a -> ('a -> 'b -> 'a) -> 'a [@@dead "+fold_left"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.mli", line 72, characters 0-50 - +get_or is never used - <-- line 72 - val get_or : 'a array -> int -> (unit -> 'a) -> 'a [@@dead "+get_or"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_buffer.ml", line 42, characters 0-31 +is_empty is never used @@ -14847,4 +14661,4 @@ <-- line 38 val peek_minus : t -> bool [@@dead "+peek_minus"] - Analysis reported 2610 issues (Warning Dead Module:151, Warning Dead Type:265, Warning Dead Value:1939, Warning Dead Value With Side Effects:36, Warning Redundant Optional Argument:195, Warning Unused Argument:24) + Analysis reported 2579 issues (Warning Dead Module:151, Warning Dead Type:265, Warning Dead Value:1908, Warning Dead Value With Side Effects:36, Warning Redundant Optional Argument:195, Warning Unused Argument:24) diff --git a/compiler/ext/ext_array.ml b/compiler/ext/ext_array.ml index 9a416e5b0ab..1aaaa19a686 100644 --- a/compiler/ext/ext_array.ml +++ b/compiler/ext/ext_array.ml @@ -35,18 +35,6 @@ let reverse_range a i len = a.!(i + len - 1 - k) <- t done -let reverse_in_place a = reverse_range a 0 (Array.length a) - -let reverse a = - let b_len = Array.length a in - if b_len = 0 then [||] - else - let b = Array.copy a in - for i = 0 to b_len - 1 do - Array.unsafe_set b i (Array.unsafe_get a (b_len - 1 - i)) - done; - b - let reverse_of_list = function | [] -> [||] | hd :: tl -> @@ -60,49 +48,6 @@ let reverse_of_list = function in fill (len - 1) tl -let filter a f = - let arr_len = Array.length a in - let rec aux acc i = - if i = arr_len then reverse_of_list acc - else - let v = Array.unsafe_get a i in - if f v then aux (v :: acc) (i + 1) else aux acc (i + 1) - in - aux [] 0 - -let filter_map a (f : _ -> _ option) = - let arr_len = Array.length a in - let rec aux acc i = - if i = arr_len then reverse_of_list acc - else - let v = Array.unsafe_get a i in - match f v with - | Some v -> aux (v :: acc) (i + 1) - | None -> aux acc (i + 1) - in - aux [] 0 - -let filter_mapi a (f : _ -> _ -> _ option) = - let arr_len = Array.length a in - let rec aux acc i = - if i = arr_len then reverse_of_list acc - else - let v = Array.unsafe_get a i in - match f i v with - | Some v -> aux (v :: acc) (i + 1) - | None -> aux acc (i + 1) - in - aux [] 0 - -let range from to_ = - if from > to_ then invalid_arg "Ext_array.range" - else Array.init (to_ - from + 1) (fun i -> i + from) - -let map2i f a b = - let len = Array.length a in - if len <> Array.length b then invalid_arg "Ext_array.map2i" - else Array.mapi (fun i a -> f i a (Array.unsafe_get b i)) a - let rec tolist_f_aux a f i res = if i < 0 then res else @@ -111,18 +56,6 @@ let rec tolist_f_aux a f i res = let to_list_f a f = tolist_f_aux a f (Array.length a - 1) [] -let rec tolist_aux a f i res = - if i < 0 then res - else - tolist_aux a f (i - 1) - (match f a.!(i) with - | Some v -> v :: res - | None -> res) - -let to_list_map a f = tolist_aux a f (Array.length a - 1) [] - -let to_list_map_acc a acc f = tolist_aux a f (Array.length a - 1) acc - let of_list_map a f = match a with | [] -> [||] @@ -171,44 +104,6 @@ let of_list_map a f = in fill 5 tl -(** - {[ - # rfind_with_index [|1;2;3|] (=) 2;; - - : int = 1 - # rfind_with_index [|1;2;3|] (=) 1;; - - : int = 0 - # rfind_with_index [|1;2;3|] (=) 3;; - - : int = 2 - # rfind_with_index [|1;2;3|] (=) 4;; - - : int = -1 - ]} -*) -let rfind_with_index arr cmp v = - let len = Array.length arr in - let rec aux i = - if i < 0 then i - else if cmp (Array.unsafe_get arr i) v then i - else aux (i - 1) - in - aux (len - 1) - -type 'a split = No_split | Split of 'a array * 'a array - -let find_with_index arr cmp v = - let len = Array.length arr in - let rec aux i len = - if i >= len then -1 - else if cmp (Array.unsafe_get arr i) v then i - else aux (i + 1) len - in - aux 0 len - -let find_and_split arr cmp v : _ split = - let i = find_with_index arr cmp v in - if i < 0 then No_split - else - Split (Array.sub arr 0 i, Array.sub arr (i + 1) (Array.length arr - i - 1)) - (** TODO: available since 4.03, use {!Array.exists} *) let exists a p = @@ -220,14 +115,6 @@ let exists a p = in loop 0 -let is_empty arr = Array.length arr = 0 - -let rec unsafe_loop index len p xs ys = - if index >= len then true - else - p (Array.unsafe_get xs index) (Array.unsafe_get ys index) - && unsafe_loop (succ index) len p xs ys - let for_alli a p = let n = Array.length a in let rec loop i = @@ -237,11 +124,6 @@ let for_alli a p = in loop 0 -let for_all2_no_exn xs ys p = - let len_xs = Array.length xs in - let len_ys = Array.length ys in - len_xs = len_ys && unsafe_loop 0 len_xs p xs ys - let map a f = let open Array in let l = length a in @@ -266,6 +148,3 @@ let fold_left a x f = r := f !r (unsafe_get a i) done; !r - -let get_or arr i cb = - if i >= 0 && i < Array.length arr then Array.unsafe_get arr i else cb () diff --git a/compiler/ext/ext_array.mli b/compiler/ext/ext_array.mli index b55bd1a09e7..05d29b799c1 100644 --- a/compiler/ext/ext_array.mli +++ b/compiler/ext/ext_array.mli @@ -25,42 +25,14 @@ val reverse_range : 'a array -> int -> int -> unit (** Some utilities for {!Array} operations *) -val reverse_in_place : 'a array -> unit - -val reverse : 'a array -> 'a array - val reverse_of_list : 'a list -> 'a array -val filter : 'a array -> ('a -> bool) -> 'a array - -val filter_map : 'a array -> ('a -> 'b option) -> 'b array - -val filter_mapi : 'a array -> (int -> 'a -> 'b option) -> 'b array - -val range : int -> int -> int array - -val map2i : (int -> 'a -> 'b -> 'c) -> 'a array -> 'b array -> 'c array - val to_list_f : 'a array -> ('a -> 'b) -> 'b list -val to_list_map : 'a array -> ('a -> 'b option) -> 'b list - -val to_list_map_acc : 'a array -> 'b list -> ('a -> 'b option) -> 'b list - val of_list_map : 'a list -> ('a -> 'b) -> 'b array -val rfind_with_index : 'a array -> ('a -> 'b -> bool) -> 'b -> int - -type 'a split = No_split | Split of 'a array * 'a array - -val find_and_split : 'a array -> ('a -> 'b -> bool) -> 'b -> 'a split - val exists : 'a array -> ('a -> bool) -> bool -val is_empty : 'a array -> bool - -val for_all2_no_exn : 'a array -> 'b array -> ('a -> 'b -> bool) -> bool - val for_alli : 'a array -> (int -> 'a -> bool) -> bool val map : 'a array -> ('a -> 'b) -> 'b array @@ -68,5 +40,3 @@ val map : 'a array -> ('a -> 'b) -> 'b array val iter : 'a array -> ('a -> unit) -> unit val fold_left : 'b array -> 'a -> ('a -> 'b -> 'a) -> 'a - -val get_or : 'a array -> int -> (unit -> 'a) -> 'a diff --git a/tests/ounit_tests/ounit_array_tests.ml b/tests/ounit_tests/ounit_array_tests.ml index 74274cd4f5b..fcd36a613e1 100644 --- a/tests/ounit_tests/ounit_array_tests.ml +++ b/tests/ounit_tests/ounit_array_tests.ml @@ -8,26 +8,6 @@ let printer_int_array xs = let suites = __FILE__ >::: [ - ( __LOC__ >:: fun _ -> - Ext_array.find_and_split [|"a"; "b"; "c"|] Ext_string.equal "--" - =~ No_split ); - ( __LOC__ >:: fun _ -> - Ext_array.find_and_split [|"a"; "b"; "c"; "--"|] Ext_string.equal - "--" - =~ Split ([|"a"; "b"; "c"|], [||]) ); - ( __LOC__ >:: fun _ -> - Ext_array.find_and_split - [|"--"; "a"; "b"; "c"; "--"|] - Ext_string.equal "--" - =~ Split ([||], [|"a"; "b"; "c"; "--"|]) ); - ( __LOC__ >:: fun _ -> - Ext_array.find_and_split - [|"u"; "g"; "--"; "a"; "b"; "c"; "--"|] - Ext_string.equal "--" - =~ Split ([|"u"; "g"|], [|"a"; "b"; "c"; "--"|]) ); - ( __LOC__ >:: fun _ -> - Ext_array.reverse [|1; 2|] =~ [|2; 1|]; - Ext_array.reverse [||] =~ [||] ); ( __LOC__ >:: fun _ -> let ( =~ ) = OUnit.assert_equal ~printer:printer_int_array in let k x y = Ext_array.of_list_map y x in @@ -38,22 +18,4 @@ let suites = k succ [1; 2; 3; 4; 5] =~ [|2; 3; 4; 5; 6|]; k succ [1; 2; 3; 4; 5; 6] =~ [|2; 3; 4; 5; 6; 7|]; k succ [1; 2; 3; 4; 5; 6; 7] =~ [|2; 3; 4; 5; 6; 7; 8|] ); - ( __LOC__ >:: fun _ -> - Ext_array.to_list_map_acc [|1; 2; 3; 4; 5; 6|] [1; 2; 3] (fun x -> - if x mod 2 = 0 then Some x else None) - =~ [2; 4; 6; 1; 2; 3] ); - ( __LOC__ >:: fun _ -> - Ext_array.to_list_map_acc [|1; 2; 3; 4; 5; 6|] [] (fun x -> - if x mod 2 = 0 then Some x else None) - =~ [2; 4; 6] ); - ( __LOC__ >:: fun _ -> - OUnit.assert_bool __LOC__ - (Ext_array.for_all2_no_exn [|1; 2; 3|] [|1; 2; 3|] ( = )) ); - ( __LOC__ >:: fun _ -> - OUnit.assert_bool __LOC__ (Ext_array.for_all2_no_exn [||] [||] ( = )); - OUnit.assert_bool __LOC__ - (not @@ Ext_array.for_all2_no_exn [||] [|1|] ( = )) ); - ( __LOC__ >:: fun _ -> - OUnit.assert_bool __LOC__ - (not (Ext_array.for_all2_no_exn [|1; 2; 3|] [|1; 2; 33|] ( = ))) ); ] From 94b4cc7d8f7749ad8ba48f92810c814b5f0db540 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 13:27:56 +0000 Subject: [PATCH 120/214] dce: note array liveness --- scripts/dce/live-findings.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/scripts/dce/live-findings.md b/scripts/dce/live-findings.md index f2a6a90e723..b183565e6f5 100644 --- a/scripts/dce/live-findings.md +++ b/scripts/dce/live-findings.md @@ -283,6 +283,20 @@ live after manual validation. implementation as dead, but those functions are the shared implementation of the compiler's generated map and set modules. +### `Ext_array` production helpers + +- Report: remaining `Warning Dead Value` entries in + `compiler/ext/ext_array.ml` / `.mli`, currently `reverse_range`, + `of_list_map`, and `fold_left`. +- Verdict: live; false positive. +- Validation: `compiler/ext/vec.cppo.ml` calls `Ext_array.reverse_range`; + `compiler/core/lam_util.cppo.ml` and `lam_stats_export.ml` call + `Ext_array.of_list_map`; and `compiler/ext/map.cppo.ml` calls + `Ext_array.fold_left`. +- Context: helpers with no production callers were removed with their + unit-only tests. The remaining warnings are `.cppo.ml` and cross-module uses + missed by DCE. + ### Core JS analyzer and delimiters - Report: `Warning Dead Type`, `compiler/core/j.ml`, `delim.DBackQuotes`; and From c36c7f83b440bfb1b43089d3053b3aa917eb9700 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 13:49:38 +0000 Subject: [PATCH 121/214] dce: trim lambda debug API --- _dce/report.txt | 68 ++++++--------------------------- compiler/core/lam_primitive.ml | 7 ---- compiler/core/lam_primitive.mli | 7 ---- compiler/core/lam_print.ml | 2 - compiler/core/lam_print.mli | 2 - 5 files changed, 11 insertions(+), 75 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index 77aa37c4e01..6dbe05dfd2d 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -7381,70 +7381,34 @@ <-- line 38 val simplify_alias : Lam_stats.t -> Lam.t -> Lam.t [@@dead "+simplify_alias"] - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_primitive.ml", line 30, characters 2-18 - record_representation.Record_regular is a variant case which is never constructed - <-- line 30 - | Record_regular [@dead "record_representation.Record_regular"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_primitive.ml", line 31, characters 2-66 - record_representation.Record_inlined is a variant case which is never constructed - <-- line 31 - | Record_inlined of {tag: int; name: string; num_nonconsts: int} [@dead "record_representation.Record_inlined"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_primitive.ml", line 33, characters 2-20 - record_representation.Record_extension is a variant case which is never constructed - <-- line 33 - | Record_extension [@dead "record_representation.Record_extension"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_primitive.ml", line 185, characters 0-99 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_primitive.ml", line 178, characters 0-99 +eq_field_dbg_info is never used - <-- line 185 + <-- line 178 x = y [@@dead "+eq_field_dbg_info"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_primitive.ml", line 190, characters 0-111 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_primitive.ml", line 183, characters 0-111 +eq_set_field_dbg_info is never used - <-- line 190 + <-- line 183 x = y [@@dead "+eq_set_field_dbg_info"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_primitive.ml", line 195, characters 0-46 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_primitive.ml", line 188, characters 0-46 +eq_tag_info is never used - <-- line 195 + <-- line 188 let eq_tag_info (x : Lam_tag_info.t) y = x = y [@@dead "+eq_tag_info"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_primitive.ml", line 197, characters 0-4113 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_primitive.ml", line 190, characters 0-4113 +eq_primitive_approx is never used - <-- line 197 + <-- line 190 | Praw_js_code _ -> false [@@dead "+eq_primitive_approx"] - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_primitive.mli", line 28, characters 2-18 - record_representation.Record_regular is a variant case which is never constructed - <-- line 28 - | Record_regular [@dead "record_representation.Record_regular"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_primitive.mli", line 29, characters 2-66 - record_representation.Record_inlined is a variant case which is never constructed - <-- line 29 - | Record_inlined of {tag: int; name: string; num_nonconsts: int} [@dead "record_representation.Record_inlined"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_primitive.mli", line 31, characters 2-20 - record_representation.Record_extension is a variant case which is never constructed - <-- line 31 - | Record_extension [@dead "record_representation.Record_extension"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_primitive.mli", line 175, characters 0-40 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_primitive.mli", line 168, characters 0-40 +eq_primitive_approx is never used - <-- line 175 + <-- line 168 val eq_primitive_approx : t -> t -> bool [@@dead "+eq_primitive_approx"] Warning Dead Value @@ -7457,10 +7421,6 @@ File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_print.ml", line 493, characters 0-50 +lambda_to_string is never used and could have side effects - Warning Dead Value With Side Effects - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_print.ml", line 495, characters 0-56 - +primitive_to_string is never used and could have side effects - Warning Dead Module File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_print.mli", line 1, characters 0-0 lam_print is a dead module as all its items are dead. @@ -7489,12 +7449,6 @@ <-- line 31 val lambda_to_string : Lam.t -> string [@@dead "+lambda_to_string"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_print.mli", line 33, characters 0-51 - +primitive_to_string is never used - <-- line 33 - val primitive_to_string : Lam_primitive.t -> string [@@dead "+primitive_to_string"] - Warning Dead Module File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_scc.ml", line 1, characters 0-0 +lam_scc is a dead module as all its items are dead. @@ -14661,4 +14615,4 @@ <-- line 38 val peek_minus : t -> bool [@@dead "+peek_minus"] - Analysis reported 2579 issues (Warning Dead Module:151, Warning Dead Type:265, Warning Dead Value:1908, Warning Dead Value With Side Effects:36, Warning Redundant Optional Argument:195, Warning Unused Argument:24) + Analysis reported 2571 issues (Warning Dead Module:151, Warning Dead Type:259, Warning Dead Value:1907, Warning Dead Value With Side Effects:35, Warning Redundant Optional Argument:195, Warning Unused Argument:24) diff --git a/compiler/core/lam_primitive.ml b/compiler/core/lam_primitive.ml index 45a172aaeba..ac0439907bd 100644 --- a/compiler/core/lam_primitive.ml +++ b/compiler/core/lam_primitive.ml @@ -26,13 +26,6 @@ type ident = Ident.t -type record_representation = - | Record_regular - | Record_inlined of {tag: int; name: string; num_nonconsts: int} - (* Inlined record *) - | Record_extension -(* Inlined record under extension *) - type t = (* Operations on heap blocks *) | Pmakeblock of int * Lam_tag_info.t * Asttypes.mutable_flag diff --git a/compiler/core/lam_primitive.mli b/compiler/core/lam_primitive.mli index 208433856bf..f41c4acc94c 100644 --- a/compiler/core/lam_primitive.mli +++ b/compiler/core/lam_primitive.mli @@ -24,13 +24,6 @@ type ident = Ident.t -type record_representation = - | Record_regular - | Record_inlined of {tag: int; name: string; num_nonconsts: int} - (* Inlined record *) - | Record_extension -(* Inlined record under extension *) - type t = | Pmakeblock of int * Lam_tag_info.t * Asttypes.mutable_flag | Pfield of int * Lambda.field_dbg_info diff --git a/compiler/core/lam_print.ml b/compiler/core/lam_print.ml index de50f6e91ca..9cc41032226 100644 --- a/compiler/core/lam_print.ml +++ b/compiler/core/lam_print.ml @@ -491,5 +491,3 @@ let serialize (filename : string) (lam : Lam.t) : unit = Format.set_margin old let lambda_to_string = Format.asprintf "%a" lambda - -let primitive_to_string = Format.asprintf "%a" primitive diff --git a/compiler/core/lam_print.mli b/compiler/core/lam_print.mli index 383013368f4..f8b6fda4975 100644 --- a/compiler/core/lam_print.mli +++ b/compiler/core/lam_print.mli @@ -29,5 +29,3 @@ val primitive : Format.formatter -> Lam_primitive.t -> unit val serialize : string -> Lam.t -> unit val lambda_to_string : Lam.t -> string - -val primitive_to_string : Lam_primitive.t -> string From 8d41522d70985524672dee44e9b9797cc1d17433 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 13:49:42 +0000 Subject: [PATCH 122/214] dce: note lambda printer liveness --- scripts/dce/live-findings.md | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/scripts/dce/live-findings.md b/scripts/dce/live-findings.md index b183565e6f5..0d31185cb74 100644 --- a/scripts/dce/live-findings.md +++ b/scripts/dce/live-findings.md @@ -462,10 +462,11 @@ live after manual validation. were removed. The remaining entries are cross-module pass plumbing and local helper chains under live pass functions. -### `Lam_compat` aliases and comparisons +### `Lam_compat` aliases, comparisons, and field comments - Report: constructor warnings for `field_dbg_info` and `set_field_dbg_info` in - `compiler/core/lam_compat.ml` / `.mli`, plus comparison helpers. + `compiler/core/lam_compat.ml` / `.mli`, plus comparison helpers and + `str_of_field_info`. - Verdict: live; false positive for the remaining reported entries. - Validation: `Lam_compat.field_dbg_info` and `set_field_dbg_info` are manifest aliases of `Lambda` types. Their constructors are produced in the ML @@ -473,12 +474,30 @@ live after manual validation. consumed by core lowering in `lam_convert.ml`, `lam_util.cppo.ml`, `lam_arity_analysis.ml`, `lam_analysis.ml`, `lam_pass_remove_alias.ml`, `lam_compile.ml`, `lam_print.ml`, `polyvar_pattern_match.ml`, and - `js_of_lam_block.ml`. `cmp_int32` and `cmp_float` are called by `Lam.prim`; - `eq_comparison` is called by `lam_primitive.ml`. + `js_of_lam_block.ml`. `str_of_field_info` is used by `lam_print.ml` and by + `js_of_lam_block.ml` to preserve record-field comments in generated JS. + `cmp_int32` and `cmp_float` are called by `Lam.prim`; `eq_comparison` is + called by `lam_primitive.ml`. - Context: unused `cmp_int` was removed. The remaining constructor warnings come from constructors being built through the aliased `Lambda` type rather than directly through `Lam_compat`. +### `Lam_print` lambda printers + +- Report: `Warning Dead Value` entries in `compiler/core/lam_print.ml` / `.mli`, + including `lambda`, `primitive`, `serialize`, and `lambda_to_string`. +- Verdict: live false positives, except `primitive_to_string`, which had no + callers and was removed. +- Validation: `Lam_group.pp` calls `Lam_print.lambda`, + `lam_util.cppo.ml` calls `Lam_print.serialize`, and + `compiler/jsoo/jsoo_playground_main.ml` calls `Lam_print.lambda_to_string` + when rendering playground lambda output. The `primitive` printer is reached + from the live lambda printer. +- Context: these are debug/inspection printers reached through cross-module and + `.cppo.ml` paths that the DCE report does not root correctly. The playground + call site is not covered by `dune build @check`, so this warning must stay + documented rather than removed. + ### Lambda-to-JS compilation pipeline - Report: `Warning Dead Module` / `Warning Dead Value` clusters in From a684e064742be88008d17be227625fb098147461 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 13:55:04 +0000 Subject: [PATCH 123/214] dce: root unicode test helpers --- _dce/report.txt | 194 +------------------ compiler/frontend/ast_utf8_string_interp.ml | 20 +- compiler/frontend/ast_utf8_string_interp.mli | 18 +- 3 files changed, 25 insertions(+), 207 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index 6dbe05dfd2d..944c3cf5fb1 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -11051,198 +11051,6 @@ <-- line 40 val simple_comparison : string -> bool [@@dead "+simple_comparison"] - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_utf8_string_interp.ml", line 42, characters 2-12 - pos.lnum is a record label never used to read a value - <-- line 42 - lnum: int; [@dead "pos.lnum"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_utf8_string_interp.ml", line 43, characters 2-14 - pos.offset is a record label never used to read a value - <-- line 43 - offset: int; [@dead "pos.offset"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_utf8_string_interp.ml", line 44, characters 2-16 - pos.byte_bol is a record label never used to read a value - <-- line 44 - byte_bol: int; [@dead "pos.byte_bol"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_utf8_string_interp.ml", line 49, characters 16-27 - segment.start is a record label never used to read a value - <-- line 49 - type segment = {start: pos; [@dead "segment.start"] finish: pos; kind: kind; content: string} - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_utf8_string_interp.ml", line 49, characters 28-40 - segment.finish is a record label never used to read a value - <-- line 49 - type segment = {start: pos; [@dead "segment.start"] finish: pos; [@dead "segment.finish"] kind: kind; content: string} - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_utf8_string_interp.ml", line 49, characters 41-52 - segment.kind is a record label never used to read a value - <-- line 49 - type segment = {start: pos; [@dead "segment.start"] finish: pos; [@dead "segment.finish"] kind: kind; [@dead "segment.kind"] content: string} - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_utf8_string_interp.ml", line 65, characters 0-93 - +valid_lead_identifier_char is never used - <-- line 65 - | _ -> false [@@dead "+valid_lead_identifier_char"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_utf8_string_interp.ml", line 71, characters 0-121 - +valid_identifier_char is never used - <-- line 71 - | _ -> false [@@dead "+valid_identifier_char"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_utf8_string_interp.ml", line 76, characters 0-184 - +valid_identifier is never used - <-- line 76 - && Ext_string.for_all_from s 1 valid_identifier_char [@@dead "+valid_identifier"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_utf8_string_interp.ml", line 89, characters 0-57 - +empty_segment is never used - <-- line 89 - let empty_segment {content} = Ext_string.is_empty content [@@dead "+empty_segment"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_utf8_string_interp.ml", line 91, characters 0-123 - +update_newline is never used - <-- line 91 - cxt.byte_bol <- byte_bol [@@dead "+update_newline"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_utf8_string_interp.ml", line 96, characters 0-225 - +pos_error is never used - <-- line 96 - error )) [@@dead "+pos_error"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_utf8_string_interp.ml", line 107, characters 0-520 - +add_var_segment is never used - <-- line 107 - else pos_error cxt ~loc (Invalid_syntax_of_var content) [@@dead "+add_var_segment"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_utf8_string_interp.ml", line 125, characters 0-343 - +add_str_segment is never used - <-- line 125 - cxt.segment_start <- next_loc [@@dead "+add_str_segment"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_utf8_string_interp.ml", line 136, characters 0-1645 - +check_and_transform is never used - <-- line 136 - check_and_transform (loc + 1) s (i' + 1) cxt) [@@dead "+check_and_transform"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_utf8_string_interp.ml", line 182, characters 0-639 - +expect_simple_var is never used - <-- line 182 - check_and_transform loc s (added_length + offset) cxt) [@@dead "+expect_simple_var"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_utf8_string_interp.ml", line 199, characters 0-540 - +expect_var_paren is never used - <-- line 199 - else pos_error cxt ~loc Unmatched_paren [@@dead "+expect_var_paren"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_utf8_string_interp.ml", line 215, characters 0-584 - +escape_code is never used - <-- line 215 - | _ -> pos_error cxt ~loc (Invalid_escape_code cur_char) [@@dead "+escape_code"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_utf8_string_interp.ml", line 231, characters 0-372 - +two_hex is never used - <-- line 231 - else pos_error cxt ~loc Invalid_hex_escape [@@dead "+two_hex"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_utf8_string_interp.ml", line 240, characters 0-548 - +unicode is never used - <-- line 240 - else pos_error cxt ~loc Invalid_unicode_escape [@@dead "+unicode"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_utf8_string_interp.ml", line 256, characters 0-346 - +transform_test is never used - <-- line 256 - List.rev cxt.segments [@@dead "+transform_test"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_utf8_string_interp.ml", line 290, characters 2-41 - Delim.+escaped_back_quote_delimiter is never used - <-- line 290 - let escaped_back_quote_delimiter = "bq" [@@dead "Delim.+escaped_back_quote_delimiter"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_utf8_string_interp.ml", line 337, characters 0-137 - +is_unicode_string is never used - <-- line 337 - || Ext_string.equal opt Delim.escaped_back_quote_delimiter [@@dead "+is_unicode_string"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_utf8_string_interp.mli", line 37, characters 12-22 - pos.lnum is a record label never used to read a value - <-- line 37 - type pos = {lnum: int; [@dead "pos.lnum"] offset: int; byte_bol: int} - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_utf8_string_interp.mli", line 37, characters 23-35 - pos.offset is a record label never used to read a value - <-- line 37 - type pos = {lnum: int; [@dead "pos.lnum"] offset: int; [@dead "pos.offset"] byte_bol: int} - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_utf8_string_interp.mli", line 37, characters 36-49 - pos.byte_bol is a record label never used to read a value - <-- line 37 - type pos = {lnum: int; [@dead "pos.lnum"] offset: int; [@dead "pos.offset"] byte_bol: int [@dead "pos.byte_bol"] } - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_utf8_string_interp.mli", line 40, characters 16-27 - segment.start is a record label never used to read a value - <-- line 40 - type segment = {start: pos; [@dead "segment.start"] finish: pos; kind: kind; content: string} - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_utf8_string_interp.mli", line 40, characters 28-40 - segment.finish is a record label never used to read a value - <-- line 40 - type segment = {start: pos; [@dead "segment.start"] finish: pos; [@dead "segment.finish"] kind: kind; content: string} - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_utf8_string_interp.mli", line 40, characters 41-52 - segment.kind is a record label never used to read a value - <-- line 40 - type segment = {start: pos; [@dead "segment.start"] finish: pos; [@dead "segment.finish"] kind: kind; [@dead "segment.kind"] content: string} - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_utf8_string_interp.mli", line 56, characters 0-35 - +empty_segment is never used - <-- line 56 - val empty_segment : segment -> bool [@@dead "+empty_segment"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_utf8_string_interp.mli", line 57, characters 0-43 - +transform_test is never used - <-- line 57 - val transform_test : string -> segment list [@@dead "+transform_test"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_utf8_string_interp.mli", line 61, characters 0-38 - +is_unicode_string is never used - <-- line 61 - val is_unicode_string : string -> bool [@@dead "+is_unicode_string"] - Warning Dead Type File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/bs_syntaxerr.ml", line 25, characters 24-38 untagged_variant.OnlyOneUnknown is a variant case which is never constructed @@ -14615,4 +14423,4 @@ <-- line 38 val peek_minus : t -> bool [@@dead "+peek_minus"] - Analysis reported 2571 issues (Warning Dead Module:151, Warning Dead Type:259, Warning Dead Value:1907, Warning Dead Value With Side Effects:35, Warning Redundant Optional Argument:195, Warning Unused Argument:24) + Analysis reported 2539 issues (Warning Dead Module:151, Warning Dead Type:247, Warning Dead Value:1887, Warning Dead Value With Side Effects:35, Warning Redundant Optional Argument:195, Warning Unused Argument:24) diff --git a/compiler/frontend/ast_utf8_string_interp.ml b/compiler/frontend/ast_utf8_string_interp.ml index e3e65018a77..af78ac1d059 100644 --- a/compiler/frontend/ast_utf8_string_interp.ml +++ b/compiler/frontend/ast_utf8_string_interp.ml @@ -39,14 +39,19 @@ type kind = String | Var of int * int *) type pos = { - lnum: int; - offset: int; - byte_bol: int; + lnum: int; [@live] + offset: int; [@live] + byte_bol: int; [@live] (* Note it actually needs to be in sync with OCaml's lexing semantics *) } (** Note the position is about code point *) -type segment = {start: pos; finish: pos; kind: kind; content: string} +type segment = { + start: pos; [@live] + finish: pos; [@live] + kind: kind; [@live] + content: string; [@live] +} type segments = segment list type cxt = { @@ -87,6 +92,7 @@ let valid_identifier s = (** Note [Var] kind can not be mpty *) let empty_segment {content} = Ext_string.is_empty content +[@@live] let update_newline ~byte_bol loc cxt = cxt.pos_lnum <- cxt.pos_lnum + 1; @@ -269,6 +275,7 @@ let transform_test s = in check_and_transform 0 s 0 cxt; List.rev cxt.segments +[@@live] module Delim = struct let parse_processed = function @@ -287,7 +294,6 @@ module Delim = struct | _ -> Unrecognized let escaped_j_delimiter = "*j" (* not user level syntax allowed *) - let escaped_back_quote_delimiter = "bq" let some_escaped_back_quote_delimiter = Some "bq" let some_escaped_j_delimiter = Some escaped_j_delimiter end @@ -334,8 +340,4 @@ let transform_pat (p : Parsetree.pattern) s delim : Parsetree.pattern = } | Unrecognized -> p -let is_unicode_string opt = - Ext_string.equal opt Delim.escaped_j_delimiter - || Ext_string.equal opt Delim.escaped_back_quote_delimiter - let parse_processed_delim = Delim.parse_processed diff --git a/compiler/frontend/ast_utf8_string_interp.mli b/compiler/frontend/ast_utf8_string_interp.mli index bc0b13c93ee..e6f4ef15090 100644 --- a/compiler/frontend/ast_utf8_string_interp.mli +++ b/compiler/frontend/ast_utf8_string_interp.mli @@ -34,10 +34,19 @@ type error = private | Unmatched_paren | Invalid_syntax_of_var of string -type pos = {lnum: int; offset: int; byte_bol: int} +type pos = { + lnum: int; [@live] + offset: int; [@live] + byte_bol: int; [@live] +} (** Note the position is about code point *) -type segment = {start: pos; finish: pos; kind: kind; content: string} +type segment = { + start: pos; [@live] + finish: pos; [@live] + kind: kind; [@live] + content: string; [@live] +} type segments = segment list type cxt = { @@ -53,10 +62,9 @@ type cxt = { type exn += Error of pos * pos * error -val empty_segment : segment -> bool -val transform_test : string -> segment list +val empty_segment : segment -> bool [@@live] +val transform_test : string -> segment list [@@live] val transform_exp : Parsetree.expression -> string -> string -> Parsetree.expression val transform_pat : Parsetree.pattern -> string -> string -> Parsetree.pattern -val is_unicode_string : string -> bool val parse_processed_delim : string option -> External_arg_spec.delim option From 9fdf5f4786d568a7fb356f8a0e073e3841b6ea2e Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 13:55:08 +0000 Subject: [PATCH 124/214] dce: note primitive module liveness --- scripts/dce/live-findings.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/scripts/dce/live-findings.md b/scripts/dce/live-findings.md index 0d31185cb74..9438bbfc8a7 100644 --- a/scripts/dce/live-findings.md +++ b/scripts/dce/live-findings.md @@ -245,6 +245,21 @@ live after manual validation. The survivors are cross-module or alias-qualified uses that DCE reports as unrooted. +### `Primitive_modules` runtime module names + +- Report: `Warning Dead Value`, `compiler/ext/primitive_modules.ml`, for runtime + module-name constants such as `bool`, `int`, `float`, `bigint`, `string`, + `array`, `object_`, `hash`, and `exceptions`. +- Verdict: live; false positive for the reported constants. +- Validation: these names are used directly by lambda and JS lowering. Examples + include `lam_compile_primitive.ml` for primitive runtime calls, + `js_exp_make.ml` for checked integer/bigint operations and exception + creation, and `js_of_lam_option.ml` for option runtime helpers. Syntax and ML + frontend code also uses the same module-name table for dictionary, promise, + module, pervasives, and utility paths. +- Context: Reanalyze misses the cross-module roots even though these constants + determine generated runtime import names. + ### `Ext_list` production helpers - Report: remaining `Warning Dead Value` entries in From e7a1e9c2adf40c55f92128a49ce1e9db8183c122 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 13:56:35 +0000 Subject: [PATCH 125/214] dce: trim syntax CLI colors --- _dce/report.txt | 50 +--------------------------------- compiler/syntax/cli/res_cli.ml | 33 ++++------------------ 2 files changed, 7 insertions(+), 76 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index 944c3cf5fb1..a5a5e31bf6d 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -14315,54 +14315,6 @@ <-- line 211 val hash : t -> int [@@dead "Type_ops.+hash"] - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/syntax/cli/res_cli.ml", line 30, characters 4-11 - Color.color.Black is a variant case which is never constructed - <-- line 30 - | Black [@dead "Color.color.Black"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/syntax/cli/res_cli.ml", line 32, characters 4-11 - Color.color.Green is a variant case which is never constructed - <-- line 32 - | Green [@dead "Color.color.Green"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/syntax/cli/res_cli.ml", line 34, characters 4-10 - Color.color.Blue is a variant case which is never constructed - <-- line 34 - | Blue [@dead "Color.color.Blue"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/syntax/cli/res_cli.ml", line 37, characters 4-11 - Color.color.White is a variant case which is never constructed - <-- line 37 - | White [@dead "Color.color.White"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/syntax/cli/res_cli.ml", line 41, characters 4-17 - Color.style.BG is a variant case which is never constructed - <-- line 41 - | BG of color [@dead "Color.style.BG"] (* background *) - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/syntax/cli/res_cli.ml", line 135, characters 33-37 - Color.setting.Auto is a variant case which is never constructed - <-- line 135 - type[@warning "-37"] setting = Auto [@dead "Color.setting.Auto"] | Always | Never - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/syntax/cli/res_cli.ml", line 135, characters 38-46 - Color.setting.Always is a variant case which is never constructed - <-- line 135 - type[@warning "-37"] setting = Auto [@dead "Color.setting.Auto"] | Always [@dead "Color.setting.Always"] | Never - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/syntax/cli/res_cli.ml", line 135, characters 47-54 - Color.setting.Never is a variant case which is never constructed - <-- line 135 - type[@warning "-37"] setting = Auto [@dead "Color.setting.Auto"] | Always [@dead "Color.setting.Always"] | Never [@dead "Color.setting.Never"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/syntax/src/res_comments_table.ml", line 27, characters 0-116 +list_last is never used @@ -14423,4 +14375,4 @@ <-- line 38 val peek_minus : t -> bool [@@dead "+peek_minus"] - Analysis reported 2539 issues (Warning Dead Module:151, Warning Dead Type:247, Warning Dead Value:1887, Warning Dead Value With Side Effects:35, Warning Redundant Optional Argument:195, Warning Unused Argument:24) + Analysis reported 2531 issues (Warning Dead Module:151, Warning Dead Type:239, Warning Dead Value:1887, Warning Dead Value With Side Effects:35, Warning Redundant Optional Argument:195, Warning Unused Argument:24) diff --git a/compiler/syntax/cli/res_cli.ml b/compiler/syntax/cli/res_cli.ml index 17234927076..2b8c04f9d1a 100644 --- a/compiler/syntax/cli/res_cli.ml +++ b/compiler/syntax/cli/res_cli.ml @@ -26,36 +26,22 @@ *) module Color = struct (* use ANSI color codes, see https://en.wikipedia.org/wiki/ANSI_escape_code *) - type[@warning "-37"] color = - | Black - | Red - | Green - | Yellow - | Blue - | Magenta - | Cyan - | White - - type[@warning "-37"] style = + type color = Red | Yellow | Magenta | Cyan + + type style = | FG of color (* foreground *) - | BG of color (* background *) | Bold | Reset | Dim let ansi_of_color = function - | Black -> "0" | Red -> "1" - | Green -> "2" | Yellow -> "3" - | Blue -> "4" | Magenta -> "5" | Cyan -> "6" - | White -> "7" let code_of_style = function | FG c -> "3" ^ ansi_of_color c - | BG c -> "4" ^ ansi_of_color c | Bold -> "1" | Reset -> "0" | Dim -> "2" @@ -132,25 +118,18 @@ module Color = struct let term = try Sys.getenv "TERM" with Not_found -> "" in term <> "dumb" && term <> "" && isatty stderr - type[@warning "-37"] setting = Auto | Always | Never - let setup = let first = ref true in (* initialize only once *) let formatter_l = [Format.std_formatter; Format.err_formatter; Format.str_formatter] in - fun o -> + fun () -> if !first then ( first := false; Format.set_mark_tags true; List.iter set_color_tag_handling formatter_l; - color_enabled := - match o with - | Some Always -> true - | Some Auto -> should_enable_color () - | Some Never -> false - | None -> should_enable_color ()); + color_enabled := should_enable_color ()); () end @@ -257,7 +236,7 @@ module Cli_arg_processor = struct let (Parser backend) = parsing_engine in (* This is the whole purpose of the Color module above *) - Color.setup None; + Color.setup (); (* Special case for tokens - bypass parsing entirely *) if target = "tokens" then From 2681f9a84a9148dbe7393994cb79e8b7f8f307ec Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 14:08:00 +0000 Subject: [PATCH 126/214] dce: trim syntax helpers --- _dce/report.txt | 38 +------------------- compiler/syntax/src/res_comments_table.ml | 5 --- compiler/syntax/src/res_core.ml | 10 ++---- compiler/syntax/src/res_parsetree_viewer.mli | 2 -- compiler/syntax/src/res_scanner.ml | 1 - compiler/syntax/src/res_scanner.mli | 3 -- 6 files changed, 4 insertions(+), 55 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index a5a5e31bf6d..54eb42a6fa0 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -14315,18 +14315,6 @@ <-- line 211 val hash : t -> int [@@dead "Type_ops.+hash"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/syntax/src/res_comments_table.ml", line 27, characters 0-116 - +list_last is never used - <-- line 27 - | _ :: rest -> list_last rest [@@dead "+list_last"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/syntax/src/res_core.ml", line 394, characters 6-149 - +_async is never used - <-- line 394 - | _ -> false [@@dead "+_async"] - Warning Dead Type File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/syntax/src/res_driver.ml", line 40, characters 2-145 print_engine.print_implementation_from_source is a record label never used to read a value @@ -14350,29 +14338,5 @@ print_engine.print_interface_from_source is a record label never used to read a value <-- line 64 unit; [@dead "print_engine.print_interface_from_source"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/syntax/src/res_parsetree_viewer.mli", line 20, characters 0-60 - +has_dict_spread_attribute is never used - <-- line 20 - val has_dict_spread_attribute : Parsetree.attributes -> bool [@@dead "+has_dict_spread_attribute"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/syntax/src/res_parsetree_viewer.mli", line 74, characters 0-39 - +is_binary_operator is never used - <-- line 74 - val is_binary_operator : string -> bool [@@dead "+is_binary_operator"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/syntax/src/res_scanner.ml", line 151, characters 0-46 - +peek_minus is never used - <-- line 151 - let peek_minus scanner = peek_char scanner '-' [@@dead "+peek_minus"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/syntax/src/res_scanner.mli", line 38, characters 0-26 - +peek_minus is never used - <-- line 38 - val peek_minus : t -> bool [@@dead "+peek_minus"] - Analysis reported 2531 issues (Warning Dead Module:151, Warning Dead Type:239, Warning Dead Value:1887, Warning Dead Value With Side Effects:35, Warning Redundant Optional Argument:195, Warning Unused Argument:24) + Analysis reported 2525 issues (Warning Dead Module:151, Warning Dead Type:239, Warning Dead Value:1881, Warning Dead Value With Side Effects:35, Warning Redundant Optional Argument:195, Warning Unused Argument:24) diff --git a/compiler/syntax/src/res_comments_table.ml b/compiler/syntax/src/res_comments_table.ml index 9741d3ece62..6826d22a312 100644 --- a/compiler/syntax/src/res_comments_table.ml +++ b/compiler/syntax/src/res_comments_table.ml @@ -24,11 +24,6 @@ let copy tbl = let empty = make () -let rec list_last = function - | [] -> failwith "list_last: empty list" - | [x] -> x - | _ :: rest -> list_last rest - let print_location (k : Warnings.loc) = Doc.concat [ diff --git a/compiler/syntax/src/res_core.ml b/compiler/syntax/src/res_core.ml index 95157d44908..448972b7010 100644 --- a/compiler/syntax/src/res_core.ml +++ b/compiler/syntax/src/res_core.ml @@ -391,13 +391,9 @@ let rec go_to_closing closing_token state = (* Madness *) let is_es6_arrow_expression ~in_ternary p = Parser.lookahead p (fun state -> - let _async = - match state.Parser.token with - | Lident "async" -> - Parser.next state; - true - | _ -> false - in + (match state.Parser.token with + | Lident "async" -> Parser.next state + | _ -> ()); match state.Parser.token with | Lident _ | Underscore -> ( Parser.next state; diff --git a/compiler/syntax/src/res_parsetree_viewer.mli b/compiler/syntax/src/res_parsetree_viewer.mli index 8d4536717fe..0a7b334b538 100644 --- a/compiler/syntax/src/res_parsetree_viewer.mli +++ b/compiler/syntax/src/res_parsetree_viewer.mli @@ -17,7 +17,6 @@ val has_await_attribute : Parsetree.attributes -> bool val has_inline_record_definition_attribute : Parsetree.attributes -> bool val has_res_pat_variant_spread_attribute : Parsetree.attributes -> bool val has_dict_pattern_attribute : Parsetree.attributes -> bool -val has_dict_spread_attribute : Parsetree.attributes -> bool type dict_expr_part = | DictExprRows of Parsetree.expression @@ -71,7 +70,6 @@ val operator_precedence : string -> int val not_ghost_operator : string -> Location.t -> bool val is_unary_expression : Parsetree.expression -> bool -val is_binary_operator : string -> bool val is_binary_expression : Parsetree.expression -> bool val is_rhs_binary_operator : string -> bool val is_equality_operator : string -> bool diff --git a/compiler/syntax/src/res_scanner.ml b/compiler/syntax/src/res_scanner.ml index 82fbeb533bf..67be55fdc5d 100644 --- a/compiler/syntax/src/res_scanner.ml +++ b/compiler/syntax/src/res_scanner.ml @@ -148,7 +148,6 @@ let peek_char scanner target_char = in skip_whitespace_and_check scanner.offset -let peek_minus scanner = peek_char scanner '-' let peek_slash scanner = peek_char scanner '/' let make ~filename src = diff --git a/compiler/syntax/src/res_scanner.mli b/compiler/syntax/src/res_scanner.mli index cbb78fad4bd..df5273c5b39 100644 --- a/compiler/syntax/src/res_scanner.mli +++ b/compiler/syntax/src/res_scanner.mli @@ -34,8 +34,5 @@ val scan_template_literal_token : val scan_regex : t -> Lexing.position * Lexing.position * Res_token.t -(* Look ahead to see if the next non-whitespace character is a minus *) -val peek_minus : t -> bool - (* Look ahead to see if the next non-whitespace character is a slash *) val peek_slash : t -> bool From 281bb82d881ae77b5d89792839da8f0270115d6f Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 14:10:34 +0000 Subject: [PATCH 127/214] dce: trim syntax print engine --- _dce/report.txt | 30 ++------------------ compiler/syntax/src/res_ast_debugger.ml | 22 -------------- compiler/syntax/src/res_driver.ml | 19 ------------- compiler/syntax/src/res_driver.mli | 12 -------- compiler/syntax/src/res_driver_binary.ml | 10 ------- compiler/syntax/src/res_driver_ml_printer.ml | 6 ---- compiler/syntax/src/res_token_debugger.ml | 8 +----- 7 files changed, 4 insertions(+), 103 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index 54eb42a6fa0..332a5dde9a9 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -772,11 +772,11 @@ optional argument type_arg_context of function +instantiate_type2 is never used Warning Redundant Optional Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/syntax/src/res_driver.ml", line 211, characters 0-399 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/syntax/src/res_driver.ml", line 192, characters 0-399 optional argument ignore_parse_errors of function +parse_interface is always supplied (1 calls) Warning Redundant Optional Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/syntax/src/res_driver.ml", line 200, characters 0-409 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/syntax/src/res_driver.ml", line 181, characters 0-409 optional argument ignore_parse_errors of function +parse_implementation is always supplied (1 calls) Warning Unused Argument @@ -14314,29 +14314,5 @@ Type_ops.+hash is never used <-- line 211 val hash : t -> int [@@dead "Type_ops.+hash"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/syntax/src/res_driver.ml", line 40, characters 2-145 - print_engine.print_implementation_from_source is a record label never used to read a value - <-- line 40 - unit; [@dead "print_engine.print_implementation_from_source"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/syntax/src/res_driver.ml", line 52, characters 2-140 - print_engine.print_interface_from_source is a record label never used to read a value - <-- line 52 - unit; [@dead "print_engine.print_interface_from_source"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/syntax/src/res_driver.mli", line 52, characters 2-145 - print_engine.print_implementation_from_source is a record label never used to read a value - <-- line 52 - unit; [@dead "print_engine.print_implementation_from_source"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/syntax/src/res_driver.mli", line 64, characters 2-140 - print_engine.print_interface_from_source is a record label never used to read a value - <-- line 64 - unit; [@dead "print_engine.print_interface_from_source"] - Analysis reported 2525 issues (Warning Dead Module:151, Warning Dead Type:239, Warning Dead Value:1881, Warning Dead Value With Side Effects:35, Warning Redundant Optional Argument:195, Warning Unused Argument:24) + Analysis reported 2521 issues (Warning Dead Module:151, Warning Dead Type:235, Warning Dead Value:1881, Warning Dead Value With Side Effects:35, Warning Redundant Optional Argument:195, Warning Unused Argument:24) diff --git a/compiler/syntax/src/res_ast_debugger.ml b/compiler/syntax/src/res_ast_debugger.ml index ff5b1a42c1c..2c49968c844 100644 --- a/compiler/syntax/src/res_ast_debugger.ml +++ b/compiler/syntax/src/res_ast_debugger.ml @@ -7,15 +7,9 @@ let print_engine = print_implementation = (fun ~width:_ ~filename:_ ~comments:_ structure -> Printast.implementation Format.std_formatter structure); - print_implementation_from_source = - (fun ~width:_ ~source:_ ~comments:_ structure -> - Printast.implementation Format.std_formatter structure); print_interface = (fun ~width:_ ~filename:_ ~comments:_ signature -> Printast.interface Format.std_formatter signature); - print_interface_from_source = - (fun ~width:_ ~source:_ ~comments:_ signature -> - Printast.interface Format.std_formatter signature); } module Sexp : sig @@ -968,15 +962,9 @@ module Sexp_ast = struct print_implementation = (fun ~width:_ ~filename:_ ~comments:_ parsetree -> parsetree |> structure |> Sexp.to_string |> print_string); - print_implementation_from_source = - (fun ~width:_ ~source:_ ~comments:_ parsetree -> - parsetree |> structure |> Sexp.to_string |> print_string); print_interface = (fun ~width:_ ~filename:_ ~comments:_ parsetree -> parsetree |> signature |> Sexp.to_string |> print_string); - print_interface_from_source = - (fun ~width:_ ~source:_ ~comments:_ parsetree -> - parsetree |> signature |> Sexp.to_string |> print_string); } end @@ -989,19 +977,9 @@ let comments_print_engine = let cmt_tbl = Comment_table.make () in Comment_table.walk_structure s cmt_tbl comments; Comment_table.log cmt_tbl); - Res_driver.print_implementation_from_source = - (fun ~width:_ ~source:_ ~comments s -> - let cmt_tbl = Comment_table.make () in - Comment_table.walk_structure s cmt_tbl comments; - Comment_table.log cmt_tbl); Res_driver.print_interface = (fun ~width:_ ~filename:_ ~comments s -> let cmt_tbl = Comment_table.make () in Comment_table.walk_signature s cmt_tbl comments; Comment_table.log cmt_tbl); - Res_driver.print_interface_from_source = - (fun ~width:_ ~source:_ ~comments s -> - let cmt_tbl = Comment_table.make () in - Comment_table.walk_signature s cmt_tbl comments; - Comment_table.log cmt_tbl); } diff --git a/compiler/syntax/src/res_driver.ml b/compiler/syntax/src/res_driver.ml index eddb55a1f27..b9d38dd9e69 100644 --- a/compiler/syntax/src/res_driver.ml +++ b/compiler/syntax/src/res_driver.ml @@ -37,24 +37,12 @@ type print_engine = { comments:Res_comment.t list -> Parsetree.structure -> unit; - print_implementation_from_source: - width:int -> - source:string -> - comments:Res_comment.t list -> - Parsetree.structure -> - unit; print_interface: width:int -> filename:string -> comments:Res_comment.t list -> Parsetree.signature -> unit; - print_interface_from_source: - width:int -> - source:string -> - comments:Res_comment.t list -> - Parsetree.signature -> - unit; } let setup ~filename ~for_printer () = @@ -185,16 +173,9 @@ let print_engine = (fun ~width ~filename:_ ~comments structure -> print_string (Res_printer.print_implementation ~width structure ~comments)); - print_implementation_from_source = - (fun ~width ~source:_ ~comments structure -> - print_string - (Res_printer.print_implementation ~width structure ~comments)); print_interface = (fun ~width ~filename:_ ~comments signature -> print_string (Res_printer.print_interface ~width signature ~comments)); - print_interface_from_source = - (fun ~width ~source:_ ~comments signature -> - print_string (Res_printer.print_interface ~width signature ~comments)); } let parse_implementation ?(ignore_parse_errors = false) sourcefile = diff --git a/compiler/syntax/src/res_driver.mli b/compiler/syntax/src/res_driver.mli index 4d6feb13de6..1b24bef757e 100644 --- a/compiler/syntax/src/res_driver.mli +++ b/compiler/syntax/src/res_driver.mli @@ -49,24 +49,12 @@ type print_engine = { comments:Res_comment.t list -> Parsetree.structure -> unit; - print_implementation_from_source: - width:int -> - source:string -> - comments:Res_comment.t list -> - Parsetree.structure -> - unit; print_interface: width:int -> filename:string -> comments:Res_comment.t list -> Parsetree.signature -> unit; - print_interface_from_source: - width:int -> - source:string -> - comments:Res_comment.t list -> - Parsetree.signature -> - unit; } val parsing_engine : Res_diagnostics.t list parsing_engine diff --git a/compiler/syntax/src/res_driver_binary.ml b/compiler/syntax/src/res_driver_binary.ml index b6c9318d5cc..71eb12bd483 100644 --- a/compiler/syntax/src/res_driver_binary.ml +++ b/compiler/syntax/src/res_driver_binary.ml @@ -6,19 +6,9 @@ let print_engine = output_string stdout Config.ast_impl_magic_number; output_value stdout filename; output_value stdout structure); - print_implementation_from_source = - (fun ~width:_ ~source:_ ~comments:_ structure -> - output_string stdout Config.ast_impl_magic_number; - output_value stdout "source"; - output_value stdout structure); print_interface = (fun ~width:_ ~filename ~comments:_ signature -> output_string stdout Config.ast_intf_magic_number; output_value stdout filename; output_value stdout signature); - print_interface_from_source = - (fun ~width:_ ~source:_ ~comments:_ signature -> - output_string stdout Config.ast_intf_magic_number; - output_value stdout "source"; - output_value stdout signature); } diff --git a/compiler/syntax/src/res_driver_ml_printer.ml b/compiler/syntax/src/res_driver_ml_printer.ml index 232e328bf15..651ab058402 100644 --- a/compiler/syntax/src/res_driver_ml_printer.ml +++ b/compiler/syntax/src/res_driver_ml_printer.ml @@ -4,13 +4,7 @@ let print_engine = print_implementation = (fun ~width:_ ~filename:_ ~comments:_ structure -> Pprintast.structure Format.std_formatter structure); - print_implementation_from_source = - (fun ~width:_ ~source:_ ~comments:_ structure -> - Pprintast.structure Format.std_formatter structure); print_interface = (fun ~width:_ ~filename:_ ~comments:_ signature -> Pprintast.signature Format.std_formatter signature); - print_interface_from_source = - (fun ~width:_ ~source:_ ~comments:_ signature -> - Pprintast.signature Format.std_formatter signature); } diff --git a/compiler/syntax/src/res_token_debugger.ml b/compiler/syntax/src/res_token_debugger.ml index ff164ff4ae2..96e5a68ee6f 100644 --- a/compiler/syntax/src/res_token_debugger.ml +++ b/compiler/syntax/src/res_token_debugger.ml @@ -1,4 +1,4 @@ -type input = Filename of string | Source of string +type input = Filename of string let dump_tokens input = let src = @@ -13,13 +13,11 @@ let dump_tokens input = Printf.printf "Error reading file %s: %s\n" filename (Printexc.to_string e); exit 1) - | Source code -> code in let filename = match input with | Filename filename -> filename - | Source _ -> "" in let scanner = Res_scanner.make ~filename src in @@ -152,10 +150,6 @@ let token_print_engine = { Res_driver.print_implementation = (fun ~width:_ ~filename ~comments:_ _ -> dump_tokens (Filename filename)); - Res_driver.print_implementation_from_source = - (fun ~width:_ ~source ~comments:_ _ -> dump_tokens (Source source)); Res_driver.print_interface = (fun ~width:_ ~filename ~comments:_ _ -> dump_tokens (Filename filename)); - Res_driver.print_interface_from_source = - (fun ~width:_ ~source ~comments:_ _ -> dump_tokens (Source source)); } From 575c5db759128e2e4d94c848e3f6c6e63e7e1689 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 14:12:19 +0000 Subject: [PATCH 128/214] dce: trim unused ext helpers --- _dce/report.txt | 26 +------------------------- compiler/ext/ext_digest.ml | 2 -- compiler/ext/ext_digest.mli | 2 -- compiler/ext/ext_io.ml | 3 --- compiler/ext/ext_io.mli | 2 -- 5 files changed, 1 insertion(+), 34 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index 332a5dde9a9..99936f01fe9 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -8055,18 +8055,6 @@ <-- line 29 val is_lower_case : char -> bool [@@dead "+is_lower_case"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_digest.ml", line 27, characters 0-19 - +hex_length is never used - <-- line 27 - let hex_length = 32 [@@dead "+hex_length"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_digest.mli", line 27, characters 0-20 - +hex_length is never used - <-- line 27 - val hex_length : int [@@dead "+hex_length"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_filename.ml", line 31, characters 0-259 +chop_extension_maybe is never used @@ -8335,18 +8323,6 @@ <-- line 37 val int32_pow : int32 -> int32 -> int32 [@@dead "+int32_pow"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_io.ml", line 43, characters 0-107 - +rev_lines_of_file is never used - <-- line 43 - Ext_pervasives.finally ~clean:close_in (open_in_bin file) rev_lines_of_chann [@@dead "+rev_lines_of_file"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_io.mli", line 27, characters 0-45 - +rev_lines_of_file is never used - <-- line 27 - val rev_lines_of_file : string -> string list [@@dead "+rev_lines_of_file"] - Warning Dead Module File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_js_file_kind.ml", line 1, characters 0-0 +ext_js_file_kind is a dead module as all its items are dead. @@ -14315,4 +14291,4 @@ <-- line 211 val hash : t -> int [@@dead "Type_ops.+hash"] - Analysis reported 2521 issues (Warning Dead Module:151, Warning Dead Type:235, Warning Dead Value:1881, Warning Dead Value With Side Effects:35, Warning Redundant Optional Argument:195, Warning Unused Argument:24) + Analysis reported 2517 issues (Warning Dead Module:151, Warning Dead Type:235, Warning Dead Value:1877, Warning Dead Value With Side Effects:35, Warning Redundant Optional Argument:195, Warning Unused Argument:24) diff --git a/compiler/ext/ext_digest.ml b/compiler/ext/ext_digest.ml index b2143a3bba5..a0a53e599f4 100644 --- a/compiler/ext/ext_digest.ml +++ b/compiler/ext/ext_digest.ml @@ -23,5 +23,3 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *) let length = 16 - -let hex_length = 32 diff --git a/compiler/ext/ext_digest.mli b/compiler/ext/ext_digest.mli index 150f643444c..2f1808a79be 100644 --- a/compiler/ext/ext_digest.mli +++ b/compiler/ext/ext_digest.mli @@ -23,5 +23,3 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *) val length : int - -val hex_length : int diff --git a/compiler/ext/ext_io.ml b/compiler/ext/ext_io.ml index ffb84a49d93..0ba82d5fc28 100644 --- a/compiler/ext/ext_io.ml +++ b/compiler/ext/ext_io.ml @@ -40,9 +40,6 @@ let rev_lines_of_chann chan = in loop [] chan -let rev_lines_of_file file = - Ext_pervasives.finally ~clean:close_in (open_in_bin file) rev_lines_of_chann - let write_file f content = Ext_pervasives.finally ~clean:close_out (open_out_bin f) (fun oc -> output_string oc content) diff --git a/compiler/ext/ext_io.mli b/compiler/ext/ext_io.mli index edbebfca7cd..17edaaf379d 100644 --- a/compiler/ext/ext_io.mli +++ b/compiler/ext/ext_io.mli @@ -24,8 +24,6 @@ val load_file : string -> string -val rev_lines_of_file : string -> string list - val rev_lines_of_chann : in_channel -> string list val write_file : string -> string -> unit From 4725b5ecc595073fa8c6719fcd9471dd53fde1a1 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 14:13:40 +0000 Subject: [PATCH 129/214] dce: remove ext stats formatter --- _dce/report.txt | 14 +------------- compiler/ext/ext_util.ml | 8 -------- compiler/ext/ext_util.mli | 2 -- 3 files changed, 1 insertion(+), 23 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index 99936f01fe9..957beeb0fbc 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -9121,24 +9121,12 @@ <-- line 31 else power_2_above (x * 2) n [@@dead "+power_2_above"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_util.ml", line 36, characters 0-324 - +stats_to_string is never used - <-- line 36 - (Array.to_list (Array.map string_of_int bucket_histogram))) [@@dead "+stats_to_string"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_util.mli", line 25, characters 0-37 +power_2_above is never used <-- line 25 val power_2_above : int -> int -> int [@@dead "+power_2_above"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_util.mli", line 27, characters 0-50 - +stats_to_string is never used - <-- line 27 - val stats_to_string : Hashtbl.statistics -> string [@@dead "+stats_to_string"] - Warning Dead Type File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_gen.ml", line 21, characters 2-78 bucket.Cons is a variant case which is never constructed @@ -14291,4 +14279,4 @@ <-- line 211 val hash : t -> int [@@dead "Type_ops.+hash"] - Analysis reported 2517 issues (Warning Dead Module:151, Warning Dead Type:235, Warning Dead Value:1877, Warning Dead Value With Side Effects:35, Warning Redundant Optional Argument:195, Warning Unused Argument:24) + Analysis reported 2515 issues (Warning Dead Module:151, Warning Dead Type:235, Warning Dead Value:1875, Warning Dead Value With Side Effects:35, Warning Redundant Optional Argument:195, Warning Unused Argument:24) diff --git a/compiler/ext/ext_util.ml b/compiler/ext/ext_util.ml index 58b8ad2a177..0b6ca038895 100644 --- a/compiler/ext/ext_util.ml +++ b/compiler/ext/ext_util.ml @@ -33,14 +33,6 @@ let rec power_2_above x n = else if x * 2 > Sys.max_array_length then x else power_2_above (x * 2) n -let stats_to_string - ({num_bindings; num_buckets; max_bucket_length; bucket_histogram} : - Hashtbl.statistics) = - Printf.sprintf "bindings: %d,buckets: %d, longest: %d, hist:[%s]" num_bindings - num_buckets max_bucket_length - (String.concat "," - (Array.to_list (Array.map string_of_int bucket_histogram))) - let string_of_int_as_char (i : int) : string = if i <= 255 && i >= 0 then Format.asprintf "%C" (Char.unsafe_chr i) else diff --git a/compiler/ext/ext_util.mli b/compiler/ext/ext_util.mli index 720e5b19b24..ab641063ef3 100644 --- a/compiler/ext/ext_util.mli +++ b/compiler/ext/ext_util.mli @@ -24,6 +24,4 @@ val power_2_above : int -> int -> int -val stats_to_string : Hashtbl.statistics -> string - val string_of_int_as_char : int -> string From 61ef8a9732cc7e3576c0e278437c4a50b9d173cb Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 14:13:47 +0000 Subject: [PATCH 130/214] dce: note ext util liveness --- scripts/dce/live-findings.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/scripts/dce/live-findings.md b/scripts/dce/live-findings.md index 9438bbfc8a7..4e6cc81a5ca 100644 --- a/scripts/dce/live-findings.md +++ b/scripts/dce/live-findings.md @@ -260,6 +260,18 @@ live after manual validation. - Context: Reanalyze misses the cross-module roots even though these constants determine generated runtime import names. +### `Ext_util` table helpers + +- Report: `Warning Dead Value`, `compiler/ext/ext_util.ml` / `.mli`, for + `power_2_above`. +- Verdict: live; false positive. +- Validation: `Ext_util.power_2_above` sizes compiler hash tables in + `hash_gen.ml`, `hash_set_gen.ml`, `hash_set_ident_mask.ml`, and + `ordered_hash_map_gen.ml`. `string_of_int_as_char` is also live through + `lam_print.ml`, `js_dump.ml`, and `pprintast.ml`. +- Context: the truly unused `stats_to_string` debug helper was removed. The + remaining warning is a cross-module utility edge missed by DCE. + ### `Ext_list` production helpers - Report: remaining `Warning Dead Value` entries in From 28659d3c6f4812e73ce340bc01e2c8698d71f102 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 14:15:13 +0000 Subject: [PATCH 131/214] dce: root utf8 test helper --- _dce/report.txt | 26 +------------------------- compiler/ext/ext_utf8.ml | 1 + compiler/ext/ext_utf8.mli | 4 +--- 3 files changed, 3 insertions(+), 28 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index 957beeb0fbc..3997ac7d985 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -9091,30 +9091,6 @@ <-- line 27 val is_windows_or_cygwin : bool [@@dead "+is_windows_or_cygwin"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_utf8.ml", line 64, characters 0-250 - +follow is never used - <-- line 64 - | _ -> raise (Invalid_utf8 "Continuation byte expected") [@@dead "+follow"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_utf8.ml", line 80, characters 0-580 - +decode_utf8_string is never used - <-- line 80 - List.rev !lst [@@dead "+decode_utf8_string"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_utf8.mli", line 29, characters 0-53 - +follow is never used - <-- line 29 - val follow : string -> int -> int -> int -> int * int [@@dead "+follow"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_utf8.mli", line 38, characters 0-43 - +decode_utf8_string is never used - <-- line 38 - val decode_utf8_string : string -> int list [@@dead "+decode_utf8_string"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_util.ml", line 31, characters 0-123 +power_2_above is never used @@ -14279,4 +14255,4 @@ <-- line 211 val hash : t -> int [@@dead "Type_ops.+hash"] - Analysis reported 2515 issues (Warning Dead Module:151, Warning Dead Type:235, Warning Dead Value:1875, Warning Dead Value With Side Effects:35, Warning Redundant Optional Argument:195, Warning Unused Argument:24) + Analysis reported 2511 issues (Warning Dead Module:151, Warning Dead Type:235, Warning Dead Value:1871, Warning Dead Value With Side Effects:35, Warning Redundant Optional Argument:195, Warning Unused Argument:24) diff --git a/compiler/ext/ext_utf8.ml b/compiler/ext/ext_utf8.ml index 04846c1e527..7edd8aed3a0 100644 --- a/compiler/ext/ext_utf8.ml +++ b/compiler/ext/ext_utf8.ml @@ -96,6 +96,7 @@ let decode_utf8_string s = in decode_utf8_cont s 0 (String.length s); List.rev !lst +[@@live] (** To decode {j||j} we need verify in the ast so that we have better error location, then we do the decode later diff --git a/compiler/ext/ext_utf8.mli b/compiler/ext/ext_utf8.mli index e1beadec594..a72256f1671 100644 --- a/compiler/ext/ext_utf8.mli +++ b/compiler/ext/ext_utf8.mli @@ -26,8 +26,6 @@ type byte = Single of int | Cont of int | Leading of int * int | Invalid val classify : char -> byte -val follow : string -> int -> int -> int -> int * int - val next : string -> remaining:int -> int -> int (** return [-1] if failed @@ -35,6 +33,6 @@ val next : string -> remaining:int -> int -> int exception Invalid_utf8 of string -val decode_utf8_string : string -> int list +val decode_utf8_string : string -> int list [@@live] val encode_codepoint : int -> string From 8b7d7109d748f410f4d4d4c820876fa6fb05f672 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 14:16:34 +0000 Subject: [PATCH 132/214] dce: trim JS reserved map --- _dce/report.txt | 8 +------- compiler/ext/js_reserved_map.cppo.ml | 21 --------------------- compiler/ext/js_reserved_map.mli | 2 -- 3 files changed, 1 insertion(+), 30 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index 3997ac7d985..23ee407bb25 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -9575,12 +9575,6 @@ File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/int_vec_vec.ml", line 28, characters 2-29 +null is never used and could have side effects - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/js_reserved_map.mli", line 27, characters 0-39 - +is_js_special_word is never used - <-- line 27 - val is_js_special_word : string -> bool [@@dead "+is_js_special_word"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 25, characters 0-29 +js_type_number is never used @@ -14255,4 +14249,4 @@ <-- line 211 val hash : t -> int [@@dead "Type_ops.+hash"] - Analysis reported 2511 issues (Warning Dead Module:151, Warning Dead Type:235, Warning Dead Value:1871, Warning Dead Value With Side Effects:35, Warning Redundant Optional Argument:195, Warning Unused Argument:24) + Analysis reported 2510 issues (Warning Dead Module:151, Warning Dead Type:235, Warning Dead Value:1870, Warning Dead Value With Side Effects:35, Warning Redundant Optional Argument:195, Warning Unused Argument:24) diff --git a/compiler/ext/js_reserved_map.cppo.ml b/compiler/ext/js_reserved_map.cppo.ml index 6daaff97601..53ecb3c3154 100644 --- a/compiler/ext/js_reserved_map.cppo.ml +++ b/compiler/ext/js_reserved_map.cppo.ml @@ -113,27 +113,6 @@ let js_keywords = STbl.of_array [| let is_js_keyword s = STbl.mem js_keywords s -(** Identifiers with special meanings. - - They can have different meanings depending on the context when used as identifier names, so it should be done carefully. - - See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar#identifiers_with_special_meanings - - However, these names are actually used with no problems today. (Except `arguments` and `eval`) - *) -let js_special_words = STbl.of_array [| - "arguments"; - "as"; - "async"; - "eval"; - "from"; - "get"; - "of"; - "set"; -|] - -let is_js_special_word s = STbl.mem js_special_words s - (** Identifier names _might_ need to care about *) let js_globals = STbl.of_array [| (* JavaScript standards built-ins diff --git a/compiler/ext/js_reserved_map.mli b/compiler/ext/js_reserved_map.mli index 5ee19826fae..25b0e10fd19 100644 --- a/compiler/ext/js_reserved_map.mli +++ b/compiler/ext/js_reserved_map.mli @@ -24,6 +24,4 @@ val is_js_keyword : string -> bool -val is_js_special_word : string -> bool - val is_js_global : string -> bool From da0903bebb73f0084d28e89a7b8fe3fe3ce43375 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 14:18:53 +0000 Subject: [PATCH 133/214] dce: trim buffer helpers --- _dce/report.txt | 92 +------------------------------------ compiler/ext/ext_buffer.ml | 11 ++--- compiler/ext/ext_buffer.mli | 15 ++---- 3 files changed, 11 insertions(+), 107 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index 23ee407bb25..c78fa4f7cf6 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -7947,102 +7947,12 @@ <-- line 42 let is_empty b = b.position = 0 [@@dead "+is_empty"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_buffer.ml", line 44, characters 0-29 - +clear is never used - <-- line 44 - let clear b = b.position <- 0 [@@dead "+clear"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_buffer.ml", line 128, characters 0-50 - +digest is never used - <-- line 128 - let digest b = unsafe_string b.buffer 0 b.position [@@dead "+digest"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_buffer.ml", line 130, characters 0-173 - +not_equal_aux is never used - <-- line 130 - || not_equal_aux b s (i + 1) len [@@dead "+not_equal_aux"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_buffer.ml", line 137, characters 0-150 - +not_equal is never used - <-- line 137 - b_len <> s_len || not_equal_aux b.buffer s 0 s_len [@@dead "+not_equal"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_buffer.ml", line 146, characters 0-199 - +add_int_1 is never used - <-- line 146 - b.position <- pos + 1 [@@dead "+add_int_1"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_buffer.ml", line 153, characters 0-328 - +add_int_2 is never used - <-- line 153 - b.position <- pos + 2 [@@dead "+add_int_2"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_buffer.ml", line 163, characters 0-423 - +add_int_3 is never used - <-- line 163 - b.position <- pos + 3 [@@dead "+add_int_3"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_buffer.ml", line 175, characters 0-518 - +add_int_4 is never used - <-- line 175 - b.position <- pos + 4 [@@dead "+add_int_4"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_buffer.mli", line 48, characters 0-24 +is_empty is never used <-- line 48 val is_empty : t -> bool [@@dead "+is_empty"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_buffer.mli", line 50, characters 0-21 - +clear is never used - <-- line 50 - val clear : t -> unit [@@dead "+clear"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_buffer.mli", line 86, characters 0-26 - +digest is never used - <-- line 86 - val digest : t -> Digest.t [@@dead "+digest"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_buffer.mli", line 88, characters 0-35 - +not_equal is never used - <-- line 88 - val not_equal : t -> string -> bool [@@dead "+not_equal"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_buffer.mli", line 90, characters 0-32 - +add_int_1 is never used - <-- line 90 - val add_int_1 : t -> int -> unit [@@dead "+add_int_1"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_buffer.mli", line 92, characters 0-32 - +add_int_2 is never used - <-- line 92 - val add_int_2 : t -> int -> unit [@@dead "+add_int_2"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_buffer.mli", line 94, characters 0-32 - +add_int_3 is never used - <-- line 94 - val add_int_3 : t -> int -> unit [@@dead "+add_int_3"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_buffer.mli", line 96, characters 0-32 - +add_int_4 is never used - <-- line 96 - val add_int_4 : t -> int -> unit [@@dead "+add_int_4"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_char.ml", line 34, characters 0-114 +is_lower_case is never used @@ -14249,4 +14159,4 @@ <-- line 211 val hash : t -> int [@@dead "Type_ops.+hash"] - Analysis reported 2510 issues (Warning Dead Module:151, Warning Dead Type:235, Warning Dead Value:1870, Warning Dead Value With Side Effects:35, Warning Redundant Optional Argument:195, Warning Unused Argument:24) + Analysis reported 2495 issues (Warning Dead Module:151, Warning Dead Type:235, Warning Dead Value:1855, Warning Dead Value With Side Effects:35, Warning Redundant Optional Argument:195, Warning Unused Argument:24) diff --git a/compiler/ext/ext_buffer.ml b/compiler/ext/ext_buffer.ml index b88b3b8b8c6..60f3e138568 100644 --- a/compiler/ext/ext_buffer.ml +++ b/compiler/ext/ext_buffer.ml @@ -41,8 +41,6 @@ let length b = b.position let is_empty b = b.position = 0 -let clear b = b.position <- 0 - (* let reset b = b.position <- 0; b.buffer <- b.initial_buffer; b.length <- Bytes.length b.buffer *) @@ -123,10 +121,6 @@ let add_char_string b c s = let output_buffer oc b = output oc b.buffer 0 b.position -external unsafe_string : bytes -> int -> int -> Digest.t = "caml_md5_string" - -let digest b = unsafe_string b.buffer 0 b.position - let rec not_equal_aux (b : bytes) (s : string) i len = if i >= len then false else @@ -138,6 +132,7 @@ let not_equal (b : t) (s : string) = let b_len = b.position in let s_len = String.length s in b_len <> s_len || not_equal_aux b.buffer s 0 s_len +[@@live] (** It could be one byte, two bytes, three bytes and four bytes @@ -149,6 +144,7 @@ let add_int_1 (b : t) (x : int) = if pos >= b.length then resize b 1; Bytes.unsafe_set b.buffer pos c; b.position <- pos + 1 +[@@live] let add_int_2 (b : t) (x : int) = let c1 = Char.unsafe_chr (x land 0xff) in @@ -159,6 +155,7 @@ let add_int_2 (b : t) (x : int) = Bytes.unsafe_set b_buffer pos c1; Bytes.unsafe_set b_buffer (pos + 1) c2; b.position <- pos + 2 +[@@live] let add_int_3 (b : t) (x : int) = let c1 = Char.unsafe_chr (x land 0xff) in @@ -171,6 +168,7 @@ let add_int_3 (b : t) (x : int) = Bytes.unsafe_set b_buffer (pos + 1) c2; Bytes.unsafe_set b_buffer (pos + 2) c3; b.position <- pos + 3 +[@@live] let add_int_4 (b : t) (x : int) = let c1 = Char.unsafe_chr (x land 0xff) in @@ -185,3 +183,4 @@ let add_int_4 (b : t) (x : int) = Bytes.unsafe_set b_buffer (pos + 2) c3; Bytes.unsafe_set b_buffer (pos + 3) c4; b.position <- pos + 4 +[@@live] diff --git a/compiler/ext/ext_buffer.mli b/compiler/ext/ext_buffer.mli index e42861df887..2f0587f0a7b 100644 --- a/compiler/ext/ext_buffer.mli +++ b/compiler/ext/ext_buffer.mli @@ -47,9 +47,6 @@ val length : t -> int val is_empty : t -> bool -val clear : t -> unit -(** Empty the buffer. *) - val add_char : t -> char -> unit (** [add_char b c] appends the character [c] at the end of the buffer [b]. *) @@ -83,17 +80,15 @@ val output_buffer : out_channel -> t -> unit (** [output_buffer oc b] writes the current contents of buffer [b] on the output channel [oc]. *) -val digest : t -> Digest.t - -val not_equal : t -> string -> bool +val not_equal : t -> string -> bool [@@live] -val add_int_1 : t -> int -> unit +val add_int_1 : t -> int -> unit [@@live] -val add_int_2 : t -> int -> unit +val add_int_2 : t -> int -> unit [@@live] -val add_int_3 : t -> int -> unit +val add_int_3 : t -> int -> unit [@@live] -val add_int_4 : t -> int -> unit +val add_int_4 : t -> int -> unit [@@live] val add_string_char : t -> string -> char -> unit From f4e96cf7f6a22d9dc0d6f8fac47d1880cea410b8 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 14:18:58 +0000 Subject: [PATCH 134/214] dce: note buffer liveness --- scripts/dce/live-findings.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/scripts/dce/live-findings.md b/scripts/dce/live-findings.md index 4e6cc81a5ca..2ec05f55a45 100644 --- a/scripts/dce/live-findings.md +++ b/scripts/dce/live-findings.md @@ -272,6 +272,18 @@ live after manual validation. - Context: the truly unused `stats_to_string` debug helper was removed. The remaining warning is a cross-module utility edge missed by DCE. +### `Ext_buffer` production and test helpers + +- Report: `Warning Dead Value`, `compiler/ext/ext_buffer.ml` / `.mli`, for + `is_empty`, `not_equal`, and the `add_int_*` helpers. +- Verdict: live or intentionally retained. +- Validation: `Ext_buffer.is_empty` is used by `ext_modulename.ml` while + deriving JavaScript identifier names. `not_equal` and `add_int_1` through + `add_int_4` are unit-test support helpers exercised by the string/util OUnit + suites, so they are marked live rather than removing the unit-test surface. +- Context: unused `clear` and `digest` were removed. The remaining production + warning depends on the known `Ext_modulename` cross-module false positive. + ### `Ext_list` production helpers - Report: remaining `Warning Dead Value` entries in From a87dcfb99bd310817037ce983a5f597285793d21 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 14:20:29 +0000 Subject: [PATCH 135/214] dce: root filename test helpers --- _dce/report.txt | 74 +---------------------------------- compiler/ext/ext_filename.ml | 15 +++---- compiler/ext/ext_filename.mli | 11 +++--- 3 files changed, 13 insertions(+), 87 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index c78fa4f7cf6..b017042ef67 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -7965,78 +7965,6 @@ <-- line 29 val is_lower_case : char -> bool [@@dead "+is_lower_case"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_filename.ml", line 31, characters 0-259 - +chop_extension_maybe is never used - <-- line 31 - search_dot (String.length name - 1) [@@dead "+chop_extension_maybe"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_filename.ml", line 48, characters 0-363 - +chop_all_extensions_maybe is never used - <-- line 48 - search_dot (String.length name - 1) None [@@dead "+chop_all_extensions_maybe"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_filename.ml", line 89, characters 20-40 - module_info.module_name is a record label never used to read a value - <-- line 89 - type module_info = {module_name: string; [@dead "module_info.module_name"] case: bool} - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_filename.ml", line 89, characters 41-51 - module_info.case is a record label never used to read a value - <-- line 89 - type module_info = {module_name: string; [@dead "module_info.module_name"] case: bool [@dead "module_info.case"] } - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_filename.ml", line 91, characters 0-277 - +valid_module_name_aux is never used - <-- line 91 - | _ -> false [@@dead "+valid_module_name_aux"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_filename.ml", line 102, characters 0-338 - +valid_module_name is never used - <-- line 102 - | _ -> Invalid [@@dead "+valid_module_name"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_filename.ml", line 112, characters 0-796 - +as_module is never used - <-- line 112 - search_dot (name_len - 1) basename name_len [@@dead "+as_module"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_filename.mli", line 36, characters 0-43 - +chop_extension_maybe is never used - <-- line 36 - val chop_extension_maybe : string -> string [@@dead "+chop_extension_maybe"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_filename.mli", line 43, characters 0-48 - +chop_all_extensions_maybe is never used - <-- line 43 - val chop_all_extensions_maybe : string -> string [@@dead "+chop_all_extensions_maybe"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_filename.mli", line 48, characters 20-40 - module_info.module_name is a record label never used to read a value - <-- line 48 - type module_info = {module_name: string; [@dead "module_info.module_name"] case: bool} - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_filename.mli", line 48, characters 41-51 - module_info.case is a record label never used to read a value - <-- line 48 - type module_info = {module_name: string; [@dead "module_info.module_name"] case: bool [@dead "module_info.case"] } - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_filename.mli", line 50, characters 0-53 - +as_module is never used - <-- line 50 - val as_module : basename:string -> module_info option [@@dead "+as_module"] - Warning Dead Module File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_fmt.ml", line 1, characters 0-0 +ext_fmt is a dead module as all its items are dead. @@ -14159,4 +14087,4 @@ <-- line 211 val hash : t -> int [@@dead "Type_ops.+hash"] - Analysis reported 2495 issues (Warning Dead Module:151, Warning Dead Type:235, Warning Dead Value:1855, Warning Dead Value With Side Effects:35, Warning Redundant Optional Argument:195, Warning Unused Argument:24) + Analysis reported 2483 issues (Warning Dead Module:151, Warning Dead Type:231, Warning Dead Value:1847, Warning Dead Value With Side Effects:35, Warning Redundant Optional Argument:195, Warning Unused Argument:24) diff --git a/compiler/ext/ext_filename.ml b/compiler/ext/ext_filename.ml index fd7c64c4267..136c55dbbb8 100644 --- a/compiler/ext/ext_filename.ml +++ b/compiler/ext/ext_filename.ml @@ -28,14 +28,6 @@ let is_dir_sep_win_cygwin c = c = '/' || c = '\\' || c = ':' let is_dir_sep = if Sys.unix then is_dir_sep_unix else is_dir_sep_win_cygwin -let chop_extension_maybe name = - let rec search_dot i = - if i < 0 || is_dir_sep (String.unsafe_get name i) then name - else if String.unsafe_get name i = '.' then String.sub name 0 i - else search_dot (i - 1) - in - search_dot (String.length name - 1) - let get_extension_maybe name = let name_len = String.length name in let rec search_dot name i name_len = @@ -55,6 +47,7 @@ let chop_all_extensions_maybe name = else search_dot (i - 1) last in search_dot (String.length name - 1) None +[@@live] let new_extension name (ext : string) = let rec search_dot name i ext = @@ -86,7 +79,10 @@ let module_name name = let name_len = String.length name in search_dot (name_len - 1) name -type module_info = {module_name: string; case: bool} +type module_info = { + module_name: string; [@live] + case: bool; [@live] +} let rec valid_module_name_aux name off len = if off >= len then true @@ -130,3 +126,4 @@ let as_module ~basename = in let name_len = String.length basename in search_dot (name_len - 1) basename name_len +[@@live] diff --git a/compiler/ext/ext_filename.mli b/compiler/ext/ext_filename.mli index 5c678310b9e..8373a0ea2da 100644 --- a/compiler/ext/ext_filename.mli +++ b/compiler/ext/ext_filename.mli @@ -33,18 +33,19 @@ val is_dir_sep : char -> bool -val chop_extension_maybe : string -> string - (* return an empty string if no extension found *) val get_extension_maybe : string -> string val new_extension : string -> string -> string -val chop_all_extensions_maybe : string -> string +val chop_all_extensions_maybe : string -> string [@@live] (* OCaml specific abstraction*) val module_name : string -> string -type module_info = {module_name: string; case: bool} +type module_info = { + module_name: string; [@live] + case: bool; [@live] +} -val as_module : basename:string -> module_info option +val as_module : basename:string -> module_info option [@@live] From f9f20ee65379eddafed38a86e5b830d37cd23c58 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 14:20:33 +0000 Subject: [PATCH 136/214] dce: note filename liveness --- scripts/dce/live-findings.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/scripts/dce/live-findings.md b/scripts/dce/live-findings.md index 2ec05f55a45..1c8c177daa3 100644 --- a/scripts/dce/live-findings.md +++ b/scripts/dce/live-findings.md @@ -284,6 +284,17 @@ live after manual validation. - Context: unused `clear` and `digest` were removed. The remaining production warning depends on the known `Ext_modulename` cross-module false positive. +### `Ext_filename` test helpers + +- Report: `Warning Dead Value` / `Warning Dead Type`, + `compiler/ext/ext_filename.ml` / `.mli`, for `chop_all_extensions_maybe`, + `as_module`, and the `module_info` fields. +- Verdict: intentionally retained unit-test helper surface. +- Validation: these helpers are exercised by `ounit_string_tests.ml` and have + no production callers. They are marked live so unit-test-only validation code + remains available while DCE ignores test modules. +- Context: the fully unused `chop_extension_maybe` helper was removed. + ### `Ext_list` production helpers - Report: remaining `Warning Dead Value` entries in From 1255408f9c65338f99cb2853dbca58af5e71af51 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 14:23:10 +0000 Subject: [PATCH 137/214] dce: trim arg spec variants --- _dce/report.txt | 38 +------------------------------------- compiler/ext/bsc_args.ml | 9 ++------- compiler/ext/bsc_args.mli | 4 +--- 3 files changed, 4 insertions(+), 47 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index b017042ef67..87e47f0e036 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -7857,42 +7857,6 @@ <-- line 35 | Dependency_script_module_dependent_not of string [@dead "error.Dependency_script_module_dependent_not"] - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/bsc_args.ml", line 29, characters 2-28 - string_action.String_set is a variant case which is never constructed - <-- line 29 - | String_set of string ref [@dead "string_action.String_set"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/bsc_args.ml", line 35, characters 2-28 - unit_action.Unit_lazy is a variant case which is never constructed - <-- line 35 - | Unit_lazy of unit lazy_t [@dead "unit_action.Unit_lazy"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/bsc_args.ml", line 39, characters 12-22 - spec.Unit_dummy is a variant case which is never constructed - <-- line 39 - type spec = Unit_dummy [@dead "spec.Unit_dummy"] | Unit of unit_action | String of string_action - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/bsc_args.mli", line 29, characters 2-28 - string_action.String_set is a variant case which is never constructed - <-- line 29 - | String_set of string ref [@dead "string_action.String_set"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/bsc_args.mli", line 35, characters 2-28 - unit_action.Unit_lazy is a variant case which is never constructed - <-- line 35 - | Unit_lazy of unit lazy_t [@dead "unit_action.Unit_lazy"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/bsc_args.mli", line 39, characters 12-22 - spec.Unit_dummy is a variant case which is never constructed - <-- line 39 - type spec = Unit_dummy [@dead "spec.Unit_dummy"] | Unit of unit_action | String of string_action - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/config.ml", line 7, characters 0-37 +cmt_magic_number is never used @@ -14087,4 +14051,4 @@ <-- line 211 val hash : t -> int [@@dead "Type_ops.+hash"] - Analysis reported 2483 issues (Warning Dead Module:151, Warning Dead Type:231, Warning Dead Value:1847, Warning Dead Value With Side Effects:35, Warning Redundant Optional Argument:195, Warning Unused Argument:24) + Analysis reported 2477 issues (Warning Dead Module:151, Warning Dead Type:225, Warning Dead Value:1847, Warning Dead Value With Side Effects:35, Warning Redundant Optional Argument:195, Warning Unused Argument:24) diff --git a/compiler/ext/bsc_args.ml b/compiler/ext/bsc_args.ml index 19e034a2c66..a7f41e2d3aa 100644 --- a/compiler/ext/bsc_args.ml +++ b/compiler/ext/bsc_args.ml @@ -26,17 +26,15 @@ type anon_fun = rev_args:string list -> unit type string_action = | String_call of (string -> unit) - | String_set of string ref | String_optional_set of string option ref | String_list_add of string list ref type unit_action = | Unit_call of (unit -> unit) - | Unit_lazy of unit lazy_t | Unit_set of bool ref | Unit_clear of bool ref -type spec = Unit_dummy | Unit of unit_action | String of string_action +type spec = Unit of unit_action | String of string_action exception Bad = Arg.Bad @@ -108,13 +106,11 @@ let parse_exn ~usage ~argv ?(start = 1) (speclist : t) match Ext_spec.assoc3 speclist s with | Some action -> ( match action with - | Unit_dummy -> () | Unit r -> ( match r with | Unit_set r -> r := true | Unit_clear r -> r := false - | Unit_call f -> f () - | Unit_lazy f -> Lazy.force f) + | Unit_call f -> f ()) | String f -> ( if !current >= finish then stop_raise ~usage ~error:(Missing s) speclist @@ -123,7 +119,6 @@ let parse_exn ~usage ~argv ?(start = 1) (speclist : t) incr current; match f with | String_call f -> f arg - | String_set u -> u := arg | String_optional_set s -> s := Some arg | String_list_add s -> s := arg :: !s)) | None -> stop_raise ~usage ~error:(Unknown s) speclist diff --git a/compiler/ext/bsc_args.mli b/compiler/ext/bsc_args.mli index 742313e96b3..c66b2a5a649 100644 --- a/compiler/ext/bsc_args.mli +++ b/compiler/ext/bsc_args.mli @@ -26,17 +26,15 @@ type anon_fun = rev_args:string list -> unit type string_action = | String_call of (string -> unit) - | String_set of string ref | String_optional_set of string option ref | String_list_add of string list ref type unit_action = | Unit_call of (unit -> unit) - | Unit_lazy of unit lazy_t | Unit_set of bool ref | Unit_clear of bool ref -type spec = Unit_dummy | Unit of unit_action | String of string_action +type spec = Unit of unit_action | String of string_action type t = (string * spec * string) array From 3db42992d9dc0b4f5f5e099b1a81c3e3c9077c44 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 14:28:03 +0000 Subject: [PATCH 138/214] dce: trim ext debug helpers --- _dce/report.txt | 184 ++++++---------------------------- compiler/ext/ext_ident.ml | 6 -- compiler/ext/ext_ident.mli | 6 -- compiler/ext/ext_pp.ml | 4 - compiler/ext/ext_pp.mli | 4 - compiler/ext/ext_pp_scope.ml | 9 -- compiler/ext/ext_pp_scope.mli | 2 - compiler/ext/ext_ref.ml | 43 -------- compiler/ext/ext_ref.mli | 15 --- 9 files changed, 31 insertions(+), 242 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index 87e47f0e036..c1556d712a3 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -7964,103 +7964,69 @@ let is_js_or_global (i : Ident.t) = i.flags land (8 lor 1) <> 0 [@@dead "+is_js_or_global"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_ident.ml", line 41, characters 0-65 - +is_js_object is never used - <-- line 41 - let is_js_object (i : Ident.t) = i.flags land js_object_flag <> 0 [@@dead "+is_js_object"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_ident.ml", line 43, characters 0-72 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_ident.ml", line 41, characters 0-72 +make_js_object is never used - <-- line 43 + <-- line 41 let make_js_object (i : Ident.t) = i.flags <- i.flags lor js_object_flag [@@dead "+make_js_object"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_ident.ml", line 53, characters 0-54 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_ident.ml", line 51, characters 0-54 +create_tmp is never used - <-- line 53 + <-- line 51 let create_tmp ?(name = Literals.tmp) () = create name [@@dead "+create_tmp"] - Warning Dead Value With Side Effects - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_ident.ml", line 55, characters 0-67 - +js_module_table is never used and could have side effects - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_ident.ml", line 170, characters 0-31 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_ident.ml", line 166, characters 0-31 +make_unused is never used - <-- line 170 + <-- line 166 let make_unused () = create "_" [@@dead "+make_unused"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_ident.ml", line 172, characters 0-48 - +reset is never used - <-- line 172 - let reset () = Hash_string.clear js_module_table [@@dead "+reset"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_ident.ml", line 178, characters 0-128 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_ident.ml", line 172, characters 0-128 +compare is never used - <-- line 178 + <-- line 172 if u = 0 then Ext_string.compare x.name y.name else u [@@dead "+compare"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_ident.ml", line 182, characters 0-116 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_ident.ml", line 176, characters 0-116 +equal is never used - <-- line 182 + <-- line 176 if x.stamp <> 0 then x.stamp = y.stamp else y.stamp = 0 && x.name = y.name [@@dead "+equal"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_ident.mli", line 29, characters 0-34 - +is_js_object is never used - <-- line 29 - val is_js_object : Ident.t -> bool [@@dead "+is_js_object"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_ident.mli", line 36, characters 0-36 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_ident.mli", line 34, characters 0-36 +make_js_object is never used - <-- line 36 + <-- line 34 val make_js_object : Ident.t -> unit [@@dead "+make_js_object"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_ident.mli", line 38, characters 0-24 - +reset is never used - <-- line 38 - val reset : unit -> unit [@@dead "+reset"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_ident.mli", line 40, characters 0-48 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_ident.mli", line 36, characters 0-48 +create_tmp is never used - <-- line 40 + <-- line 36 val create_tmp : ?name:string -> unit -> Ident.t [@@dead "+create_tmp"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_ident.mli", line 42, characters 0-33 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_ident.mli", line 38, characters 0-33 +make_unused is never used - <-- line 42 + <-- line 38 val make_unused : unit -> Ident.t [@@dead "+make_unused"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_ident.mli", line 46, characters 0-40 - +is_uppercase_exotic is never used - <-- line 46 - val is_uppercase_exotic : string -> bool [@@dead "+is_uppercase_exotic"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_ident.mli", line 55, characters 0-37 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_ident.mli", line 49, characters 0-37 +is_js_or_global is never used - <-- line 55 + <-- line 49 val is_js_or_global : Ident.t -> bool [@@dead "+is_js_or_global"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_ident.mli", line 57, characters 0-39 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_ident.mli", line 51, characters 0-39 +compare is never used - <-- line 57 + <-- line 51 val compare : Ident.t -> Ident.t -> int [@@dead "+compare"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_ident.mli", line 58, characters 0-38 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_ident.mli", line 52, characters 0-38 +equal is never used - <-- line 58 + <-- line 52 val equal : Ident.t -> Ident.t -> bool [@@dead "+equal"] Warning Dead Module @@ -8727,118 +8693,30 @@ <-- line 53 val parse_nat_of_string : string -> int ref -> int [@@dead "+parse_nat_of_string"] - Warning Dead Value With Side Effects - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_pp.ml", line 31, characters 0-46 - +indent_length is never used and could have side effects - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_pp.ml", line 42, characters 0-217 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_pp.ml", line 40, characters 0-217 +from_channel is never used - <-- line 42 + <-- line 40 } [@@dead "+from_channel"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_pp.ml", line 93, characters 0-45 - +nspace is never used - <-- line 93 - let nspace t n = string t (String.make n ' ') [@@dead "+nspace"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_pp.ml", line 166, characters 0-67 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_pp.ml", line 162, characters 0-67 +brace_group is never used - <-- line 166 + <-- line 162 let brace_group st n action = group st n (fun _ -> brace st action) [@@dead "+brace_group"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_pp.mli", line 38, characters 0-23 - +indent_length is never used - <-- line 38 - val indent_length : int [@@dead "+indent_length"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_pp.mli", line 44, characters 0-29 - +nspace is never used - <-- line 44 - val nspace : t -> int -> unit [@@dead "+nspace"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_pp.mli", line 63, characters 0-48 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_pp.mli", line 59, characters 0-48 +brace_group is never used - <-- line 63 + <-- line 59 val brace_group : t -> int -> (unit -> 'a) -> 'a [@@dead "+brace_group"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_pp.mli", line 75, characters 0-35 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_pp.mli", line 71, characters 0-35 +from_channel is never used - <-- line 75 + <-- line 71 val from_channel : out_channel -> t [@@dead "+from_channel"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_pp_scope.ml", line 32, characters 0-172 - +print is never used - <-- line 32 - Format.fprintf fmt "}@]" [@@dead "+print"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_pp_scope.ml", line 38, characters 0-88 - +print_int_map is never used - <-- line 38 - Map_int.iter m (fun k v -> Format.fprintf fmt "%d - %d" k v) [@@dead "+print_int_map"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_pp_scope.mli", line 36, characters 0-41 - +print is never used - <-- line 36 - val print : Format.formatter -> t -> unit [@@dead "+print"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_ref.ml", line 25, characters 0-99 - +non_exn_protect is never used - <-- line 25 - res [@@dead "+non_exn_protect"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_ref.ml", line 43, characters 0-160 - +non_exn_protect2 is never used - <-- line 43 - res [@@dead "+non_exn_protect2"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_ref.ml", line 53, characters 0-226 - +protect2 is never used - <-- line 53 - raise x [@@dead "+protect2"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_ref.ml", line 68, characters 0-301 - +protect_list is never used - <-- line 68 - raise e [@@dead "+protect_list"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_ref.mli", line 29, characters 0-56 - +non_exn_protect is never used - <-- line 29 - val non_exn_protect : 'a ref -> 'a -> (unit -> 'b) -> 'b [@@dead "+non_exn_protect"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_ref.mli", line 33, characters 0-65 - +protect2 is never used - <-- line 33 - val protect2 : 'a ref -> 'b ref -> 'a -> 'b -> (unit -> 'c) -> 'c [@@dead "+protect2"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_ref.mli", line 35, characters 0-73 - +non_exn_protect2 is never used - <-- line 35 - val non_exn_protect2 : 'a ref -> 'b ref -> 'a -> 'b -> (unit -> 'c) -> 'c [@@dead "+non_exn_protect2"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_ref.mli", line 40, characters 0-59 - +protect_list is never used - <-- line 40 - val protect_list : ('a ref * 'a) list -> (unit -> 'b) -> 'b [@@dead "+protect_list"] - Warning Dead Module File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_scc.ml", line 1, characters 0-0 +ext_scc is a dead module as all its items are dead. @@ -14051,4 +13929,4 @@ <-- line 211 val hash : t -> int [@@dead "Type_ops.+hash"] - Analysis reported 2477 issues (Warning Dead Module:151, Warning Dead Type:225, Warning Dead Value:1847, Warning Dead Value With Side Effects:35, Warning Redundant Optional Argument:195, Warning Unused Argument:24) + Analysis reported 2456 issues (Warning Dead Module:151, Warning Dead Type:225, Warning Dead Value:1828, Warning Dead Value With Side Effects:33, Warning Redundant Optional Argument:195, Warning Unused Argument:24) diff --git a/compiler/ext/ext_ident.ml b/compiler/ext/ext_ident.ml index 7a4dac253a0..9dfcc9ba168 100644 --- a/compiler/ext/ext_ident.ml +++ b/compiler/ext/ext_ident.ml @@ -38,8 +38,6 @@ let is_js (i : Ident.t) = i.flags land js_flag <> 0 let is_js_or_global (i : Ident.t) = i.flags land (8 lor 1) <> 0 -let is_js_object (i : Ident.t) = i.flags land js_object_flag <> 0 - let make_js_object (i : Ident.t) = i.flags <- i.flags lor js_object_flag (* It's a js function hard coded by js api, so when printing, @@ -52,8 +50,6 @@ let create = Ident.create (* FIXME: no need for `$' operator *) let create_tmp ?(name = Literals.tmp) () = create name -let js_module_table : Ident.t Hash_string.t = Hash_string.create 31 - (* This is for a js exeternal module, we can change it when printing for example {[ @@ -169,8 +165,6 @@ let convert (name : string) = *) let make_unused () = create "_" -let reset () = Hash_string.clear js_module_table - (* Has to be total order, [x < y] and [x > y] should be consistent flags are not relevant here diff --git a/compiler/ext/ext_ident.mli b/compiler/ext/ext_ident.mli index ff21fca3c56..9172b27a868 100644 --- a/compiler/ext/ext_ident.mli +++ b/compiler/ext/ext_ident.mli @@ -26,8 +26,6 @@ val is_js : Ident.t -> bool -val is_js_object : Ident.t -> bool - val create_js : string -> Ident.t (** create identifiers for predefined [js] global variables *) @@ -35,16 +33,12 @@ val create : string -> Ident.t val make_js_object : Ident.t -> unit -val reset : unit -> unit - val create_tmp : ?name:string -> unit -> Ident.t val make_unused : unit -> Ident.t val is_uident : string -> bool -val is_uppercase_exotic : string -> bool - val unwrap_uppercase_exotic : string -> string val convert : string -> string diff --git a/compiler/ext/ext_pp.ml b/compiler/ext/ext_pp.ml index f9237c271a7..aaca8bb0c0d 100644 --- a/compiler/ext/ext_pp.ml +++ b/compiler/ext/ext_pp.ml @@ -28,8 +28,6 @@ module L = struct let indent_str = " " end -let indent_length = String.length L.indent_str - type t = { output_string: string -> unit; output_char: char -> unit; @@ -90,8 +88,6 @@ let force_newline t = let space t = string t L.space -let nspace t n = string t (String.make n ' ') - let group t i action = if i = 0 then action () else diff --git a/compiler/ext/ext_pp.mli b/compiler/ext/ext_pp.mli index aaf2176214a..271eae3725e 100644 --- a/compiler/ext/ext_pp.mli +++ b/compiler/ext/ext_pp.mli @@ -35,14 +35,10 @@ type t } *) -val indent_length : int - val string : t -> string -> unit val space : t -> unit -val nspace : t -> int -> unit - val group : t -> int -> (unit -> 'a) -> 'a (** [group] will record current indentation and indent futher diff --git a/compiler/ext/ext_pp_scope.ml b/compiler/ext/ext_pp_scope.ml index f074a411f00..317d38afb3a 100644 --- a/compiler/ext/ext_pp_scope.ml +++ b/compiler/ext/ext_pp_scope.ml @@ -29,15 +29,6 @@ type t = int Map_int.t Map_string.t *) let empty : t = Map_string.empty -let rec print fmt v = - Format.fprintf fmt "@[{"; - Map_string.iter v (fun k m -> - Format.fprintf fmt "%s: @[%a@],@ " k print_int_map m); - Format.fprintf fmt "}@]" - -and print_int_map fmt m = - Map_int.iter m (fun k v -> Format.fprintf fmt "%d - %d" k v) - let add_ident ~mangled:name (stamp : int) (cxt : t) : int * t = match Map_string.find_opt cxt name with | None -> (0, Map_string.add cxt name (Map_int.add Map_int.empty stamp 0)) diff --git a/compiler/ext/ext_pp_scope.mli b/compiler/ext/ext_pp_scope.mli index 460a0354d36..2eae91087f2 100644 --- a/compiler/ext/ext_pp_scope.mli +++ b/compiler/ext/ext_pp_scope.mli @@ -33,8 +33,6 @@ type t val empty : t -val print : Format.formatter -> t -> unit - val sub_scope : t -> Set_ident.t -> t val merge : t -> Set_ident.t -> t diff --git a/compiler/ext/ext_ref.ml b/compiler/ext/ext_ref.ml index e0afb7892d0..3550d4fc67d 100644 --- a/compiler/ext/ext_ref.ml +++ b/compiler/ext/ext_ref.ml @@ -22,13 +22,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *) -let non_exn_protect r v body = - let old = !r in - r := v; - let res = body () in - r := old; - res - let protect r v body = let old = !r in try @@ -39,39 +32,3 @@ let protect r v body = with x -> r := old; raise x - -let non_exn_protect2 r1 r2 v1 v2 body = - let old1 = !r1 in - let old2 = !r2 in - r1 := v1; - r2 := v2; - let res = body () in - r1 := old1; - r2 := old2; - res - -let protect2 r1 r2 v1 v2 body = - let old1 = !r1 in - let old2 = !r2 in - try - r1 := v1; - r2 := v2; - let res = body () in - r1 := old1; - r2 := old2; - res - with x -> - r1 := old1; - r2 := old2; - raise x - -let protect_list rvs body = - let olds = Ext_list.map rvs (fun (x, _) -> !x) in - let () = List.iter (fun (x, y) -> x := y) rvs in - try - let res = body () in - List.iter2 (fun (x, _) old -> x := old) rvs olds; - res - with e -> - List.iter2 (fun (x, _) old -> x := old) rvs olds; - raise e diff --git a/compiler/ext/ext_ref.mli b/compiler/ext/ext_ref.mli index 94a47dcf08d..8ca93af1e91 100644 --- a/compiler/ext/ext_ref.mli +++ b/compiler/ext/ext_ref.mli @@ -22,19 +22,4 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *) -(** [non_exn_protect ref value f] assusme [f()] - would not raise -*) - -val non_exn_protect : 'a ref -> 'a -> (unit -> 'b) -> 'b - val protect : 'a ref -> 'a -> (unit -> 'b) -> 'b - -val protect2 : 'a ref -> 'b ref -> 'a -> 'b -> (unit -> 'c) -> 'c - -val non_exn_protect2 : 'a ref -> 'b ref -> 'a -> 'b -> (unit -> 'c) -> 'c -(** [non_exn_protect2 refa refb va vb f ] - assume [f ()] would not raise -*) - -val protect_list : ('a ref * 'a) list -> (unit -> 'b) -> 'b From 12206d451659682c01e63b182d9642ce4745f685 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 14:28:08 +0000 Subject: [PATCH 139/214] dce: note ext helper liveness --- scripts/dce/live-findings.md | 56 ++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/scripts/dce/live-findings.md b/scripts/dce/live-findings.md index 1c8c177daa3..3ab9a46b472 100644 --- a/scripts/dce/live-findings.md +++ b/scripts/dce/live-findings.md @@ -295,6 +295,62 @@ live after manual validation. remains available while DCE ignores test modules. - Context: the fully unused `chop_extension_maybe` helper was removed. +### `Ext_fmt` and `Ext_ident` compiler helpers + +- Report: `Warning Dead Module`, `Warning Dead Value`, and + `Warning Dead Value With Side Effects`, `compiler/ext/ext_fmt.ml` and + `compiler/ext/ext_ident.ml` / `.mli`, for formatting helpers, JavaScript + identifier flags, temporary identifiers, and identifier comparison helpers. +- Verdict: live; false positive for cross-module and `.cppo.ml` callers. +- Validation: `Ext_fmt.with_file_as_pp` is called from + `lam_compile_main.cppo.ml`, while `Ext_fmt.failwithf` is used by + `lam_dce.ml` and `ext_path.ml`. `Ext_ident.create_tmp`, `make_js_object`, + `make_unused`, and `is_js_or_global` are used throughout lambda and JS + lowering (`lam_compile*.ml`, `js_ast_util.ml`, `js_dump.ml`, and + `lam_dce.ml`). `Ext_ident.compare` and `equal` feed identity maps, hash sets, + and module identifier equality. +- Context: Reanalyze does not root these references through the cross-module + compiler pipeline. The unused `is_js_object`, `reset`, JS-module table, and + public `is_uppercase_exotic` export were removed. + +### `compiler/ext` cross-module helpers + +- Report: `Warning Dead Module`, `Warning Dead Type`, and + `Warning Dead Value` entries across `compiler/ext/config.ml`, + `ext_char.ml`, `ext_int.ml`, `ext_js_file_kind.ml`, `ext_modulename.ml`, + `ext_namespace.ml`, `ext_option.ml`, `ext_path.ml`, `ext_pervasives.ml`, + `ext_pp.ml`, `ext_scc.ml`, and `ext_sys.mli`. +- Verdict: live; false positive for production callers hidden behind + `.cppo.ml`, module aliases, or public type signatures. +- Validation: `Config.cmt_magic_number` is used by `cmt_format.cppo.ml`; + `Ext_char.is_lower_case`, `Ext_path.package_dir`, and + `Ext_pervasives.with_file_as_chan` are used by `lam_compile_main.cppo.ml`; + `Ext_int` feeds the integer map/hash/set functors and JS int32 lowering; + `Ext_js_file_kind.case` is stored in CMJ data and lambda compile env + signatures; `Ext_modulename.js_id_name_of_hint_name` is used by + `lam_compile_env.ml`; `Ext_namespace` is used by JS module-name lowering and + outcome printing; `Ext_option.map` / `exists` are used throughout lambda + passes; `Ext_path.node_rebase_file` is used by `js_name_of_module_id.cppo.ml`; + `Ext_pp.from_channel` and `brace_group` drive JS dumping; `Ext_scc.graph` is + used by `lam_scc.ml`; and `Ext_sys.is_windows_or_cygwin` is used by JS module + path generation. +- Context: several helper implementations are reported only because their + exported wrapper is itself reported as dead; the wrapper has a production + caller. Dead pretty-printer scope/debug helpers and extra `Ext_ref` protect + variants were removed. + +### `Ext_pervasives` unit-test number parsers + +- Report: `Warning Dead Value`, `compiler/ext/ext_pervasives.ml` / `.mli`, for + `nat_of_string_exn`, `parse_nat_of_string`, and their local helper. +- Verdict: intentionally retained unit-test-covered utility surface for now. +- Validation: the number parsers are exercised only by + `ounit_util_tests.ml`. Since unit tests are excluded from the DCE roots and + this pass is avoiding unit-test edits, they are documented rather than + removed in this batch. +- Context: `with_file_as_chan` from the same module is production-live through + `.cppo.ml` callers. + ### `Ext_list` production helpers - Report: remaining `Warning Dead Value` entries in From 220e6759f1bb37e76bf8960c79982b2c7cab4bc6 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 14:29:52 +0000 Subject: [PATCH 140/214] dce: trim ext test helpers --- _dce/report.txt | 96 +--------------------------------------- compiler/ext/ext_obj.ml | 27 +---------- compiler/ext/ext_obj.mli | 8 +--- compiler/ext/ext_scc.ml | 1 + compiler/ext/ext_scc.mli | 2 +- 5 files changed, 5 insertions(+), 129 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index c1556d712a3..fccf7e9cb0e 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -8523,68 +8523,6 @@ <-- line 50 val namespace_of_package_name : string -> string [@@dead "+namespace_of_package_name"] - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_obj.ml", line 1, characters 0-0 - +ext_obj is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_obj.ml", line 25, characters 0-2650 - +dump is never used - <-- line 25 - | _ -> opaque (Printf.sprintf "unknown: tag %d size %d" t s) [@@dead "+dump"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_obj.ml", line 101, characters 0-30 - +dump is never used - <-- line 101 - let dump v = dump (Obj.repr v) [@@dead "+dump"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_obj.ml", line 103, characters 0-86 - +dump_endline is never used - <-- line 103 - print_endline (dump v) [@@dead "+dump_endline"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_obj.ml", line 107, characters 0-55 - +pp_any is never used - <-- line 107 - let pp_any fmt v = Format.fprintf fmt "@[%s@]" (dump v) [@@dead "+pp_any"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_obj.ml", line 109, characters 0-611 - +bt is never used - <-- line 109 - bt.line_number bt.start_char bt.end_char) [@@dead "+bt"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_obj.mli", line 1, characters 0-0 - ext_obj is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_obj.mli", line 24, characters 0-23 - +dump is never used - <-- line 24 - val dump : 'a -> string [@@dead "+dump"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_obj.mli", line 26, characters 0-48 - +dump_endline is never used - <-- line 26 - val dump_endline : ?__LOC__:string -> 'a -> unit [@@dead "+dump_endline"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_obj.mli", line 28, characters 0-43 - +pp_any is never used - <-- line 28 - val pp_any : Format.formatter -> 'a -> unit [@@dead "+pp_any"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_obj.mli", line 30, characters 0-21 - +bt is never used - <-- line 30 - val bt : unit -> unit [@@dead "+bt"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_option.ml", line 25, characters 0-70 +map is never used @@ -8717,44 +8655,12 @@ <-- line 71 val from_channel : out_channel -> t [@@dead "+from_channel"] - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_scc.ml", line 1, characters 0-0 - +ext_scc is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_scc.ml", line 37, characters 0-48 - +min_int is never used - <-- line 37 - let min_int (x : int) y = if x < y then x else y [@@dead "+min_int"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_scc.ml", line 39, characters 0-1928 - +graph is never used - <-- line 39 - output [@@dead "+graph"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_scc.ml", line 98, characters 0-138 - +graph_check is never used - <-- line 98 - Int_vec_vec.fold_left (fun acc x -> Vec_int.length x :: acc) [] v ) [@@dead "+graph_check"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_scc.mli", line 1, characters 0-0 - ext_scc is a dead module as all its items are dead. - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_scc.mli", line 27, characters 0-44 +graph is never used <-- line 27 val graph : Vec_int.t array -> Int_vec_vec.t [@@dead "+graph"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_scc.mli", line 41, characters 0-46 - +graph_check is never used - <-- line 41 - val graph_check : node array -> int * int list [@@dead "+graph_check"] - Warning Dead Module File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_sys.mli", line 1, characters 0-0 ext_sys is a dead module as all its items are dead. @@ -13929,4 +13835,4 @@ <-- line 211 val hash : t -> int [@@dead "Type_ops.+hash"] - Analysis reported 2456 issues (Warning Dead Module:151, Warning Dead Type:225, Warning Dead Value:1828, Warning Dead Value With Side Effects:33, Warning Redundant Optional Argument:195, Warning Unused Argument:24) + Analysis reported 2439 issues (Warning Dead Module:147, Warning Dead Type:225, Warning Dead Value:1815, Warning Dead Value With Side Effects:33, Warning Redundant Optional Argument:195, Warning Unused Argument:24) diff --git a/compiler/ext/ext_obj.ml b/compiler/ext/ext_obj.ml index c81e86f232f..825d8a5363d 100644 --- a/compiler/ext/ext_obj.ml +++ b/compiler/ext/ext_obj.ml @@ -98,29 +98,4 @@ let rec dump r = ^ "|]" | _ -> opaque (Printf.sprintf "unknown: tag %d size %d" t s) -let dump v = dump (Obj.repr v) - -let dump_endline ?(__LOC__ = "") v = - print_endline __LOC__; - print_endline (dump v) - -let pp_any fmt v = Format.fprintf fmt "@[%s@]" (dump v) - -let bt () = - let raw_bt = Printexc.backtrace_slots (Printexc.get_raw_backtrace ()) in - match raw_bt with - | None -> () - | Some raw_bt -> - let acc = ref [] in - for i = Array.length raw_bt - 1 downto 0 do - let slot = raw_bt.(i) in - match Printexc.Slot.location slot with - | None -> () - | Some bt -> ( - match !acc with - | [] -> acc := [bt] - | hd :: _ -> if hd <> bt then acc := bt :: !acc) - done; - Ext_list.iter !acc (fun bt -> - Printf.eprintf "File \"%s\", line %d, characters %d-%d\n" bt.filename - bt.line_number bt.start_char bt.end_char) +let dump v = dump (Obj.repr v) [@@live] diff --git a/compiler/ext/ext_obj.mli b/compiler/ext/ext_obj.mli index dddf4735ab2..54895324911 100644 --- a/compiler/ext/ext_obj.mli +++ b/compiler/ext/ext_obj.mli @@ -21,10 +21,4 @@ * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *) -val dump : 'a -> string - -val dump_endline : ?__LOC__:string -> 'a -> unit - -val pp_any : Format.formatter -> 'a -> unit - -val bt : unit -> unit +val dump : 'a -> string [@@live] diff --git a/compiler/ext/ext_scc.ml b/compiler/ext/ext_scc.ml index d640d68714a..7d13269b93a 100644 --- a/compiler/ext/ext_scc.ml +++ b/compiler/ext/ext_scc.ml @@ -99,3 +99,4 @@ let graph_check v = let v = graph v in ( Int_vec_vec.length v, Int_vec_vec.fold_left (fun acc x -> Vec_int.length x :: acc) [] v ) +[@@live] diff --git a/compiler/ext/ext_scc.mli b/compiler/ext/ext_scc.mli index b72bc8228e7..ca84b10bd63 100644 --- a/compiler/ext/ext_scc.mli +++ b/compiler/ext/ext_scc.mli @@ -38,5 +38,5 @@ val graph : Vec_int.t array -> Int_vec_vec.t [Array.length] of the input *) -val graph_check : node array -> int * int list +val graph_check : node array -> int * int list [@@live] (** Used for unit test *) From 634449d08082c951e4e1d465c3db9821e13e2bff Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 14:30:07 +0000 Subject: [PATCH 141/214] dce: note ext test liveness --- scripts/dce/live-findings.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/scripts/dce/live-findings.md b/scripts/dce/live-findings.md index 3ab9a46b472..bd1c9559c57 100644 --- a/scripts/dce/live-findings.md +++ b/scripts/dce/live-findings.md @@ -351,6 +351,18 @@ live after manual validation. - Context: `with_file_as_chan` from the same module is production-live through `.cppo.ml` callers. +### `Ext_obj` and `Ext_scc` unit-test helpers + +- Report: `Warning Dead Module` / `Warning Dead Value`, + `compiler/ext/ext_obj.ml` / `.mli` and `compiler/ext/ext_scc.ml` / `.mli`, + for object dumping and SCC graph checking helpers. +- Verdict: intentionally retained unit-test helper surface where still used. +- Validation: `Ext_obj.dump` is the shared OUnit printer in several unit-test + modules, and `Ext_scc.graph_check` is used only by `ounit_scc_tests.ml`. + Both are marked live while unit tests are excluded from DCE roots. +- Context: unused `Ext_obj` debug helpers (`dump_endline`, `pp_any`, `bt`) were + removed. `Ext_scc.graph` remains production-live through `lam_scc.ml`. + ### `Ext_list` production helpers - Report: remaining `Warning Dead Value` entries in From dea85ba3de11a0fe074fbe9f5b1e5420c35612af Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 14:31:52 +0000 Subject: [PATCH 142/214] dce: remove identifiable pair --- _dce/report.txt | 54 +++-------------------------------- compiler/ext/identifiable.ml | 13 --------- compiler/ext/identifiable.mli | 2 -- 3 files changed, 4 insertions(+), 65 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index fccf7e9cb0e..ffccdd477fd 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -9071,60 +9071,14 @@ <-- line 21 include Map.OrderedType with type t := t [@@dead "Make.+compare"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/identifiable.ml", line 86, characters 2-106 - Pair.+compare is never used - <-- line 86 - if c <> 0 then c else B.compare b1 b2 [@@dead "Pair.+compare"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/identifiable.ml", line 91, characters 2-53 - Pair.+hash is never used - <-- line 91 - let hash (a, b) = Hashtbl.hash (A.hash a, B.hash b) [@@dead "Pair.+hash"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/identifiable.ml", line 92, characters 2-62 - Pair.+equal is never used - <-- line 92 - let equal (a1, b1) (a2, b2) = A.equal a1 a2 && B.equal b1 b2 [@@dead "Pair.+equal"] - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/identifiable.mli", line 29, characters 0-78 - identifiable.Pair is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/identifiable.mli", line 22, characters 10-45 - Pair.+hash is never used - <-- line 22 - include Hashtbl.HashedType with type t := t [@@dead "Pair.+hash"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/identifiable.mli", line 23, characters 10-42 - Pair.+compare is never used - <-- line 23 - include Map.OrderedType with type t := t [@@dead "Pair.+compare"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/identifiable.mli", line 25, characters 2-39 - Pair.+output is never used - <-- line 25 - val output : out_channel -> t -> unit [@@dead "Pair.+output"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/identifiable.mli", line 26, characters 2-43 - Pair.+print is never used - <-- line 26 - val print : Format.formatter -> t -> unit [@@dead "Pair.+print"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/identifiable.mli", line 100, characters 26-46 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/identifiable.mli", line 98, characters 26-46 identifiable.Make.Tbl is a dead module as all its items are dead. Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/identifiable.mli", line 100, characters 26-46 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/identifiable.mli", line 98, characters 26-46 Make.Tbl.+map is never used - <-- line 100 + <-- line 98 module Make (T : Thing) : S with type t := T.t [@@dead "Make.Tbl.+map"] Warning Dead Module @@ -13835,4 +13789,4 @@ <-- line 211 val hash : t -> int [@@dead "Type_ops.+hash"] - Analysis reported 2439 issues (Warning Dead Module:147, Warning Dead Type:225, Warning Dead Value:1815, Warning Dead Value With Side Effects:33, Warning Redundant Optional Argument:195, Warning Unused Argument:24) + Analysis reported 2431 issues (Warning Dead Module:146, Warning Dead Type:225, Warning Dead Value:1808, Warning Dead Value With Side Effects:33, Warning Redundant Optional Argument:195, Warning Unused Argument:24) diff --git a/compiler/ext/identifiable.ml b/compiler/ext/identifiable.ml index b9b88f9e4f8..91cb451ef31 100644 --- a/compiler/ext/identifiable.ml +++ b/compiler/ext/identifiable.ml @@ -80,19 +80,6 @@ module type Tbl = sig val map : 'a t -> ('a -> 'b) -> 'b t end -module Pair (A : Thing) (B : Thing) : Thing with type t = A.t * B.t = struct - type t = A.t * B.t - - let compare (a1, b1) (a2, b2) = - let c = A.compare a1 a2 in - if c <> 0 then c else B.compare b1 b2 - - let output oc (a, b) = Printf.fprintf oc " (%a, %a)" A.output a B.output b - let hash (a, b) = Hashtbl.hash (A.hash a, B.hash b) - let equal (a1, b1) (a2, b2) = A.equal a1 a2 && B.equal b1 b2 - let print ppf (a, b) = Format.fprintf ppf " (%a, @ %a)" A.print a B.print b -end - module Make_map (T : Thing) = struct include Map.Make (T) diff --git a/compiler/ext/identifiable.mli b/compiler/ext/identifiable.mli index b698fc5d3fe..6310e4dcc2b 100644 --- a/compiler/ext/identifiable.mli +++ b/compiler/ext/identifiable.mli @@ -26,8 +26,6 @@ module type Thing = sig val print : Format.formatter -> t -> unit end -module Pair : functor (A : Thing) (B : Thing) -> Thing with type t = A.t * B.t - module type Set = sig module T : Set.OrderedType include Set.S with type elt = T.t and type t = Set.Make(T).t From de068990a9332743d174e68e735e6469b8d1f394 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 14:32:11 +0000 Subject: [PATCH 143/214] dce: note ident liveness --- scripts/dce/live-findings.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/scripts/dce/live-findings.md b/scripts/dce/live-findings.md index bd1c9559c57..90f7acb14ef 100644 --- a/scripts/dce/live-findings.md +++ b/scripts/dce/live-findings.md @@ -363,6 +363,21 @@ live after manual validation. - Context: unused `Ext_obj` debug helpers (`dump_endline`, `pp_any`, `bt`) were removed. `Ext_scc.graph` remains production-live through `lam_scc.ml`. +### `Ident`, `Identifiable`, and SCC vector helpers + +- Report: `Warning Dead Value` / `Warning Dead Module`, + `compiler/ext/ident.ml` / `.mli`, `identifiable.ml` / `.mli`, + `int_vec_util.ml` / `.mli`, and `int_vec_vec.ml` / `.mli`. +- Verdict: live; false positive for the remaining reported identifiers. +- Validation: `Ident.unique_name` is used in module-inclusion diagnostics, + `Ident.is_predef_exn` is used by lambda conversion, `Ident.print` is used by + lambda and typed-tree printers, and `Ident.compare` / `equal` are used by path + comparison, type checking, maps, and hash tables. `Identifiable.Make` builds + the `Ident` set/map/table helpers. `Int_vec_util.mem` and `Int_vec_vec` are + used by `lam_scc.ml` and `ext_scc.ml`. +- Context: the unused `Identifiable.Pair` functor was removed. The remaining + warnings are cross-module/functor-signature edges missed by DCE. + ### `Ext_list` production helpers - Report: remaining `Warning Dead Value` entries in From 31a1dcc018a5c555c6c5840a6b61880641c340f2 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 14:33:59 +0000 Subject: [PATCH 144/214] dce: trim warnings API --- _dce/report.txt | 50 ++++++--------------------------------- compiler/ext/warnings.ml | 21 ---------------- compiler/ext/warnings.mli | 9 ------- 3 files changed, 7 insertions(+), 73 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index ffccdd477fd..8adf31598cf 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -10125,60 +10125,24 @@ <-- line 46 val invariant : cmp:('a -> 'a -> int) -> 'a t -> bool [@@dead "+invariant"] - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/warnings.ml", line 43, characters 2-29 - t.Bad_module_name is a variant case which is never constructed - <-- line 43 - | Bad_module_name of string [@dead "t.Bad_module_name"] (* 24 *) - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/warnings.ml", line 188, characters 0-216 - +mk_lazy is never used - <-- line 188 - raise exn) [@@dead "+mk_lazy"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/warnings.ml", line 489, characters 0-33 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/warnings.ml", line 468, characters 0-33 +reset_fatal is never used - <-- line 489 + <-- line 468 let reset_fatal () = nerrors := 0 [@@dead "+reset_fatal"] - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/warnings.mli", line 36, characters 2-29 - t.Bad_module_name is a variant case which is never constructed - <-- line 36 - | Bad_module_name of string [@dead "t.Bad_module_name"] (* 24 *) - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/warnings.mli", line 77, characters 0-24 - +is_error is never used - <-- line 77 - val is_error : t -> bool [@@dead "+is_error"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/warnings.mli", line 92, characters 0-30 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/warnings.mli", line 89, characters 0-30 +reset_fatal is never used - <-- line 92 + <-- line 89 val reset_fatal : unit -> unit [@@dead "+reset_fatal"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/warnings.mli", line 102, characters 0-39 - +mk_lazy is never used - <-- line 102 - val mk_lazy : (unit -> 'a) -> 'a Lazy.t [@@dead "+mk_lazy"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/warnings.mli", line 106, characters 0-27 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/warnings.mli", line 99, characters 0-27 +has_warnings is never used - <-- line 106 + <-- line 99 val has_warnings : bool ref [@@dead "+has_warnings"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/warnings.mli", line 108, characters 0-21 - +nerrors is never used - <-- line 108 - val nerrors : int ref [@@dead "+nerrors"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_compatible.ml", line 76, characters 0-341 +app3 is never used @@ -13789,4 +13753,4 @@ <-- line 211 val hash : t -> int [@@dead "Type_ops.+hash"] - Analysis reported 2431 issues (Warning Dead Module:146, Warning Dead Type:225, Warning Dead Value:1808, Warning Dead Value With Side Effects:33, Warning Redundant Optional Argument:195, Warning Unused Argument:24) + Analysis reported 2425 issues (Warning Dead Module:146, Warning Dead Type:223, Warning Dead Value:1804, Warning Dead Value With Side Effects:33, Warning Redundant Optional Argument:195, Warning Unused Argument:24) diff --git a/compiler/ext/warnings.ml b/compiler/ext/warnings.ml index 7acd96d03ce..3c4d294d36a 100644 --- a/compiler/ext/warnings.ml +++ b/compiler/ext/warnings.ml @@ -40,7 +40,6 @@ type t = | Nonreturning_statement (* 21 *) | Preprocessor of string (* 22 *) | Useless_record_with (* 23 *) - | Bad_module_name of string (* 24 *) | All_clauses_guarded (* 8, used to be 25 *) | Unused_var of string (* 26 *) | Unused_var_strict of string (* 27 *) @@ -93,7 +92,6 @@ let number = function | Nonreturning_statement -> 21 | Preprocessor _ -> 22 | Useless_record_with -> 23 - | Bad_module_name _ -> 24 | All_clauses_guarded -> 8 (* used to be 25 *) | Unused_var _ -> 26 | Unused_var_strict _ -> 27 @@ -185,19 +183,6 @@ let is_active x = (not !disabled) && !current.active.(number x) let is_error x = (not !disabled) && !current.error.(number x) -let mk_lazy f = - let state = backup () in - lazy - (let prev = backup () in - restore state; - try - let r = f () in - restore prev; - r - with exn -> - restore prev; - raise exn) - let parse_opt error active flags s = let set i = flags.(i) <- true in let clear i = flags.(i) <- false in @@ -308,12 +293,6 @@ let message = function | Useless_record_with -> "All the fields are already explicitly listed in this record. You can \ remove the `...` spread." - | Bad_module_name modname -> - "This file's name is potentially invalid. The build systems conventionally \ - turn a file name into a module name by upper-casing the first letter. " - ^ modname ^ " isn't a valid module name.\n" - ^ "Note: some build systems might e.g. turn kebab-case into CamelCase \ - module, which is why this isn't a hard error." | All_clauses_guarded -> "this pattern-matching is not exhaustive.\n\ All clauses in this pattern-matching are guarded." diff --git a/compiler/ext/warnings.mli b/compiler/ext/warnings.mli index 5ebdfa4b248..23b032bfaf7 100644 --- a/compiler/ext/warnings.mli +++ b/compiler/ext/warnings.mli @@ -33,7 +33,6 @@ type t = | Nonreturning_statement (* 21 *) | Preprocessor of string (* 22 *) | Useless_record_with (* 23 *) - | Bad_module_name of string (* 24 *) | All_clauses_guarded (* 8, used to be 25 *) | Unused_var of string (* 26 *) | Unused_var_strict of string (* 27 *) @@ -74,8 +73,6 @@ val without_warnings : (unit -> 'a) -> 'a val is_active : t -> bool -val is_error : t -> bool - type reporting_information = { number: int; message: string; @@ -99,14 +96,8 @@ val backup : unit -> state val restore : state -> unit -val mk_lazy : (unit -> 'a) -> 'a Lazy.t -(** Like [Lazy.of_fun], but the function is applied with - the warning settings at the time [mk_lazy] is called. *) - val has_warnings : bool ref -val nerrors : int ref - val message : t -> string val number : t -> int From b0d57737eb90dd3269114fccf3635b4f4b52b16f Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 14:34:18 +0000 Subject: [PATCH 145/214] dce: note hash liveness --- scripts/dce/live-findings.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/scripts/dce/live-findings.md b/scripts/dce/live-findings.md index 90f7acb14ef..db8dda4b192 100644 --- a/scripts/dce/live-findings.md +++ b/scripts/dce/live-findings.md @@ -378,6 +378,25 @@ live after manual validation. - Context: the unused `Identifiable.Pair` functor was removed. The remaining warnings are cross-module/functor-signature edges missed by DCE. +### Runtime package, warnings, and hash collections + +- Report: `Warning Dead Value` and `Warning Dead Module` entries in + `compiler/ext/runtime_package.ml` / `.mli`, `warnings.ml` / `.mli`, + `hash_gen.ml`, `hash_set_gen.ml`, `hash_set_ident_mask.ml` / `.mli`, and + `hash_set_poly.mli`. +- Verdict: live; false positive for the remaining production callers, with + some unit-test-only hash-set exports retained while unit tests are not being + edited. +- Validation: `Runtime_package.name` and `path` are used by compiler package + path resolution and JS package-info generation. `Warnings.reset_fatal` is used + by the playground entry point, and `Warnings.has_warnings` is used by + `lam_compile_main.cppo.ml`. `Hash_gen` / `Hash_set_gen` are wrapped by + `hash.cppo.ml` and `hash_set.cppo.ml`; `Hash_set_ident_mask` is used by + `lam_scc.ml`; `Hash_set_poly` is used by `used_attributes.ml` and covered by + unit tests for the extra collection operations. +- Context: unused `Warnings.Bad_module_name`, `mk_lazy`, and unused interface + exports were removed. + ### `Ext_list` production helpers - Report: remaining `Warning Dead Value` entries in From 29214ec6b5f5c8e0036d543ae5a30db370514c86 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 14:36:48 +0000 Subject: [PATCH 146/214] dce: trim frontend helpers --- _dce/report.txt | 98 +------------------ compiler/frontend/ast_compatible.ml | 40 +------- compiler/frontend/ast_compatible.mli | 19 +--- compiler/frontend/ast_core_type.ml | 16 --- compiler/frontend/ast_core_type.mli | 8 -- compiler/frontend/ast_exp_handle_external.ml | 44 --------- compiler/frontend/ast_exp_handle_external.mli | 2 - compiler/frontend/ast_external_mk.ml | 34 ------- compiler/frontend/ast_external_mk.mli | 10 -- 9 files changed, 4 insertions(+), 267 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index 8adf31598cf..80ad991c134 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -10143,78 +10143,6 @@ <-- line 99 val has_warnings : bool ref [@@dead "+has_warnings"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_compatible.ml", line 76, characters 0-341 - +app3 is never used - <-- line 76 - } [@@dead "+app3"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_compatible.ml", line 106, characters 0-217 - +const_exp_string is never used - <-- line 106 - } [@@dead "+const_exp_string"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_compatible.ml", line 114, characters 0-206 - +const_exp_int is never used - <-- line 114 - } [@@dead "+const_exp_int"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_compatible.ml", line 153, characters 0-104 - +const_exp_int_list_as_array is never used - <-- line 153 - Ast_helper.Exp.array (Ext_list.map xs (fun x -> const_exp_int x)) [@@dead "+const_exp_int_list_as_array"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_compatible.mli", line 31, characters 0-101 - +const_exp_string is never used - <-- line 31 - ?loc:Location.t -> ?attrs:attrs -> ?delimiter:string -> string -> expression [@@dead "+const_exp_string"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_compatible.mli", line 34, characters 0-72 - +const_exp_int is never used - <-- line 34 - val const_exp_int : ?loc:Location.t -> ?attrs:attrs -> int -> expression [@@dead "+const_exp_int"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_compatible.mli", line 36, characters 0-56 - +const_exp_int_list_as_array is never used - <-- line 36 - val const_exp_int_list_as_array : int list -> expression [@@dead "+const_exp_int_list_as_array"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_compatible.mli", line 47, characters 0-126 - +app3 is never used - <-- line 47 - expression [@@dead "+app3"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_core_type.ml", line 122, characters 0-139 - +get_uncurry_arity is never used - <-- line 122 - | _ -> None [@@dead "+get_uncurry_arity"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_core_type.ml", line 154, characters 0-178 - +add_last_obj is never used - <-- line 154 - result [@@dead "+add_last_obj"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_core_type.mli", line 44, characters 0-39 - +get_uncurry_arity is never used - <-- line 44 - val get_uncurry_arity : t -> int option [@@dead "+get_uncurry_arity"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_core_type.mli", line 53, characters 0-30 - +add_last_obj is never used - <-- line 53 - val add_last_obj : t -> t -> t [@@dead "+add_last_obj"] - Warning Dead Type File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_derive.ml", line 30, characters 2-71 gen.expression_gen is a record label never used to read a value @@ -10227,30 +10155,6 @@ <-- line 30 expression_gen: (Parsetree.core_type -> Parsetree.expression) option; [@dead "gen.expression_gen"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_exp_handle_external.ml", line 35, characters 0-1188 - +handle_external is never used - <-- line 35 - empty (Some raw_exp)) [@@dead "+handle_external"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_exp_handle_external.mli", line 25, characters 0-66 - +handle_external is never used - <-- line 25 - val handle_external : Location.t -> string -> Parsetree.expression [@@dead "+handle_external"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_external_mk.ml", line 100, characters 0-998 - +local_extern_cont_to_obj is never used - <-- line 100 - } ) [@@dead "+local_extern_cont_to_obj"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_external_mk.mli", line 50, characters 0-290 - +local_extern_cont_to_obj is never used - <-- line 50 - Parsetree.expression_desc [@@dead "+local_extern_cont_to_obj"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_literal.ml", line 31, characters 0-66 +predef_some is never used @@ -13753,4 +13657,4 @@ <-- line 211 val hash : t -> int [@@dead "Type_ops.+hash"] - Analysis reported 2425 issues (Warning Dead Module:146, Warning Dead Type:223, Warning Dead Value:1804, Warning Dead Value With Side Effects:33, Warning Redundant Optional Argument:195, Warning Unused Argument:24) + Analysis reported 2409 issues (Warning Dead Module:146, Warning Dead Type:223, Warning Dead Value:1788, Warning Dead Value With Side Effects:33, Warning Redundant Optional Argument:195, Warning Unused Argument:24) diff --git a/compiler/frontend/ast_compatible.ml b/compiler/frontend/ast_compatible.ml index 598a7ed63b2..2e5db92bc31 100644 --- a/compiler/frontend/ast_compatible.ml +++ b/compiler/frontend/ast_compatible.ml @@ -59,9 +59,9 @@ let app1 ?(loc = default_loc) ?(attrs = []) fn arg1 : expression = }; } -let app2 ?(loc = default_loc) fn arg1 arg2 : expression = +let app2 fn arg1 arg2 : expression = { - pexp_loc = loc; + pexp_loc = default_loc; pexp_attributes = []; pexp_desc = Pexp_apply @@ -73,20 +73,6 @@ let app2 ?(loc = default_loc) fn arg1 arg2 : expression = }; } -let app3 ?(loc = default_loc) ?(attrs = []) fn arg1 arg2 arg3 : expression = - { - pexp_loc = loc; - pexp_attributes = attrs; - pexp_desc = - Pexp_apply - { - funct = fn; - args = [(Nolabel, arg1); (Nolabel, arg2); (Nolabel, arg3)]; - partial = false; - transformed_jsx = false; - }; - } - let fun_ ~arity pat exp = { pexp_loc = default_loc; @@ -103,21 +89,6 @@ let fun_ ~arity pat exp = }; } -let const_exp_string ?(loc = default_loc) ?(attrs = []) ?delimiter (s : string) - : expression = - { - pexp_loc = loc; - pexp_attributes = attrs; - pexp_desc = Pexp_constant (Pconst_string (s, delimiter)); - } - -let const_exp_int ?(loc = default_loc) ?(attrs = []) (s : int) : expression = - { - pexp_loc = loc; - pexp_attributes = attrs; - pexp_desc = Pexp_constant (Pconst_integer (string_of_int s, None)); - } - let apply_labels ?(loc = default_loc) fn (args : (string * expression) list) : expression = { @@ -150,13 +121,6 @@ let rec_type_sig ?(loc = default_loc) rf tds : signature_item = tds) } *) -let const_exp_int_list_as_array xs = - Ast_helper.Exp.array (Ext_list.map xs (fun x -> const_exp_int x)) - -(* let const_exp_string_list_as_array xs = - Ast_helper.Exp.array - (Ext_list.map xs (fun x -> const_exp_string x ) ) *) - type object_field = Parsetree.object_field let object_field l attrs ty = Parsetree.Otag (l, attrs, ty) diff --git a/compiler/frontend/ast_compatible.mli b/compiler/frontend/ast_compatible.mli index c3724016299..9d8ac938473 100644 --- a/compiler/frontend/ast_compatible.mli +++ b/compiler/frontend/ast_compatible.mli @@ -28,30 +28,13 @@ type attrs = Parsetree.attribute list open Parsetree -val const_exp_string : - ?loc:Location.t -> ?attrs:attrs -> ?delimiter:string -> string -> expression - -val const_exp_int : ?loc:Location.t -> ?attrs:attrs -> int -> expression - -val const_exp_int_list_as_array : int list -> expression - val apply_simple : ?loc:Location.t -> expression -> expression list -> expression val app1 : ?loc:Location.t -> ?attrs:attrs -> expression -> expression -> expression -val app2 : - ?loc:Location.t -> expression -> expression -> expression -> expression - -val app3 : - ?loc:Location.t -> - ?attrs:attrs -> - expression -> - expression -> - expression -> - expression -> - expression +val app2 : expression -> expression -> expression -> expression val apply_labels : ?loc:Location.t -> diff --git a/compiler/frontend/ast_core_type.ml b/compiler/frontend/ast_core_type.ml index ee05b07ef8b..84442e5f0e1 100644 --- a/compiler/frontend/ast_core_type.ml +++ b/compiler/frontend/ast_core_type.ml @@ -114,16 +114,6 @@ let rec get_uncurry_arity_aux (ty : t) acc = | Ptyp_poly (_, ty) -> get_uncurry_arity_aux ty acc | _ -> acc -(** - {[ unit -> 'b ]} return arity 1 - {[ unit -> 'a1 -> a2']} arity 2 - {[ 'a1 -> 'a2 -> ... 'aN -> 'b ]} return arity N -*) -let get_uncurry_arity (ty : t) = - match ty.ptyp_desc with - | Ptyp_arrow {ret = rest} -> Some (get_uncurry_arity_aux rest 1) - | _ -> None - let get_curry_arity (ty : t) = match ty.ptyp_desc with | Ptyp_arrow {arity = Some arity} -> arity @@ -150,9 +140,3 @@ let list_of_arrow (ty : t) : t * Parsetree.arg list = | _ -> (ty, List.rev acc) in aux ty [] - -let add_last_obj (ty : t) (obj : t) = - let result, params = list_of_arrow ty in - Typ.arrows ~loc:obj.ptyp_loc - (params @ [{lbl = Nolabel; typ = obj; attrs = []}]) - result diff --git a/compiler/frontend/ast_core_type.mli b/compiler/frontend/ast_core_type.mli index dfa1f017526..76f0b44ee0d 100644 --- a/compiler/frontend/ast_core_type.mli +++ b/compiler/frontend/ast_core_type.mli @@ -41,15 +41,7 @@ val make_obj : loc:Location.t -> Parsetree.object_field list -> t val is_user_option : t -> bool -val get_uncurry_arity : t -> int option -(** - returns 0 when it can not tell arity from the syntax - None -- means not a function -*) - val list_of_arrow : t -> t * Parsetree.arg list (** fails when Ptyp_poly *) -val add_last_obj : t -> t -> t - val is_arity_one : t -> bool diff --git a/compiler/frontend/ast_exp_handle_external.ml b/compiler/frontend/ast_exp_handle_external.ml index 73818242f31..375d5e98bc0 100644 --- a/compiler/frontend/ast_exp_handle_external.ml +++ b/compiler/frontend/ast_exp_handle_external.ml @@ -22,50 +22,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *) -(** - {[ - Js.undefinedToOption - (if Js.typeof x = "undefined" then undefined - else x ) - - ]} - - @deprecated -*) -let handle_external loc (x : string) : Parsetree.expression = - let raw_exp : Ast_exp.t = - let str_exp = - Ast_compatible.const_exp_string ~loc x ~delimiter:Ext_string.empty - in - { - str_exp with - pexp_desc = - Ast_external_mk.local_external_apply loc ~pval_prim:["#raw_expr"] - ~pval_type: - (Ast_helper.Typ.arrows - [{attrs = []; lbl = Nolabel; typ = Ast_helper.Typ.any ()}] - (Ast_helper.Typ.any ())) - [str_exp]; - } - in - let empty = - (* FIXME: the empty delimiter does not make sense*) - Ast_helper.Exp.ident ~loc - {txt = Ldot (Ldot (Lident "Js", "Undefined"), "empty"); loc} - in - let undefined_typeof = - Ast_helper.Exp.ident {loc; txt = Ldot (Lident "Js", "undefinedToOption")} - in - let typeof = Ast_helper.Exp.ident {loc; txt = Ldot (Lident "Js", "typeof")} in - - Ast_compatible.app1 ~loc undefined_typeof - (Ast_helper.Exp.ifthenelse ~loc - (Ast_compatible.app2 ~loc - (Ast_helper.Exp.ident ~loc {loc; txt = Lident "=="}) - (Ast_compatible.app1 ~loc typeof raw_exp) - (Ast_compatible.const_exp_string ~loc "undefined")) - empty (Some raw_exp)) - let handle_debugger loc (payload : Ast_payload.t) = match payload with | PStr [] -> diff --git a/compiler/frontend/ast_exp_handle_external.mli b/compiler/frontend/ast_exp_handle_external.mli index c3ff047268c..74829c3547c 100644 --- a/compiler/frontend/ast_exp_handle_external.mli +++ b/compiler/frontend/ast_exp_handle_external.mli @@ -22,8 +22,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *) -val handle_external : Location.t -> string -> Parsetree.expression - val handle_debugger : Location.t -> Ast_payload.t -> Parsetree.expression_desc val handle_ffi : loc:Location.t -> payload:Ast_payload.t -> Parsetree.expression diff --git a/compiler/frontend/ast_external_mk.ml b/compiler/frontend/ast_external_mk.ml index 7a8572e1da3..08191a7c93a 100644 --- a/compiler/frontend/ast_external_mk.ml +++ b/compiler/frontend/ast_external_mk.ml @@ -96,37 +96,3 @@ let local_external_obj loc ~pval_prim ~pval_type args : } : Parsetree.expression) args ~loc ) - -let local_extern_cont_to_obj loc ?(pval_attributes = []) ~pval_prim ~pval_type - ?(local_module_name = "J") ?(local_fun_name = "unsafe_expr") - (cb : Parsetree.expression -> 'a) : Parsetree.expression_desc = - Pexp_letmodule - ( {txt = local_module_name; loc}, - { - pmod_desc = - Pmod_structure - [ - { - pstr_desc = - Pstr_primitive - { - pval_name = {txt = local_fun_name; loc}; - pval_type; - pval_loc = loc; - pval_prim; - pval_attributes; - }; - pstr_loc = loc; - }; - ]; - pmod_loc = loc; - pmod_attributes = []; - }, - cb - { - pexp_desc = - Pexp_ident - {txt = Ldot (Lident local_module_name, local_fun_name); loc}; - pexp_attributes = []; - pexp_loc = loc; - } ) diff --git a/compiler/frontend/ast_external_mk.mli b/compiler/frontend/ast_external_mk.mli index dca82b0db22..6c212073478 100644 --- a/compiler/frontend/ast_external_mk.mli +++ b/compiler/frontend/ast_external_mk.mli @@ -46,13 +46,3 @@ val local_external_obj : (string * Parsetree.expression) list -> (* [ (label, exp )]*) Parsetree.expression_desc - -val local_extern_cont_to_obj : - Location.t -> - ?pval_attributes:Parsetree.attributes -> - pval_prim:string list -> - pval_type:Parsetree.core_type -> - ?local_module_name:string -> - ?local_fun_name:string -> - (Parsetree.expression -> Parsetree.expression) -> - Parsetree.expression_desc From 44dda5d05545a98dfc9b3ed855f0e36139a06338 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 14:39:14 +0000 Subject: [PATCH 147/214] dce: trim frontend literals --- _dce/report.txt | 130 ++++-------------------------- compiler/frontend/ast_literal.ml | 42 ---------- compiler/frontend/ast_literal.mli | 14 ---- 3 files changed, 15 insertions(+), 171 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index 80ad991c134..fd4cb243b1a 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -10156,147 +10156,47 @@ expression_gen: (Parsetree.core_type -> Parsetree.expression) option; [@dead "gen.expression_gen"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_literal.ml", line 31, characters 0-66 - +predef_some is never used - <-- line 31 - let predef_some : Longident.t = Ldot (predef_prefix_ident, "Some") [@@dead "+predef_some"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_literal.ml", line 33, characters 0-66 - +predef_none is never used - <-- line 33 - let predef_none : Longident.t = Ldot (predef_prefix_ident, "None") [@@dead "+predef_none"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_literal.ml", line 48, characters 2-33 - Lid.+type_exn is never used - <-- line 48 - let type_exn : t = Lident "exn" [@@dead "Lid.+type_exn"] (* use *predef* *) - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_literal.ml", line 52, characters 2-58 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_literal.ml", line 42, characters 2-58 Lid.+pervasives is never used - <-- line 52 + <-- line 42 let pervasives : t = Lident Primitive_modules.pervasives [@@dead "Lid.+pervasives"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_literal.ml", line 60, characters 2-49 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_literal.ml", line 50, characters 2-49 Lid.+ignore_id is never used - <-- line 60 + <-- line 50 let ignore_id : t = Ldot (pervasives, "ignore") [@@dead "Lid.+ignore_id"] - Warning Dead Value With Side Effects - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_literal.ml", line 84, characters 2-85 - No_loc.+type_exn is never used and could have side effects - - Warning Dead Value With Side Effects - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_literal.ml", line 89, characters 2-90 - No_loc.+type_bigint is never used and could have side effects - - Warning Dead Value With Side Effects - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_literal.ml", line 98, characters 2-38 - No_loc.+type_any is never used and could have side effects - - Warning Dead Value With Side Effects - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_literal.ml", line 100, characters 2-61 - No_loc.+pat_unit is never used and could have side effects - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_literal.ml", line 122, characters 0-156 - +type_exn is never used - <-- line 122 - Ast_helper.Typ.mk ~loc (Ptyp_constr ({txt = Lid.type_exn; loc}, [])) [@@dead "+type_exn"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_literal.ml", line 150, characters 0-165 - +type_bigint is never used - <-- line 150 - Ast_helper.Typ.mk ~loc (Ptyp_constr ({txt = Lid.type_bigint; loc}, [])) [@@dead "+type_bigint"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_literal.ml", line 156, characters 0-110 - +type_any is never used - <-- line 156 - | Some loc -> Ast_helper.Typ.any ~loc () [@@dead "+type_any"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_literal.ml", line 161, characters 0-133 - +pat_unit is never used - <-- line 161 - | Some loc -> Pat.construct ~loc {txt = Lid.val_unit; loc} None [@@dead "+pat_unit"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_literal.mli", line 29, characters 0-29 - +predef_some is never used - <-- line 29 - val predef_some : Longident.t [@@dead "+predef_some"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_literal.mli", line 31, characters 0-29 - +predef_none is never used - <-- line 31 - val predef_none : Longident.t [@@dead "+predef_none"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_literal.mli", line 36, characters 2-18 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_literal.mli", line 32, characters 2-18 Lid.+val_unit is never used - <-- line 36 + <-- line 32 val val_unit : t [@@dead "Lid.+val_unit"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_literal.mli", line 38, characters 2-19 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_literal.mli", line 34, characters 2-19 Lid.+type_unit is never used - <-- line 38 + <-- line 34 val type_unit : t [@@dead "Lid.+type_unit"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_literal.mli", line 40, characters 2-18 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_literal.mli", line 36, characters 2-18 Lid.+type_int is never used - <-- line 40 + <-- line 36 val type_int : t [@@dead "Lid.+type_int"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_literal.mli", line 42, characters 2-21 - Lid.+type_bigint is never used - <-- line 42 - val type_bigint : t [@@dead "Lid.+type_bigint"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_literal.mli", line 44, characters 2-20 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_literal.mli", line 38, characters 2-20 Lid.+pervasives is never used - <-- line 44 + <-- line 38 val pervasives : t [@@dead "Lid.+pervasives"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_literal.mli", line 52, characters 2-19 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_literal.mli", line 46, characters 2-19 Lid.+ignore_id is never used - <-- line 52 + <-- line 46 val ignore_id : t [@@dead "Lid.+ignore_id"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_literal.mli", line 73, characters 0-28 - +type_exn is never used - <-- line 73 - val type_exn : core_type_lit [@@dead "+type_exn"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_literal.mli", line 83, characters 0-31 - +type_bigint is never used - <-- line 83 - val type_bigint : core_type_lit [@@dead "+type_bigint"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_literal.mli", line 85, characters 0-28 - +type_any is never used - <-- line 85 - val type_any : core_type_lit [@@dead "+type_any"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_literal.mli", line 87, characters 0-26 - +pat_unit is never used - <-- line 87 - val pat_unit : pattern_lit [@@dead "+pat_unit"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_pat.ml", line 27, characters 0-130 +is_unit_cont is never used @@ -13657,4 +13557,4 @@ <-- line 211 val hash : t -> int [@@dead "Type_ops.+hash"] - Analysis reported 2409 issues (Warning Dead Module:146, Warning Dead Type:223, Warning Dead Value:1788, Warning Dead Value With Side Effects:33, Warning Redundant Optional Argument:195, Warning Unused Argument:24) + Analysis reported 2391 issues (Warning Dead Module:146, Warning Dead Type:223, Warning Dead Value:1774, Warning Dead Value With Side Effects:29, Warning Redundant Optional Argument:195, Warning Unused Argument:24) diff --git a/compiler/frontend/ast_literal.ml b/compiler/frontend/ast_literal.ml index 50ea292d53d..8663708d123 100644 --- a/compiler/frontend/ast_literal.ml +++ b/compiler/frontend/ast_literal.ml @@ -22,16 +22,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *) -open Ast_helper - let predef_prefix_ident : Longident.t = Lident "*predef*" let predef_option : Longident.t = Ldot (predef_prefix_ident, "option") -let predef_some : Longident.t = Ldot (predef_prefix_ident, "Some") - -let predef_none : Longident.t = Ldot (predef_prefix_ident, "None") - module Lid = struct type t = Longident.t @@ -43,10 +37,6 @@ module Lid = struct let type_int : t = Lident "int" (* use *predef* *) - let type_bigint : t = Lident "bigint" (* use *predef* *) - - let type_exn : t = Lident "exn" (* use *predef* *) - let type_bool : t = Lident "bool" (* use *predef* *) let pervasives : t = Lident Primitive_modules.pervasives @@ -81,23 +71,13 @@ module No_loc = struct let type_unit = Ast_helper.Typ.mk (Ptyp_constr ({txt = Lid.type_unit; loc}, [])) - let type_exn = - Ast_helper.Typ.mk (Ptyp_constr ({txt = Lid.type_unit; loc}, [])) - let type_int = Ast_helper.Typ.mk (Ptyp_constr ({txt = Lid.type_int; loc}, [])) - let type_bigint = - Ast_helper.Typ.mk (Ptyp_constr ({txt = Lid.type_bigint; loc}, [])) - let type_string = Ast_helper.Typ.mk (Ptyp_constr ({txt = Lid.type_string; loc}, [])) let type_bool = Ast_helper.Typ.mk (Ptyp_constr ({txt = Lid.type_bool; loc}, [])) - - let type_any = Ast_helper.Typ.any () - - let pat_unit = Pat.construct {txt = Lid.val_unit; loc} None end type 'a lit = ?loc:Location.t -> unit -> 'a @@ -119,12 +99,6 @@ let type_unit ?loc () = | Some loc -> Ast_helper.Typ.mk ~loc (Ptyp_constr ({txt = Lid.type_unit; loc}, [])) -let type_exn ?loc () = - match loc with - | None -> No_loc.type_exn - | Some loc -> - Ast_helper.Typ.mk ~loc (Ptyp_constr ({txt = Lid.type_exn; loc}, [])) - let type_string ?loc () = match loc with | None -> No_loc.type_string @@ -146,19 +120,3 @@ let type_int ?loc () = let type_float = Ast_helper.Typ.mk (Ptyp_constr ({txt = Lident "float"; loc = Location.none}, [])) - -let type_bigint ?loc () = - match loc with - | None -> No_loc.type_bigint - | Some loc -> - Ast_helper.Typ.mk ~loc (Ptyp_constr ({txt = Lid.type_bigint; loc}, [])) - -let type_any ?loc () = - match loc with - | None -> No_loc.type_any - | Some loc -> Ast_helper.Typ.any ~loc () - -let pat_unit ?loc () = - match loc with - | None -> No_loc.pat_unit - | Some loc -> Pat.construct ~loc {txt = Lid.val_unit; loc} None diff --git a/compiler/frontend/ast_literal.mli b/compiler/frontend/ast_literal.mli index 82d57261715..a94623644a6 100644 --- a/compiler/frontend/ast_literal.mli +++ b/compiler/frontend/ast_literal.mli @@ -26,10 +26,6 @@ type 'a lit = ?loc:Location.t -> unit -> 'a val predef_option : Longident.t -val predef_some : Longident.t - -val predef_none : Longident.t - module Lid : sig type t = Longident.t @@ -39,8 +35,6 @@ module Lid : sig val type_int : t - val type_bigint : t - val pervasives : t val js_oo : t @@ -70,8 +64,6 @@ val val_unit : expression_lit val type_unit : core_type_lit -val type_exn : core_type_lit - val type_string : core_type_lit val type_bool : core_type_lit @@ -79,9 +71,3 @@ val type_bool : core_type_lit val type_int : core_type_lit val type_float : Parsetree.core_type - -val type_bigint : core_type_lit - -val type_any : core_type_lit - -val pat_unit : pattern_lit From d4d008d544a198bd8ef831d03b19a8d88002c091 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 14:41:06 +0000 Subject: [PATCH 148/214] dce: trim frontend helpers --- _dce/report.txt | 74 +---------------------- compiler/frontend/ast_derive.ml | 1 - compiler/frontend/ast_derive.mli | 1 - compiler/frontend/ast_derive_js_mapper.ml | 1 - compiler/frontend/ast_derive_projector.ml | 1 - compiler/frontend/ast_pat.ml | 24 -------- compiler/frontend/ast_pat.mli | 8 --- compiler/frontend/ast_polyvar.ml | 21 ------- compiler/frontend/ast_polyvar.mli | 3 - compiler/frontend/ast_structure.ml | 2 - compiler/frontend/ast_structure.mli | 2 - 11 files changed, 1 insertion(+), 137 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index fd4cb243b1a..cf0c0ca18e3 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -10143,18 +10143,6 @@ <-- line 99 val has_warnings : bool ref [@@dead "+has_warnings"] - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_derive.ml", line 30, characters 2-71 - gen.expression_gen is a record label never used to read a value - <-- line 30 - expression_gen: (Parsetree.core_type -> Parsetree.expression) option; [@dead "gen.expression_gen"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_derive.mli", line 30, characters 2-71 - gen.expression_gen is a record label never used to read a value - <-- line 30 - expression_gen: (Parsetree.core_type -> Parsetree.expression) option; [@dead "gen.expression_gen"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_literal.ml", line 42, characters 2-58 Lid.+pervasives is never used @@ -10197,66 +10185,6 @@ <-- line 46 val ignore_id : t [@@dead "Lid.+ignore_id"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_pat.ml", line 27, characters 0-130 - +is_unit_cont is never used - <-- line 27 - | _ -> no [@@dead "+is_unit_cont"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_pat.ml", line 35, characters 0-383 - +arity_of_fun is never used - <-- line 35 - is_unit_cont ~yes:0 ~no:1 pat + aux e [@@dead "+arity_of_fun"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_pat.ml", line 46, characters 0-149 - +labels_of_fun is never used - <-- line 46 - | _ -> [] [@@dead "+labels_of_fun"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_pat.mli", line 27, characters 0-45 - +is_unit_cont is never used - <-- line 27 - val is_unit_cont : yes:'a -> no:'a -> t -> 'a [@@dead "+is_unit_cont"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_pat.mli", line 29, characters 0-51 - +arity_of_fun is never used - <-- line 29 - val arity_of_fun : t -> Parsetree.expression -> int [@@dead "+arity_of_fun"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_pat.mli", line 33, characters 0-67 - +labels_of_fun is never used - <-- line 33 - val labels_of_fun : Parsetree.expression -> Asttypes.arg_label list [@@dead "+labels_of_fun"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_polyvar.ml", line 44, characters 0-594 - +map_constructor_declarations_into_ints is never used - <-- line 44 - | `complex -> `New (List.rev acc) [@@dead "+map_constructor_declarations_into_ints"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_polyvar.mli", line 29, characters 0-124 - +map_constructor_declarations_into_ints is never used - <-- line 29 - Parsetree.constructor_declaration list -> [`Offset of int | `New of int list] [@@dead "+map_constructor_declarations_into_ints"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_structure.ml", line 53, characters 0-72 - +dummy_item is never used - <-- line 53 - let dummy_item loc : item = Str.eval ~loc (Ast_literal.val_unit ~loc ()) [@@dead "+dummy_item"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_structure.mli", line 40, characters 0-35 - +dummy_item is never used - <-- line 40 - val dummy_item : Location.t -> item [@@dead "+dummy_item"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_utf8_string.ml", line 184, characters 0-157 +transform_test is never used @@ -13557,4 +13485,4 @@ <-- line 211 val hash : t -> int [@@dead "Type_ops.+hash"] - Analysis reported 2391 issues (Warning Dead Module:146, Warning Dead Type:223, Warning Dead Value:1774, Warning Dead Value With Side Effects:29, Warning Redundant Optional Argument:195, Warning Unused Argument:24) + Analysis reported 2379 issues (Warning Dead Module:146, Warning Dead Type:221, Warning Dead Value:1764, Warning Dead Value With Side Effects:29, Warning Redundant Optional Argument:195, Warning Unused Argument:24) diff --git a/compiler/frontend/ast_derive.ml b/compiler/frontend/ast_derive.ml index e6b3c14b0c5..2be46c30b32 100644 --- a/compiler/frontend/ast_derive.ml +++ b/compiler/frontend/ast_derive.ml @@ -27,7 +27,6 @@ type tdcls = Parsetree.type_declaration list type gen = { structure_gen: tdcls -> Asttypes.rec_flag -> Ast_structure.t; signature_gen: tdcls -> Asttypes.rec_flag -> Ast_signature.t; - expression_gen: (Parsetree.core_type -> Parsetree.expression) option; } (* the first argument is [config] payload diff --git a/compiler/frontend/ast_derive.mli b/compiler/frontend/ast_derive.mli index 4355525a2c0..f13aaffab13 100644 --- a/compiler/frontend/ast_derive.mli +++ b/compiler/frontend/ast_derive.mli @@ -27,7 +27,6 @@ type tdcls = Parsetree.type_declaration list type gen = { structure_gen: tdcls -> Asttypes.rec_flag -> Ast_structure.t; signature_gen: tdcls -> Asttypes.rec_flag -> Ast_signature.t; - expression_gen: (Parsetree.core_type -> Parsetree.expression) option; } val register : string -> (Parsetree.expression option -> gen) -> unit diff --git a/compiler/frontend/ast_derive_js_mapper.ml b/compiler/frontend/ast_derive_js_mapper.ml index 4ff05c9056e..6ec3ec0d803 100644 --- a/compiler/frontend/ast_derive_js_mapper.ml +++ b/compiler/frontend/ast_derive_js_mapper.ml @@ -354,5 +354,4 @@ let init () = [] in Ext_list.flat_map tdcls handle_tdcl); - expression_gen = None; }) diff --git a/compiler/frontend/ast_derive_projector.ml b/compiler/frontend/ast_derive_projector.ml index 3d2c7d19620..36efb81ceba 100644 --- a/compiler/frontend/ast_derive_projector.ml +++ b/compiler/frontend/ast_derive_projector.ml @@ -173,5 +173,4 @@ let init () = [] in Ext_list.flat_map tdcls handle_tdcl); - expression_gen = None; }) diff --git a/compiler/frontend/ast_pat.ml b/compiler/frontend/ast_pat.ml index 12b99ace36f..9022be76c7d 100644 --- a/compiler/frontend/ast_pat.ml +++ b/compiler/frontend/ast_pat.ml @@ -24,30 +24,6 @@ type t = Parsetree.pattern -let is_unit_cont ~yes ~no (p : t) = - match p with - | {ppat_desc = Ppat_construct ({txt = Lident "()"}, None)} -> yes - | _ -> no - -(** [arity_of_fun pat e] tells the arity of - expression [fun pat -> e] -*) -let arity_of_fun (pat : Parsetree.pattern) (e : Parsetree.expression) = - let rec aux (e : Parsetree.expression) = - match e.pexp_desc with - | Pexp_fun {rhs = e} -> 1 + aux e (*FIXME error on optional*) - (* | Pexp_fun _ - -> Location.raise_errorf - ~loc:e.pexp_loc "Label is not allowed in JS object" *) - | _ -> 0 - in - is_unit_cont ~yes:0 ~no:1 pat + aux e - -let rec labels_of_fun (e : Parsetree.expression) = - match e.pexp_desc with - | Pexp_fun {arg_label = l; rhs = e} -> l :: labels_of_fun e - | _ -> [] - let rec is_single_variable_pattern_conservative (p : t) = match p.ppat_desc with | Parsetree.Ppat_any -> Some "" diff --git a/compiler/frontend/ast_pat.mli b/compiler/frontend/ast_pat.mli index 3689c09fc50..8aee23b7d39 100644 --- a/compiler/frontend/ast_pat.mli +++ b/compiler/frontend/ast_pat.mli @@ -24,12 +24,4 @@ type t = Parsetree.pattern -val is_unit_cont : yes:'a -> no:'a -> t -> 'a - -val arity_of_fun : t -> Parsetree.expression -> int -(** [arity_of_fun pat e] tells the arity of - expression [fun pat -> e]*) - -val labels_of_fun : Parsetree.expression -> Asttypes.arg_label list - val is_single_variable_pattern_conservative : t -> string option diff --git a/compiler/frontend/ast_polyvar.ml b/compiler/frontend/ast_polyvar.ml index 5d04a5beb89..efc87e02e2e 100644 --- a/compiler/frontend/ast_polyvar.ml +++ b/compiler/frontend/ast_polyvar.ml @@ -37,27 +37,6 @@ let map_row_fields_into_ints ptyp_loc (row_fields : Parsetree.row_field list) = in List.rev acc -(** Note this is okay with enums, for variants, - the underlying representation may change due to - unbox -*) -let map_constructor_declarations_into_ints - (row_fields : Parsetree.constructor_declaration list) = - let mark = ref `nothing in - let _, acc = - Ext_list.fold_left row_fields (0, []) (fun (i, acc) rtag -> - let attrs = rtag.pcd_attributes in - match Ast_attributes.iter_process_bs_int_as attrs with - | Some j -> - if j <> i then if i = 0 then mark := `offset j else mark := `complex; - (j + 1, j :: acc) - | None -> (i + 1, i :: acc)) - in - match !mark with - | `nothing -> `Offset 0 - | `offset j -> `Offset j - | `complex -> `New (List.rev acc) - (** It also check in-consistency of cases like {[ [`a | `c of int ] ]} *) diff --git a/compiler/frontend/ast_polyvar.mli b/compiler/frontend/ast_polyvar.mli index af509f56aa8..814e670b9a0 100644 --- a/compiler/frontend/ast_polyvar.mli +++ b/compiler/frontend/ast_polyvar.mli @@ -26,9 +26,6 @@ val map_row_fields_into_ints : Location.t -> Parsetree.row_field list -> (string * int) list (** side effect: it will mark used attributes `as` *) -val map_constructor_declarations_into_ints : - Parsetree.constructor_declaration list -> [`Offset of int | `New of int list] - val map_row_fields_into_strings : Location.t -> Parsetree.row_field list -> External_arg_spec.attr diff --git a/compiler/frontend/ast_structure.ml b/compiler/frontend/ast_structure.ml index b4152e884e3..844232d9378 100644 --- a/compiler/frontend/ast_structure.ml +++ b/compiler/frontend/ast_structure.ml @@ -49,5 +49,3 @@ let constraint_ ?(loc = Location.none) (stru : t) (sign : Ast_signature.t) = Str.include_ ~loc (Incl.mk ~loc (Mod.constraint_ ~loc (Mod.structure ~loc stru) (Mty.signature ~loc sign))) - -let dummy_item loc : item = Str.eval ~loc (Ast_literal.val_unit ~loc ()) diff --git a/compiler/frontend/ast_structure.mli b/compiler/frontend/ast_structure.mli index 240cbc3ee9e..dd0a406c56d 100644 --- a/compiler/frontend/ast_structure.mli +++ b/compiler/frontend/ast_structure.mli @@ -36,5 +36,3 @@ val fuse_all : ?loc:Ast_helper.loc -> t -> item item *) val constraint_ : ?loc:Ast_helper.loc -> t -> Ast_signature.t -> item - -val dummy_item : Location.t -> item From d03d317a71c9f30dde677b6a475efea86af3f6c0 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 14:42:35 +0000 Subject: [PATCH 149/214] dce: root utf8 test hook --- _dce/report.txt | 32 ++++++--------------------- compiler/frontend/ast_utf8_string.ml | 1 + compiler/frontend/ast_utf8_string.mli | 4 +--- 3 files changed, 9 insertions(+), 28 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index cf0c0ca18e3..2c2d7baba2f 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -10186,39 +10186,21 @@ val ignore_id : t [@@dead "Lid.+ignore_id"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_utf8_string.ml", line 184, characters 0-157 - +transform_test is never used - <-- line 184 - Buffer.contents buf [@@dead "+transform_test"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_utf8_string.ml", line 199, characters 0-370 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_utf8_string.ml", line 200, characters 0-370 +check_no_escapes_or_unicode is never used - <-- line 199 + <-- line 200 | Invalid | Cont _ | Leading _ -> false [@@dead "+check_no_escapes_or_unicode"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_utf8_string.ml", line 209, characters 0-75 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_utf8_string.ml", line 210, characters 0-75 +simple_comparison is never used - <-- line 209 + <-- line 210 let simple_comparison s = check_no_escapes_or_unicode s 0 (String.length s) [@@dead "+simple_comparison"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_utf8_string.mli", line 29, characters 0-48 - +pp_error is never used - <-- line 29 - val pp_error : Format.formatter -> error -> unit [@@dead "+pp_error"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_utf8_string.mli", line 35, characters 0-37 - +transform_test is never used - <-- line 35 - val transform_test : string -> string [@@dead "+transform_test"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_utf8_string.mli", line 40, characters 0-38 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_utf8_string.mli", line 38, characters 0-38 +simple_comparison is never used - <-- line 40 + <-- line 38 val simple_comparison : string -> bool [@@dead "+simple_comparison"] Warning Dead Type @@ -13485,4 +13467,4 @@ <-- line 211 val hash : t -> int [@@dead "Type_ops.+hash"] - Analysis reported 2379 issues (Warning Dead Module:146, Warning Dead Type:221, Warning Dead Value:1764, Warning Dead Value With Side Effects:29, Warning Redundant Optional Argument:195, Warning Unused Argument:24) + Analysis reported 2376 issues (Warning Dead Module:146, Warning Dead Type:221, Warning Dead Value:1761, Warning Dead Value With Side Effects:29, Warning Redundant Optional Argument:195, Warning Unused Argument:24) diff --git a/compiler/frontend/ast_utf8_string.ml b/compiler/frontend/ast_utf8_string.ml index 75b17029346..737415d9439 100644 --- a/compiler/frontend/ast_utf8_string.ml +++ b/compiler/frontend/ast_utf8_string.ml @@ -186,6 +186,7 @@ let transform_test s = let buf = Buffer.create (s_len * 2) in check_and_transform 0 buf s 0 s_len; Buffer.contents buf +[@@live] let transform loc s = let s_len = String.length s in diff --git a/compiler/frontend/ast_utf8_string.mli b/compiler/frontend/ast_utf8_string.mli index 588125f4250..86999287e20 100644 --- a/compiler/frontend/ast_utf8_string.mli +++ b/compiler/frontend/ast_utf8_string.mli @@ -26,13 +26,11 @@ type error type exn += Error of int (* offset *) * error -val pp_error : Format.formatter -> error -> unit - (* module Interp : sig *) (* val check_and_transform : int -> string -> int -> cxt -> unit *) (* val transform_test : string -> segments *) (* end *) -val transform_test : string -> string +val transform_test : string -> string [@@live] val transform : Location.t -> string -> string From 60c41e2ca81f2710a8f55a0528b55711f7859eb6 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 14:43:56 +0000 Subject: [PATCH 150/214] dce: trim literal interface --- _dce/report.txt | 42 +++++-------------------------- compiler/frontend/ast_literal.ml | 4 +-- compiler/frontend/ast_literal.mli | 8 ------ 3 files changed, 7 insertions(+), 47 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index 2c2d7baba2f..b0b3d1d7fb5 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -10144,45 +10144,15 @@ val has_warnings : bool ref [@@dead "+has_warnings"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_literal.ml", line 42, characters 2-58 - Lid.+pervasives is never used - <-- line 42 - let pervasives : t = Lident Primitive_modules.pervasives [@@dead "Lid.+pervasives"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_literal.ml", line 50, characters 2-49 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_literal.ml", line 48, characters 2-74 Lid.+ignore_id is never used - <-- line 50 - let ignore_id : t = Ldot (pervasives, "ignore") [@@dead "Lid.+ignore_id"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_literal.mli", line 32, characters 2-18 - Lid.+val_unit is never used - <-- line 32 - val val_unit : t [@@dead "Lid.+val_unit"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_literal.mli", line 34, characters 2-19 - Lid.+type_unit is never used - <-- line 34 - val type_unit : t [@@dead "Lid.+type_unit"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_literal.mli", line 36, characters 2-18 - Lid.+type_int is never used - <-- line 36 - val type_int : t [@@dead "Lid.+type_int"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_literal.mli", line 38, characters 2-20 - Lid.+pervasives is never used - <-- line 38 - val pervasives : t [@@dead "Lid.+pervasives"] + <-- line 48 + let ignore_id : t = Ldot (Lident Primitive_modules.pervasives, "ignore") [@@dead "Lid.+ignore_id"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_literal.mli", line 46, characters 2-19 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_literal.mli", line 38, characters 2-19 Lid.+ignore_id is never used - <-- line 46 + <-- line 38 val ignore_id : t [@@dead "Lid.+ignore_id"] Warning Dead Value @@ -13467,4 +13437,4 @@ <-- line 211 val hash : t -> int [@@dead "Type_ops.+hash"] - Analysis reported 2376 issues (Warning Dead Module:146, Warning Dead Type:221, Warning Dead Value:1761, Warning Dead Value With Side Effects:29, Warning Redundant Optional Argument:195, Warning Unused Argument:24) + Analysis reported 2371 issues (Warning Dead Module:146, Warning Dead Type:221, Warning Dead Value:1756, Warning Dead Value With Side Effects:29, Warning Redundant Optional Argument:195, Warning Unused Argument:24) diff --git a/compiler/frontend/ast_literal.ml b/compiler/frontend/ast_literal.ml index 8663708d123..eda0e09274a 100644 --- a/compiler/frontend/ast_literal.ml +++ b/compiler/frontend/ast_literal.ml @@ -39,15 +39,13 @@ module Lid = struct let type_bool : t = Lident "bool" (* use *predef* *) - let pervasives : t = Lident Primitive_modules.pervasives - (* FIXME: Use primitive module *) let js_oo : t = Lident "Js_OO" (* FIXME: Use primitive module *) let js_meth_callback : t = Ldot (js_oo, "Callback") - let ignore_id : t = Ldot (pervasives, "ignore") + let ignore_id : t = Ldot (Lident Primitive_modules.pervasives, "ignore") let hidden_field n : t = Lident ("I" ^ n) diff --git a/compiler/frontend/ast_literal.mli b/compiler/frontend/ast_literal.mli index a94623644a6..4425fb846d9 100644 --- a/compiler/frontend/ast_literal.mli +++ b/compiler/frontend/ast_literal.mli @@ -29,14 +29,6 @@ val predef_option : Longident.t module Lid : sig type t = Longident.t - val val_unit : t - - val type_unit : t - - val type_int : t - - val pervasives : t - val js_oo : t val js_meth_callback : t From 31460295ce86b128eb3121129afc61d5b41871c7 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 14:44:21 +0000 Subject: [PATCH 151/214] dce: note frontend liveness --- scripts/dce/live-findings.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/scripts/dce/live-findings.md b/scripts/dce/live-findings.md index db8dda4b192..147273c3b98 100644 --- a/scripts/dce/live-findings.md +++ b/scripts/dce/live-findings.md @@ -260,6 +260,23 @@ live after manual validation. - Context: Reanalyze misses the cross-module roots even though these constants determine generated runtime import names. +### Frontend literal and UTF-8 helpers + +- Report: `Warning Dead Value`, `compiler/frontend/ast_literal.ml` / `.mli`, + `Lid.ignore_id`; and `compiler/frontend/ast_utf8_string.ml` / `.mli`, + `check_no_escapes_or_unicode` and `simple_comparison`. +- Verdict: live; false positives for the remaining reported entries. +- Validation: `compiler/frontend/ast_comb.ml` uses + `Ast_literal.Lid.ignore_id` to build calls to the compiler's ignore + primitive. `compiler/core/js_exp_make.ml` calls + `Ast_utf8_string.simple_comparison` from `str_equal` so string literal + equality can be folded only when there are no escape or unicode surprises; the + private `check_no_escapes_or_unicode` helper feeds that exported function. +- Context: stale `Ast_literal.Lid` exports, unused literal constructors, + orphaned frontend helpers, and the `Ast_utf8_string.pp_error` export were + removed. `Ast_utf8_string.transform_test` is retained as a unit-test support + hook and marked `[@@live]`. + ### `Ext_util` table helpers - Report: `Warning Dead Value`, `compiler/ext/ext_util.ml` / `.mli`, for From c3564c473eaccb16a5a6a4dcd7cef9fe793dace2 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 14:46:13 +0000 Subject: [PATCH 152/214] dce: trim frontend constants --- _dce/report.txt | 114 ++++-------------------- compiler/core/lam_constant_convert.ml | 3 +- compiler/frontend/bs_syntaxerr.ml | 2 - compiler/frontend/bs_syntaxerr.mli | 2 - compiler/frontend/external_arg_spec.mli | 2 - compiler/frontend/lam_constant.ml | 5 +- compiler/frontend/lam_constant.mli | 3 - 7 files changed, 20 insertions(+), 111 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index b0b3d1d7fb5..35d250ce697 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -6620,7 +6620,7 @@ +lam_constant_convert is a dead module as all its items are dead. Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_constant_convert.ml", line 25, characters 0-2504 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_constant_convert.ml", line 25, characters 0-2474 +convert_constant is never used <-- line 25 | _ -> assert false)) [@@dead "+convert_constant"] @@ -10173,136 +10173,58 @@ <-- line 38 val simple_comparison : string -> bool [@@dead "+simple_comparison"] - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/bs_syntaxerr.ml", line 25, characters 24-38 - untagged_variant.OnlyOneUnknown is a variant case which is never constructed - <-- line 25 - type untagged_variant = OnlyOneUnknown [@dead "untagged_variant.OnlyOneUnknown"] | AtMostOneObject | AtMostOneArray - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/bs_syntaxerr.ml", line 25, characters 39-56 - untagged_variant.AtMostOneObject is a variant case which is never constructed - <-- line 25 - type untagged_variant = OnlyOneUnknown [@dead "untagged_variant.OnlyOneUnknown"] | AtMostOneObject [@dead "untagged_variant.AtMostOneObject"] | AtMostOneArray - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/bs_syntaxerr.ml", line 25, characters 57-73 - untagged_variant.AtMostOneArray is a variant case which is never constructed - <-- line 25 - type untagged_variant = OnlyOneUnknown [@dead "untagged_variant.OnlyOneUnknown"] | AtMostOneObject [@dead "untagged_variant.AtMostOneObject"] | AtMostOneArray [@dead "untagged_variant.AtMostOneArray"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/bs_syntaxerr.mli", line 25, characters 24-38 - untagged_variant.OnlyOneUnknown is a variant case which is never constructed - <-- line 25 - type untagged_variant = OnlyOneUnknown [@dead "untagged_variant.OnlyOneUnknown"] | AtMostOneObject | AtMostOneArray - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/bs_syntaxerr.mli", line 25, characters 39-56 - untagged_variant.AtMostOneObject is a variant case which is never constructed - <-- line 25 - type untagged_variant = OnlyOneUnknown [@dead "untagged_variant.OnlyOneUnknown"] | AtMostOneObject [@dead "untagged_variant.AtMostOneObject"] | AtMostOneArray - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/bs_syntaxerr.mli", line 25, characters 57-73 - untagged_variant.AtMostOneArray is a variant case which is never constructed - <-- line 25 - type untagged_variant = OnlyOneUnknown [@dead "untagged_variant.OnlyOneUnknown"] | AtMostOneObject [@dead "untagged_variant.AtMostOneObject"] | AtMostOneArray [@dead "untagged_variant.AtMostOneArray"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/external_arg_spec.mli", line 60, characters 0-23 - +empty_label is never used - <-- line 60 - val empty_label : label [@@dead "+empty_label"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/external_ffi_types.mli", line 95, characters 0-29 +from_string is never used <-- line 95 val from_string : string -> t [@@dead "+from_string"] - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/lam_constant.ml", line 27, characters 2-13 - constructor_tag.const is a record label never used to read a value - <-- line 27 - const: int; [@dead "constructor_tag.const"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/lam_constant.ml", line 28, characters 2-17 - constructor_tag.non_const is a record label never used to read a value - <-- line 28 - non_const: int; [@dead "constructor_tag.non_const"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/lam_constant.ml", line 35, characters 2-18 - pointer_info.Some is a variant case which is never constructed - <-- line 35 - | Some of string [@dead "pointer_info.Some"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/lam_constant.ml", line 37, characters 0-205 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/lam_constant.ml", line 34, characters 0-190 +string_of_pointer_info is never used - <-- line 37 + <-- line 34 | None -> None [@@dead "+string_of_pointer_info"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/lam_constant.ml", line 61, characters 0-1153 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/lam_constant.ml", line 58, characters 0-1153 +eq_approx is never used - <-- line 61 + <-- line 58 | _ -> false) [@@dead "+eq_approx"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/lam_constant.ml", line 102, characters 0-55 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/lam_constant.ml", line 99, characters 0-55 +lam_none is never used - <-- line 102 + <-- line 99 let lam_none : t = Const_js_undefined {is_unit = false} [@@dead "+lam_none"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/lam_constant.ml", line 104, characters 0-324 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/lam_constant.ml", line 101, characters 0-324 +is_allocating is never used - <-- line 104 + <-- line 101 false [@@dead "+is_allocating"] - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/lam_constant.mli", line 27, characters 2-13 - constructor_tag.const is a record label never used to read a value - <-- line 27 - const: int; [@dead "constructor_tag.const"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/lam_constant.mli", line 28, characters 2-17 - constructor_tag.non_const is a record label never used to read a value - <-- line 28 - non_const: int; [@dead "constructor_tag.non_const"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/lam_constant.mli", line 35, characters 2-18 - pointer_info.Some is a variant case which is never constructed - <-- line 35 - | Some of string [@dead "pointer_info.Some"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/lam_constant.mli", line 37, characters 0-58 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/lam_constant.mli", line 34, characters 0-58 +string_of_pointer_info is never used - <-- line 37 + <-- line 34 val string_of_pointer_info : pointer_info -> string option [@@dead "+string_of_pointer_info"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/lam_constant.mli", line 57, characters 0-30 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/lam_constant.mli", line 54, characters 0-30 +eq_approx is never used - <-- line 57 + <-- line 54 val eq_approx : t -> t -> bool [@@dead "+eq_approx"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/lam_constant.mli", line 59, characters 0-16 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/lam_constant.mli", line 56, characters 0-16 +lam_none is never used - <-- line 59 + <-- line 56 val lam_none : t [@@dead "+lam_none"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/lam_constant.mli", line 61, characters 0-29 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/lam_constant.mli", line 58, characters 0-29 +is_allocating is never used - <-- line 61 + <-- line 58 val is_allocating : t -> bool [@@dead "+is_allocating"] Warning Dead Module @@ -13437,4 +13359,4 @@ <-- line 211 val hash : t -> int [@@dead "Type_ops.+hash"] - Analysis reported 2371 issues (Warning Dead Module:146, Warning Dead Type:221, Warning Dead Value:1756, Warning Dead Value With Side Effects:29, Warning Redundant Optional Argument:195, Warning Unused Argument:24) + Analysis reported 2358 issues (Warning Dead Module:146, Warning Dead Type:209, Warning Dead Value:1755, Warning Dead Value With Side Effects:29, Warning Redundant Optional Argument:195, Warning Unused Argument:24) diff --git a/compiler/core/lam_constant_convert.ml b/compiler/core/lam_constant_convert.ml index a5764124949..a7217de481f 100644 --- a/compiler/core/lam_constant_convert.ml +++ b/compiler/core/lam_constant_convert.ml @@ -52,8 +52,7 @@ let rec convert_constant (const : Lambda.structured_constant) : Lam_constant.t = Const_int { i = Int32.of_int i; - comment = - Pt_constructor {cstr_name = {name; tag_type}; const; non_const}; + comment = Pt_constructor {cstr_name = {name; tag_type}}; } | Pt_variant {name} -> if Ext_string.is_valid_hash_number name then diff --git a/compiler/frontend/bs_syntaxerr.ml b/compiler/frontend/bs_syntaxerr.ml index 062e38ff93c..d47a1c3fd02 100644 --- a/compiler/frontend/bs_syntaxerr.ml +++ b/compiler/frontend/bs_syntaxerr.ml @@ -22,8 +22,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *) -type untagged_variant = OnlyOneUnknown | AtMostOneObject | AtMostOneArray - type error = | Unsupported_predicates | Duplicated_bs_deriving diff --git a/compiler/frontend/bs_syntaxerr.mli b/compiler/frontend/bs_syntaxerr.mli index 3f457b0d5c1..8d3f0977a28 100644 --- a/compiler/frontend/bs_syntaxerr.mli +++ b/compiler/frontend/bs_syntaxerr.mli @@ -22,8 +22,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *) -type untagged_variant = OnlyOneUnknown | AtMostOneObject | AtMostOneArray - type error = | Unsupported_predicates | Duplicated_bs_deriving diff --git a/compiler/frontend/external_arg_spec.mli b/compiler/frontend/external_arg_spec.mli index 6c79a3380ab..c5e3f63a9c1 100644 --- a/compiler/frontend/external_arg_spec.mli +++ b/compiler/frontend/external_arg_spec.mli @@ -57,8 +57,6 @@ val cst_int : int -> cst val cst_string : string -> delim -> cst -val empty_label : label - (* val empty_lit : cst -> label *) val obj_label : string -> label diff --git a/compiler/frontend/lam_constant.ml b/compiler/frontend/lam_constant.ml index c5bab8ffa9d..571e634159a 100644 --- a/compiler/frontend/lam_constant.ml +++ b/compiler/frontend/lam_constant.ml @@ -24,19 +24,16 @@ type constructor_tag = { cstr_name: Ast_untagged_variants.tag; - const: int; - non_const: int; } type pointer_info = | None | Pt_constructor of constructor_tag | Pt_assertfalse - | Some of string let string_of_pointer_info (x : pointer_info) : string option = match x with - | Some name | Pt_constructor {cstr_name = {name}; _} -> Some name + | Pt_constructor {cstr_name = {name}} -> Some name | Pt_assertfalse -> Some "assert_false" | None -> None diff --git a/compiler/frontend/lam_constant.mli b/compiler/frontend/lam_constant.mli index 846e29d7439..008d738b1d1 100644 --- a/compiler/frontend/lam_constant.mli +++ b/compiler/frontend/lam_constant.mli @@ -24,15 +24,12 @@ type constructor_tag = { cstr_name: Ast_untagged_variants.tag; - const: int; - non_const: int; } type pointer_info = | None | Pt_constructor of constructor_tag | Pt_assertfalse - | Some of string val string_of_pointer_info : pointer_info -> string option From 42773b4bbadd90e1c48955c63b2b51c5aad46492 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 14:46:37 +0000 Subject: [PATCH 153/214] dce: note frontend constants --- scripts/dce/live-findings.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/scripts/dce/live-findings.md b/scripts/dce/live-findings.md index 147273c3b98..7534e4244ff 100644 --- a/scripts/dce/live-findings.md +++ b/scripts/dce/live-findings.md @@ -277,6 +277,25 @@ live after manual validation. removed. `Ast_utf8_string.transform_test` is retained as a unit-test support hook and marked `[@@live]`. +### Frontend FFI and lambda constants + +- Report: `Warning Dead Value`, `compiler/frontend/external_ffi_types.mli`, + `from_string`; and `compiler/frontend/lam_constant.ml` / `.mli`, + `string_of_pointer_info`, `eq_approx`, `lam_none`, and `is_allocating`. +- Verdict: live; false positives for the remaining reported entries. +- Validation: `compiler/core/lam_convert.ml` calls + `External_ffi_types.from_string` while lowering primitive externals. + `compiler/core/lam_compile_const.ml` calls + `Lam_constant.string_of_pointer_info` for generated integer comments, + `compiler/core/lam.ml` calls `Lam_constant.eq_approx` when comparing + constants, `compiler/core/lam_constant_convert.ml` uses `Lam_constant.lam_none` + for `Pt_shape_none`, and `compiler/core/lam_util.cppo.ml` calls + `Lam_constant.is_allocating` before preserving constant bindings. +- Context: the orphaned `Bs_syntaxerr.untagged_variant` type, the over-exported + `External_arg_spec.empty_label`, unused `Lam_constant.constructor_tag` fields, + and the unconstructed `Lam_constant.pointer_info.Some` case were removed. + What remains is cross-module compiler-core use that reanalyze does not root. + ### `Ext_util` table helpers - Report: `Warning Dead Value`, `compiler/ext/ext_util.ml` / `.mli`, for From c1f2e4f03dec8b5dd05a4e62d9c912a4915fc929 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 14:48:14 +0000 Subject: [PATCH 154/214] dce: trim gentype config --- _dce/report.txt | 14 +------------- compiler/gentype/gentype_config.ml | 3 --- compiler/gentype/paths.ml | 2 -- 3 files changed, 1 insertion(+), 18 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index 35d250ce697..4c2cef336d4 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -10237,12 +10237,6 @@ <-- line 4 let compare (x : int) (y : int) = compare x y [@@dead "Int_map.+compare"] - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/gentype/gentype_config.ml", line 16, characters 2-27 - t.bsb_project_root is a record label never used to read a value - <-- line 16 - bsb_project_root: string; [@dead "t.bsb_project_root"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/gentype/module_name.ml", line 27, characters 0-44 +compare is never used @@ -10255,12 +10249,6 @@ <-- line 3 val compare : t -> t -> int [@@dead "+compare"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/gentype/paths.ml", line 3, characters 0-28 - +concat is never used - <-- line 3 - let concat = Filename.concat [@@dead "+concat"] - Warning Dead Module File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/gentype/resolved_name.ml", line 10, characters 0-336 +resolved_name.Name_set is a dead module as all its items are dead. @@ -13359,4 +13347,4 @@ <-- line 211 val hash : t -> int [@@dead "Type_ops.+hash"] - Analysis reported 2358 issues (Warning Dead Module:146, Warning Dead Type:209, Warning Dead Value:1755, Warning Dead Value With Side Effects:29, Warning Redundant Optional Argument:195, Warning Unused Argument:24) + Analysis reported 2356 issues (Warning Dead Module:146, Warning Dead Type:208, Warning Dead Value:1754, Warning Dead Value With Side Effects:29, Warning Redundant Optional Argument:195, Warning Unused Argument:24) diff --git a/compiler/gentype/gentype_config.ml b/compiler/gentype/gentype_config.ml index dd0d8361afb..a130e855970 100644 --- a/compiler/gentype/gentype_config.ml +++ b/compiler/gentype/gentype_config.ml @@ -13,7 +13,6 @@ type module_resolution = type bs_version = int * int * int type t = { - bsb_project_root: string; bs_dependencies: string list; dep_paths: (string, string) Hashtbl.t; (** Map from package name to its install path, used to locate @@ -36,7 +35,6 @@ type t = { let default = { - bsb_project_root = ""; bs_dependencies = []; dep_paths = Hashtbl.create 0; emit_import_curry = false; @@ -158,7 +156,6 @@ let build_config ~namespace = tbl in { - bsb_project_root; bs_dependencies = !bs_dependencies_flag; dep_paths; emit_import_curry = false; diff --git a/compiler/gentype/paths.ml b/compiler/gentype/paths.ml index b5e7daaae58..2c825165397 100644 --- a/compiler/gentype/paths.ml +++ b/compiler/gentype/paths.ml @@ -1,7 +1,5 @@ open Gentype_common -let concat = Filename.concat - let handle_namespace cmt = let cut_after_dash s = match String.index s '-' with From 3030b0234da7262f8d9339eb291f97543f25b0c7 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 14:48:36 +0000 Subject: [PATCH 155/214] dce: note gentype liveness --- scripts/dce/live-findings.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/scripts/dce/live-findings.md b/scripts/dce/live-findings.md index 7534e4244ff..e6848be0178 100644 --- a/scripts/dce/live-findings.md +++ b/scripts/dce/live-findings.md @@ -296,6 +296,24 @@ live after manual validation. and the unconstructed `Lam_constant.pointer_info.Some` case were removed. What remains is cross-module compiler-core use that reanalyze does not root. +### GenType map/set helpers + +- Report: `Warning Dead Module` / `Warning Dead Value`, + `compiler/gentype/gen_ident.ml`, `module_name.ml` / `.mli`, and + `resolved_name.ml`, for `Int_map`, `Module_name.compare`, and + `Resolved_name.Name_set`. +- Verdict: live; false positives. +- Validation: `compiler/gentype/gen_ident.ml` uses `Int_map.empty`, `find`, and + `add` to assign stable generated names for anonymous type ids. + `Gentype_config.Module_name_map`, `module_resolver.ml`, and `emit_js.ml` build + maps with `Module_name` as the ordered key module, so `Module_name.compare` is + consumed by `Map.Make`. `Resolved_name.Name_set` is used by + `apply_equations_to_elements`, which is reached from + `compiler/gentype/translation.ml` through `Resolved_name.apply_equations`. +- Context: the unused `Paths.concat` alias and the stored-but-unread + `Gentype_config.t.bsb_project_root` field were removed. The remaining + warnings are callback/cross-module edges missed by DCE. + ### `Ext_util` table helpers - Report: `Warning Dead Value`, `compiler/ext/ext_util.ml` / `.mli`, for From 3864b902e58f44cabb96bd8aa5fcbe70d26048ff Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 14:50:32 +0000 Subject: [PATCH 156/214] dce: trim call annotations --- _dce/report.txt | 90 +++++++++++++----------------------------- compiler/ml/annot.ml | 4 -- compiler/ml/stypes.ml | 16 -------- compiler/ml/stypes.mli | 1 - 4 files changed, 27 insertions(+), 84 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index 4c2cef336d4..6b4c0c60396 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -10259,24 +10259,6 @@ <-- line 13 | false -> compare rest1 rest2) [@@dead "Name_set.+compare"] - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/annot.ml", line 18, characters 12-16 - call.Tail is a variant case which is never constructed - <-- line 18 - type call = Tail [@dead "call.Tail"] | Stack | Inline - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/annot.ml", line 18, characters 17-24 - call.Stack is a variant case which is never constructed - <-- line 18 - type call = Tail [@dead "call.Tail"] | Stack [@dead "call.Stack"] | Inline - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/annot.ml", line 18, characters 25-33 - call.Inline is a variant case which is never constructed - <-- line 18 - type call = Tail [@dead "call.Tail"] | Stack [@dead "call.Stack"] | Inline [@dead "call.Inline"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper.ml", line 28, characters 0-182 +with_default_loc is never used @@ -12831,76 +12813,64 @@ <-- line 35 | Ti_class of unit [@dead "annotation.Ti_class"] - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/stypes.ml", line 37, characters 2-38 - annotation.An_call is a variant case which is never constructed - <-- line 37 - | An_call of Location.t * Annot.call [@dead "annotation.An_call"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/stypes.ml", line 62, characters 0-176 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/stypes.ml", line 60, characters 0-176 +cmp_loc_inner_first is never used - <-- line 62 + <-- line 60 | x -> x [@@dead "+cmp_loc_inner_first"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/stypes.ml", line 66, characters 0-92 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/stypes.ml", line 64, characters 0-92 +cmp_ti_inner_first is never used - <-- line 66 + <-- line 64 cmp_loc_inner_first (get_location ti1) (get_location ti2) [@@dead "+cmp_ti_inner_first"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/stypes.ml", line 69, characters 0-333 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/stypes.ml", line 67, characters 0-333 +print_position is never used - <-- line 69 + <-- line 67 output_int pp pos.pos_cnum) [@@dead "+print_position"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/stypes.ml", line 81, characters 0-116 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/stypes.ml", line 79, characters 0-116 +print_location is never used - <-- line 81 + <-- line 79 print_position pp loc.loc_end [@@dead "+print_location"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/stypes.ml", line 86, characters 0-406 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/stypes.ml", line 84, characters 0-406 +sort_filter_phrases is never used - <-- line 86 + <-- line 84 phrases := loop [] Location.none ph [@@dead "+sort_filter_phrases"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/stypes.ml", line 100, characters 0-208 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/stypes.ml", line 98, characters 0-208 +printtyp_reset_maybe is never used - <-- line 100 + <-- line 98 | _ -> () [@@dead "+printtyp_reset_maybe"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/stypes.ml", line 108, characters 0-102 - +call_kind_string is never used - <-- line 108 - | Inline -> "inline" [@@dead "+call_kind_string"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/stypes.ml", line 114, characters 0-448 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/stypes.ml", line 106, characters 0-448 +print_ident_annot is never used - <-- line 114 + <-- line 106 output_char pp '\n' [@@dead "+print_ident_annot"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/stypes.ml", line 135, characters 0-1140 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/stypes.ml", line 127, characters 0-914 +print_info is never used - <-- line 135 + <-- line 127 loc [@@dead "+print_info"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/stypes.ml", line 171, characters 0-108 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/stypes.ml", line 155, characters 0-108 +get_info is never used - <-- line 171 + <-- line 155 info [@@dead "+get_info"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/stypes.ml", line 176, characters 0-423 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/stypes.ml", line 160, characters 0-423 +dump is never used - <-- line 176 + <-- line 160 else annotations := [] [@@dead "+dump"] Warning Dead Type @@ -12909,28 +12879,22 @@ <-- line 25 | Ti_class of unit [@dead "annotation.Ti_class"] - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/stypes.mli", line 27, characters 2-38 - annotation.An_call is a variant case which is never constructed - <-- line 27 - | An_call of Location.t * Annot.call [@dead "annotation.An_call"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/stypes.mli", line 32, characters 0-32 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/stypes.mli", line 31, characters 0-32 +dump is never used - <-- line 32 + <-- line 31 val dump : string option -> unit [@@dead "+dump"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/stypes.mli", line 34, characters 0-43 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/stypes.mli", line 33, characters 0-43 +get_location is never used - <-- line 34 + <-- line 33 val get_location : annotation -> Location.t [@@dead "+get_location"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/stypes.mli", line 35, characters 0-38 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/stypes.mli", line 34, characters 0-38 +get_info is never used - <-- line 35 + <-- line 34 val get_info : unit -> annotation list [@@dead "+get_info"] Warning Dead Value @@ -13347,4 +13311,4 @@ <-- line 211 val hash : t -> int [@@dead "Type_ops.+hash"] - Analysis reported 2356 issues (Warning Dead Module:146, Warning Dead Type:208, Warning Dead Value:1754, Warning Dead Value With Side Effects:29, Warning Redundant Optional Argument:195, Warning Unused Argument:24) + Analysis reported 2350 issues (Warning Dead Module:146, Warning Dead Type:203, Warning Dead Value:1753, Warning Dead Value With Side Effects:29, Warning Redundant Optional Argument:195, Warning Unused Argument:24) diff --git a/compiler/ml/annot.ml b/compiler/ml/annot.ml index 13a586592ec..e590aa47332 100644 --- a/compiler/ml/annot.ml +++ b/compiler/ml/annot.ml @@ -13,10 +13,6 @@ (* *) (**************************************************************************) -(* Data types for annotations (Stypes.ml) *) - -type call = Tail | Stack | Inline - type ident = | Iref_internal of Location.t (* defining occurrence *) | Iref_external diff --git a/compiler/ml/stypes.ml b/compiler/ml/stypes.ml index 0584b169388..4d0eaa41a10 100644 --- a/compiler/ml/stypes.ml +++ b/compiler/ml/stypes.ml @@ -34,7 +34,6 @@ type annotation = | Ti_expr of expression | Ti_class of unit | Ti_mod of module_expr - | An_call of Location.t * Annot.call | An_ident of Location.t * string * Annot.ident let get_location ti = @@ -43,7 +42,6 @@ let get_location ti = | Ti_expr e -> e.exp_loc | Ti_class () -> assert false | Ti_mod m -> m.mod_loc - | An_call (l, _k) -> l | An_ident (l, _s, _k) -> l let annotations = ref ([] : annotation list) @@ -105,12 +103,6 @@ let rec printtyp_reset_maybe loc = printtyp_reset_maybe loc | _ -> () -let call_kind_string k = - match k with - | Tail -> "tail" - | Stack -> "stack" - | Inline -> "inline" - let print_ident_annot pp str k = match k with | Idef l -> @@ -151,14 +143,6 @@ let print_info pp prev_loc ti = output_string pp s; output_string pp ")\n"; loc - | An_call (loc, k) -> - if loc <> prev_loc then ( - print_location pp loc; - output_char pp '\n'); - output_string pp "call(\n "; - output_string pp (call_kind_string k); - output_string pp "\n)\n"; - loc | An_ident (loc, str, k) -> if loc <> prev_loc then ( print_location pp loc; diff --git a/compiler/ml/stypes.mli b/compiler/ml/stypes.mli index 3182f7eb9ae..6ad1c36c865 100644 --- a/compiler/ml/stypes.mli +++ b/compiler/ml/stypes.mli @@ -24,7 +24,6 @@ type annotation = | Ti_expr of expression | Ti_class of unit | Ti_mod of module_expr - | An_call of Location.t * Annot.call | An_ident of Location.t * string * Annot.ident val record : annotation -> unit From 697d486789e4b65b44e37e1d8624c33898d85eb5 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 14:53:23 +0000 Subject: [PATCH 157/214] dce: trim ast helper --- _dce/report.txt | 180 +------------------------------------ compiler/ml/ast_helper.ml | 40 +-------- compiler/ml/ast_helper.mli | 30 ------- 3 files changed, 2 insertions(+), 248 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index 6b4c0c60396..48109349be6 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -10259,184 +10259,6 @@ <-- line 13 | false -> compare rest1 rest2) [@@dead "Name_set.+compare"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper.ml", line 28, characters 0-182 - +with_default_loc is never used - <-- line 28 - raise exn [@@dead "+with_default_loc"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper.ml", line 42, characters 2-67 - Const.+int32 is never used - <-- line 42 - let int32 ?(suffix = 'l') i = integer ~suffix (Int32.to_string i) [@@dead "Const.+int32"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper.ml", line 43, characters 2-67 - Const.+int64 is never used - <-- line 43 - let int64 ?(suffix = 'L') i = integer ~suffix (Int64.to_string i) [@@dead "Const.+int64"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper.ml", line 44, characters 2-75 - Const.+nativeint is never used - <-- line 44 - let nativeint ?(suffix = 'n') i = integer ~suffix (Nativeint.to_string i) [@@dead "Const.+nativeint"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper.ml", line 45, characters 2-48 - Const.+float is never used - <-- line 45 - let float ?suffix f = Pconst_float (f, suffix) [@@dead "Const.+float"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper.ml", line 46, characters 2-40 - Const.+char is never used - <-- line 46 - let char c = Pconst_char (Char.code c) [@@dead "Const.+char"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper.ml", line 53, characters 2-67 - Typ.+attr is never used - <-- line 53 - let attr d a = {d with ptyp_attributes = d.ptyp_attributes @ [a]} [@@dead "Typ.+attr"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper.ml", line 134, characters 2-67 - Pat.+attr is never used - <-- line 134 - let attr d a = {d with ppat_attributes = d.ppat_attributes @ [a]} [@@dead "Pat.+attr"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper.ml", line 158, characters 2-67 - Exp.+attr is never used - <-- line 158 - let attr d a = {d with pexp_attributes = d.pexp_attributes @ [a]} [@@dead "Exp.+attr"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper.ml", line 257, characters 2-67 - Mty.+attr is never used - <-- line 257 - let attr d a = {d with pmty_attributes = d.pmty_attributes @ [a]} [@@dead "Mty.+attr"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper.ml", line 271, characters 2-67 - Mod.+attr is never used - <-- line 271 - let attr d a = {d with pmod_attributes = d.pmod_attributes @ [a]} [@@dead "Mod.+attr"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper.ml", line 419, characters 2-219 - Te.+decl is never used - <-- line 419 - } [@@dead "Te.+decl"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper.ml", line 428, characters 2-183 - Te.+rebind is never used - <-- line 428 - } [@@dead "Te.+rebind"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper.mli", line 1, characters 0-0 - ast_helper is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper.mli", line 28, characters 0-25 - +default_loc is never used - <-- line 28 - val default_loc : loc ref [@@dead "+default_loc"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper.mli", line 31, characters 0-48 - +with_default_loc is never used - <-- line 31 - val with_default_loc : loc -> (unit -> 'a) -> 'a [@@dead "+with_default_loc"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper.mli", line 38, characters 2-29 - Const.+char is never used - <-- line 38 - val char : char -> constant [@@dead "Const.+char"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper.mli", line 40, characters 2-50 - Const.+integer is never used - <-- line 40 - val integer : ?suffix:char -> string -> constant [@@dead "Const.+integer"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper.mli", line 42, characters 2-47 - Const.+int32 is never used - <-- line 42 - val int32 : ?suffix:char -> int32 -> constant [@@dead "Const.+int32"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper.mli", line 43, characters 2-47 - Const.+int64 is never used - <-- line 43 - val int64 : ?suffix:char -> int64 -> constant [@@dead "Const.+int64"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper.mli", line 44, characters 2-55 - Const.+nativeint is never used - <-- line 44 - val nativeint : ?suffix:char -> nativeint -> constant [@@dead "Const.+nativeint"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper.mli", line 45, characters 2-48 - Const.+float is never used - <-- line 45 - val float : ?suffix:char -> string -> constant [@@dead "Const.+float"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper.mli", line 53, characters 2-48 - Typ.+attr is never used - <-- line 53 - val attr : core_type -> attribute -> core_type [@@dead "Typ.+attr"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper.mli", line 92, characters 2-44 - Pat.+attr is never used - <-- line 92 - val attr : pattern -> attribute -> pattern [@@dead "Pat.+attr"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper.mli", line 121, characters 2-50 - Exp.+attr is never used - <-- line 121 - val attr : expression -> attribute -> expression [@@dead "Exp.+attr"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper.mli", line 310, characters 2-142 - Te.+decl is never used - <-- line 310 - extension_constructor [@@dead "Te.+decl"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper.mli", line 317, characters 2-78 - Te.+rebind is never used - <-- line 317 - val rebind : ?loc:loc -> ?attrs:attrs -> str -> lid -> extension_constructor [@@dead "Te.+rebind"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper.mli", line 330, characters 2-52 - Mty.+attr is never used - <-- line 330 - val attr : module_type -> attribute -> module_type [@@dead "Mty.+attr"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper.mli", line 354, characters 2-70 - Mod.+mk is never used - <-- line 354 - val mk : ?loc:loc -> ?attrs:attrs -> module_expr_desc -> module_expr [@@dead "Mod.+mk"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper.mli", line 355, characters 2-52 - Mod.+attr is never used - <-- line 355 - val attr : module_expr -> attribute -> module_expr [@@dead "Mod.+attr"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 28, characters 0-182 +with_default_loc is never used @@ -13311,4 +13133,4 @@ <-- line 211 val hash : t -> int [@@dead "Type_ops.+hash"] - Analysis reported 2350 issues (Warning Dead Module:146, Warning Dead Type:203, Warning Dead Value:1753, Warning Dead Value With Side Effects:29, Warning Redundant Optional Argument:195, Warning Unused Argument:24) + Analysis reported 2320 issues (Warning Dead Module:145, Warning Dead Type:203, Warning Dead Value:1724, Warning Dead Value With Side Effects:29, Warning Redundant Optional Argument:195, Warning Unused Argument:24) diff --git a/compiler/ml/ast_helper.ml b/compiler/ml/ast_helper.ml index 2b6becf61c9..8ba76ac6077 100644 --- a/compiler/ml/ast_helper.ml +++ b/compiler/ml/ast_helper.ml @@ -25,32 +25,14 @@ type attrs = attribute list let default_loc = ref Location.none -let with_default_loc l f = - let old = !default_loc in - default_loc := l; - try - let r = f () in - default_loc := old; - r - with exn -> - default_loc := old; - raise exn - module Const = struct - let integer ?suffix i = Pconst_integer (i, suffix) - let int i = integer (string_of_int i) - let int32 ?(suffix = 'l') i = integer ~suffix (Int32.to_string i) - let int64 ?(suffix = 'L') i = integer ~suffix (Int64.to_string i) - let nativeint ?(suffix = 'n') i = integer ~suffix (Nativeint.to_string i) - let float ?suffix f = Pconst_float (f, suffix) - let char c = Pconst_char (Char.code c) + let int i = Pconst_integer (string_of_int i, None) let string s = Pconst_string (s, None) end module Typ = struct let mk ?(loc = !default_loc) ?(attrs = []) d = {ptyp_desc = d; ptyp_loc = loc; ptyp_attributes = attrs} - let attr d a = {d with ptyp_attributes = d.ptyp_attributes @ [a]} let any ?loc ?attrs () = mk ?loc ?attrs Ptyp_any let var ?loc ?attrs a = mk ?loc ?attrs (Ptyp_var a) @@ -131,7 +113,6 @@ end module Pat = struct let mk ?(loc = !default_loc) ?(attrs = []) d = {ppat_desc = d; ppat_loc = loc; ppat_attributes = attrs} - let attr d a = {d with ppat_attributes = d.ppat_attributes @ [a]} let any ?loc ?attrs () = mk ?loc ?attrs Ppat_any let var ?loc ?attrs a = mk ?loc ?attrs (Ppat_var a) @@ -155,7 +136,6 @@ end module Exp = struct let mk ?(loc = !default_loc) ?(attrs = []) d = {pexp_desc = d; pexp_loc = loc; pexp_attributes = attrs} - let attr d a = {d with pexp_attributes = d.pexp_attributes @ [a]} let ident ?loc ?attrs a = mk ?loc ?attrs (Pexp_ident a) let constant ?loc ?attrs a = mk ?loc ?attrs (Pexp_constant a) @@ -254,7 +234,6 @@ end module Mty = struct let mk ?(loc = !default_loc) ?(attrs = []) d = {pmty_desc = d; pmty_loc = loc; pmty_attributes = attrs} - let attr d a = {d with pmty_attributes = d.pmty_attributes @ [a]} let ident ?loc ?attrs a = mk ?loc ?attrs (Pmty_ident a) let alias ?loc ?attrs a = mk ?loc ?attrs (Pmty_alias a) @@ -268,7 +247,6 @@ end module Mod = struct let mk ?(loc = !default_loc) ?(attrs = []) d = {pmod_desc = d; pmod_loc = loc; pmod_attributes = attrs} - let attr d a = {d with pmod_attributes = d.pmod_attributes @ [a]} let ident ?loc ?attrs x = mk ?loc ?attrs (Pmod_ident x) let structure ?loc ?attrs x = mk ?loc ?attrs (Pmod_structure x) @@ -416,22 +394,6 @@ module Te = struct pext_attributes = attrs; } - let decl ?(loc = !default_loc) ?(attrs = []) ?(args = Pcstr_tuple []) ?res - name = - { - pext_name = name; - pext_kind = Pext_decl (args, res); - pext_loc = loc; - pext_attributes = attrs; - } - - let rebind ?(loc = !default_loc) ?(attrs = []) name lid = - { - pext_name = name; - pext_kind = Pext_rebind lid; - pext_loc = loc; - pext_attributes = attrs; - } end module Jsx = struct diff --git a/compiler/ml/ast_helper.mli b/compiler/ml/ast_helper.mli index 24a592173b7..9c3f4f9ba1d 100644 --- a/compiler/ml/ast_helper.mli +++ b/compiler/ml/ast_helper.mli @@ -23,26 +23,11 @@ type str = string loc type loc = Location.t type attrs = attribute list -(** {1 Default locations} *) - -val default_loc : loc ref -(** Default value for all optional location arguments. *) - -val with_default_loc : loc -> (unit -> 'a) -> 'a -(** Set the [default_loc] within the scope of the execution - of the provided function. *) - (** {1 Constants} *) module Const : sig - val char : char -> constant val string : string -> constant - val integer : ?suffix:char -> string -> constant val int : int -> constant - val int32 : ?suffix:char -> int32 -> constant - val int64 : ?suffix:char -> int64 -> constant - val nativeint : ?suffix:char -> nativeint -> constant - val float : ?suffix:char -> string -> constant end (** {1 Core language} *) @@ -50,7 +35,6 @@ end (** Type expressions *) module Typ : sig val mk : ?loc:loc -> ?attrs:attrs -> core_type_desc -> core_type - val attr : core_type -> attribute -> core_type val any : ?loc:loc -> ?attrs:attrs -> unit -> core_type val var : ?loc:loc -> ?attrs:attrs -> string -> core_type @@ -89,7 +73,6 @@ end (** Patterns *) module Pat : sig val mk : ?loc:loc -> ?attrs:attrs -> pattern_desc -> pattern - val attr : pattern -> attribute -> pattern val any : ?loc:loc -> ?attrs:attrs -> unit -> pattern val var : ?loc:loc -> ?attrs:attrs -> str -> pattern @@ -118,7 +101,6 @@ end (** Expressions *) module Exp : sig val mk : ?loc:loc -> ?attrs:attrs -> expression_desc -> expression - val attr : expression -> attribute -> expression val ident : ?loc:loc -> ?attrs:attrs -> lid -> expression val constant : ?loc:loc -> ?attrs:attrs -> constant -> expression @@ -307,14 +289,6 @@ module Te : sig extension_constructor_kind -> extension_constructor - val decl : - ?loc:loc -> - ?attrs:attrs -> - ?args:constructor_arguments -> - ?res:core_type -> - str -> - extension_constructor - val rebind : ?loc:loc -> ?attrs:attrs -> str -> lid -> extension_constructor end module Jsx : sig @@ -327,7 +301,6 @@ end (** Module type expressions *) module Mty : sig val mk : ?loc:loc -> ?attrs:attrs -> module_type_desc -> module_type - val attr : module_type -> attribute -> module_type val ident : ?loc:loc -> ?attrs:attrs -> lid -> module_type val alias : ?loc:loc -> ?attrs:attrs -> lid -> module_type @@ -351,9 +324,6 @@ end (** Module expressions *) module Mod : sig - val mk : ?loc:loc -> ?attrs:attrs -> module_expr_desc -> module_expr - val attr : module_expr -> attribute -> module_expr - val ident : ?loc:loc -> ?attrs:attrs -> lid -> module_expr val structure : ?loc:loc -> ?attrs:attrs -> structure -> module_expr val functor_ : From 88ff69af07062c2e7156498ddbe270343a00be55 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 14:53:53 +0000 Subject: [PATCH 158/214] dce: note ast helper0 liveness --- scripts/dce/live-findings.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/dce/live-findings.md b/scripts/dce/live-findings.md index e6848be0178..a53f1dfef95 100644 --- a/scripts/dce/live-findings.md +++ b/scripts/dce/live-findings.md @@ -17,10 +17,12 @@ live after manual validation. `process_cmt_files`; `process_cmt_files` mutates it from `Reactive_analysis.process_files` stats when reactive mode is active. -### `Ast_helper0` helper labels +### `Ast_helper0` compatibility helper surface -- Report: many `Warning Redundant Optional Argument` entries in - `compiler/ml/ast_helper0.ml`, starting with `Te.constructor`, `Te.mk`, +- Report: many `Warning Dead Value`, `Warning Dead Module`, and + `Warning Redundant Optional Argument` entries in `compiler/ml/ast_helper0.ml` + / `.mli`, including helper submodules such as `Const`, `Typ`, `Pat`, `Exp`, + `Mty`, `Mod`, and `Te`, plus optional labels on `Te.constructor`, `Te.mk`, `Type.field`, and `Type.constructor`. - Verdict: live compatibility surface; do not remove as part of this DCE pass. - Validation: `compiler/ml/ast_mapper_to0.ml` opens `Ast_helper0` and uses these From 237d5fd8cfabdded12c8ee835d8e61cfa620c83c Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 14:54:51 +0000 Subject: [PATCH 159/214] dce: note ast mapper liveness --- scripts/dce/live-findings.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/scripts/dce/live-findings.md b/scripts/dce/live-findings.md index a53f1dfef95..1acd878712e 100644 --- a/scripts/dce/live-findings.md +++ b/scripts/dce/live-findings.md @@ -34,6 +34,23 @@ live after manual validation. changing this helper API for locally redundant labels is higher risk than the DCE warning suggests. +### `Ast_mapper` PPX compatibility API + +- Report: `Warning Dead Value` / `Warning Dead Module`, + `compiler/ml/ast_mapper.ml` / `.mli`, including `attribute_of_warning`, + `String_map`, `get_cookie`, `set_cookie`, `tool_name`, `apply`, + `run_main`, `register_function`, `register`, and convenience exports. +- Verdict: live compatibility surface; do not remove as part of this DCE pass. +- Validation: compiler code uses the core mapper through + `compiler/syntax/src/jsx_v4.ml`, `jsx_ppx.ml`, and `compiler/ml/subst.ml`. + `compiler/core/cmd_ppx_apply.ml` uses the ppx context add/drop helpers around + external mapper execution. The remaining API is the documented standalone + `-ppx` mapper surface in `ast_mapper.mli`, including registration and cookie + functions for mapper authors/drivers. +- Context: reanalyze sees repository-internal roots but not external compiler + library consumers. This module intentionally mirrors the OCaml PPX mapper API, + so pruning apparently unused public functions would risk breaking ppx tooling. + ### `Type_utils` type argument contexts - Report: `Warning Unused Argument`, `analysis/src/type_utils.ml`, optional From 5512ec75f4d4d6fc677dacd6fe2c605481aeec45 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 14:55:52 +0000 Subject: [PATCH 160/214] dce: trim mapper helpers --- _dce/report.txt | 14 +------------- compiler/ml/ast_mapper_from0.ml | 1 - compiler/ml/ast_mapper_to0.ml | 1 - 3 files changed, 1 insertion(+), 15 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index 48109349be6..08fe15bf8ec 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -10529,18 +10529,6 @@ <-- line 188 val get_cookie : string -> Parsetree.expression option [@@dead "+get_cookie"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_mapper_from0.ml", line 79, characters 0-31 - +map_snd is never used - <-- line 79 - let map_snd f (x, y) = (x, f y) [@@dead "+map_snd"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_mapper_to0.ml", line 73, characters 0-31 - +map_snd is never used - <-- line 73 - let map_snd f (x, y) = (x, f y) [@@dead "+map_snd"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_payload.ml", line 42, characters 0-341 +is_single_string_as_ast is never used @@ -13133,4 +13121,4 @@ <-- line 211 val hash : t -> int [@@dead "Type_ops.+hash"] - Analysis reported 2320 issues (Warning Dead Module:145, Warning Dead Type:203, Warning Dead Value:1724, Warning Dead Value With Side Effects:29, Warning Redundant Optional Argument:195, Warning Unused Argument:24) + Analysis reported 2318 issues (Warning Dead Module:145, Warning Dead Type:203, Warning Dead Value:1722, Warning Dead Value With Side Effects:29, Warning Redundant Optional Argument:195, Warning Unused Argument:24) diff --git a/compiler/ml/ast_mapper_from0.ml b/compiler/ml/ast_mapper_from0.ml index c4e8f80bb35..0eadfebb204 100644 --- a/compiler/ml/ast_mapper_from0.ml +++ b/compiler/ml/ast_mapper_from0.ml @@ -76,7 +76,6 @@ type mapper = { } let map_fst f (x, y) = (f x, y) -let map_snd f (x, y) = (x, f y) let map_tuple f1 f2 (x, y) = (f1 x, f2 y) let map_tuple3 f1 f2 f3 (x, y, z) = (f1 x, f2 y, f3 z) let map_opt f = function diff --git a/compiler/ml/ast_mapper_to0.ml b/compiler/ml/ast_mapper_to0.ml index c204651070e..f47e319f64e 100644 --- a/compiler/ml/ast_mapper_to0.ml +++ b/compiler/ml/ast_mapper_to0.ml @@ -70,7 +70,6 @@ type mapper = { } let map_fst f (x, y) = (f x, y) -let map_snd f (x, y) = (x, f y) let map_tuple f1 f2 (x, y) = (f1 x, f2 y) let map_tuple3 f1 f2 f3 (x, y, z) = (f1 x, f2 y, f3 z) let map_opt f = function From 8282068072185e29ce8cfab771813bed66175886 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 14:57:05 +0000 Subject: [PATCH 161/214] dce: trim ast payload --- _dce/report.txt | 44 +------------------------------------ compiler/ml/ast_payload.ml | 26 ---------------------- compiler/ml/ast_payload.mli | 9 -------- 3 files changed, 1 insertion(+), 78 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index 08fe15bf8ec..c2c6e6a973d 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -10529,48 +10529,6 @@ <-- line 188 val get_cookie : string -> Parsetree.expression option [@@dead "+get_cookie"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_payload.ml", line 42, characters 0-341 - +is_single_string_as_ast is never used - <-- line 42 - | _ -> None [@@dead "+is_single_string_as_ast"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_payload.ml", line 171, characters 0-118 - +as_core_type is never used - <-- line 171 - | _ -> Location.raise_errorf ~loc "except a core type" [@@dead "+as_core_type"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_payload.ml", line 176, characters 0-140 - +as_ident is never used - <-- line 176 - | _ -> None [@@dead "+as_ident"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_payload.mli", line 38, characters 0-62 - +is_single_string_as_ast is never used - <-- line 38 - val is_single_string_as_ast : t -> Parsetree.expression option [@@dead "+is_single_string_as_ast"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_payload.mli", line 57, characters 0-57 - +as_core_type is never used - <-- line 57 - val as_core_type : Location.t -> t -> Parsetree.core_type [@@dead "+as_core_type"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_payload.mli", line 60, characters 0-51 - +as_ident is never used - <-- line 60 - val as_ident : t -> Longident.t Asttypes.loc option [@@dead "+as_ident"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_payload.mli", line 92, characters 0-61 - +unrecognized_config_record is never used - <-- line 92 - val unrecognized_config_record : Location.t -> string -> unit [@@dead "+unrecognized_config_record"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 169, characters 0-248 +tag_can_be_undefined is never used @@ -13121,4 +13079,4 @@ <-- line 211 val hash : t -> int [@@dead "Type_ops.+hash"] - Analysis reported 2318 issues (Warning Dead Module:145, Warning Dead Type:203, Warning Dead Value:1722, Warning Dead Value With Side Effects:29, Warning Redundant Optional Argument:195, Warning Unused Argument:24) + Analysis reported 2311 issues (Warning Dead Module:145, Warning Dead Type:203, Warning Dead Value:1715, Warning Dead Value With Side Effects:29, Warning Redundant Optional Argument:195, Warning Unused Argument:24) diff --git a/compiler/ml/ast_payload.ml b/compiler/ml/ast_payload.ml index eb953cd5831..a2474060c35 100644 --- a/compiler/ml/ast_payload.ml +++ b/compiler/ml/ast_payload.ml @@ -39,21 +39,6 @@ let is_single_string (x : t) = Some (name, dec) | _ -> None -let is_single_string_as_ast (x : t) : Parsetree.expression option = - match x with - (*TODO also need detect empty phrase case *) - | PStr - [ - { - pstr_desc = - Pstr_eval - (({pexp_desc = Pexp_constant (Pconst_string (_, _)); _} as e), _); - _; - }; - ] -> - Some e - | _ -> None - let is_single_int (x : t) : int option = match x with | PStr @@ -168,17 +153,6 @@ let raw_as_string_exp_exn ~(kind : Js_raw_info.raw_kind) ?is_function (x : t) : Some {e with pexp_desc = Pexp_constant (Pconst_string (str, None))} | _ -> None -let as_core_type loc (x : t) = - match x with - | PTyp x -> x - | _ -> Location.raise_errorf ~loc "except a core type" - -let as_ident (x : t) = - match x with - | PStr [{pstr_desc = Pstr_eval ({pexp_desc = Pexp_ident ident}, _)}] -> - Some ident - | _ -> None - type lid = string Asttypes.loc type label_expr = lid * Parsetree.expression diff --git a/compiler/ml/ast_payload.mli b/compiler/ml/ast_payload.mli index 493ad8efb69..35783d76dcb 100644 --- a/compiler/ml/ast_payload.mli +++ b/compiler/ml/ast_payload.mli @@ -35,8 +35,6 @@ type action = lid * Parsetree.expression option val is_single_string : t -> (string * string option) option -val is_single_string_as_ast : t -> Parsetree.expression option - val is_single_int : t -> int option val is_single_float : t -> string option @@ -54,10 +52,7 @@ val raw_as_string_exp_exn : Parsetree.expression option (** Convert %raw into expression *) -val as_core_type : Location.t -> t -> Parsetree.core_type - (* val as_empty_structure : t -> bool *) -val as_ident : t -> Longident.t Asttypes.loc option (* val raw_string_payload : Location.t -> string -> t *) val assert_strings : Location.t -> t -> string list @@ -88,7 +83,3 @@ val empty : t val table_dispatch : (Parsetree.expression option -> 'a) Map_string.t -> action -> 'a - -val unrecognized_config_record : Location.t -> string -> unit -(** Report to the user, as a warning, that the bs-attribute parser is bailing out. (This is to allow - external ppx, like ppx_deriving, to pick up where the builtin ppx leave off.) *) From 27975b1ef65fa617e2f6542923e3baf0d43f2d4b Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 14:58:19 +0000 Subject: [PATCH 162/214] dce: trim untagged helpers --- _dce/report.txt | 86 ++++++++++++---------------- compiler/ml/ast_untagged_variants.ml | 9 --- 2 files changed, 37 insertions(+), 58 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index c2c6e6a973d..26792026867 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -10530,131 +10530,119 @@ val get_cookie : string -> Parsetree.expression option [@@dead "+get_cookie"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 169, characters 0-248 - +tag_can_be_undefined is never used - <-- line 169 - | Some Undefined -> true [@@dead "+tag_can_be_undefined"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 527, characters 0-76 - +block_is_object is never used - <-- line 527 - let block_is_object ~env attrs = get_block_type ~env attrs = Some ObjectType [@@dead "+block_is_object"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 539, characters 2-204 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 530, characters 2-204 Dynamic_checks.+size is never used - <-- line 539 + <-- line 530 | Expr _ -> 1 [@@dead "Dynamic_checks.+size"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 547, characters 2-35 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 538, characters 2-35 Dynamic_checks.+bin is never used - <-- line 547 + <-- line 538 let bin op x y = BinOp (op, x, y) [@@dead "Dynamic_checks.+bin"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 549, characters 2-25 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 540, characters 2-25 Dynamic_checks.+typeof is never used - <-- line 549 + <-- line 540 let typeof x = TypeOf x [@@dead "Dynamic_checks.+typeof"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 550, characters 2-34 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 541, characters 2-34 Dynamic_checks.+str is never used - <-- line 550 + <-- line 541 let str s = String s |> tag_type [@@dead "Dynamic_checks.+str"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 551, characters 2-43 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 542, characters 2-43 Dynamic_checks.+is_instance is never used - <-- line 551 + <-- line 542 let is_instance i x = IsInstanceOf (i, x) [@@dead "Dynamic_checks.+is_instance"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 552, characters 2-19 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 543, characters 2-19 Dynamic_checks.+not is never used - <-- line 552 + <-- line 543 let not x = Not x [@@dead "Dynamic_checks.+not"] Warning Dead Value With Side Effects - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 553, characters 2-28 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 544, characters 2-28 Dynamic_checks.+nil is never used and could have side effects Warning Dead Value With Side Effects - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 554, characters 2-39 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 545, characters 2-39 Dynamic_checks.+undefined is never used and could have side effects Warning Dead Value With Side Effects - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 555, characters 2-47 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 546, characters 2-47 Dynamic_checks.+object_ is never used and could have side effects Warning Dead Value With Side Effects - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 557, characters 2-51 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 548, characters 2-51 Dynamic_checks.+function_ is never used and could have side effects Warning Dead Value With Side Effects - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 558, characters 2-46 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 549, characters 2-46 Dynamic_checks.+string is never used and could have side effects Warning Dead Value With Side Effects - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 559, characters 2-43 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 550, characters 2-43 Dynamic_checks.+number is never used and could have side effects Warning Dead Value With Side Effects - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 561, characters 2-46 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 552, characters 2-46 Dynamic_checks.+bigint is never used and could have side effects Warning Dead Value With Side Effects - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 563, characters 2-48 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 554, characters 2-48 Dynamic_checks.+boolean is never used and could have side effects Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 565, characters 2-33 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 556, characters 2-33 Dynamic_checks.+== is never used - <-- line 565 + <-- line 556 let ( == ) x y = bin EqEqEq x y [@@dead "Dynamic_checks.+=="] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 566, characters 2-34 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 557, characters 2-34 Dynamic_checks.+!= is never used - <-- line 566 + <-- line 557 let ( != ) x y = bin NotEqEq x y [@@dead "Dynamic_checks.+!="] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 567, characters 2-30 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 558, characters 2-30 Dynamic_checks.+||| is never used - <-- line 567 + <-- line 558 let ( ||| ) x y = bin Or x y [@@dead "Dynamic_checks.+|||"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 568, characters 2-31 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 559, characters 2-31 Dynamic_checks.+&&& is never used - <-- line 568 + <-- line 559 let ( &&& ) x y = bin And x y [@@dead "Dynamic_checks.+&&&"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 570, characters 2-2866 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 561, characters 2-2866 Dynamic_checks.+is_a_literal_case is never used - <-- line 570 + <-- line 561 | [] -> assert false [@@dead "Dynamic_checks.+is_a_literal_case"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 650, characters 2-411 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 641, characters 2-411 Dynamic_checks.+is_a_literal_case is never used - <-- line 650 + <-- line 641 else without_literal_cases [@@dead "Dynamic_checks.+is_a_literal_case"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 661, characters 2-706 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 652, characters 2-706 Dynamic_checks.+is_int_tag is never used - <-- line 661 + <-- line 652 typeof e != object_ [@@dead "Dynamic_checks.+is_int_tag"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 679, characters 2-1031 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 670, characters 2-1031 Dynamic_checks.+add_runtime_type_check is never used - <-- line 679 + <-- line 670 | Bool _ | Float _ | Int _ | BigInt _ | String _ | Null | Undefined -> x [@@dead "Dynamic_checks.+add_runtime_type_check"] Warning Dead Type @@ -13079,4 +13067,4 @@ <-- line 211 val hash : t -> int [@@dead "Type_ops.+hash"] - Analysis reported 2311 issues (Warning Dead Module:145, Warning Dead Type:203, Warning Dead Value:1715, Warning Dead Value With Side Effects:29, Warning Redundant Optional Argument:195, Warning Unused Argument:24) + Analysis reported 2309 issues (Warning Dead Module:145, Warning Dead Type:203, Warning Dead Value:1713, Warning Dead Value With Side Effects:29, Warning Redundant Optional Argument:195, Warning Unused Argument:24) diff --git a/compiler/ml/ast_untagged_variants.ml b/compiler/ml/ast_untagged_variants.ml index 281c2f418c2..5709c6a17d7 100644 --- a/compiler/ml/ast_untagged_variants.ml +++ b/compiler/ml/ast_untagged_variants.ml @@ -166,13 +166,6 @@ let block_type_can_be_undefined = function false | UnknownType -> true -let tag_can_be_undefined tag = - match tag.tag_type with - | None -> false - | Some (String _ | Int _ | Float _ | BigInt _ | Bool _ | Null) -> false - | Some (Untagged block_type) -> block_type_can_be_undefined block_type - | Some Undefined -> true - let has_untagged (attrs : Parsetree.attributes) = Ext_list.exists attrs (function {txt}, _ -> txt = untagged) @@ -524,8 +517,6 @@ let check_well_formed ~env {is_untagged_def; cstrs} = let has_undefined_literal attrs = process_tag_type attrs = Some Undefined -let block_is_object ~env attrs = get_block_type ~env attrs = Some ObjectType - module Dynamic_checks = struct type op = EqEqEq | NotEqEq | Or | And type 'a t = From d4039b19eb8591834aaa14c0493d7ce6762e8147 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 14:58:44 +0000 Subject: [PATCH 163/214] dce: note untagged checks --- scripts/dce/live-findings.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/scripts/dce/live-findings.md b/scripts/dce/live-findings.md index 1acd878712e..b3c493d400f 100644 --- a/scripts/dce/live-findings.md +++ b/scripts/dce/live-findings.md @@ -315,6 +315,22 @@ live after manual validation. and the unconstructed `Lam_constant.pointer_info.Some` case were removed. What remains is cross-module compiler-core use that reanalyze does not root. +### Untagged variant dynamic checks + +- Report: `Warning Dead Value` / `Warning Dead Value With Side Effects`, + `compiler/ml/ast_untagged_variants.ml`, for `Dynamic_checks.*` builders and + combinators such as `size`, `typeof`, literal check constructors, + `is_a_literal_case`, `is_int_tag`, and `add_runtime_type_check`. +- Verdict: live; false positives. +- Validation: `compiler/core/js_exp_make.ml` exposes `emit_check`, + `is_a_literal_case`, and `is_int_tag` by calling + `Ast_untagged_variants.Dynamic_checks`; `compiler/core/lam_compile.ml` uses + `Dynamic_checks.add_runtime_type_check` and the `( == )` builder while + compiling untagged variant comparisons and runtime checks. +- Context: unused standalone helpers `tag_can_be_undefined` and + `block_is_object` were removed. The remaining warnings are a cross-module + pipeline edge from ML variant analysis into JS lowering. + ### GenType map/set helpers - Report: `Warning Dead Module` / `Warning Dead Value`, From 9c7f294d62815f19098e45c9a61e87abfa962d04 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 14:59:57 +0000 Subject: [PATCH 164/214] dce: trim ml utilities --- _dce/report.txt | 38 +----------------------------------- compiler/ml/asttypes.ml | 2 -- compiler/ml/bigint_utils.mli | 4 ---- 3 files changed, 1 insertion(+), 43 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index 26792026867..29539eac301 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -10645,42 +10645,6 @@ <-- line 670 | Bool _ | Float _ | Int _ | BigInt _ | String _ | Null | Undefined -> x [@@dead "Dynamic_checks.+add_runtime_type_check"] - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/asttypes.ml", line 36, characters 20-27 - virtual_flag.Virtual is a variant case which is never constructed - <-- line 36 - type virtual_flag = Virtual [@dead "virtual_flag.Virtual"] | Concrete - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/asttypes.ml", line 36, characters 28-38 - virtual_flag.Concrete is a variant case which is never constructed - <-- line 36 - type virtual_flag = Virtual [@dead "virtual_flag.Virtual"] | Concrete [@dead "virtual_flag.Concrete"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/bigint_utils.mli", line 1, characters 0-27 - +is_neg is never used - <-- line 1 - val is_neg : string -> bool [@@dead "+is_neg"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/bigint_utils.mli", line 2, characters 0-27 - +is_pos is never used - <-- line 2 - val is_pos : string -> bool [@@dead "+is_pos"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/bigint_utils.mli", line 4, characters 0-49 - +remove_leading_sign is never used - <-- line 4 - val remove_leading_sign : string -> bool * string [@@dead "+remove_leading_sign"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/bigint_utils.mli", line 5, characters 0-43 - +remove_leading_zeros is never used - <-- line 5 - val remove_leading_zeros : string -> string [@@dead "+remove_leading_zeros"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/btype.ml", line 412, characters 0-155 +copy_kind is never used @@ -13067,4 +13031,4 @@ <-- line 211 val hash : t -> int [@@dead "Type_ops.+hash"] - Analysis reported 2309 issues (Warning Dead Module:145, Warning Dead Type:203, Warning Dead Value:1713, Warning Dead Value With Side Effects:29, Warning Redundant Optional Argument:195, Warning Unused Argument:24) + Analysis reported 2303 issues (Warning Dead Module:145, Warning Dead Type:201, Warning Dead Value:1709, Warning Dead Value With Side Effects:29, Warning Redundant Optional Argument:195, Warning Unused Argument:24) diff --git a/compiler/ml/asttypes.ml b/compiler/ml/asttypes.ml index de7ae1d75eb..1169f202a93 100644 --- a/compiler/ml/asttypes.ml +++ b/compiler/ml/asttypes.ml @@ -33,8 +33,6 @@ type private_flag = Private | Public type mutable_flag = Immutable | Mutable -type virtual_flag = Virtual | Concrete - type override_flag = Override | Fresh type closed_flag = Closed | Open diff --git a/compiler/ml/bigint_utils.mli b/compiler/ml/bigint_utils.mli index 14b09a9efc9..c8fcf3b7dde 100644 --- a/compiler/ml/bigint_utils.mli +++ b/compiler/ml/bigint_utils.mli @@ -1,8 +1,4 @@ -val is_neg : string -> bool -val is_pos : string -> bool val to_string : bool -> string -> string -val remove_leading_sign : string -> bool * string -val remove_leading_zeros : string -> string val parse_bigint : string -> bool * string val is_valid : string -> bool val compare : bool * string -> bool * string -> int From a70028dee011705ccd44217de3bdade8e1d55dc2 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 15:02:38 +0000 Subject: [PATCH 165/214] dce: trim ml flags --- _dce/report.txt | 36 +----------------------------------- compiler/ml/btype.ml | 8 -------- compiler/ml/btype.mli | 4 ---- compiler/ml/clflags.ml | 2 -- compiler/ml/clflags.mli | 1 - 5 files changed, 1 insertion(+), 50 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index 29539eac301..e510cdda4ab 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -10645,30 +10645,6 @@ <-- line 670 | Bool _ | Float _ | Int _ | BigInt _ | String _ | Null | Undefined -> x [@@dead "Dynamic_checks.+add_runtime_type_check"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/btype.ml", line 412, characters 0-155 - +copy_kind is never used - <-- line 412 - | Fabsent -> assert false [@@dead "+copy_kind"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/btype.ml", line 489, characters 0-53 - +mark_type_params is never used - <-- line 489 - let mark_type_params ty = iter_type_expr mark_type ty [@@dead "+mark_type_params"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/btype.mli", line 134, characters 0-40 - +copy_kind is never used - <-- line 134 - val copy_kind : field_kind -> field_kind [@@dead "+copy_kind"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/btype.mli", line 157, characters 0-40 - +mark_type_params is never used - <-- line 157 - val mark_type_params : type_expr -> unit [@@dead "+mark_type_params"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/classify_function.ml", line 107, characters 0-210 +classify_stmt is never used @@ -10681,16 +10657,6 @@ <-- line 29 val classify_stmt : string -> Js_raw_info.stmt [@@dead "+classify_stmt"] - Warning Dead Value With Side Effects - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/clflags.ml", line 39, characters 0-27 - +dump_lambda is never used and could have side effects - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/clflags.mli", line 23, characters 0-26 - +dump_lambda is never used - <-- line 23 - val dump_lambda : bool ref [@@dead "+dump_lambda"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/cmi_format.ml", line 67, characters 0-369 +output_cmi is never used @@ -13031,4 +12997,4 @@ <-- line 211 val hash : t -> int [@@dead "Type_ops.+hash"] - Analysis reported 2303 issues (Warning Dead Module:145, Warning Dead Type:201, Warning Dead Value:1709, Warning Dead Value With Side Effects:29, Warning Redundant Optional Argument:195, Warning Unused Argument:24) + Analysis reported 2297 issues (Warning Dead Module:145, Warning Dead Type:201, Warning Dead Value:1704, Warning Dead Value With Side Effects:28, Warning Redundant Optional Argument:195, Warning Unused Argument:24) diff --git a/compiler/ml/btype.ml b/compiler/ml/btype.ml index 6419cc3daa5..da2bcd94b9e 100644 --- a/compiler/ml/btype.ml +++ b/compiler/ml/btype.ml @@ -409,12 +409,6 @@ let copy_row f fixed row keep more = row_name = name; } -let rec copy_kind = function - | Fvar {contents = Some k} -> copy_kind k - | Fvar _ -> Fvar (ref None) - | Fpresent -> Fpresent - | Fabsent -> assert false - let copy_commu c = if commu_repr c = Cok then Cok else Clink (ref Cunknown) (* Since univars may be used as row variables, we need to do some @@ -486,8 +480,6 @@ let mark_type_node ty = let ty = repr ty in if ty.level >= lowest_level then ty.level <- pivot_level - ty.level -let mark_type_params ty = iter_type_expr mark_type ty - let type_iterators = let it_type_expr it ty = let ty = repr ty in diff --git a/compiler/ml/btype.mli b/compiler/ml/btype.mli index 117f23f7a75..491bc8be165 100644 --- a/compiler/ml/btype.mli +++ b/compiler/ml/btype.mli @@ -131,7 +131,6 @@ val copy_type_desc : val copy_row : (type_expr -> type_expr) -> bool -> row_desc -> bool -> type_expr -> row_desc -val copy_kind : field_kind -> field_kind val save_desc : type_expr -> type_desc -> unit (* Save a type description *) @@ -154,9 +153,6 @@ val mark_type : type_expr -> unit val mark_type_node : type_expr -> unit (* Mark a type node (but not its sons) *) -val mark_type_params : type_expr -> unit -(* Mark the sons of a type node *) - val unmark_type : type_expr -> unit val unmark_type_decl : type_declaration -> unit val unmark_extension_constructor : extension_constructor -> unit diff --git a/compiler/ml/clflags.ml b/compiler/ml/clflags.ml index f0cd88115e7..b9bc75c61fb 100644 --- a/compiler/ml/clflags.ml +++ b/compiler/ml/clflags.ml @@ -36,8 +36,6 @@ and dump_typedtree = ref false (* -dtypedtree *) and dump_rawlambda = ref false (* -drawlambda *) -and dump_lambda = ref false (* -dlambda *) - and only_parse = ref false (* -only-parse *) and editor_mode = ref false (* -editor-mode *) diff --git a/compiler/ml/clflags.mli b/compiler/ml/clflags.mli index 0cb5f1ea3e5..c597b2a2d6a 100644 --- a/compiler/ml/clflags.mli +++ b/compiler/ml/clflags.mli @@ -20,7 +20,6 @@ val dump_source : bool ref val dump_parsetree : bool ref val dump_typedtree : bool ref val dump_rawlambda : bool ref -val dump_lambda : bool ref val dont_write_files : bool ref val keep_locs : bool ref val only_parse : bool ref From cae950b33a74165f710634e69753df45e7873389 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 15:03:34 +0000 Subject: [PATCH 166/214] dce: note cmt liveness --- scripts/dce/live-findings.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/scripts/dce/live-findings.md b/scripts/dce/live-findings.md index b3c493d400f..61f03ea7aef 100644 --- a/scripts/dce/live-findings.md +++ b/scripts/dce/live-findings.md @@ -229,6 +229,29 @@ live after manual validation. They are live in the compiler pipeline even though the current DCE report misses those edges. +### Typed artifact readers and raw statement classification + +- Report: `Warning Dead Value` / `Warning Dead Type`, + `compiler/ml/classify_function.ml` / `.mli`, + `compiler/ml/cmi_format.ml` / `.mli`, `compiler/ml/cmt_format.mli`, and + `compiler/ml/cmt_utils.ml`. +- Verdict: live; false positives for compiler, GenType, and analysis tooling. +- Validation: `compiler/core/lam_convert.ml` calls + `Classify_function.classify_stmt` when lowering raw JavaScript statement + literals. `compiler/ml/cmt_format.cppo.ml` calls `Cmi_format.input_cmi`, + `Cmi_format.output_cmi`, and its own `read_magic_number` while reading and + writing `.cmi`, `.cmt`, and `.cmti` artifacts. `analysis/src/*`, + `analysis/reanalyze/src/*`, and `compiler/gentype/*` call + `Cmt_format.read_cmt`, inspect `Partial_interface` / `Packed` typed + artifacts, and traverse `Partial_class_expr` where present. +- Context: the reported `cmt_infos` fields are serialized into typed artifact + files by `cmt_format.cppo.ml` and are part of the reader/writer schema even + when a specific field is not read back by current in-repo code. The + deprecation hook is installed from `cmt_format.cppo.ml` into + `Cmt_utils.record_deprecated_used` and invoked through + `compiler/ml/builtin_attributes.ml`, with `deprecated_text` carried in the + recorded payload. + ### `Misc` live utility surface - Report: remaining `Warning Dead Value`, `Warning Dead Module`, and constructor From 65b434c4061249bee1a6f2fdc90964b079dcf50d Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 15:04:39 +0000 Subject: [PATCH 167/214] dce: trim consistbl --- _dce/report.txt | 38 +------------------------------------- compiler/ml/consistbl.ml | 22 ---------------------- compiler/ml/consistbl.mli | 16 ---------------- 3 files changed, 1 insertion(+), 75 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index e510cdda4ab..fb3d644ae23 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -10783,42 +10783,6 @@ <-- line 5 deprecated_text: string; [@dead "deprecated_used.deprecated_text"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/consistbl.ml", line 34, characters 0-221 - +check_noadd is never used - <-- line 34 - with Not_found -> raise (Not_available name) [@@dead "+check_noadd"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/consistbl.ml", line 42, characters 0-49 - +source is never used - <-- line 42 - let source tbl name = snd (Hashtbl.find tbl name) [@@dead "+source"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/consistbl.ml", line 54, characters 0-267 - +filter is never used - <-- line 54 - !to_remove [@@dead "+filter"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/consistbl.mli", line 32, characters 0-59 - +check_noadd is never used - <-- line 32 - val check_noadd : t -> string -> Digest.t -> string -> unit [@@dead "+check_noadd"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/consistbl.mli", line 41, characters 0-34 - +source is never used - <-- line 41 - val source : t -> string -> string [@@dead "+source"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/consistbl.mli", line 51, characters 0-42 - +filter is never used - <-- line 51 - val filter : (string -> bool) -> t -> unit [@@dead "+filter"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 131, characters 0-111 +begin_class_def is never used @@ -12997,4 +12961,4 @@ <-- line 211 val hash : t -> int [@@dead "Type_ops.+hash"] - Analysis reported 2297 issues (Warning Dead Module:145, Warning Dead Type:201, Warning Dead Value:1704, Warning Dead Value With Side Effects:28, Warning Redundant Optional Argument:195, Warning Unused Argument:24) + Analysis reported 2291 issues (Warning Dead Module:145, Warning Dead Type:201, Warning Dead Value:1698, Warning Dead Value With Side Effects:28, Warning Redundant Optional Argument:195, Warning Unused Argument:24) diff --git a/compiler/ml/consistbl.ml b/compiler/ml/consistbl.ml index 37047a26287..16a7ed64355 100644 --- a/compiler/ml/consistbl.ml +++ b/compiler/ml/consistbl.ml @@ -23,24 +23,14 @@ let clear = Hashtbl.clear exception Inconsistency of string * string * string -exception Not_available of string - let check tbl name crc source = try let old_crc, old_source = Hashtbl.find tbl name in if crc <> old_crc then raise (Inconsistency (name, source, old_source)) with Not_found -> Hashtbl.add tbl name (crc, source) -let check_noadd tbl name crc source = - try - let old_crc, old_source = Hashtbl.find tbl name in - if crc <> old_crc then raise (Inconsistency (name, source, old_source)) - with Not_found -> raise (Not_available name) - let set tbl name crc source = Hashtbl.add tbl name (crc, source) -let source tbl name = snd (Hashtbl.find tbl name) - let extract l tbl = let l = List.sort_uniq String.compare l in List.fold_left @@ -50,15 +40,3 @@ let extract l tbl = (name, Some crc) :: assc with Not_found -> (name, None) :: assc) [] l - -let filter p tbl = - let to_remove = ref [] in - Hashtbl.iter - (fun name _ -> if not (p name) then to_remove := name :: !to_remove) - tbl; - List.iter - (fun name -> - while Hashtbl.mem tbl name do - Hashtbl.remove tbl name - done) - !to_remove diff --git a/compiler/ml/consistbl.mli b/compiler/ml/consistbl.mli index cfee26f5d26..b030d0b05b2 100644 --- a/compiler/ml/consistbl.mli +++ b/compiler/ml/consistbl.mli @@ -29,34 +29,18 @@ val check : t -> string -> Digest.t -> string -> unit [source] is the name of the file from which the information comes from. This is used for error reporting. *) -val check_noadd : t -> string -> Digest.t -> string -> unit -(* Same as [check], but raise [Not_available] if no CRC was previously - associated with [name]. *) - val set : t -> string -> Digest.t -> string -> unit (* [set tbl name crc source] forcefully associates [name] with [crc] in [tbl], even if [name] already had a different CRC associated with [name] in [tbl]. *) -val source : t -> string -> string -(* [source tbl name] returns the file name associated with [name] - if the latter has an associated CRC in [tbl]. - Raise [Not_found] otherwise. *) - val extract : string list -> t -> (string * Digest.t option) list (* [extract tbl names] returns an associative list mapping each string in [names] to the CRC associated with it in [tbl]. If no CRC is associated with a name then it is mapped to [None]. *) -val filter : (string -> bool) -> t -> unit -(* [filter pred tbl] removes from [tbl] table all (name, CRC) pairs - such that [pred name] is [false]. *) - exception Inconsistency of string * string * string (* Raised by [check] when a CRC mismatch is detected. First string is the name of the compilation unit. Second string is the source that caused the inconsistency. Third string is the source that set the CRC. *) - -exception Not_available of string -(* Raised by [check_noadd] when a name doesn't have an associated CRC. *) From 643457a98d4b2916d6c355952af5fdf8a4ac3909 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 15:15:28 +0000 Subject: [PATCH 168/214] dce: use fixed reanalyze --- _dce/report.txt | 10558 ++++----------------------------------- scripts/dce/README.md | 81 +- scripts/dce/run-dce.sh | 12 +- 3 files changed, 1064 insertions(+), 9587 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index fb3d644ae23..c7f450743cf 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -1,4 +1,24 @@ + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile.ml", line 820, characters 4-2265 + optional argument declaration of function +switch is never used + + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile.ml", line 820, characters 4-2265 + optional argument default of function +switch is never used + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile.ml", line 272, characters 2-2044 + optional argument dynamic_import of function +compile_external_field_apply is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile.ml", line 235, characters 2-511 + optional argument dynamic_import of function +compile_external_field is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_alpha_conversion.ml", line 26, characters 2-955 + optional argument ap_transformed_jsx of function +populate_apply_info is always supplied (1 calls) + Warning Unused Argument File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reanalyze.ml", line 199, characters 0-11133 optional argument file_stats of function +run_analysis is never used @@ -771,8485 +791,1403 @@ File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/type_utils.ml", line 179, characters 0-2146 optional argument type_arg_context of function +instantiate_type2 is never used - Warning Redundant Optional Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/syntax/src/res_driver.ml", line 192, characters 0-399 - optional argument ignore_parse_errors of function +parse_interface is always supplied (1 calls) + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.mli", line 160, characters 0-54 + optional argument comment of function +return_stmt is never used - Warning Redundant Optional Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/syntax/src/res_driver.ml", line 181, characters 0-409 - optional argument ignore_parse_errors of function +parse_implementation is always supplied (1 calls) + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.mli", line 151, characters 0-100 + optional argument comment of function +try_ is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typecore.ml", line 1145, characters 2-61 - optional argument from_type of function Constructor.+unbound_name_error is never used + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.mli", line 151, characters 0-100 + optional argument finally of function +try_ is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typecore.ml", line 967, characters 2-55 - optional argument from_type of function Label.+unbound_name_error is never used + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.mli", line 148, characters 0-97 + optional argument comment of function +for_await_of is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typetexp.mli", line 102, characters 0-91 - optional argument from_type of function +unbound_label_error is never used + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.mli", line 145, characters 0-91 + optional argument comment of function +for_of is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typetexp.mli", line 100, characters 0-97 - optional argument from_type of function +unbound_constructor_error is never used + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.mli", line 135, characters 0-172 + optional argument comment of function +for_ is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typetexp.ml", line 173, characters 0-141 - optional argument from_type of function +unbound_label_error is never used + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.mli", line 133, characters 0-78 + optional argument comment of function +while_ is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typetexp.ml", line 168, characters 0-160 - optional argument from_type of function +unbound_constructor_error is never used + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.mli", line 107, characters 0-60 + optional argument comment of function +assign is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 116, characters 0-90 - optional argument loc of function +lookup_modtype is never used + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.mli", line 92, characters 0-137 + optional argument ident_info of function +define_variable is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 110, characters 0-63 - optional argument loc of function +lookup_type is never used + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.mli", line 75, characters 0-191 + optional argument comment of function +string_switch is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 105, characters 0-112 - optional argument loc of function +lookup_all_labels is never used + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.mli", line 52, characters 0-161 + optional argument comment of function +int_switch is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 99, characters 0-124 - optional argument loc of function +lookup_all_constructors is never used + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.mli", line 35, characters 0-262 + optional argument comment of function +if_ is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 97, characters 0-89 - optional argument loc of function +lookup_constructor is never used + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.mli", line 33, characters 0-53 + optional argument comment of function +throw_stmt is never used + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/syntax/src/res_driver.ml", line 192, characters 0-399 + optional argument ignore_parse_errors of function +parse_interface is always supplied (1 calls) + + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/syntax/src/res_driver.ml", line 181, characters 0-409 + optional argument ignore_parse_errors of function +parse_implementation is always supplied (1 calls) Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 95, characters 0-86 - optional argument loc of function +lookup_value is never used + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.ml", line 335, characters 0-101 + optional argument comment of function +try_ is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 1268, characters 0-295 - optional argument loc of function +lookup_all_labels is never used + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.ml", line 335, characters 0-101 + optional argument finally of function +try_ is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 1234, characters 0-313 - optional argument loc of function +lookup_all_constructors is never used + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.ml", line 332, characters 0-152 + optional argument comment of function +for_await_of is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 1222, characters 0-206 - optional argument loc of function +lookup_constructor is never used + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.ml", line 329, characters 0-141 + optional argument comment of function +for_of is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 1206, characters 0-137 - optional argument loc of function +lookup_type is never used + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.ml", line 320, characters 0-245 + optional argument comment of function +for_ is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 1201, characters 0-138 - optional argument loc of function +lookup_value is never used + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.ml", line 317, characters 0-108 + optional argument comment of function +while_ is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 1145, characters 0-84 - optional argument loc of function +lookup_modtype is never used + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.ml", line 314, characters 0-90 + optional argument comment of function +assign is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 1104, characters 0-663 - optional argument loc of function +lookup_all_simple is never used + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.ml", line 233, characters 0-3141 + optional argument comment of function +if_ is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 1092, characters 0-391 - optional argument loc of function +lookup is never used + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.ml", line 136, characters 0-1581 + optional argument comment of function +string_switch is never used - Warning Redundant Optional Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/location.mli", line 103, characters 0-108 - optional argument custom_intro of function +report_error is always supplied (1 calls) + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.ml", line 91, characters 0-1408 + optional argument comment of function +int_switch is never used - Warning Redundant Optional Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/location.mli", line 103, characters 0-108 - optional argument src of function +report_error is always supplied (1 calls) + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.ml", line 67, characters 0-483 + optional argument ident_info of function +define_variable is never used - Warning Redundant Optional Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/location.ml", line 253, characters 0-108 - optional argument custom_intro of function +report_error is always supplied (1 calls) + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.ml", line 34, characters 0-67 + optional argument comment of function +throw_stmt is never used - Warning Redundant Optional Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/location.ml", line 253, characters 0-108 - optional argument src of function +report_error is always supplied (1 calls) + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.ml", line 29, characters 0-69 + optional argument comment of function +return_stmt is never used - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 24, characters 0-232 - +merge_entries is never used - <-- line 24 - Hashtbl.fold (fun k v acc -> (k, v) :: acc) tbl [] [@@dead "+merge_entries"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typecore.ml", line 1145, characters 2-61 + optional argument from_type of function Constructor.+unbound_name_error is never used - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 73, characters 0-223 - +count_changes is never used - <-- line 73 - (!adds, !removes) [@@dead "+count_changes"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typecore.ml", line 967, characters 2-55 + optional argument from_type of function Label.+unbound_name_error is never used - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 110, characters 2-261 - Registry.+register is never used - <-- line 110 - info [@@dead "Registry.+register"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 361, characters 0-49 + optional argument comment of function +is_null_undefined is never used - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 468, characters 2-648 - +process is never used - <-- line 468 - List.iter (fun h -> h delta) !subscribers)) [@@dead "+process"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 357, characters 0-39 + optional argument comment of function +is_null is never used - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 485, characters 2-71 - +_info is never used - <-- line 485 - let _info = Registry.register ~name ~level:0 ~process ~stats:my_stats [@@dead "+_info"] in + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 353, characters 0-73 + optional argument comment of function +raw_js_code is never used - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 532, characters 2-82 - +merge_fn is never used - <-- line 532 - | None -> fun _ v -> v [@@dead "+merge_fn"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 350, characters 0-74 + optional argument comment of function +of_block is never used - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 550, characters 2-614 - +recompute_target is never used - <-- line 550 - Some (k2, Some merged) [@@dead "+recompute_target"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 347, characters 0-54 + optional argument comment of function +dummy_obj is never used - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 571, characters 2-358 - +remove_source is never used - <-- line 571 - target_keys [@@dead "+remove_source"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 341, characters 0-40 + optional argument comment of function +or_ is never used - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 603, characters 2-550 - +process_entry is never used - <-- line 603 - all_affected [@@dead "+process_entry"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 339, characters 0-41 + optional argument comment of function +and_ is never used - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 624, characters 2-1165 - +process is never used - <-- line 624 - List.iter (fun h -> h delta) !subscribers)) [@@dead "+process"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 337, characters 0-53 + optional argument comment of function +obj_length is never used - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 651, characters 2-82 - +_info is never used - <-- line 651 - Registry.register ~name ~level:my_level ~process ~stats:my_stats [@@dead "+_info"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 330, characters 0-62 + optional argument comment of function +tag is never used - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 694, characters 2-82 - +merge_fn is never used - <-- line 694 - | None -> fun _ v -> v [@@dead "+merge_fn"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 317, characters 0-69 + optional argument comment of function +obj is never used - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 716, characters 2-614 - +recompute_target is never used - <-- line 716 - Some (k3, Some merged) [@@dead "+recompute_target"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 303, characters 0-147 + optional argument comment of function +make_block is never used - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 796, characters 2-462 - +remove_left_entry is never used - <-- line 796 - affected [@@dead "+remove_left_entry"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 293, characters 0-67 + optional argument comment of function +tagged_template is never used - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 811, characters 2-2770 - +process is never used - <-- line 811 - List.iter (fun h -> h delta) !subscribers) [@@dead "+process"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 285, characters 0-69 + optional argument comment of function +js_comp is never used - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 890, characters 2-82 - +_info is never used - <-- line 890 - Registry.register ~name ~level:my_level ~process ~stats:my_stats [@@dead "+_info"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 283, characters 0-63 + optional argument comment of function +bigint_mod is never used - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 945, characters 2-403 - +recompute_target is never used - <-- line 945 - Some (k, Some merged) [@@dead "+recompute_target"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 281, characters 0-63 + optional argument comment of function +bigint_div is never used - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 959, characters 2-2260 - +process is never used - <-- line 959 - List.iter (fun h -> h delta) !subscribers) [@@dead "+process"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 279, characters 0-73 + optional argument comment of function +bigint_comp is never used - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 1025, characters 2-82 - +_info is never used - <-- line 1025 - Registry.register ~name ~level:my_level ~process ~stats:my_stats [@@dead "+_info"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 271, characters 0-71 + optional argument comment of function +bool_comp is never used - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 1083, characters 2-524 - +emit_output is never used - <-- line 1083 - List.iter (fun h -> h delta) !subscribers) [@@dead "+emit_output"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 265, characters 0-46 + optional argument comment of function +float_mod is never used - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 1095, characters 2-1019 - +process is never used - <-- line 1095 - emit_output output_entries [@@dead "+process"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 251, characters 0-47 + optional argument comment of function +int32_band is never used - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive.ml", line 1125, characters 2-82 - +_info is never used - <-- line 1125 - Registry.register ~name ~level:my_level ~process ~stats:my_stats [@@dead "+_info"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 249, characters 0-47 + optional argument comment of function +int32_bxor is never used - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive_fixpoint.ml", line 16, characters 0-674 - +analyze_edge_change is never used - <-- line 16 - (removed_targets, has_new_edge) [@@dead "+analyze_edge_change"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 247, characters 0-46 + optional argument comment of function +int32_asr is never used - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive_fixpoint.ml", line 106, characters 2-1492 - Metrics.+update is never used - <-- line 106 - max totals.max_rederived_nodes rederived_nodes) [@@dead "Metrics.+update"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 243, characters 0-46 + optional argument comment of function +int32_lsl is never used - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive_fixpoint.ml", line 189, characters 2-87 - Invariants.+assert_ is never used - <-- line 189 - if enabled && not condition then failwith message [@@dead "Invariants.+assert_"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 241, characters 0-46 + optional argument comment of function +int32_pow is never used - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive_fixpoint.ml", line 192, characters 2-142 - Invariants.+copy_set is never used - <-- line 192 - out [@@dead "Invariants.+copy_set"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 239, characters 0-62 + optional argument comment of function +int32_mod is never used - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive_fixpoint.ml", line 197, characters 2-177 - Invariants.+set_equal is never used - <-- line 197 - !ok [@@dead "Invariants.+set_equal"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 237, characters 0-62 + optional argument comment of function +int32_div is never used - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive_fixpoint.ml", line 204, characters 2-673 - Invariants.+assert_edge_changes_consistent is never used - <-- line 204 - edge_changes [@@dead "Invariants.+assert_edge_changes_consistent"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 233, characters 0-46 + optional argument comment of function +int32_mul is never used - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive_fixpoint.ml", line 220, characters 2-736 - Invariants.+assert_deleted_nodes_closed is never used - <-- line 220 - deleted_nodes [@@dead "Invariants.+assert_deleted_nodes_closed"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 231, characters 0-48 + optional argument comment of function +int32_minus is never used - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive_fixpoint.ml", line 239, characters 2-428 - Invariants.+assert_current_minus_deleted is never used - <-- line 239 - deleted") [@@dead "Invariants.+assert_current_minus_deleted"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 225, characters 0-46 + optional argument comment of function +int32_add is never used - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive_fixpoint.ml", line 249, characters 2-442 - Invariants.+assert_no_supported_deleted_left is never used - <-- line 249 - deleted_nodes [@@dead "Invariants.+assert_no_supported_deleted_left"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 221, characters 0-40 + optional argument comment of function +to_int32 is never used - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive_fixpoint.ml", line 261, characters 2-698 - Invariants.+assert_removal_output_matches is never used - <-- line 261 - "ReactiveFixpoint.apply invariant failed: removal output mismatch") [@@dead "Invariants.+assert_removal_output_matches"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 217, characters 0-38 + optional argument comment of function +typeof is never used - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive_fixpoint.ml", line 277, characters 2-2048 - Invariants.+assert_final_fixpoint_and_delta is never used - <-- line 277 - (Hashtbl.length actual_removes))) [@@dead "Invariants.+assert_final_fixpoint_and_delta"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 203, characters 0-46 + optional argument comment of function +is_type_number is never used - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive_fixpoint.ml", line 368, characters 0-291 - +has_live_predecessor is never used - <-- line 368 - with Found_live_pred -> true) [@@dead "+has_live_predecessor"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 201, characters 0-63 + optional argument comment of function +neq_null_undefined_boolean is never used - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive_fixpoint.ml", line 422, characters 0-7005 - +apply is never used - <-- line 422 - !output_entries [@@dead "+apply"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 199, characters 0-62 + optional argument comment of function +eq_null_undefined_boolean is never used - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reactive/src/reactive_fixpoint.mli", line 36, characters 0-134 - +apply is never used - <-- line 36 - ('k * unit option) list [@@dead "+apply"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 195, characters 0-40 + optional argument comment of function +int_bnot is never used - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/arnold.ml", line 33, characters 2-134 - Function_args.+compare_arg is never used - <-- line 33 - if n <> 0 then n else compare a1.function_name a2.function_name [@@dead "Function_args.+compare_arg"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 193, characters 0-46 + optional argument comment of function +int_equal is never used - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/arnold.ml", line 37, characters 2-217 - Function_args.+compare is never used - <-- line 37 - if n <> 0 then n else compare l1 l2 [@@dead "Function_args.+compare"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 182, characters 0-43 + optional argument comment of function +assign is never used - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/arnold.ml", line 74, characters 2-170 - Function_call.+compare is never used - <-- line 74 - else Function_args.compare x1.function_args x2.function_args [@@dead "Function_call.+compare"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 158, characters 0-48 + optional argument comment of function +array_index is never used - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/dead_exception.ml", line 3, characters 0-93 - +dead_exception.Path_map is a dead module as all its items are dead. + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 141, characters 0-47 + optional argument comment of function +function_length is never used - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/dead_exception.ml", line 6, characters 2-30 - Path_map.+compare is never used - <-- line 6 - let compare = Stdlib.compare [@@dead "Path_map.+compare"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 139, characters 0-45 + optional argument comment of function +string_length is never used - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/dead_type.ml", line 69, characters 0-93 - +dead_type.Path_map is a dead module as all its items are dead. + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 137, characters 0-44 + optional argument comment of function +array_length is never used - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/dead_type.ml", line 72, characters 2-30 - Path_map.+compare is never used - <-- line 72 - let compare = Stdlib.compare [@@dead "Path_map.+compare"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 133, characters 0-45 + optional argument comment of function +dot is never used - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/exn.ml", line 3, characters 0-28 - +compare is never used - <-- line 3 - let compare = String.compare [@@dead "+compare"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 100, characters 0-139 + optional argument comment of function +method_ is never used - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/exn.mli", line 3, characters 0-27 - +compare is never used - <-- line 3 - val compare : t -> t -> int [@@dead "+compare"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 100, characters 0-139 + optional argument immutable_mask of function +method_ is never used - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/file_deps.ml", line 6, characters 0-129 - +file_deps.File_hash is a dead module as all its items are dead. + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 89, characters 0-187 + optional argument comment of function +ocaml_fun is never used - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/file_deps.ml", line 9, characters 2-35 - File_hash.+hash is never used - <-- line 9 - let hash (x : t) = Hashtbl.hash x [@@dead "File_hash.+hash"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 76, characters 0-78 + optional argument comment of function +ml_module_as_var is never used - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/file_deps.ml", line 10, characters 2-29 - File_hash.+equal is never used - <-- line 10 - let equal (x : t) y = x = y [@@dead "File_hash.+equal"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 69, characters 0-143 + optional argument comment of function +external_var is never used - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/file_hash.ml", line 1, characters 0-0 - +file_hash is a dead module as all its items are dead. + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 57, characters 0-185 + optional argument comment of function +external_var_field is never used - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/file_hash.ml", line 6, characters 2-35 - +hash is never used - <-- line 6 - let hash (x : t) = Hashtbl.hash x [@@dead "+hash"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 52, characters 0-84 + optional argument comment of function +ml_var_dot is never used - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/file_hash.ml", line 7, characters 2-29 - +equal is never used - <-- line 7 - let equal (x : t) y = x = y [@@dead "+equal"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1754, characters 0-605 + optional argument comment of function +neq_null_undefined_boolean is never used - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/loc_set.ml", line 1, characters 0-0 - +loc_set is a dead module as all its items are dead. + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1739, characters 0-605 + optional argument comment of function +eq_null_undefined_boolean is never used - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/loc_set.ml", line 4, characters 2-23 - +compare is never used - <-- line 4 - let compare = compare [@@dead "+compare"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1733, characters 0-216 + optional argument comment of function +is_null_undefined is never used - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/name.ml", line 3, characters 0-28 - +compare is never used - <-- line 3 - let compare = String.compare [@@dead "+compare"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1727, characters 0-58 + optional argument comment of function +is_null is never used - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/name.mli", line 3, characters 0-27 - +compare is never used - <-- line 3 - val compare : t -> t -> int [@@dead "+compare"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1703, characters 0-596 + optional argument comment of function +of_block is never used - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/pos_hash.ml", line 1, characters 0-0 - +pos_hash is a dead module as all its items are dead. + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1696, characters 0-160 + optional argument comment of function +bigint_mod is never used - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/pos_hash.ml", line 7, characters 2-106 - +hash is never used - <-- line 7 - Hashtbl.hash (x.Lexing.pos_cnum, s) [@@dead "+hash"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1692, characters 0-159 + optional argument comment of function +bigint_div is never used - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/pos_hash.ml", line 11, characters 2-29 - +equal is never used - <-- line 11 - let equal (x : t) y = x = y [@@dead "+equal"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1665, characters 0-992 + optional argument comment of function +bigint_comp is never used - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/pos_set.ml", line 1, characters 0-0 - +pos_set is a dead module as all its items are dead. + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1649, characters 0-384 + optional argument comment of function +int32_band is never used - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/pos_set.ml", line 7, characters 2-23 - +compare is never used - <-- line 7 - let compare = compare [@@dead "+compare"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1639, characters 0-445 + optional argument comment of function +int32_bxor is never used - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/shared_types.ml", line 488, characters 0-149 - +shared_types.Location_set is a dead module as all its items are dead. + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1633, characters 0-251 + optional argument comment of function +int32_pow is never used - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/shared_types.ml", line 491, characters 2-43 - Location_set.+compare is never used - <-- line 491 - let compare loc1 loc2 = compare loc2 loc1 [@@dead "Location_set.+compare"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1628, characters 0-179 + optional argument comment of function +int_bnot is never used - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/shared_types.ml", line 523, characters 2-30 - package.rescript_version is a record label never used to read a value - <-- line 523 - rescript_version: int * int; [@dead "package.rescript_version"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1609, characters 0-702 + optional argument comment of function +int32_mul is never used - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/common/bs_loc.ml", line 1, characters 0-0 - +bs_loc is a dead module as all its items are dead. + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1592, characters 0-316 + optional argument comment of function +int32_lsl is never used - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/common/bs_loc.ml", line 26, characters 2-29 - t.loc_start is a record label never used to read a value - <-- line 26 - loc_start: Lexing.position; [@dead "t.loc_start"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1582, characters 0-316 + optional argument comment of function +int32_mod is never used - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/common/bs_loc.ml", line 27, characters 2-27 - t.loc_end is a record label never used to read a value - <-- line 27 - loc_end: Lexing.position; [@dead "t.loc_end"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1571, characters 0-482 + optional argument comment of function +int32_div is never used - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/common/bs_loc.ml", line 28, characters 2-18 - t.loc_ghost is a record label never used to read a value - <-- line 28 - loc_ghost: bool; [@dead "t.loc_ghost"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1567, characters 0-94 + optional argument comment of function +int32_asr is never used - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/common/bs_loc.mli", line 1, characters 0-0 - bs_loc is a dead module as all its items are dead. + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1557, characters 0-87 + optional argument comment of function +int32_minus is never used - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/common/bs_loc.mli", line 26, characters 2-29 - t.loc_start is a record label never used to read a value - <-- line 26 - loc_start: Lexing.position; [@dead "t.loc_start"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1552, characters 0-66 + optional argument comment of function +int32_add is never used - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/common/bs_loc.mli", line 27, characters 2-27 - t.loc_end is a record label never used to read a value - <-- line 27 - loc_end: Lexing.position; [@dead "t.loc_end"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1442, characters 0-89 + optional argument comment of function +js_comp is never used - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/common/bs_loc.mli", line 28, characters 2-18 - t.loc_ghost is a record label never used to read a value - <-- line 28 - loc_ghost: bool; [@dead "t.loc_ghost"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1412, characters 0-901 + optional argument comment of function +bool_comp is never used - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/common/bs_version.ml", line 25, characters 0-62 - +header is never used - <-- line 25 - let header = "// Generated by ReScript, PLEASE EDIT WITH CARE" [@@dead "+header"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1372, characters 0-94 + optional argument comment of function +obj_length is never used - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/common/bs_version.mli", line 27, characters 0-19 - +header is never used - <-- line 27 - val header : string [@@dead "+header"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1364, characters 0-91 + optional argument comment of function +is_type_number is never used - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/common/ext_log.ml", line 1, characters 0-0 - +ext_log is a dead module as all its items are dead. + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1349, characters 0-97 + optional argument comment of function +to_int32 is never used - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/common/ext_log.ml", line 28, characters 0-386 - +dwarn is never used - <-- line 28 - else Format.ifprintf Format.err_formatter ("WARN: " ^^ f ^^ "@.") [@@dead "+dwarn"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1315, characters 0-106 + optional argument comment of function +tag is never used - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/common/ext_log.mli", line 1, characters 0-0 - ext_log is a dead module as all its items are dead. + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1251, characters 0-27 + optional argument comment of function +int_equal is never used - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/common/ext_log.mli", line 35, characters 0-59 - +dwarn is never used - <-- line 35 - val dwarn : ?__POS__:string * int * int * int -> 'a logging [@@dead "+dwarn"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1126, characters 0-516 + optional argument comment of function +or_ is never used - Warning Dead Value With Side Effects - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/common/js_config.ml", line 54, characters 0-24 - +js_stdout is never used and could have side effects + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1106, characters 0-751 + optional argument comment of function +and_ is never used - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/common/js_config.mli", line 85, characters 0-24 - +js_stdout is never used - <-- line 85 - val js_stdout : bool ref [@@dead "+js_stdout"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 587, characters 0-94 + optional argument comment of function +obj is never used - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/j.ml", line 77, characters 65-78 - delim.DBackQuotes is a variant case which is never constructed - <-- line 77 - and delim = External_arg_spec.delim = DNone | DStarJ | DNoQuotes | DBackQuotes [@dead "delim.DBackQuotes"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 553, characters 0-304 + optional argument comment of function +function_length is never used - Warning Dead Value With Side Effects - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_analyzer.ml", line 70, characters 0-29 - +obj is never used and could have side effects + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 547, characters 0-242 + optional argument comment of function +string_length is never used - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_analyzer.ml", line 72, characters 0-99 - +clean_up is never used - <-- line 72 - init.defined_idents <- Set_ident.empty [@@dead "+clean_up"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 540, characters 0-277 + optional argument comment of function +array_length is never used - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_analyzer.ml", line 76, characters 0-131 - +free_variables_of_statement is never used - <-- line 76 - Set_ident.diff init.used_idents init.defined_idents [@@dead "+free_variables_of_statement"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 485, characters 0-77 + optional argument comment of function +assign is never used - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_analyzer.ml", line 81, characters 0-133 - +free_variables_of_expression is never used - <-- line 81 - Set_ident.diff init.used_idents init.defined_idents [@@dead "+free_variables_of_expression"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 379, characters 0-422 + optional argument comment of function +array_index is never used - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_analyzer.ml", line 86, characters 0-1631 - +no_side_effect_expression_desc is never used - <-- line 86 - | Spread _ -> false [@@dead "+no_side_effect_expression_desc"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 376, characters 0-94 + optional argument comment of function +float_mod is never used - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_analyzer.ml", line 122, characters 0-90 - +no_side_effect is never used - <-- line 122 - no_side_effect_expression_desc x.expression_desc [@@dead "+no_side_effect"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 273, characters 0-465 + optional argument comment of function +dummy_obj is never used - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_analyzer.ml", line 125, characters 0-67 - +no_side_effect_expression is never used - <-- line 125 - let no_side_effect_expression (x : J.expression) = no_side_effect x [@@dead "+no_side_effect_expression"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 255, characters 0-365 + optional argument comment of function +method_ is never used - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_analyzer.ml", line 127, characters 0-32 - +super is never used - <-- line 127 - let super = Js_record_iter.super [@@dead "+super"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 255, characters 0-365 + optional argument immutable_mask of function +method_ is never used - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_analyzer.ml", line 129, characters 0-581 - +no_side_effect_obj is never used - <-- line 129 - } [@@dead "+no_side_effect_obj"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 236, characters 0-444 + optional argument comment of function +ocaml_fun is never used - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_analyzer.ml", line 147, characters 0-122 - +no_side_effect_statement is never used - <-- line 147 - with _ -> false [@@dead "+no_side_effect_statement"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 206, characters 0-103 + optional argument comment of function +instanceof is never used - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_analyzer.ml", line 164, characters 0-2369 - +eq_expression is never used - <-- line 164 - | Spread _ -> false [@@dead "+eq_expression"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 198, characters 0-301 + optional argument comment of function +typeof is never used - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_analyzer.ml", line 237, characters 0-75 - +eq_expression_list is never used - <-- line 237 - and eq_expression_list xs ys = Ext_list.for_all2_no_exn xs ys eq_expression [@@dead "+eq_expression_list"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 191, characters 0-189 + optional argument comment of function +make_block is never used - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_analyzer.ml", line 239, characters 0-90 - +eq_block is never used - <-- line 239 - Ext_list.for_all2_no_exn xs ys eq_statement [@@dead "+eq_block"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 178, characters 0-104 + optional argument comment of function +dot is never used - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_analyzer.ml", line 242, characters 0-594 - +eq_statement is never used - <-- line 242 - false [@@dead "+eq_statement"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 160, characters 0-134 + optional argument comment of function +raw_js_code is never used - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_analyzer.ml", line 263, characters 0-235 - +rev_flatten_seq is never used - <-- line 263 - aux [] x [@@dead "+rev_flatten_seq"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 140, characters 0-176 + optional argument comment of function +ml_module_as_var is never used - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_analyzer.ml", line 275, characters 0-454 - +rev_toplevel_flatten is never used - <-- line 275 - aux [] block [@@dead "+rev_toplevel_flatten"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 124, characters 0-390 + optional argument comment of function +external_var is never used - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_analyzer.ml", line 304, characters 0-198 - +is_okay_to_duplicate is never used - <-- line 304 - | _ -> false [@@dead "+is_okay_to_duplicate"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 109, characters 0-367 + optional argument comment of function +external_var_field is never used - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_analyzer.mli", line 1, characters 0-0 - js_analyzer is a dead module as all its items are dead. + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 96, characters 0-189 + optional argument comment of function +ml_var_dot is never used - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_analyzer.mli", line 30, characters 0-60 - +free_variables_of_statement is never used - <-- line 30 - val free_variables_of_statement : J.statement -> Set_ident.t [@@dead "+free_variables_of_statement"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 76, characters 0-164 + optional argument comment of function +tagged_template is never used - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_analyzer.mli", line 32, characters 0-62 - +free_variables_of_expression is never used - <-- line 32 - val free_variables_of_expression : J.expression -> Set_ident.t [@@dead "+free_variables_of_expression"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typetexp.mli", line 102, characters 0-91 + optional argument from_type of function +unbound_label_error is never used - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_analyzer.mli", line 37, characters 0-52 - +no_side_effect_expression is never used - <-- line 37 - val no_side_effect_expression : J.expression -> bool [@@dead "+no_side_effect_expression"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typetexp.mli", line 100, characters 0-97 + optional argument from_type of function +unbound_constructor_error is never used - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_analyzer.mli", line 47, characters 0-50 - +no_side_effect_statement is never used - <-- line 47 - val no_side_effect_statement : J.statement -> bool [@@dead "+no_side_effect_statement"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typetexp.ml", line 173, characters 0-141 + optional argument from_type of function +unbound_label_error is never used - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_analyzer.mli", line 56, characters 0-56 - +eq_expression is never used - <-- line 56 - val eq_expression : J.expression -> J.expression -> bool [@@dead "+eq_expression"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typetexp.ml", line 168, characters 0-160 + optional argument from_type of function +unbound_constructor_error is never used - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_analyzer.mli", line 58, characters 0-53 - +eq_statement is never used - <-- line 58 - val eq_statement : J.statement -> J.statement -> bool [@@dead "+eq_statement"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 116, characters 0-90 + optional argument loc of function +lookup_modtype is never used - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_analyzer.mli", line 60, characters 0-41 - +eq_block is never used - <-- line 60 - val eq_block : J.block -> J.block -> bool [@@dead "+eq_block"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 110, characters 0-63 + optional argument loc of function +lookup_type is never used - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_analyzer.mli", line 62, characters 0-45 - +rev_flatten_seq is never used - <-- line 62 - val rev_flatten_seq : J.expression -> J.block [@@dead "+rev_flatten_seq"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 105, characters 0-112 + optional argument loc of function +lookup_all_labels is never used - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_analyzer.mli", line 64, characters 0-45 - +rev_toplevel_flatten is never used - <-- line 64 - val rev_toplevel_flatten : J.block -> J.block [@@dead "+rev_toplevel_flatten"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 99, characters 0-124 + optional argument loc of function +lookup_all_constructors is never used - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_analyzer.mli", line 73, characters 0-47 - +is_okay_to_duplicate is never used - <-- line 73 - val is_okay_to_duplicate : J.expression -> bool [@@dead "+is_okay_to_duplicate"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 97, characters 0-89 + optional argument loc of function +lookup_constructor is never used - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_arr.ml", line 1, characters 0-0 - +js_arr is a dead module as all its items are dead. + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 95, characters 0-86 + optional argument loc of function +lookup_value is never used - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_arr.ml", line 27, characters 0-56 - +set_array is never used - <-- line 27 - let set_array e e0 e1 = E.assign (E.array_index e e0) e1 [@@dead "+set_array"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 1268, characters 0-295 + optional argument loc of function +lookup_all_labels is never used - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_arr.ml", line 29, characters 0-39 - +ref_array is never used - <-- line 29 - let ref_array e e0 = E.array_index e e0 [@@dead "+ref_array"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 1234, characters 0-313 + optional argument loc of function +lookup_all_constructors is never used - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_arr.mli", line 1, characters 0-0 - js_arr is a dead module as all its items are dead. + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 1222, characters 0-206 + optional argument loc of function +lookup_constructor is never used - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_arr.mli", line 25, characters 0-76 - +set_array is never used - <-- line 25 - val set_array : J.expression -> J.expression -> J.expression -> J.expression [@@dead "+set_array"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 1206, characters 0-137 + optional argument loc of function +lookup_type is never used - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_arr.mli", line 27, characters 0-60 - +ref_array is never used - <-- line 27 - val ref_array : J.expression -> J.expression -> J.expression [@@dead "+ref_array"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 1201, characters 0-138 + optional argument loc of function +lookup_value is never used - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_ast_util.ml", line 1, characters 0-0 - +js_ast_util is a dead module as all its items are dead. + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 1145, characters 0-84 + optional argument loc of function +lookup_modtype is never used - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_ast_util.ml", line 29, characters 0-256 - +named_expression is never used - <-- line 29 - Some (obj_code, obj) [@@dead "+named_expression"] + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 1104, characters 0-663 + optional argument loc of function +lookup_all_simple is never used - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_ast_util.mli", line 1, characters 0-0 - js_ast_util is a dead module as all its items are dead. + Warning Unused Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 1092, characters 0-391 + optional argument loc of function +lookup is never used - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_ast_util.mli", line 25, characters 0-69 - +named_expression is never used - <-- line 25 - val named_expression : J.expression -> (J.statement * Ident.t) option [@@dead "+named_expression"] + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/location.mli", line 103, characters 0-108 + optional argument custom_intro of function +report_error is always supplied (1 calls) - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_block_runtime.ml", line 1, characters 0-0 - +js_block_runtime is a dead module as all its items are dead. + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/location.mli", line 103, characters 0-108 + optional argument src of function +report_error is always supplied (1 calls) - Warning Dead Value With Side Effects - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_block_runtime.ml", line 25, characters 0-64 - +option_id is never used and could have side effects + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/location.ml", line 253, characters 0-108 + optional argument custom_intro of function +report_error is always supplied (1 calls) - Warning Dead Value With Side Effects - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_block_runtime.ml", line 27, characters 0-62 - +curry_id is never used and could have side effects + Warning Redundant Optional Argument + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/location.ml", line 253, characters 0-108 + optional argument src of function +report_error is always supplied (1 calls) - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_block_runtime.ml", line 29, characters 0-201 - +check_additional_id is never used - <-- line 29 - | _ -> None [@@dead "+check_additional_id"] + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/shared_types.ml", line 523, characters 2-30 + package.rescript_version is a record label never used to read a value + <-- line 523 + rescript_version: int * int; [@dead "package.rescript_version"] Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_block_runtime.mli", line 1, characters 0-0 - js_block_runtime is a dead module as all its items are dead. + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/common/bs_loc.ml", line 1, characters 0-0 + +bs_loc is a dead module as all its items are dead. - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_block_runtime.mli", line 25, characters 0-56 - +check_additional_id is never used - <-- line 25 - val check_additional_id : J.expression -> Ident.t option [@@dead "+check_additional_id"] + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/common/bs_loc.ml", line 26, characters 2-29 + t.loc_start is a record label never used to read a value + <-- line 26 + loc_start: Lexing.position; [@dead "t.loc_start"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_call_info.ml", line 38, characters 0-75 - +dummy is never used - <-- line 38 - let dummy = {arity = NA; call_info = Call_na; call_transformed_jsx = false} [@@dead "+dummy"] + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/common/bs_loc.ml", line 27, characters 2-27 + t.loc_end is a record label never used to read a value + <-- line 27 + loc_end: Lexing.position; [@dead "t.loc_end"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_call_info.ml", line 43, characters 0-86 - +ml_full_call is never used - <-- line 43 - {arity = Full; call_info = Call_ml; call_transformed_jsx = false} [@@dead "+ml_full_call"] + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/common/bs_loc.ml", line 28, characters 2-18 + t.loc_ghost is a record label never used to read a value + <-- line 28 + loc_ghost: bool; [@dead "t.loc_ghost"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_call_info.ml", line 46, characters 0-112 - +na_full_call is never used - <-- line 46 - {arity = Full; call_info = Call_na; call_transformed_jsx = transformed_jsx} [@@dead "+na_full_call"] + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/common/bs_loc.mli", line 1, characters 0-0 + bs_loc is a dead module as all its items are dead. - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_call_info.mli", line 40, characters 0-13 - +dummy is never used - <-- line 40 - val dummy : t [@@dead "+dummy"] + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/common/bs_loc.mli", line 26, characters 2-29 + t.loc_start is a record label never used to read a value + <-- line 26 + loc_start: Lexing.position; [@dead "t.loc_start"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_call_info.mli", line 44, characters 0-20 - +ml_full_call is never used - <-- line 44 - val ml_full_call : t [@@dead "+ml_full_call"] + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/common/bs_loc.mli", line 27, characters 2-27 + t.loc_end is a record label never used to read a value + <-- line 27 + loc_end: Lexing.position; [@dead "t.loc_end"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_call_info.mli", line 46, characters 0-28 - +na_full_call is never used - <-- line 46 - val na_full_call : bool -> t [@@dead "+na_full_call"] + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/common/bs_loc.mli", line 28, characters 2-18 + t.loc_ghost is a record label never used to read a value + <-- line 28 + loc_ghost: bool; [@dead "t.loc_ghost"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_cmj_format.ml", line 38, characters 0-35 - +single_na is never used - <-- line 38 - let single_na = Single Lam_arity.na [@@dead "+single_na"] + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/j.ml", line 77, characters 65-78 + delim.DBackQuotes is a variant case which is never constructed + <-- line 77 + and delim = External_arg_spec.delim = DNone | DStarJ | DNoQuotes | DBackQuotes [@dead "delim.DBackQuotes"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_cmj_format.ml", line 55, characters 0-357 - +make is never used - <-- line 55 - } [@@dead "+make"] + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_analyzer.mli", line 58, characters 0-53 + +eq_statement is never used + <-- line 58 + val eq_statement : J.statement -> J.statement -> bool [@@dead "+eq_statement"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_cmj_format.ml", line 72, characters 2-31 - +_digest is never used - <-- line 72 - let _digest = Digest.input ic [@@dead "+_digest"] in + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump.ml", line 1715, characters 0-213 + +string_of_block is never used + <-- line 1715 + Buffer.contents buffer [@@dead "+string_of_block"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_cmj_format.ml", line 77, characters 0-238 - +for_sure_not_changed is never used - <-- line 77 - else false [@@dead "+for_sure_not_changed"] + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump.mli", line 28, characters 0-39 + +string_of_block is never used + <-- line 28 + val string_of_block : J.block -> string [@@dead "+string_of_block"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_cmj_format.ml", line 88, characters 0-315 - +to_file is never used - <-- line 88 - close_out oc) [@@dead "+to_file"] + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_program.mli", line 28, characters 0-124 + +pp_deps_program is never used + <-- line 28 + unit [@@dead "+pp_deps_program"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_cmj_format.ml", line 98, characters 0-61 - +key_comp is never used - <-- line 98 - let key_comp (a : string) b = Map_string.compare_key a b.name [@@dead "+key_comp"] + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 73, characters 0-83 + +flat_call is never used + <-- line 73 + {expression_desc = FlatCall (e0, es); comment} [@@dead "+flat_call"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_cmj_format.ml", line 100, characters 0-86 - +not_found is never used - <-- line 100 - {name = key; arity = single_na; persistent_closed_lambda = None} [@@dead "+not_found"] + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 472, characters 0-487 + +string_index is never used + <-- line 472 + | _ -> {expression_desc = String_index (e0, e1); comment} [@@dead "+string_index"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_cmj_format.ml", line 103, characters 0-320 - +get_result is never used - <-- line 103 - else {mid_val with persistent_closed_lambda = None} [@@dead "+get_result"] + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 487, characters 0-419 + +assign_by_exp is never used + <-- line 487 + | _ -> assign {expression_desc = Array_index (e, index); comment = None} value [@@dead "+assign_by_exp"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_cmj_format.ml", line 114, characters 0-658 - +binary_search_aux is never used - <-- line 114 - else binary_search_aux arr mid hi key [@@dead "+binary_search_aux"] + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1367, characters 0-91 + +is_type_string is never used + <-- line 1367 + string_equal ?comment (typeof e) (str "string") [@@dead "+is_type_string"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_cmj_format.ml", line 133, characters 0-435 - +binary_search is never used - <-- line 133 - if c2 > 0 then not_found key else binary_search_aux sorted 0 (len - 1) key [@@dead "+binary_search"] + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1439, characters 0-92 + +float_comp is never used + <-- line 1439 + bin ?comment (Lam_compile_util.jsop_of_comp cmp) e0 e1 [@@dead "+float_comp"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_cmj_format.ml", line 148, characters 0-121 - +query_by_name is never used - <-- line 148 - binary_search values name [@@dead "+query_by_name"] + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1551, characters 0-65 + +unchecked_int32_add is never used + <-- line 1551 + let unchecked_int32_add ?comment e1 e2 = float_add ?comment e1 e2 [@@dead "+unchecked_int32_add"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_cmj_format.mli", line 70, characters 0-139 - +make is never used - <-- line 70 - t [@@dead "+make"] + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1560, characters 0-86 + +unchecked_int32_minus is never used + <-- line 1560 + float_minus ?comment e1 e2 [@@dead "+unchecked_int32_minus"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_cmj_format.mli", line 77, characters 0-50 - +query_by_name is never used - <-- line 77 - val query_by_name : t -> string -> keyed_cmj_value [@@dead "+query_by_name"] + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1565, characters 0-62 + +float_notequal is never used + <-- line 1565 + let float_notequal ?comment e1 e2 = bin ?comment NotEqEq e1 e2 [@@dead "+float_notequal"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_cmj_format.mli", line 79, characters 0-21 - +single_na is never used - <-- line 79 - val single_na : arity [@@dead "+single_na"] + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1625, characters 0-104 + +unchecked_int32_mul is never used + <-- line 1625 + {comment; expression_desc = Bin (Mul, e1, e2)} [@@dead "+unchecked_int32_mul"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_cmj_format.mli", line 86, characters 0-54 - +to_file is never used - <-- line 86 - val to_file : string -> check_exists:bool -> t -> unit [@@dead "+to_file"] - - Warning Dead Value With Side Effects - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_cmj_load.ml", line 59, characters 0-39 - +load_unit is never used and could have side effects - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_cmj_load.mli", line 1, characters 0-0 - js_cmj_load is a dead module as all its items are dead. + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 48, characters 0-43 + +runtime_var_dot is never used + <-- line 48 + val runtime_var_dot : string -> string -> t [@@dead "+runtime_var_dot"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_cmj_load.mli", line 29, characters 0-59 - +load_unit is never used - <-- line 29 - val load_unit : (string -> Js_cmj_format.cmj_load_info) ref [@@dead "+load_unit"] + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 156, characters 0-49 + +string_index is never used + <-- line 156 + val string_index : ?comment:string -> t -> t -> t [@@dead "+string_index"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump.ml", line 1715, characters 0-213 - +string_of_block is never used - <-- line 1715 - Buffer.contents buffer [@@dead "+string_of_block"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump.mli", line 1, characters 0-0 - js_dump is a dead module as all its items are dead. + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 180, characters 0-36 + +assign_by_exp is never used + <-- line 180 + val assign_by_exp : t -> t -> t -> t [@@dead "+assign_by_exp"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump.mli", line 23, characters 0-80 - +statements is never used - <-- line 23 - val statements : bool -> Ext_pp_scope.t -> Ext_pp.t -> J.block -> Ext_pp_scope.t [@@dead "+statements"] + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 191, characters 0-48 + +float_equal is never used + <-- line 191 + val float_equal : ?comment:string -> t -> t -> t [@@dead "+float_equal"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump.mli", line 28, characters 0-39 - +string_of_block is never used - <-- line 28 - val string_of_block : J.block -> string [@@dead "+string_of_block"] + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 213, characters 0-46 + +is_type_string is never used + <-- line 213 + val is_type_string : ?comment:string -> t -> t [@@dead "+is_type_string"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_import_export.ml", line 30, characters 0-38 - +es_module is never used - <-- line 30 - let es_module = ("__esModule", "true") [@@dead "+es_module"] + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 218, characters 0-47 + +instanceof is never used + <-- line 218 + val instanceof : ?comment:string -> t -> t -> t [@@dead "+instanceof"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_import_export.ml", line 33, characters 0-171 - +rev_iter_inter is never used - <-- line 33 - f a [@@dead "+rev_iter_inter"] + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 223, characters 0-56 + +unchecked_int32_add is never used + <-- line 223 + val unchecked_int32_add : ?comment:string -> t -> t -> t [@@dead "+unchecked_int32_add"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_import_export.ml", line 44, characters 0-840 - +exports is never used - <-- line 44 - outer_cxt [@@dead "+exports"] + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 229, characters 0-58 + +unchecked_int32_minus is never used + <-- line 229 + val unchecked_int32_minus : ?comment:string -> t -> t -> t [@@dead "+unchecked_int32_minus"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_import_export.ml", line 72, characters 0-977 - +esmodule_export is never used - <-- line 72 - outer_cxt [@@dead "+esmodule_export"] + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 235, characters 0-56 + +unchecked_int32_mul is never used + <-- line 235 + val unchecked_int32_mul : ?comment:string -> t -> t -> t [@@dead "+unchecked_int32_mul"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_import_export.ml", line 103, characters 0-740 - +requires is never used - <-- line 103 - outer_cxt [@@dead "+requires"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_import_export.ml", line 125, characters 0-736 - +dump_import_attributes is never used - <-- line 125 - idx := !idx + 1)) [@@dead "+dump_import_attributes"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_import_export.ml", line 148, characters 0-1123 - +imports is never used - <-- line 148 - outer_cxt [@@dead "+imports"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_import_export.mli", line 27, characters 0-74 - +exports is never used - <-- line 27 - val exports : Ext_pp_scope.t -> Ext_pp.t -> Ident.t list -> Ext_pp_scope.t [@@dead "+exports"] + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 263, characters 0-51 + +float_notequal is never used + <-- line 263 + val float_notequal : ?comment:string -> t -> t -> t [@@dead "+float_notequal"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_import_export.mli", line 29, characters 0-84 - +esmodule_export is never used - <-- line 29 - Ext_pp_scope.t -> Ext_pp.t -> Ident.t list -> Ext_pp_scope.t [@@dead "+esmodule_export"] + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 275, characters 0-72 + +float_comp is never used + <-- line 275 + val float_comp : Lam_compat.comparison -> ?comment:string -> t -> t -> t [@@dead "+float_comp"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_import_export.mli", line 32, characters 0-113 - +requires is never used - <-- line 32 - Ext_pp_scope.t [@@dead "+requires"] + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 291, characters 0-46 + +flat_call is never used + <-- line 291 + val flat_call : ?comment:string -> t -> t -> t [@@dead "+flat_call"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_import_export.mli", line 39, characters 0-146 - +imports is never used - <-- line 39 - Ext_pp_scope.t [@@dead "+imports"] + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_block.ml", line 48, characters 0-40 + +field_by_exp is never used + <-- line 48 + let field_by_exp e i = E.array_index e i [@@dead "+field_by_exp"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_lit.ml", line 41, characters 0-23 - +require is never used - <-- line 41 - let require = "require" [@@dead "+require"] + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_block.ml", line 57, characters 0-72 + +set_field_by_exp is never used + <-- line 57 + let set_field_by_exp self index value = E.assign_by_exp self index value [@@dead "+set_field_by_exp"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_lit.ml", line 43, characters 0-21 - +import is never used - <-- line 43 - let import = "import" [@@dead "+import"] + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_block.mli", line 36, characters 0-63 + +field_by_exp is never used + <-- line 36 + val field_by_exp : J.expression -> J.expression -> J.expression [@@dead "+field_by_exp"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_lit.ml", line 45, characters 0-17 - +from is never used + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_block.mli", line 45, characters 0-85 + +set_field_by_exp is never used <-- line 45 - let from = "from" [@@dead "+from"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_lit.ml", line 47, characters 0-14 - +as_ is never used - <-- line 47 - let as_ = "as" [@@dead "+as_"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_lit.ml", line 49, characters 0-21 - +export is never used - <-- line 49 - let export = "export" [@@dead "+export"] + J.expression -> J.expression -> J.expression -> J.expression [@@dead "+set_field_by_exp"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_lit.ml", line 51, characters 0-14 - +star is never used - <-- line 51 - let star = "*" [@@dead "+star"] + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.mli", line 42, characters 0-39 + +some is never used + <-- line 42 + val some : J.expression -> J.expression [@@dead "+some"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_lit.ml", line 57, characters 0-23 - +exports is never used - <-- line 57 - let exports = "exports" [@@dead "+exports"] + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_string.ml", line 35, characters 0-41 + +ref_string is never used + <-- line 35 + let ref_string e e1 = E.string_index e e1 [@@dead "+ref_string"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_lit.ml", line 109, characters 0-38 - +strict_directive is never used - <-- line 109 - let strict_directive = "'use strict';" [@@dead "+strict_directive"] + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_string.mli", line 31, characters 0-61 + +ref_string is never used + <-- line 31 + val ref_string : J.expression -> J.expression -> J.expression [@@dead "+ref_string"] - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_program.ml", line 1, characters 0-0 - +js_dump_program is a dead module as all its items are dead. + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_variant.ml", line 28, characters 22-29 + arg_expression.Splice0 is a variant case which is never constructed + <-- line 28 + type arg_expression = Splice0 [@dead "arg_expression.Splice0"] | Splice1 of E.t | Splice2 of E.t * E.t - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_program.ml", line 28, characters 0-142 - +empty_explanation is never used + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_variant.ml", line 28, characters 30-46 + arg_expression.Splice1 is a variant case which is never constructed <-- line 28 - unused code got optimized away. */\n" [@@dead "+empty_explanation"] + type arg_expression = Splice0 [@dead "arg_expression.Splice0"] | Splice1 of E.t [@dead "arg_expression.Splice1"] | Splice2 of E.t * E.t - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_program.ml", line 32, characters 0-123 - +program_is_empty is never used - <-- line 32 - | _ -> false [@@dead "+program_is_empty"] + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_variant.mli", line 28, characters 2-11 + arg_expression.Splice0 is a variant case which is never constructed + <-- line 28 + | Splice0 [@dead "arg_expression.Splice0"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_program.ml", line 37, characters 0-154 - +deps_program_is_empty is never used - <-- line 37 - | _ -> false [@@dead "+deps_program_is_empty"] + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_variant.mli", line 29, characters 2-27 + arg_expression.Splice1 is a variant case which is never constructed + <-- line 29 + | Splice1 of J.expression [@dead "arg_expression.Splice1"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_program.ml", line 42, characters 0-314 - +extract_block_comments is never used - <-- line 42 - | _ -> (acc, x) [@@dead "+extract_block_comments"] + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op.ml", line 99, characters 38-44 + property.Strict is a variant case which is never constructed + <-- line 99 + type property = Lam_compat.let_kind = Strict [@dead "property.Strict"] | Alias | StrictOpt | Variable - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_program.ml", line 56, characters 0-189 - +extract_file_comments is never used - <-- line 56 - (comments, {x with program = {x.program with block = new_block}}) [@@dead "+extract_file_comments"] + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op.ml", line 99, characters 45-52 + property.Alias is a variant case which is never constructed + <-- line 99 + type property = Lam_compat.let_kind = Strict [@dead "property.Strict"] | Alias [@dead "property.Alias"] | StrictOpt | Variable - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_program.ml", line 60, characters 0-162 - +program is never used - <-- line 60 - Js_dump_import_export.exports cxt f x.exports [@@dead "+program"] + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op.ml", line 99, characters 53-64 + property.StrictOpt is a variant case which is never constructed + <-- line 99 + type property = Lam_compat.let_kind = Strict [@dead "property.Strict"] | Alias [@dead "property.Alias"] | StrictOpt [@dead "property.StrictOpt"] | Variable - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_program.ml", line 65, characters 0-97 - +dump_program is never used - <-- line 65 - ignore (program (P.from_channel oc) Ext_pp_scope.empty x) [@@dead "+dump_program"] + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op.ml", line 99, characters 65-75 + property.Variable is a variant case which is never constructed + <-- line 99 + type property = Lam_compat.let_kind = Strict [@dead "property.Strict"] | Alias [@dead "property.Alias"] | StrictOpt [@dead "property.StrictOpt"] | Variable [@dead "property.Variable"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_program.ml", line 68, characters 0-106 - +is_default is never used - <-- line 68 - | _ -> false [@@dead "+is_default"] + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_fold.ml", line 63, characters 0-109 + +required_modules is never used + <-- line 63 + fun _self st arg -> list _self.module_id _self st arg [@@dead "+required_modules"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_program.ml", line 73, characters 0-559 - +commonjs_program is never used - <-- line 73 - program f cxt x.program [@@dead "+commonjs_program"] + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_fold.ml", line 314, characters 0-203 + +deps_program is never used + <-- line 314 + st [@@dead "+deps_program"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_program.ml", line 90, characters 0-768 - +esmodule_program is never used - <-- line 90 - Js_dump_import_export.esmodule_export cxt f x.program.exports [@@dead "+esmodule_program"] + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_iter.ml", line 61, characters 0-93 + +required_modules is never used + <-- line 61 + fun _self arg -> list _self.module_id _self arg [@@dead "+required_modules"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_program.ml", line 110, characters 0-1055 - +pp_deps_program is never used - <-- line 110 - P.flush f () [@@dead "+pp_deps_program"] + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_iter.ml", line 229, characters 0-156 + +deps_program is never used + <-- line 229 + required_modules _self _x1 [@@dead "+deps_program"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_program.ml", line 141, characters 0-124 - +dump_deps_program is never used - <-- line 141 - pp_deps_program ~output_prefix kind x (P.from_channel oc) [@@dead "+dump_deps_program"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_program.mli", line 1, characters 0-0 - js_dump_program is a dead module as all its items are dead. + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_map.ml", line 63, characters 0-93 + +required_modules is never used + <-- line 63 + fun _self arg -> list _self.module_id _self arg [@@dead "+required_modules"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_program.mli", line 25, characters 0-51 - +dump_program is never used - <-- line 25 - val dump_program : J.program -> out_channel -> unit [@@dead "+dump_program"] + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_map.ml", line 311, characters 0-233 + +deps_program is never used + <-- line 311 + {program = _x0; modules = _x1; side_effect = _x2} [@@dead "+deps_program"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_program.mli", line 28, characters 0-124 - +pp_deps_program is never used - <-- line 28 - unit [@@dead "+pp_deps_program"] + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 137, characters 0-14 + +false_ is never used + <-- line 137 + val false_ : t [@@dead "+false_"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_program.mli", line 35, characters 0-129 - +dump_deps_program is never used - <-- line 35 - unit [@@dead "+dump_deps_program"] + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.ml", line 57, characters 2-69 + field_dbg_info.Fld_record is a variant case which is never constructed + <-- line 57 + | Fld_record of {name: string; mutable_flag: Asttypes.mutable_flag} [@dead "field_dbg_info.Fld_record"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 25, characters 0-58 - +no_side_effect is never used - <-- line 25 - let no_side_effect = Js_analyzer.no_side_effect_expression [@@dead "+no_side_effect"] + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.ml", line 58, characters 2-32 + field_dbg_info.Fld_module is a variant case which is never constructed + <-- line 58 + | Fld_module of {name: string} [@dead "field_dbg_info.Fld_module"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 36, characters 0-632 - +remove_pure_sub_exp is never used - <-- line 36 - | _ -> Some x [@@dead "+remove_pure_sub_exp"] + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.ml", line 59, characters 2-39 + field_dbg_info.Fld_record_inline is a variant case which is never constructed + <-- line 59 + | Fld_record_inline of {name: string} [@dead "field_dbg_info.Fld_record_inline"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 52, characters 0-58 - +is_pure_sub_exp is never used - <-- line 52 - and is_pure_sub_exp (x : t) = remove_pure_sub_exp x = None [@@dead "+is_pure_sub_exp"] + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.ml", line 60, characters 2-42 + field_dbg_info.Fld_record_extension is a variant case which is never constructed + <-- line 60 + | Fld_record_extension of {name: string} [@dead "field_dbg_info.Fld_record_extension"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 73, characters 0-83 - +flat_call is never used - <-- line 73 - {expression_desc = FlatCall (e0, es); comment} [@@dead "+flat_call"] + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.ml", line 61, characters 2-13 + field_dbg_info.Fld_tuple is a variant case which is never constructed + <-- line 61 + | Fld_tuple [@dead "field_dbg_info.Fld_tuple"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 76, characters 0-164 - +tagged_template is never used - <-- line 76 - } [@@dead "+tagged_template"] + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.ml", line 62, characters 2-20 + field_dbg_info.Fld_poly_var_tag is a variant case which is never constructed + <-- line 62 + | Fld_poly_var_tag [@dead "field_dbg_info.Fld_poly_var_tag"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 96, characters 0-189 - +ml_var_dot is never used - <-- line 96 - } [@@dead "+ml_var_dot"] + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.ml", line 63, characters 2-24 + field_dbg_info.Fld_poly_var_content is a variant case which is never constructed + <-- line 63 + | Fld_poly_var_content [@dead "field_dbg_info.Fld_poly_var_content"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 109, characters 0-367 - +external_var_field is never used - <-- line 109 - } [@@dead "+external_var_field"] + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.ml", line 64, characters 2-17 + field_dbg_info.Fld_extension is a variant case which is never constructed + <-- line 64 + | Fld_extension [@dead "field_dbg_info.Fld_extension"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 124, characters 0-390 - +external_var is never used - <-- line 124 - } [@@dead "+external_var"] + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.ml", line 65, characters 2-15 + field_dbg_info.Fld_variant is a variant case which is never constructed + <-- line 65 + | Fld_variant [@dead "field_dbg_info.Fld_variant"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 140, characters 0-176 - +ml_module_as_var is never used - <-- line 140 - } [@@dead "+ml_module_as_var"] + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.ml", line 66, characters 2-12 + field_dbg_info.Fld_cons is a variant case which is never constructed + <-- line 66 + | Fld_cons [@dead "field_dbg_info.Fld_cons"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 152, characters 0-169 - +pure_runtime_call is never used - <-- line 152 - args [@@dead "+pure_runtime_call"] + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.ml", line 82, characters 2-38 + set_field_dbg_info.Fld_record_extension_set is a variant case which is never constructed + <-- line 82 + | Fld_record_extension_set of string [@dead "set_field_dbg_info.Fld_record_extension_set"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 160, characters 0-134 - +raw_js_code is never used - <-- line 160 - } [@@dead "+raw_js_code"] + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.mli", line 30, characters 2-69 + field_dbg_info.Fld_record is a variant case which is never constructed + <-- line 30 + | Fld_record of {name: string; mutable_flag: Asttypes.mutable_flag} [@dead "field_dbg_info.Fld_record"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 167, characters 0-23 - +some_comment is never used - <-- line 167 - let some_comment = None [@@dead "+some_comment"] + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.mli", line 31, characters 2-32 + field_dbg_info.Fld_module is a variant case which is never constructed + <-- line 31 + | Fld_module of {name: string} [@dead "field_dbg_info.Fld_module"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 169, characters 0-109 - +optional_block is never used - <-- line 169 - {expression_desc = Optional_block (e, false); comment = some_comment} [@@dead "+optional_block"] + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.mli", line 32, characters 2-39 + field_dbg_info.Fld_record_inline is a variant case which is never constructed + <-- line 32 + | Fld_record_inline of {name: string} [@dead "field_dbg_info.Fld_record_inline"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 172, characters 0-109 - +optional_not_nest_block is never used - <-- line 172 - {expression_desc = Optional_block (e, true); comment = None} [@@dead "+optional_not_nest_block"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 178, characters 0-104 - +dot is never used - <-- line 178 - {expression_desc = Static_index (e0, e1, None); comment} [@@dead "+dot"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 181, characters 0-421 - +module_access is never used - <-- line 181 - | _ -> {expression_desc = Static_index (e, name, Some pos); comment = None} [@@dead "+module_access"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 191, characters 0-189 - +make_block is never used - <-- line 191 - {expression_desc = Caml_block (es, mutable_flag, tag, tag_info); comment} [@@dead "+make_block"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 198, characters 0-301 - +typeof is never used - <-- line 198 - | _ -> {expression_desc = Typeof e; comment} [@@dead "+typeof"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 206, characters 0-103 - +instanceof is never used - <-- line 206 - {expression_desc = Bin (InstanceOf, e0, e1); comment} [@@dead "+instanceof"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 209, characters 0-157 - +is_array is never used - <-- line 209 - {expression_desc = Call (f, [e0], Js_call_info.ml_full_call); comment = None} [@@dead "+is_array"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 215, characters 0-77 - +unit is never used - <-- line 215 - let unit : t = {expression_desc = Undefined {is_unit = true}; comment = None} [@@dead "+unit"] + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.mli", line 33, characters 2-42 + field_dbg_info.Fld_record_extension is a variant case which is never constructed + <-- line 33 + | Fld_record_extension of {name: string} [@dead "field_dbg_info.Fld_record_extension"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 236, characters 0-444 - +ocaml_fun is never used - <-- line 236 - } [@@dead "+ocaml_fun"] + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.mli", line 34, characters 2-13 + field_dbg_info.Fld_tuple is a variant case which is never constructed + <-- line 34 + | Fld_tuple [@dead "field_dbg_info.Fld_tuple"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 255, characters 0-365 - +method_ is never used - <-- line 255 - } [@@dead "+method_"] + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.mli", line 35, characters 2-20 + field_dbg_info.Fld_poly_var_tag is a variant case which is never constructed + <-- line 35 + | Fld_poly_var_tag [@dead "field_dbg_info.Fld_poly_var_tag"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 273, characters 0-465 - +dummy_obj is never used - <-- line 273 - | Blk_some | Blk_some_not_nested -> assert false [@@dead "+dummy_obj"] + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.mli", line 36, characters 2-24 + field_dbg_info.Fld_poly_var_content is a variant case which is never constructed + <-- line 36 + | Fld_poly_var_content [@dead "field_dbg_info.Fld_poly_var_content"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 289, characters 0-622 - +seq is never used - <-- line 289 - | _ -> {expression_desc = Seq (e0, e1); comment} [@@dead "+seq"] + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.mli", line 37, characters 2-17 + field_dbg_info.Fld_extension is a variant case which is never constructed + <-- line 37 + | Fld_extension [@dead "field_dbg_info.Fld_extension"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 304, characters 0-73 - +fuse_to_seq is never used - <-- line 304 - let fuse_to_seq x xs = if xs = [] then x else Ext_list.fold_left xs x seq [@@dead "+fuse_to_seq"] + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.mli", line 38, characters 2-15 + field_dbg_info.Fld_variant is a variant case which is never constructed + <-- line 38 + | Fld_variant [@dead "field_dbg_info.Fld_variant"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 347, characters 0-127 - +zero_bigint_literal is never used - <-- line 347 - } [@@dead "+zero_bigint_literal"] + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.mli", line 39, characters 2-12 + field_dbg_info.Fld_cons is a variant case which is never constructed + <-- line 39 + | Fld_cons [@dead "field_dbg_info.Fld_cons"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 373, characters 0-88 - +zero_float_lit is never used - <-- line 373 - {expression_desc = Number (Float {f = "0."}); comment = None} [@@dead "+zero_float_lit"] + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.mli", line 46, characters 2-38 + set_field_dbg_info.Fld_record_extension_set is a variant case which is never constructed + <-- line 46 + | Fld_record_extension_set of string [@dead "set_field_dbg_info.Fld_record_extension_set"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 376, characters 0-94 - +float_mod is never used - <-- line 376 - {comment; expression_desc = Bin (Mod, e1, e2)} [@@dead "+float_mod"] + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_env.ml", line 33, characters 2-15 + ident_info.name is a record label never used to read a value + <-- line 33 + name: string; [@dead "ident_info.name"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 379, characters 0-422 - +array_index is never used - <-- line 379 - | _ -> {expression_desc = Array_index (e0, e1); comment} [@@dead "+array_index"] + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_env.ml", line 34, characters 2-29 + ident_info.arity is a record label never used to read a value + <-- line 34 + arity: Js_cmj_format.arity; [@dead "ident_info.arity"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 389, characters 0-447 - +array_index_by_int is never used - <-- line 389 - | _ -> {expression_desc = Array_index (e, int ?comment pos); comment = None} [@@dead "+array_index_by_int"] + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_env.ml", line 35, characters 2-41 + ident_info.persistent_closed_lambda is a record label never used to read a value + <-- line 35 + persistent_closed_lambda: Lam.t option; [@dead "ident_info.persistent_closed_lambda"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 400, characters 0-489 - +record_access is never used - <-- line 400 - | _ -> {expression_desc = Static_index (e, name, Some pos); comment = None} [@@dead "+record_access"] + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_external_call.ml", line 60, characters 2-24 + arg_expression.Splice2 is a variant case which is never constructed + <-- line 60 + | Splice2 of E.t * E.t [@dead "arg_expression.Splice2"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 413, characters 0-40 - +inline_record_access is never used - <-- line 413 - let inline_record_access = record_access [@@dead "+inline_record_access"] + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_iter.ml", line 29, characters 0-1404 + +inner_iter is never used + <-- line 29 + | Lassign (_id, e) -> f e [@@dead "+inner_iter"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 415, characters 0-99 - +variant_access is never used - <-- line 415 - inline_record_access e ("_" ^ Int32.to_string pos) pos [@@dead "+variant_access"] + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_iter.mli", line 25, characters 0-49 + +inner_iter is never used + <-- line 25 + val inner_iter : Lam.t -> (Lam.t -> unit) -> unit [@@dead "+inner_iter"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 418, characters 0-178 - +cons_access is never used - <-- line 418 - pos [@@dead "+cons_access"] + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_module_ident.ml", line 25, characters 55-75 + t.dynamic_import is a record label never used to read a value + <-- line 25 + type t = J.module_id = {id: Ident.t; kind: Js_op.kind; dynamic_import: bool [@dead "t.dynamic_import"] } Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 426, characters 0-297 - +poly_var_tag_access is never used - <-- line 426 - } [@@dead "+poly_var_tag_access"] + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_module_ident.ml", line 27, characters 0-15 + +id is never used + <-- line 27 + let id x = x.id [@@dead "+id"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 438, characters 0-304 - +poly_var_value_access is never used - <-- line 438 - } [@@dead "+poly_var_value_access"] + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_module_ident.mli", line 31, characters 2-23 + t.dynamic_import is a record label never used to read a value + <-- line 31 + dynamic_import: bool; [@dead "t.dynamic_import"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 450, characters 0-665 - +extension_access is never used - <-- line 450 - {expression_desc = Static_index (e, name, Some pos); comment = None} [@@dead "+extension_access"] + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_module_ident.mli", line 34, characters 0-21 + +id is never used + <-- line 34 + val id : t -> Ident.t [@@dead "+id"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 472, characters 0-487 - +string_index is never used - <-- line 472 - | _ -> {expression_desc = String_index (e0, e1); comment} [@@dead "+string_index"] + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_count.ml", line 39, characters 0-94 + +pp_info is never used + <-- line 39 + Format.fprintf fmt "(:%d)" x.captured x.times [@@dead "+pp_info"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 485, characters 0-77 - +assign is never used - <-- line 485 - let assign ?comment e0 e1 : t = {expression_desc = Bin (Eq, e0, e1); comment} [@@dead "+assign"] + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_count.ml", line 42, characters 0-123 + +pp_occ_tbl is never used + <-- line 42 + Format.fprintf fmt "@[%a@ %a@]@." Ident.print k pp_info v) [@@dead "+pp_occ_tbl"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 487, characters 0-419 - +assign_by_exp is never used - <-- line 487 - | _ -> assign {expression_desc = Array_index (e, index); comment = None} value [@@dead "+assign_by_exp"] + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_count.mli", line 30, characters 0-52 + +pp_occ_tbl is never used + <-- line 30 + val pp_occ_tbl : Format.formatter -> occ_tbl -> unit [@@dead "+pp_occ_tbl"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 502, characters 0-447 - +record_assign is never used - <-- line 502 - value [@@dead "+record_assign"] + Warning Dead Value With Side Effects + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_print.ml", line 493, characters 0-50 + +lambda_to_string is never used and could have side effects Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 520, characters 0-457 - +extension_assign is never used - <-- line 520 - value [@@dead "+extension_assign"] + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_print.mli", line 27, characters 0-59 + +primitive is never used + <-- line 27 + val primitive : Format.formatter -> Lam_primitive.t -> unit [@@dead "+primitive"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 540, characters 0-277 - +array_length is never used - <-- line 540 - | _ -> {expression_desc = Length (e, Array); comment} [@@dead "+array_length"] + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_print.mli", line 31, characters 0-38 + +lambda_to_string is never used + <-- line 31 + val lambda_to_string : Lam.t -> string [@@dead "+lambda_to_string"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 547, characters 0-242 - +string_length is never used - <-- line 547 - | _ -> {expression_desc = Length (e, String); comment} [@@dead "+string_length"] + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_util.mli", line 62, characters 0-31 + +is_function is never used + <-- line 62 + val is_function : Lam.t -> bool [@@dead "+is_function"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 553, characters 0-304 - +function_length is never used - <-- line 553 - | _ -> {expression_desc = Length (e, Function); comment} [@@dead "+function_length"] + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/depends/binary_ast.mli", line 29, characters 0-25 + +magic_sep_char is never used + <-- line 29 + val magic_sep_char : char [@@dead "+magic_sep_char"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 566, characters 0-1023 - +string_append is never used - <-- line 566 - | _, _ -> {comment; expression_desc = String_append (e, el)} [@@dead "+string_append"] + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/depends/bs_exception.ml", line 28, characters 2-36 + error.Bs_cyclic_depends is a variant case which is never constructed + <-- line 28 + | Bs_cyclic_depends of string list [@dead "error.Bs_cyclic_depends"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 587, characters 0-94 - +obj is never used - <-- line 587 - {expression_desc = Object (dup, properties); comment} [@@dead "+obj"] + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/depends/bs_exception.ml", line 29, characters 2-43 + error.Bs_duplicated_module is a variant case which is never constructed + <-- line 29 + | Bs_duplicated_module of string * string [@dead "error.Bs_duplicated_module"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 590, characters 0-304 - +str_equal is never used - <-- line 590 - else None [@@dead "+str_equal"] + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/depends/bs_exception.ml", line 31, characters 2-34 + error.Bs_package_not_found is a variant case which is never constructed + <-- line 31 + | Bs_package_not_found of string [@dead "error.Bs_package_not_found"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 600, characters 0-824 - +triple_equal is never used - <-- line 600 - | _ -> {expression_desc = Bin (EqEqEq, e0, e1); comment} [@@dead "+triple_equal"] + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/depends/bs_exception.ml", line 32, characters 2-31 + error.Bs_main_not_exist is a variant case which is never constructed + <-- line 32 + | Bs_main_not_exist of string [@dead "error.Bs_main_not_exist"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 621, characters 0-493 - +bin is never used - <-- line 621 - | _ -> {expression_desc = Bin (op, e0, e1); comment} [@@dead "+bin"] + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/depends/bs_exception.ml", line 33, characters 2-29 + error.Bs_invalid_path is a variant case which is never constructed + <-- line 33 + | Bs_invalid_path of string [@dead "error.Bs_invalid_path"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 655, characters 0-17 - +debug is never used - <-- line 655 - let debug = false [@@dead "+debug"] + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/depends/bs_exception.mli", line 28, characters 2-36 + error.Bs_cyclic_depends is a variant case which is never constructed + <-- line 28 + | Bs_cyclic_depends of string list [@dead "error.Bs_cyclic_depends"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 671, characters 0-634 - +push_negation is never used - <-- line 671 - | _ -> None [@@dead "+push_negation"] + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/depends/bs_exception.mli", line 29, characters 2-43 + error.Bs_duplicated_module is a variant case which is never constructed + <-- line 29 + | Bs_duplicated_module of string * string [@dead "error.Bs_duplicated_module"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 688, characters 0-27 - +simplify_max_depth is never used - <-- line 688 - let simplify_max_depth = 10 [@@dead "+simplify_max_depth"] + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/depends/bs_exception.mli", line 31, characters 2-34 + error.Bs_package_not_found is a variant case which is never constructed + <-- line 31 + | Bs_package_not_found of string [@dead "error.Bs_package_not_found"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 730, characters 0-12453 - +simplify_and_ is never used - <-- line 730 - res [@@dead "+simplify_and_"] + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/depends/bs_exception.mli", line 32, characters 2-31 + error.Bs_main_not_exist is a variant case which is never constructed + <-- line 32 + | Bs_main_not_exist of string [@dead "error.Bs_main_not_exist"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1039, characters 0-174 - +simplify_and_force is never used - <-- line 1039 - | x -> x [@@dead "+simplify_and_force"] + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/depends/bs_exception.mli", line 33, characters 2-29 + error.Bs_invalid_path is a variant case which is never constructed + <-- line 33 + | Bs_invalid_path of string [@dead "error.Bs_invalid_path"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1064, characters 0-818 - +simplify_or_ is never used - <-- line 1064 - res [@@dead "+simplify_or_"] + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_fmt.ml", line 10, characters 0-54 + +invalid_argf is never used + <-- line 10 + let invalid_argf fmt = Format.ksprintf invalid_arg fmt [@@dead "+invalid_argf"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1093, characters 0-171 - +simplify_or_force is never used - <-- line 1093 - | x -> x [@@dead "+simplify_or_force"] + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_ident.ml", line 166, characters 0-31 + +make_unused is never used + <-- line 166 + let make_unused () = create "_" [@@dead "+make_unused"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1098, characters 0-133 - +simplify_and is never used - <-- line 1098 - else None [@@dead "+simplify_and"] + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_ident.mli", line 38, characters 0-33 + +make_unused is never used + <-- line 38 + val make_unused : unit -> Ident.t [@@dead "+make_unused"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1102, characters 0-131 - +simplify_or is never used - <-- line 1102 - else None [@@dead "+simplify_or"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1106, characters 0-751 - +and_ is never used - <-- line 1106 - | None -> {expression_desc = Bin (And, e1, e2); comment}) [@@dead "+and_"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1126, characters 0-516 - +or_ is never used - <-- line 1126 - | None -> {expression_desc = Bin (Or, e1, e2); comment}) [@@dead "+or_"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1140, characters 0-87 - +in_ is never used - <-- line 1140 - {expression_desc = In (prop, obj); comment = None} [@@dead "+in_"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1143, characters 0-685 - +not is never used - <-- line 1143 - | None -> {expression_desc = Js_not e; comment = None}) [@@dead "+not"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1159, characters 0-124 - +not_empty_branch is never used - <-- line 1159 - | _ -> true [@@dead "+not_empty_branch"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1164, characters 0-1851 - +econd is never used - <-- line 1164 - | _ -> default () [@@dead "+econd"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1213, characters 0-1526 - +float_equal is never used - <-- line 1213 - | _ -> {expression_desc = Bin (EqEqEq, e0, e1); comment} [@@dead "+float_equal"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1251, characters 0-27 - +int_equal is never used - <-- line 1251 - let int_equal = float_equal [@@dead "+int_equal"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1276, characters 0-636 - +emit_check is never used - <-- line 1276 - | Expr x -> x [@@dead "+emit_check"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1296, characters 0-199 - +is_a_literal_case is never used - <-- line 1296 - emit_check check [@@dead "+is_a_literal_case"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1303, characters 0-175 - +is_int_tag is never used - <-- line 1303 - emit_check check [@@dead "+is_int_tag"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1315, characters 0-106 - +tag is never used - <-- line 1315 - {expression_desc = Caml_block_tag (e, name); comment} [@@dead "+tag"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1331, characters 0-726 - +int32_bor is never used - <-- line 1331 - | _ -> {comment; expression_desc = Bin (Bor, e1, e2)} [@@dead "+int32_bor"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1349, characters 0-97 - +to_int32 is never used - <-- line 1349 - int32_bor ?comment e zero_int_literal [@@dead "+to_int32"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1353, characters 0-434 - +string_comp is never used - <-- line 1353 - | _ -> bin ?comment (Lam_compile_util.jsop_of_comp cmp) e0 e1 [@@dead "+string_comp"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1362, characters 0-80 - +string_equal is never used - <-- line 1362 - let string_equal ?comment (e0 : t) (e1 : t) : t = string_comp Ceq ?comment e0 e1 [@@dead "+string_equal"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1364, characters 0-91 - +is_type_number is never used - <-- line 1364 - string_equal ?comment (typeof e) (str "number") [@@dead "+is_type_number"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1367, characters 0-91 - +is_type_string is never used - <-- line 1367 - string_equal ?comment (typeof e) (str "string") [@@dead "+is_type_string"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1370, characters 0-71 - +is_type_object is never used - <-- line 1370 - let is_type_object (e : t) : t = string_equal (typeof e) (str "object") [@@dead "+is_type_object"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1372, characters 0-94 - +obj_length is never used - <-- line 1372 - to_int32 {expression_desc = Length (e, Caml_block); comment} [@@dead "+obj_length"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1375, characters 0-186 - +compare_int_aux is never used - <-- line 1375 - | Cge -> l >= r [@@dead "+compare_int_aux"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1384, characters 0-990 - +int_comp is never used - <-- line 1384 - | _ -> bin ?comment (Lam_compile_util.jsop_of_comp cmp) e0 e1 [@@dead "+int_comp"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1412, characters 0-901 - +bool_comp is never used - <-- line 1412 - | _, _ -> bin ?comment (Lam_compile_util.jsop_of_comp cmp) e0 e1 [@@dead "+bool_comp"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1439, characters 0-92 - +float_comp is never used - <-- line 1439 - bin ?comment (Lam_compile_util.jsop_of_comp cmp) e0 e1 [@@dead "+float_comp"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1442, characters 0-89 - +js_comp is never used - <-- line 1442 - bin ?comment (Lam_compile_util.jsop_of_comp cmp) e0 e1 [@@dead "+js_comp"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1445, characters 0-555 - +int32_lsr is never used - <-- line 1445 - | _, _ -> {comment; expression_desc = Bin (Lsr, e1, e2)} [@@dead "+int32_lsr"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1461, characters 0-1966 - +is_out is never used - <-- line 1461 - | _, _ -> int_comp ?comment Cgt e range [@@dead "+is_out"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1515, characters 0-1244 - +float_add is never used - <-- line 1515 - | _ -> {comment; expression_desc = Bin (Plus, e1, e2)} [@@dead "+float_add"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1545, characters 0-241 - +float_minus is never used - <-- line 1545 - | _ -> {comment; expression_desc = Bin (Minus, e1, e2)} [@@dead "+float_minus"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1551, characters 0-65 - +unchecked_int32_add is never used - <-- line 1551 - let unchecked_int32_add ?comment e1 e2 = float_add ?comment e1 e2 [@@dead "+unchecked_int32_add"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1552, characters 0-66 - +int32_add is never used - <-- line 1552 - let int32_add ?comment e1 e2 = to_int32 (float_add ?comment e1 e2) [@@dead "+int32_add"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1554, characters 0-91 - +offset is never used - <-- line 1554 - if offset = 0 then e1 else int32_add e1 (small_int offset) [@@dead "+offset"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1557, characters 0-87 - +int32_minus is never used - <-- line 1557 - to_int32 (float_minus ?comment e1 e2) [@@dead "+int32_minus"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1560, characters 0-86 - +unchecked_int32_minus is never used - <-- line 1560 - float_minus ?comment e1 e2 [@@dead "+unchecked_int32_minus"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1563, characters 0-53 - +float_div is never used - <-- line 1563 - let float_div ?comment e1 e2 = bin ?comment Div e1 e2 [@@dead "+float_div"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1564, characters 0-53 - +float_pow is never used - <-- line 1564 - let float_pow ?comment e1 e2 = bin ?comment Pow e1 e2 [@@dead "+float_pow"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1565, characters 0-62 - +float_notequal is never used - <-- line 1565 - let float_notequal ?comment e1 e2 = bin ?comment NotEqEq e1 e2 [@@dead "+float_notequal"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1567, characters 0-94 - +int32_asr is never used - <-- line 1567 - {comment; expression_desc = Bin (Asr, e1, e2)} [@@dead "+int32_asr"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1571, characters 0-482 - +int32_div is never used - <-- line 1571 - else to_int32 (float_div ?comment e1 e2) [@@dead "+int32_div"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1582, characters 0-316 - +int32_mod is never used - <-- line 1582 - else {comment; expression_desc = Bin (Mod, e1, e2)} [@@dead "+int32_mod"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1590, characters 0-53 - +float_mul is never used - <-- line 1590 - let float_mul ?comment e1 e2 = bin ?comment Mul e1 e2 [@@dead "+float_mul"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1592, characters 0-316 - +int32_lsl is never used - <-- line 1592 - | _ -> {comment; expression_desc = Bin (Lsl, e1, e2)} [@@dead "+int32_lsl"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1599, characters 0-253 - +is_pos_pow is never used - <-- line 1599 - try aux 0 n with E -> -1 [@@dead "+is_pos_pow"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1609, characters 0-702 - +int32_mul is never used - <-- line 1609 - | _ -> to_int32 (float_mul ?comment e1 e2) [@@dead "+int32_mul"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1625, characters 0-104 - +unchecked_int32_mul is never used - <-- line 1625 - {comment; expression_desc = Bin (Mul, e1, e2)} [@@dead "+unchecked_int32_mul"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1628, characters 0-179 - +int_bnot is never used - <-- line 1628 - | _ -> {comment; expression_desc = Js_bnot e} [@@dead "+int_bnot"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1633, characters 0-251 - +int32_pow is never used - <-- line 1633 - | _ -> to_int32 (float_pow ?comment e1 e2) [@@dead "+int32_pow"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1639, characters 0-445 - +int32_bxor is never used - <-- line 1639 - | _ -> {comment; expression_desc = Bin (Bxor, e1, e2)} [@@dead "+int32_bxor"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1649, characters 0-384 - +int32_band is never used - <-- line 1649 - | _ -> {comment; expression_desc = Bin (Band, e1, e2)} [@@dead "+int32_band"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1663, characters 0-67 - +bigint_op is never used - <-- line 1663 - let bigint_op ?comment op (e1 : t) (e2 : t) = bin ?comment op e1 e2 [@@dead "+bigint_op"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1665, characters 0-992 - +bigint_comp is never used - <-- line 1665 - | _ -> bin ?comment (Lam_compile_util.jsop_of_comp cmp) e0 e1 [@@dead "+bigint_comp"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1692, characters 0-159 - +bigint_div is never used - <-- line 1692 - else bigint_op ?comment Div e0 e1 [@@dead "+bigint_div"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1696, characters 0-160 - +bigint_mod is never used - <-- line 1696 - else bigint_op ?comment Mod e0 e1 [@@dead "+bigint_mod"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1703, characters 0-596 - +of_block is never used - <-- line 1703 - [] [@@dead "+of_block"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1727, characters 0-58 - +is_null is never used - <-- line 1727 - let is_null ?comment (x : t) = triple_equal ?comment x nil [@@dead "+is_null"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1728, characters 0-117 - +is_null_undefined_constant is never used - <-- line 1728 - | _ -> false [@@dead "+is_null_undefined_constant"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1733, characters 0-216 - +is_null_undefined is never used - <-- line 1733 - | _ -> {comment; expression_desc = Is_null_or_undefined x} [@@dead "+is_null_undefined"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1739, characters 0-605 - +eq_null_undefined_boolean is never used - <-- line 1739 - | _ -> {expression_desc = Bin (EqEqEq, a, b); comment} [@@dead "+eq_null_undefined_boolean"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1754, characters 0-605 - +neq_null_undefined_boolean is never used - <-- line 1754 - | _ -> {expression_desc = Bin (NotEqEq, a, b); comment} [@@dead "+neq_null_undefined_boolean"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1769, characters 0-106 - +make_exception is never used - <-- line 1769 - pure_runtime_call Primitive_modules.exceptions Literals.create [str s] [@@dead "+make_exception"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1772, characters 0-173 - +variadic_args is never used - <-- line 1772 - | arg :: args -> arg :: variadic_args args [@@dead "+variadic_args"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 42, characters 0-39 - +remove_pure_sub_exp is never used - <-- line 42 - val remove_pure_sub_exp : t -> t option [@@dead "+remove_pure_sub_exp"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 48, characters 0-43 - +runtime_var_dot is never used - <-- line 48 - val runtime_var_dot : string -> string -> t [@@dead "+runtime_var_dot"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 52, characters 0-84 - +ml_var_dot is never used - <-- line 52 - ?comment:string -> ?dynamic_import:bool -> Ident.t -> string -> t [@@dead "+ml_var_dot"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 57, characters 0-185 - +external_var_field is never used - <-- line 57 - t [@@dead "+external_var_field"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 69, characters 0-143 - +external_var is never used - <-- line 69 - t [@@dead "+external_var"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 76, characters 0-78 - +ml_module_as_var is never used - <-- line 76 - val ml_module_as_var : ?comment:string -> ?dynamic_import:bool -> Ident.t -> t [@@dead "+ml_module_as_var"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 89, characters 0-187 - +ocaml_fun is never used - <-- line 89 - t [@@dead "+ocaml_fun"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 100, characters 0-139 - +method_ is never used - <-- line 100 - t [@@dead "+method_"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 109, characters 0-47 - +econd is never used - <-- line 109 - val econd : ?comment:string -> t -> t -> t -> t [@@dead "+econd"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 111, characters 0-49 - +int is never used - <-- line 111 - val int : ?comment:string -> ?c:int -> int32 -> t [@@dead "+int"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 113, characters 0-24 - +small_int is never used - <-- line 113 - val small_int : int -> t [@@dead "+small_int"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 115, characters 0-32 - +bigint is never used - <-- line 115 - val bigint : bool -> string -> t [@@dead "+bigint"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 117, characters 0-23 - +float is never used - <-- line 117 - val float : string -> t [@@dead "+float"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 121, characters 0-24 - +zero_int_literal is never used - <-- line 121 - val zero_int_literal : t [@@dead "+zero_int_literal"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 124, characters 0-22 - +zero_float_lit is never used - <-- line 124 - val zero_float_lit : t [@@dead "+zero_float_lit"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 126, characters 0-27 - +zero_bigint_literal is never used - <-- line 126 - val zero_bigint_literal : t [@@dead "+zero_bigint_literal"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 128, characters 0-43 - +is_out is never used - <-- line 128 - val is_out : ?comment:string -> t -> t -> t [@@dead "+is_out"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 133, characters 0-45 - +dot is never used - <-- line 133 - val dot : ?comment:string -> t -> string -> t [@@dead "+dot"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 135, characters 0-45 - +module_access is never used - <-- line 135 - val module_access : t -> string -> int32 -> t [@@dead "+module_access"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 137, characters 0-44 - +array_length is never used - <-- line 137 - val array_length : ?comment:string -> t -> t [@@dead "+array_length"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 139, characters 0-45 - +string_length is never used - <-- line 139 - val string_length : ?comment:string -> t -> t [@@dead "+string_length"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 141, characters 0-47 - +function_length is never used - <-- line 141 - val function_length : ?comment:string -> t -> t [@@dead "+function_length"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 143, characters 0-50 - +string_append is never used - <-- line 143 - val string_append : ?comment:string -> t -> t -> t [@@dead "+string_append"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 156, characters 0-49 - +string_index is never used - <-- line 156 - val string_index : ?comment:string -> t -> t -> t [@@dead "+string_index"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 158, characters 0-48 - +array_index is never used - <-- line 158 - val array_index : ?comment:string -> t -> t -> t [@@dead "+array_index"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 160, characters 0-61 - +array_index_by_int is never used - <-- line 160 - val array_index_by_int : ?comment:string -> t -> Int32.t -> t [@@dead "+array_index_by_int"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 162, characters 0-47 - +record_access is never used - <-- line 162 - val record_access : t -> string -> Int32.t -> t [@@dead "+record_access"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 164, characters 0-54 - +inline_record_access is never used - <-- line 164 - val inline_record_access : t -> string -> Int32.t -> t [@@dead "+inline_record_access"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 166, characters 0-36 - +variant_access is never used - <-- line 166 - val variant_access : t -> int32 -> t [@@dead "+variant_access"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 168, characters 0-33 - +cons_access is never used - <-- line 168 - val cons_access : t -> int32 -> t [@@dead "+cons_access"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 170, characters 0-57 - +extension_access is never used - <-- line 170 - val extension_access : t -> string option -> Int32.t -> t [@@dead "+extension_access"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 172, characters 0-50 - +record_assign is never used - <-- line 172 - val record_assign : t -> int32 -> string -> t -> t [@@dead "+record_assign"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 174, characters 0-32 - +poly_var_tag_access is never used - <-- line 174 - val poly_var_tag_access : t -> t [@@dead "+poly_var_tag_access"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 176, characters 0-34 - +poly_var_value_access is never used - <-- line 176 - val poly_var_value_access : t -> t [@@dead "+poly_var_value_access"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 178, characters 0-53 - +extension_assign is never used - <-- line 178 - val extension_assign : t -> int32 -> string -> t -> t [@@dead "+extension_assign"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 180, characters 0-36 - +assign_by_exp is never used - <-- line 180 - val assign_by_exp : t -> t -> t -> t [@@dead "+assign_by_exp"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 182, characters 0-43 - +assign is never used - <-- line 182 - val assign : ?comment:string -> t -> t -> t [@@dead "+assign"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 186, characters 0-62 - +emit_check is never used - <-- line 186 - val emit_check : t Ast_untagged_variants.Dynamic_checks.t -> t [@@dead "+emit_check"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 188, characters 0-49 - +triple_equal is never used - <-- line 188 - val triple_equal : ?comment:string -> t -> t -> t [@@dead "+triple_equal"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 191, characters 0-48 - +float_equal is never used - <-- line 191 - val float_equal : ?comment:string -> t -> t -> t [@@dead "+float_equal"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 193, characters 0-46 - +int_equal is never used - <-- line 193 - val int_equal : ?comment:string -> t -> t -> t [@@dead "+int_equal"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 195, characters 0-40 - +int_bnot is never used - <-- line 195 - val int_bnot : ?comment:string -> t -> t [@@dead "+int_bnot"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 197, characters 0-49 - +string_equal is never used - <-- line 197 - val string_equal : ?comment:string -> t -> t -> t [@@dead "+string_equal"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 199, characters 0-62 - +eq_null_undefined_boolean is never used - <-- line 199 - val eq_null_undefined_boolean : ?comment:string -> t -> t -> t [@@dead "+eq_null_undefined_boolean"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 201, characters 0-63 - +neq_null_undefined_boolean is never used - <-- line 201 - val neq_null_undefined_boolean : ?comment:string -> t -> t -> t [@@dead "+neq_null_undefined_boolean"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 203, characters 0-46 - +is_type_number is never used - <-- line 203 - val is_type_number : ?comment:string -> t -> t [@@dead "+is_type_number"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 205, characters 0-71 - +is_int_tag is never used - <-- line 205 - val is_int_tag : ?has_null_undefined_other:bool * bool * bool -> t -> t [@@dead "+is_int_tag"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 207, characters 0-144 - +is_a_literal_case is never used - <-- line 207 - t [@@dead "+is_a_literal_case"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 213, characters 0-46 - +is_type_string is never used - <-- line 213 - val is_type_string : ?comment:string -> t -> t [@@dead "+is_type_string"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 215, characters 0-27 - +is_type_object is never used - <-- line 215 - val is_type_object : t -> t [@@dead "+is_type_object"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 217, characters 0-38 - +typeof is never used - <-- line 217 - val typeof : ?comment:string -> t -> t [@@dead "+typeof"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 218, characters 0-47 - +instanceof is never used - <-- line 218 - val instanceof : ?comment:string -> t -> t -> t [@@dead "+instanceof"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 219, characters 0-21 - +is_array is never used - <-- line 219 - val is_array : t -> t [@@dead "+is_array"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 221, characters 0-40 - +to_int32 is never used - <-- line 221 - val to_int32 : ?comment:string -> t -> t [@@dead "+to_int32"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 223, characters 0-56 - +unchecked_int32_add is never used - <-- line 223 - val unchecked_int32_add : ?comment:string -> t -> t -> t [@@dead "+unchecked_int32_add"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 225, characters 0-46 - +int32_add is never used - <-- line 225 - val int32_add : ?comment:string -> t -> t -> t [@@dead "+int32_add"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 227, characters 0-26 - +offset is never used - <-- line 227 - val offset : t -> int -> t [@@dead "+offset"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 229, characters 0-58 - +unchecked_int32_minus is never used - <-- line 229 - val unchecked_int32_minus : ?comment:string -> t -> t -> t [@@dead "+unchecked_int32_minus"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 231, characters 0-48 - +int32_minus is never used - <-- line 231 - val int32_minus : ?comment:string -> t -> t -> t [@@dead "+int32_minus"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 233, characters 0-46 - +int32_mul is never used - <-- line 233 - val int32_mul : ?comment:string -> t -> t -> t [@@dead "+int32_mul"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 235, characters 0-56 - +unchecked_int32_mul is never used - <-- line 235 - val unchecked_int32_mul : ?comment:string -> t -> t -> t [@@dead "+unchecked_int32_mul"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 237, characters 0-62 - +int32_div is never used - <-- line 237 - val int32_div : checked:bool -> ?comment:string -> t -> t -> t [@@dead "+int32_div"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 239, characters 0-62 - +int32_mod is never used - <-- line 239 - val int32_mod : checked:bool -> ?comment:string -> t -> t -> t [@@dead "+int32_mod"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 241, characters 0-46 - +int32_pow is never used - <-- line 241 - val int32_pow : ?comment:string -> t -> t -> t [@@dead "+int32_pow"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 243, characters 0-46 - +int32_lsl is never used - <-- line 243 - val int32_lsl : ?comment:string -> t -> t -> t [@@dead "+int32_lsl"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 245, characters 0-46 - +int32_lsr is never used - <-- line 245 - val int32_lsr : ?comment:string -> t -> t -> t [@@dead "+int32_lsr"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 247, characters 0-46 - +int32_asr is never used - <-- line 247 - val int32_asr : ?comment:string -> t -> t -> t [@@dead "+int32_asr"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 249, characters 0-47 - +int32_bxor is never used - <-- line 249 - val int32_bxor : ?comment:string -> t -> t -> t [@@dead "+int32_bxor"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 251, characters 0-47 - +int32_band is never used - <-- line 251 - val int32_band : ?comment:string -> t -> t -> t [@@dead "+int32_band"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 253, characters 0-46 - +int32_bor is never used - <-- line 253 - val int32_bor : ?comment:string -> t -> t -> t [@@dead "+int32_bor"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 255, characters 0-46 - +float_add is never used - <-- line 255 - val float_add : ?comment:string -> t -> t -> t [@@dead "+float_add"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 257, characters 0-48 - +float_minus is never used - <-- line 257 - val float_minus : ?comment:string -> t -> t -> t [@@dead "+float_minus"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 259, characters 0-46 - +float_mul is never used - <-- line 259 - val float_mul : ?comment:string -> t -> t -> t [@@dead "+float_mul"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 261, characters 0-46 - +float_div is never used - <-- line 261 - val float_div : ?comment:string -> t -> t -> t [@@dead "+float_div"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 263, characters 0-51 - +float_notequal is never used - <-- line 263 - val float_notequal : ?comment:string -> t -> t -> t [@@dead "+float_notequal"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 265, characters 0-46 - +float_mod is never used - <-- line 265 - val float_mod : ?comment:string -> t -> t -> t [@@dead "+float_mod"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 267, characters 0-46 - +float_pow is never used - <-- line 267 - val float_pow : ?comment:string -> t -> t -> t [@@dead "+float_pow"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 269, characters 0-70 - +int_comp is never used - <-- line 269 - val int_comp : Lam_compat.comparison -> ?comment:string -> t -> t -> t [@@dead "+int_comp"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 271, characters 0-71 - +bool_comp is never used - <-- line 271 - val bool_comp : Lam_compat.comparison -> ?comment:string -> t -> t -> t [@@dead "+bool_comp"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 273, characters 0-73 - +string_comp is never used - <-- line 273 - val string_comp : Lam_compat.comparison -> ?comment:string -> t -> t -> t [@@dead "+string_comp"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 275, characters 0-72 - +float_comp is never used - <-- line 275 - val float_comp : Lam_compat.comparison -> ?comment:string -> t -> t -> t [@@dead "+float_comp"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 277, characters 0-61 - +bigint_op is never used - <-- line 277 - val bigint_op : ?comment:string -> Js_op.binop -> t -> t -> t [@@dead "+bigint_op"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 279, characters 0-73 - +bigint_comp is never used - <-- line 279 - val bigint_comp : Lam_compat.comparison -> ?comment:string -> t -> t -> t [@@dead "+bigint_comp"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 281, characters 0-63 - +bigint_div is never used - <-- line 281 - val bigint_div : checked:bool -> ?comment:string -> t -> t -> t [@@dead "+bigint_div"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 283, characters 0-63 - +bigint_mod is never used - <-- line 283 - val bigint_mod : checked:bool -> ?comment:string -> t -> t -> t [@@dead "+bigint_mod"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 285, characters 0-69 - +js_comp is never used - <-- line 285 - val js_comp : Lam_compat.comparison -> ?comment:string -> t -> t -> t [@@dead "+js_comp"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 287, characters 0-16 - +not is never used - <-- line 287 - val not : t -> t [@@dead "+not"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 289, characters 0-69 - +call is never used - <-- line 289 - val call : ?comment:string -> info:Js_call_info.t -> t -> t list -> t [@@dead "+call"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 291, characters 0-46 - +flat_call is never used - <-- line 291 - val flat_call : ?comment:string -> t -> t -> t [@@dead "+flat_call"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 293, characters 0-67 - +tagged_template is never used - <-- line 293 - val tagged_template : ?comment:string -> t -> t list -> t list -> t [@@dead "+tagged_template"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 299, characters 0-49 - +optional_block is never used - <-- line 299 - val optional_block : J.expression -> J.expression [@@dead "+optional_block"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 301, characters 0-58 - +optional_not_nest_block is never used - <-- line 301 - val optional_not_nest_block : J.expression -> J.expression [@@dead "+optional_not_nest_block"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 303, characters 0-147 - +make_block is never used - <-- line 303 - t [@@dead "+make_block"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 313, characters 0-40 - +seq is never used - <-- line 313 - val seq : ?comment:string -> t -> t -> t [@@dead "+seq"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 315, characters 0-34 - +fuse_to_seq is never used - <-- line 315 - val fuse_to_seq : t -> t list -> t [@@dead "+fuse_to_seq"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 317, characters 0-69 - +obj is never used - <-- line 317 - val obj : ?comment:string -> ?dup:J.expression -> J.property_map -> t [@@dead "+obj"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 319, characters 0-13 - +true_ is never used - <-- line 319 - val true_ : t [@@dead "+true_"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 321, characters 0-14 - +false_ is never used - <-- line 321 - val false_ : t [@@dead "+false_"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 323, characters 0-20 - +bool is never used - <-- line 323 - val bool : bool -> t [@@dead "+bool"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 325, characters 0-12 - +unit is never used - <-- line 325 - val unit : t [@@dead "+unit"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 328, characters 0-17 - +undefined is never used - <-- line 328 - val undefined : t [@@dead "+undefined"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 330, characters 0-62 - +tag is never used - <-- line 330 - val tag : ?comment:string -> ?name:string -> J.expression -> t [@@dead "+tag"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 337, characters 0-53 - +obj_length is never used - <-- line 337 - val obj_length : ?comment:string -> J.expression -> t [@@dead "+obj_length"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 339, characters 0-41 - +and_ is never used - <-- line 339 - val and_ : ?comment:string -> t -> t -> t [@@dead "+and_"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 341, characters 0-40 - +or_ is never used - <-- line 341 - val or_ : ?comment:string -> t -> t -> t [@@dead "+or_"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 343, characters 0-21 - +in_ is never used - <-- line 343 - val in_ : t -> t -> t [@@dead "+in_"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 347, characters 0-54 - +dummy_obj is never used - <-- line 347 - val dummy_obj : ?comment:string -> Lam_tag_info.t -> t [@@dead "+dummy_obj"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 350, characters 0-74 - +of_block is never used - <-- line 350 - val of_block : ?comment:string -> ?e:J.expression -> J.statement list -> t [@@dead "+of_block"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 353, characters 0-73 - +raw_js_code is never used - <-- line 353 - val raw_js_code : ?comment:string -> Js_raw_info.code_info -> string -> t [@@dead "+raw_js_code"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 355, characters 0-11 - +nil is never used - <-- line 355 - val nil : t [@@dead "+nil"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 357, characters 0-39 - +is_null is never used - <-- line 357 - val is_null : ?comment:string -> t -> t [@@dead "+is_null"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 359, characters 0-53 - +is_null_undefined_constant is never used - <-- line 359 - val is_null_undefined_constant : J.expression -> bool [@@dead "+is_null_undefined_constant"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 361, characters 0-49 - +is_null_undefined is never used - <-- line 361 - val is_null_undefined : ?comment:string -> t -> t [@@dead "+is_null_undefined"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 363, characters 0-32 - +make_exception is never used - <-- line 363 - val make_exception : string -> t [@@dead "+make_exception"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 365, characters 0-36 - +variadic_args is never used - <-- line 365 - val variadic_args : t list -> t list [@@dead "+variadic_args"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_fold_basic.ml", line 1, characters 0-0 - +js_fold_basic is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_fold_basic.ml", line 25, characters 0-56 - +add_lam_module_ident is never used - <-- line 25 - let add_lam_module_ident = Lam_module_ident.Hash_set.add [@@dead "+add_lam_module_ident"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_fold_basic.ml", line 27, characters 0-45 - +create is never used - <-- line 27 - let create = Lam_module_ident.Hash_set.create [@@dead "+create"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_fold_basic.ml", line 29, characters 0-32 - +super is never used - <-- line 29 - let super = Js_record_iter.super [@@dead "+super"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_fold_basic.ml", line 31, characters 0-411 - +count_hard_dependencies is never used - <-- line 31 - } [@@dead "+count_hard_dependencies"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_fold_basic.ml", line 45, characters 0-178 - +calculate_hard_dependencies is never used - <-- line 45 - hard_dependencies [@@dead "+calculate_hard_dependencies"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_fold_basic.mli", line 1, characters 0-0 - js_fold_basic is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_fold_basic.mli", line 29, characters 0-72 - +calculate_hard_dependencies is never used - <-- line 29 - val calculate_hard_dependencies : J.block -> Lam_module_ident.Hash_set.t [@@dead "+calculate_hard_dependencies"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_fun_env.ml", line 52, characters 0-243 - +make is never used - <-- line 52 - } [@@dead "+make"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_fun_env.ml", line 62, characters 0-134 - +no_tailcall is never used - <-- line 62 - | Immutable_mask arr -> Array.to_list arr [@@dead "+no_tailcall"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_fun_env.ml", line 67, characters 0-45 - +mark_unused is never used - <-- line 67 - let mark_unused t i = t.used_mask.(i) <- true [@@dead "+mark_unused"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_fun_env.ml", line 79, characters 0-233 - +get_mutable_params is never used - <-- line 79 - Ext_list.filter_mapi params (fun p i -> if not xs.(i) then Some p else None) [@@dead "+get_mutable_params"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_fun_env.ml", line 87, characters 0-143 - +set_unbounded is never used - <-- line 87 - env.unbounded <- v [@@dead "+set_unbounded"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_fun_env.mli", line 31, characters 0-49 - +make is never used - <-- line 31 - val make : ?immutable_mask:bool array -> int -> t [@@dead "+make"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_fun_env.mli", line 33, characters 0-32 - +no_tailcall is never used - <-- line 33 - val no_tailcall : t -> bool list [@@dead "+no_tailcall"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_fun_env.mli", line 37, characters 0-44 - +set_unbounded is never used - <-- line 37 - val set_unbounded : t -> Set_ident.t -> unit [@@dead "+set_unbounded"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_fun_env.mli", line 41, characters 0-34 - +mark_unused is never used - <-- line 41 - val mark_unused : t -> int -> unit [@@dead "+mark_unused"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_fun_env.mli", line 45, characters 0-58 - +get_mutable_params is never used - <-- line 45 - val get_mutable_params : Ident.t list -> t -> Ident.t list [@@dead "+get_mutable_params"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_name_of_module_id.mli", line 1, characters 0-0 - js_name_of_module_id is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_name_of_module_id.mli", line 33, characters 0-117 - +string_of_module_id is never used - <-- line 33 - string [@@dead "+string_of_module_id"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_array.ml", line 1, characters 0-0 - +js_of_lam_array is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_array.ml", line 28, characters 0-40 - +make_array is never used - <-- line 28 - let make_array mt args = E.array mt args [@@dead "+make_array"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_array.ml", line 30, characters 0-56 - +set_array is never used - <-- line 30 - let set_array e e0 e1 = E.assign (E.array_index e e0) e1 [@@dead "+set_array"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_array.ml", line 32, characters 0-39 - +ref_array is never used - <-- line 32 - let ref_array e e0 = E.array_index e e0 [@@dead "+ref_array"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_array.mli", line 1, characters 0-0 - js_of_lam_array is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_array.mli", line 27, characters 0-68 - +make_array is never used - <-- line 27 - val make_array : J.mutable_flag -> J.expression list -> J.expression [@@dead "+make_array"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_array.mli", line 30, characters 0-76 - +set_array is never used - <-- line 30 - val set_array : J.expression -> J.expression -> J.expression -> J.expression [@@dead "+set_array"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_array.mli", line 32, characters 0-60 - +ref_array is never used - <-- line 32 - val ref_array : J.expression -> J.expression -> J.expression [@@dead "+ref_array"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_block.ml", line 1, characters 0-0 - +js_of_lam_block is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_block.ml", line 30, characters 0-141 - +make_block is never used - <-- line 30 - | _ -> E.make_block tag tag_info args mutable_flag [@@dead "+make_block"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_block.ml", line 34, characters 0-646 - +field is never used - <-- line 34 - | Fld_module {name} -> E.module_access e name i [@@dead "+field"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_block.ml", line 48, characters 0-40 - +field_by_exp is never used - <-- line 48 - let field_by_exp e i = E.array_index e i [@@dead "+field_by_exp"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_block.ml", line 50, characters 0-247 - +set_field is never used - <-- line 50 - E.record_assign e i name e0 [@@dead "+set_field"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_block.ml", line 57, characters 0-72 - +set_field_by_exp is never used - <-- line 57 - let set_field_by_exp self index value = E.assign_by_exp self index value [@@dead "+set_field_by_exp"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_block.mli", line 1, characters 0-0 - js_of_lam_block is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_block.mli", line 27, characters 0-116 - +make_block is never used - <-- line 27 - J.expression [@@dead "+make_block"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_block.mli", line 34, characters 0-78 - +field is never used - <-- line 34 - val field : Lam_compat.field_dbg_info -> J.expression -> int32 -> J.expression [@@dead "+field"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_block.mli", line 36, characters 0-63 - +field_by_exp is never used - <-- line 36 - val field_by_exp : J.expression -> J.expression -> J.expression [@@dead "+field_by_exp"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_block.mli", line 38, characters 0-112 - +set_field is never used - <-- line 38 - J.expression [@@dead "+set_field"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_block.mli", line 45, characters 0-85 - +set_field_by_exp is never used - <-- line 45 - J.expression -> J.expression -> J.expression -> J.expression [@@dead "+set_field_by_exp"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.ml", line 1, characters 0-0 - +js_of_lam_option is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.ml", line 35, characters 0-37 - +none is never used - <-- line 35 - let none : J.expression = E.undefined [@@dead "+none"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.ml", line 37, characters 0-102 - +is_none_static is never used - <-- line 37 - | _ -> false [@@dead "+is_none_static"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.ml", line 42, characters 0-226 - +is_not_none is never used - <-- line 42 - | _ -> E.not (E.triple_equal e none) [@@dead "+is_not_none"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.ml", line 65, characters 0-177 - +val_from_option is never used - <-- line 65 - | _ -> E.runtime_call Primitive_modules.option "valFromOption" [arg] [@@dead "+val_from_option"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.ml", line 70, characters 0-496 - +get_default_undefined_from_optional is never used - <-- line 70 - else E.runtime_call Primitive_modules.option "valFromOption" [arg] [@@dead "+get_default_undefined_from_optional"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.ml", line 82, characters 0-327 - +option_unwrap is never used - <-- line 82 - | _ -> E.runtime_call Primitive_modules.option "unwrapPolyVar" [arg] [@@dead "+option_unwrap"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.ml", line 91, characters 0-265 - +destruct_optional is never used - <-- line 91 - | _ -> not_sure () [@@dead "+destruct_optional"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.ml", line 100, characters 0-27 - +some is never used - <-- line 100 - let some = E.optional_block [@@dead "+some"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.ml", line 102, characters 0-55 - +null_to_opt is never used - <-- line 102 - let null_to_opt e = E.econd (E.is_null e) none (some e) [@@dead "+null_to_opt"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.ml", line 104, characters 0-71 - +null_undef_to_opt is never used - <-- line 104 - let null_undef_to_opt e = E.econd (E.is_null_undefined e) none (some e) [@@dead "+null_undef_to_opt"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.mli", line 1, characters 0-0 - js_of_lam_option is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.mli", line 25, characters 0-50 - +val_from_option is never used - <-- line 25 - val val_from_option : J.expression -> J.expression [@@dead "+val_from_option"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.mli", line 28, characters 0-70 - +get_default_undefined_from_optional is never used - <-- line 28 - val get_default_undefined_from_optional : J.expression -> J.expression [@@dead "+get_default_undefined_from_optional"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.mli", line 31, characters 0-48 - +option_unwrap is never used - <-- line 31 - val option_unwrap : J.expression -> J.expression [@@dead "+option_unwrap"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.mli", line 35, characters 0-135 - +destruct_optional is never used - <-- line 35 - 'a [@@dead "+destruct_optional"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.mli", line 42, characters 0-39 - +some is never used - <-- line 42 - val some : J.expression -> J.expression [@@dead "+some"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.mli", line 44, characters 0-46 - +is_not_none is never used - <-- line 44 - val is_not_none : J.expression -> J.expression [@@dead "+is_not_none"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.mli", line 46, characters 0-46 - +null_to_opt is never used - <-- line 46 - val null_to_opt : J.expression -> J.expression [@@dead "+null_to_opt"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.mli", line 48, characters 0-52 - +null_undef_to_opt is never used - <-- line 48 - val null_undef_to_opt : J.expression -> J.expression [@@dead "+null_undef_to_opt"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_string.ml", line 1, characters 0-0 - +js_of_lam_string is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_string.ml", line 32, characters 0-57 - +const_char is never used - <-- line 32 - let const_char (i : int) = E.int ~c:i (Int32.of_int @@ i) [@@dead "+const_char"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_string.ml", line 35, characters 0-41 - +ref_string is never used - <-- line 35 - let ref_string e e1 = E.string_index e e1 [@@dead "+ref_string"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_string.mli", line 1, characters 0-0 - js_of_lam_string is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_string.mli", line 31, characters 0-61 - +ref_string is never used - <-- line 31 - val ref_string : J.expression -> J.expression -> J.expression [@@dead "+ref_string"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_string.mli", line 33, characters 0-36 - +const_char is never used - <-- line 33 - val const_char : int -> J.expression [@@dead "+const_char"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_variant.ml", line 28, characters 22-29 - arg_expression.Splice0 is a variant case which is never constructed - <-- line 28 - type arg_expression = Splice0 [@dead "arg_expression.Splice0"] | Splice1 of E.t | Splice2 of E.t * E.t - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_variant.ml", line 28, characters 30-46 - arg_expression.Splice1 is a variant case which is never constructed - <-- line 28 - type arg_expression = Splice0 [@dead "arg_expression.Splice0"] | Splice1 of E.t [@dead "arg_expression.Splice1"] | Splice2 of E.t * E.t - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_variant.ml", line 31, characters 0-717 - +eval is never used - <-- line 31 - ] [@@dead "+eval"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_variant.ml", line 63, characters 0-1262 - +eval_as_event is never used - <-- line 63 - E.poly_var_value_access arg ) [@@dead "+eval_as_event"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_variant.ml", line 100, characters 0-734 - +eval_as_int is never used - <-- line 100 - ] [@@dead "+eval_as_int"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_variant.ml", line 121, characters 0-184 - +eval_as_unwrap is never used - <-- line 121 - | _ -> E.poly_var_value_access arg [@@dead "+eval_as_unwrap"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_variant.mli", line 28, characters 2-11 - arg_expression.Splice0 is a variant case which is never constructed - <-- line 28 - | Splice0 [@dead "arg_expression.Splice0"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_variant.mli", line 29, characters 2-27 - arg_expression.Splice1 is a variant case which is never constructed - <-- line 29 - | Splice1 of J.expression [@dead "arg_expression.Splice1"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_variant.mli", line 32, characters 0-65 - +eval is never used - <-- line 32 - val eval : J.expression -> (string * string) list -> J.expression [@@dead "+eval"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_variant.mli", line 34, characters 0-85 - +eval_as_event is never used - <-- line 34 - J.expression -> (string * string) list option -> arg_expression [@@dead "+eval_as_event"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_variant.mli", line 37, characters 0-69 - +eval_as_int is never used - <-- line 37 - val eval_as_int : J.expression -> (string * int) list -> J.expression [@@dead "+eval_as_int"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_variant.mli", line 39, characters 0-49 - +eval_as_unwrap is never used - <-- line 39 - val eval_as_unwrap : J.expression -> J.expression [@@dead "+eval_as_unwrap"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op.ml", line 99, characters 38-44 - property.Strict is a variant case which is never constructed - <-- line 99 - type property = Lam_compat.let_kind = Strict [@dead "property.Strict"] | Alias | StrictOpt | Variable - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op.ml", line 99, characters 45-52 - property.Alias is a variant case which is never constructed - <-- line 99 - type property = Lam_compat.let_kind = Strict [@dead "property.Strict"] | Alias [@dead "property.Alias"] | StrictOpt | Variable - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op.ml", line 99, characters 53-64 - property.StrictOpt is a variant case which is never constructed - <-- line 99 - type property = Lam_compat.let_kind = Strict [@dead "property.Strict"] | Alias [@dead "property.Alias"] | StrictOpt [@dead "property.StrictOpt"] | Variable - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op.ml", line 99, characters 65-75 - property.Variable is a variant case which is never constructed - <-- line 99 - type property = Lam_compat.let_kind = Strict [@dead "property.Strict"] | Alias [@dead "property.Alias"] | StrictOpt [@dead "property.StrictOpt"] | Variable [@dead "property.Variable"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op_util.ml", line 71, characters 0-249 - +update_used_stats is never used - <-- line 71 - ident_info.used_stats <- used_stats [@@dead "+update_used_stats"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op_util.ml", line 77, characters 0-174 - +same_str_opt is never used - <-- line 77 - | None, Some _ | Some _, None -> false [@@dead "+same_str_opt"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op_util.ml", line 83, characters 0-576 - +same_vident is never used - <-- line 83 - | Id _, Qualified _ | Qualified _, Id _ -> false [@@dead "+same_vident"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op_util.ml", line 98, characters 0-139 - +of_lam_mutable_flag is never used - <-- line 98 - | Mutable -> Mutable [@@dead "+of_lam_mutable_flag"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op_util.mli", line 31, characters 0-64 - +update_used_stats is never used - <-- line 31 - val update_used_stats : J.ident_info -> Js_op.used_stats -> unit [@@dead "+update_used_stats"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op_util.mli", line 33, characters 0-46 - +same_vident is never used - <-- line 33 - val same_vident : J.vident -> J.vident -> bool [@@dead "+same_vident"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_op_util.mli", line 35, characters 0-69 - +of_lam_mutable_flag is never used - <-- line 35 - val of_lam_mutable_flag : Asttypes.mutable_flag -> Js_op.mutable_flag [@@dead "+of_lam_mutable_flag"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_output.ml", line 35, characters 0-84 - +make is never used - <-- line 35 - {block; value; output_finished} [@@dead "+make"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_output.ml", line 38, characters 0-63 - +dummy is never used - <-- line 38 - let dummy = {value = None; block = []; output_finished = Dummy} [@@dead "+dummy"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_output.ml", line 42, characters 0-536 - +output_of_expression is never used - <-- line 42 - | NeedValue _ -> {block = []; value = Some exp; output_finished = False} [@@dead "+output_of_expression"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_output.ml", line 54, characters 0-494 - +output_of_block_and_expression is never used - <-- line 54 - | NeedValue _ -> make block ~value:exp [@@dead "+output_of_block_and_expression"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_output.ml", line 65, characters 0-197 - +block_with_opt_expr is never used - <-- line 65 - | Some x -> block @ [S.exp x] [@@dead "+block_with_opt_expr"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_output.ml", line 71, characters 0-196 - +opt_expr_with_block is never used - <-- line 71 - | Some x -> S.exp x :: block [@@dead "+opt_expr_with_block"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_output.ml", line 77, characters 0-143 - +unnest_block is never used - <-- line 77 - | _ -> block [@@dead "+unnest_block"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_output.ml", line 82, characters 0-213 - +output_as_block is never used - <-- line 82 - if output_finished = True then block else block_with_opt_expr block opt [@@dead "+output_as_block"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_output.ml", line 88, characters 0-455 - +to_break_block is never used - <-- line 88 - | {value = Some _ as opt; _} -> (block_with_opt_expr block opt, true) [@@dead "+to_break_block"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_output.ml", line 117, characters 0-1083 - +append_output is never used - <-- line 117 - ?value:opt_e2 ~output_finished [@@dead "+append_output"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_output.ml", line 141, characters 0-96 - +concat is never used - <-- line 141 - Ext_list.fold_right xs dummy (fun x acc -> append_output x acc) [@@dead "+concat"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_output.mli", line 41, characters 0-75 - +make is never used - <-- line 41 - val make : ?value:J.expression -> ?output_finished:finished -> J.block -> t [@@dead "+make"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_output.mli", line 43, characters 0-34 - +output_as_block is never used - <-- line 43 - val output_as_block : t -> J.block [@@dead "+output_as_block"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_output.mli", line 45, characters 0-40 - +to_break_block is never used - <-- line 45 - val to_break_block : t -> J.block * bool [@@dead "+to_break_block"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_output.mli", line 61, characters 0-31 - +append_output is never used - <-- line 61 - val append_output : t -> t -> t [@@dead "+append_output"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_output.mli", line 63, characters 0-13 - +dummy is never used - <-- line 63 - val dummy : t [@@dead "+dummy"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_output.mli", line 65, characters 0-142 - +output_of_expression is never used - <-- line 65 - t [@@dead "+output_of_expression"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_output.mli", line 72, characters 0-103 - +output_of_block_and_expression is never used - <-- line 72 - Lam_compile_context.continuation -> J.block -> J.expression -> t [@@dead "+output_of_block_and_expression"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_output.mli", line 77, characters 0-24 - +concat is never used - <-- line 77 - val concat : t list -> t [@@dead "+concat"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_packages_info.ml", line 31, characters 0-143 - +compatible is never used - <-- line 31 - | Esmodule -> dep = Esmodule [@@dead "+compatible"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_packages_info.ml", line 41, characters 0-28 - +// is never used - <-- line 41 - let ( // ) = Filename.concat [@@dead "+//"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_packages_info.ml", line 44, characters 0-114 - +runtime_dir_of_module_system is never used - <-- line 44 - | Esmodule -> "es6" [@@dead "+runtime_dir_of_module_system"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_packages_info.ml", line 49, characters 0-133 - +runtime_package_path is never used - <-- line 49 - Runtime_package.name // "lib" // runtime_dir_of_module_system ms // js_file [@@dead "+runtime_package_path"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_packages_info.ml", line 56, characters 0-250 - +same_package_by_name is never used - <-- line 56 - | Pkg_empty | Pkg_runtime -> false) [@@dead "+same_package_by_name"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_packages_info.ml", line 65, characters 0-53 - +is_runtime_package is never used - <-- line 65 - let is_runtime_package (x : t) = x.name = Pkg_runtime [@@dead "+is_runtime_package"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_packages_info.ml", line 67, characters 0-55 - +iter is never used - <-- line 67 - let iter (x : t) cb = Ext_list.iter x.module_systems cb [@@dead "+iter"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_packages_info.ml", line 69, characters 0-53 - +map is never used - <-- line 69 - let map (x : t) cb = Ext_list.map x.module_systems cb [@@dead "+map"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_packages_info.ml", line 98, characters 2-19 - package_found_info.rel_path is a record label never used to read a value - <-- line 98 - rel_path: string; [@dead "package_found_info.rel_path"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_packages_info.ml", line 99, characters 2-23 - package_found_info.pkg_rel_path is a record label never used to read a value - <-- line 99 - pkg_rel_path: string; [@dead "package_found_info.pkg_rel_path"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_packages_info.ml", line 100, characters 2-17 - package_found_info.suffix is a record label never used to read a value - <-- line 100 - suffix: string; [@dead "package_found_info.suffix"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_packages_info.ml", line 110, characters 0-884 - +query_package_infos is never used - <-- line 110 - | None -> Package_not_found) [@@dead "+query_package_infos"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_packages_info.mli", line 27, characters 0-58 - +runtime_dir_of_module_system is never used - <-- line 27 - val runtime_dir_of_module_system : module_system -> string [@@dead "+runtime_dir_of_module_system"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_packages_info.mli", line 29, characters 0-60 - +runtime_package_path is never used - <-- line 29 - val runtime_package_path : module_system -> string -> string [@@dead "+runtime_package_path"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_packages_info.mli", line 37, characters 0-34 - +is_runtime_package is never used - <-- line 37 - val is_runtime_package : t -> bool [@@dead "+is_runtime_package"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_packages_info.mli", line 39, characters 0-41 - +same_package_by_name is never used - <-- line 39 - val same_package_by_name : t -> t -> bool [@@dead "+same_package_by_name"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_packages_info.mli", line 41, characters 0-46 - +iter is never used - <-- line 41 - val iter : t -> (package_info -> unit) -> unit [@@dead "+iter"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_packages_info.mli", line 43, characters 0-46 - +map is never used - <-- line 43 - val map : t -> (package_info -> 'a) -> 'a list [@@dead "+map"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_packages_info.mli", line 57, characters 2-19 - package_found_info.rel_path is a record label never used to read a value - <-- line 57 - rel_path: string; [@dead "package_found_info.rel_path"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_packages_info.mli", line 58, characters 2-23 - package_found_info.pkg_rel_path is a record label never used to read a value - <-- line 58 - pkg_rel_path: string; [@dead "package_found_info.pkg_rel_path"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_packages_info.mli", line 59, characters 2-17 - package_found_info.suffix is a record label never used to read a value - <-- line 59 - suffix: string; [@dead "package_found_info.suffix"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_packages_info.mli", line 67, characters 0-58 - +query_package_infos is never used - <-- line 67 - val query_package_infos : t -> module_system -> info_query [@@dead "+query_package_infos"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_packages_state.ml", line 47, characters 0-41 - +get_packages_info is never used - <-- line 47 - let get_packages_info () = !packages_info [@@dead "+get_packages_info"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_packages_state.mli", line 31, characters 0-50 - +get_packages_info is never used - <-- line 31 - val get_packages_info : unit -> Js_packages_info.t [@@dead "+get_packages_info"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_debug.mli", line 1, characters 0-0 - js_pass_debug is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_debug.mli", line 25, characters 0-43 - +dump is never used - <-- line 25 - val dump : string -> J.program -> J.program [@@dead "+dump"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_external_shadow.ml", line 1, characters 0-0 - +js_pass_external_shadow is a dead module as all its items are dead. - - Warning Dead Value With Side Effects - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_external_shadow.ml", line 29, characters 0-42 - +global_this is never used and could have side effects - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_external_shadow.ml", line 32, characters 0-136 - +is_lexical_binding_kind is never used - <-- line 32 - | Variable -> false [@@dead "+is_lexical_binding_kind"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_external_shadow.ml", line 38, characters 0-183 - +should_rewrite_binding is never used - <-- line 38 - && not (Js_reserved_map.is_js_global ident.name) [@@dead "+should_rewrite_binding"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_external_shadow.ml", line 43, characters 0-455 - +rewrite_shadowed_global_in_expr is never used - <-- line 43 - self.expression self expr [@@dead "+rewrite_shadowed_global_in_expr"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_external_shadow.ml", line 59, characters 0-1533 - +program is never used - <-- line 59 - self.program self js [@@dead "+program"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_external_shadow.mli", line 1, characters 0-0 - js_pass_external_shadow is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_external_shadow.mli", line 26, characters 0-36 - +program is never used - <-- line 26 - val program : J.program -> J.program [@@dead "+program"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_flatten.ml", line 1, characters 0-0 - +js_pass_flatten is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_flatten.ml", line 35, characters 0-31 - +super is never used - <-- line 35 - let super = Js_record_map.super [@@dead "+super"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_flatten.ml", line 37, characters 0-2690 - +flatten_map is never used - <-- line 37 - } [@@dead "+flatten_map"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_flatten.ml", line 113, characters 0-63 - +program is never used - <-- line 113 - let program (x : J.program) = flatten_map.program flatten_map x [@@dead "+program"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_flatten.mli", line 1, characters 0-0 - js_pass_flatten is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_flatten.mli", line 36, characters 0-36 - +program is never used - <-- line 36 - val program : J.program -> J.program [@@dead "+program"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_flatten_and_mark_dead.ml", line 30, characters 0-32 - +super is never used - <-- line 30 - let super = Js_record_iter.super [@@dead "+super"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_flatten_and_mark_dead.ml", line 32, characters 0-2329 - +mark_dead_code is never used - <-- line 32 - js [@@dead "+mark_dead_code"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_flatten_and_mark_dead.ml", line 148, characters 0-31 - +super is never used - <-- line 148 - let super = Js_record_map.super [@@dead "+super"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_flatten_and_mark_dead.ml", line 150, characters 0-111 - +add_substitue is never used - <-- line 150 - Hash_ident.replace substitution ident e [@@dead "+add_substitue"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_flatten_and_mark_dead.ml", line 153, characters 0-4332 - +subst_map is never used - <-- line 153 - } [@@dead "+subst_map"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_flatten_and_mark_dead.ml", line 267, characters 0-131 - +program is never used - <-- line 267 - mark_dead_code js [@@dead "+program"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_flatten_and_mark_dead.mli", line 1, characters 0-0 - js_pass_flatten_and_mark_dead is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_flatten_and_mark_dead.mli", line 27, characters 0-36 - +program is never used - <-- line 27 - val program : J.program -> J.program [@@dead "+program"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_get_used.ml", line 1, characters 0-0 - +js_pass_get_used is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_get_used.ml", line 25, characters 0-71 - +add_use is never used - <-- line 25 - let add_use stats id = Hash_ident.add_or_update stats id 1 ~update:succ [@@dead "+add_use"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_get_used.ml", line 27, characters 0-785 - +post_process_stats is never used - <-- line 27 - defined_idents [@@dead "+post_process_stats"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_get_used.ml", line 53, characters 0-32 - +super is never used - <-- line 53 - let super = Js_record_iter.super [@@dead "+super"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_get_used.ml", line 55, characters 0-468 - +count_collects is never used - <-- line 55 - } [@@dead "+count_collects"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_get_used.ml", line 69, characters 0-401 - +get_stats is never used - <-- line 69 - post_process_stats my_export_set defined_idents stats [@@dead "+get_stats"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_get_used.mli", line 1, characters 0-0 - js_pass_get_used is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_get_used.mli", line 25, characters 0-64 - +get_stats is never used - <-- line 25 - val get_stats : J.program -> J.variable_declaration Hash_ident.t [@@dead "+get_stats"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_scope.ml", line 103, characters 0-238 - +init_state is never used - <-- line 103 - } [@@dead "+init_state"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_scope.ml", line 113, characters 0-88 - +with_in_loop is never used - <-- line 113 - if b = st.in_loop then st else {st with in_loop = b} [@@dead "+with_in_loop"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_scope.ml", line 116, characters 0-191 - +add_loop_mutable_variable is never used - <-- line 116 - } [@@dead "+add_loop_mutable_variable"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_scope.ml", line 123, characters 0-106 - +add_mutable_variable is never used - <-- line 123 - {st with mutable_values = Set_ident.add st.mutable_values id} [@@dead "+add_mutable_variable"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_scope.ml", line 126, characters 0-103 - +add_defined_ident is never used - <-- line 126 - {st with defined_idents = Set_ident.add st.defined_idents id} [@@dead "+add_defined_ident"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_scope.ml", line 129, characters 0-94 - +add_used_ident is never used - <-- line 129 - {st with used_idents = Set_ident.add st.used_idents id} [@@dead "+add_used_ident"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_scope.ml", line 132, characters 0-32 - +super is never used - <-- line 132 - let super = Js_record_fold.super [@@dead "+super"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_scope.ml", line 134, characters 0-7195 - +record_scope_pass is never used - <-- line 134 - } [@@dead "+record_scope_pass"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_scope.ml", line 326, characters 0-103 - +program is never used - <-- line 326 - .loop_mutable_values [@@dead "+program"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_scope.mli", line 1, characters 0-0 - js_pass_scope is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_scope.mli", line 27, characters 0-38 - +program is never used - <-- line 27 - val program : J.program -> Set_ident.t [@@dead "+program"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_tailcall_inline.ml", line 1, characters 0-0 - +js_pass_tailcall_inline is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_tailcall_inline.ml", line 38, characters 0-31 - +super is never used - <-- line 38 - let super = Js_record_map.super [@@dead "+super"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_tailcall_inline.ml", line 40, characters 0-123 - +substitue_variables is never used - <-- line 40 - {super with ident = (fun _ id -> Map_ident.find_default map id id)} [@@dead "+substitue_variables"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_tailcall_inline.ml", line 60, characters 0-889 - +inline_call is never used - <-- line 60 - obj.block obj block [@@dead "+inline_call"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_tailcall_inline.ml", line 106, characters 0-31 - +super is never used - <-- line 106 - let super = Js_record_map.super [@@dead "+super"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_tailcall_inline.ml", line 108, characters 0-4623 - +subst is never used - <-- line 108 - } [@@dead "+subst"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_tailcall_inline.ml", line 236, characters 0-200 - +tailcall_inline is never used - <-- line 236 - obj.program obj program [@@dead "+tailcall_inline"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_tailcall_inline.mli", line 1, characters 0-0 - js_pass_tailcall_inline is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_pass_tailcall_inline.mli", line 38, characters 0-44 - +tailcall_inline is never used - <-- line 38 - val tailcall_inline : J.program -> J.program [@@dead "+tailcall_inline"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_fold.ml", line 27, characters 0-32 - +unknown is never used - <-- line 27 - let[@inline] unknown _ st _ = st [@@dead "+unknown"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_fold.ml", line 29, characters 0-93 - +option is never used - <-- line 29 - | Some v -> sub self st v [@@dead "+option"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_fold.ml", line 34, characters 0-125 - +list is never used - <-- line 34 - list sub self st xs [@@dead "+list"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_fold.ml", line 56, characters 0-40 - +ident is never used - <-- line 56 - let ident : 'a. ('a, ident) fn = unknown [@@dead "+ident"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_fold.ml", line 58, characters 0-124 - +module_id is never used - <-- line 58 - st [@@dead "+module_id"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_fold.ml", line 63, characters 0-109 - +required_modules is never used - <-- line 63 - fun _self st arg -> list _self.module_id _self st arg [@@dead "+required_modules"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_fold.ml", line 66, characters 0-202 - +vident is never used - <-- line 66 - st [@@dead "+vident"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_fold.ml", line 75, characters 0-92 - +exception_ident is never used - <-- line 75 - fun _self arg -> _self.ident _self arg [@@dead "+exception_ident"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_fold.ml", line 78, characters 0-79 - +for_ident is never used - <-- line 78 - let for_ident : 'a. ('a, for_ident) fn = fun _self arg -> _self.ident _self arg [@@dead "+for_ident"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_fold.ml", line 80, characters 0-56 - +for_direction is never used - <-- line 80 - let for_direction : 'a. ('a, for_direction) fn = unknown [@@dead "+for_direction"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_fold.ml", line 82, characters 0-181 - +property_map is never used - <-- line 82 - _self st arg [@@dead "+property_map"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_fold.ml", line 90, characters 0-56 - +length_object is never used - <-- line 90 - let length_object : 'a. ('a, length_object) fn = unknown [@@dead "+length_object"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_fold.ml", line 92, characters 0-3130 - +expression_desc is never used - <-- line 92 - st [@@dead "+expression_desc"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_fold.ml", line 200, characters 0-107 - +for_ident_expression is never used - <-- line 200 - fun _self arg -> _self.expression _self arg [@@dead "+for_ident_expression"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_fold.ml", line 203, characters 0-113 - +finish_ident_expression is never used - <-- line 203 - fun _self arg -> _self.expression _self arg [@@dead "+finish_ident_expression"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_fold.ml", line 206, characters 0-160 - +case_clause is never used - <-- line 206 - st [@@dead "+case_clause"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_fold.ml", line 211, characters 0-120 - +string_clause is never used - <-- line 211 - st [@@dead "+string_clause"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_fold.ml", line 216, characters 0-114 - +int_clause is never used - <-- line 216 - st [@@dead "+int_clause"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_fold.ml", line 221, characters 0-2128 - +statement_desc is never used - <-- line 221 - | Debugger -> st [@@dead "+statement_desc"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_fold.ml", line 290, characters 0-146 - +expression is never used - <-- line 290 - st [@@dead "+expression"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_fold.ml", line 295, characters 0-142 - +statement is never used - <-- line 295 - st [@@dead "+statement"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_fold.ml", line 300, characters 0-235 - +variable_declaration is never used - <-- line 300 - st [@@dead "+variable_declaration"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_fold.ml", line 306, characters 0-87 - +block is never used - <-- line 306 - fun _self st arg -> list _self.statement _self st arg [@@dead "+block"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_fold.ml", line 309, characters 0-144 - +program is never used - <-- line 309 - st [@@dead "+program"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_fold.ml", line 314, characters 0-203 - +deps_program is never used - <-- line 314 - st [@@dead "+deps_program"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_fold.ml", line 320, characters 0-188 - +super is never used - <-- line 320 - } [@@dead "+super"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_iter.ml", line 61, characters 0-93 - +required_modules is never used - <-- line 61 - fun _self arg -> list _self.module_id _self arg [@@dead "+required_modules"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_iter.ml", line 229, characters 0-156 - +deps_program is never used - <-- line 229 - required_modules _self _x1 [@@dead "+deps_program"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_map.ml", line 27, characters 0-28 - +unknown is never used - <-- line 27 - let[@inline] unknown _ x = x [@@dead "+unknown"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_map.ml", line 29, characters 0-96 - +option is never used - <-- line 29 - | Some v -> Some (sub self v) [@@dead "+option"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_map.ml", line 34, characters 0-120 - +list is never used - <-- line 34 - v :: list sub self xs [@@dead "+list"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_map.ml", line 56, characters 0-30 - +ident is never used - <-- line 56 - let ident : ident fn = unknown [@@dead "+ident"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_map.ml", line 58, characters 0-173 - +module_id is never used - <-- line 58 - {id = _x0; kind = _x1; dynamic_import = _x2} [@@dead "+module_id"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_map.ml", line 63, characters 0-93 - +required_modules is never used - <-- line 63 - fun _self arg -> list _self.module_id _self arg [@@dead "+required_modules"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_map.ml", line 66, characters 0-207 - +vident is never used - <-- line 66 - Qualified (_x0, _x1) [@@dead "+vident"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_map.ml", line 75, characters 0-82 - +exception_ident is never used - <-- line 75 - fun _self arg -> _self.ident _self arg [@@dead "+exception_ident"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_map.ml", line 78, characters 0-69 - +for_ident is never used - <-- line 78 - let for_ident : for_ident fn = fun _self arg -> _self.ident _self arg [@@dead "+for_ident"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_map.ml", line 80, characters 0-46 - +for_direction is never used - <-- line 80 - let for_direction : for_direction fn = unknown [@@dead "+for_direction"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_map.ml", line 82, characters 0-168 - +property_map is never used - <-- line 82 - _self arg [@@dead "+property_map"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_map.ml", line 90, characters 0-46 - +length_object is never used - <-- line 90 - let length_object : length_object fn = unknown [@@dead "+length_object"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_map.ml", line 92, characters 0-3481 - +expression_desc is never used - <-- line 92 - Spread _x0 [@@dead "+expression_desc"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_map.ml", line 198, characters 0-97 - +for_ident_expression is never used - <-- line 198 - fun _self arg -> _self.expression _self arg [@@dead "+for_ident_expression"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_map.ml", line 201, characters 0-103 - +finish_ident_expression is never used - <-- line 201 - fun _self arg -> _self.expression _self arg [@@dead "+finish_ident_expression"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_map.ml", line 204, characters 0-197 - +case_clause is never used - <-- line 204 - {switch_body = _x0; should_break = _x1; comment = _x2} [@@dead "+case_clause"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_map.ml", line 209, characters 0-113 - +string_clause is never used - <-- line 209 - (_x0, _x1) [@@dead "+string_clause"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_map.ml", line 214, characters 0-107 - +int_clause is never used - <-- line 214 - (_x0, _x1) [@@dead "+int_clause"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_map.ml", line 219, characters 0-2310 - +statement_desc is never used - <-- line 219 - | Debugger as v -> v [@@dead "+statement_desc"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_map.ml", line 288, characters 0-167 - +expression is never used - <-- line 288 - {expression_desc = _x0; comment = _x1} [@@dead "+expression"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_map.ml", line 293, characters 0-162 - +statement is never used - <-- line 293 - {statement_desc = _x0; comment = _x1} [@@dead "+statement"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_map.ml", line 298, characters 0-276 - +variable_declaration is never used - <-- line 298 - {ident = _x0; value = _x1; property = _x2; ident_info = _x3} [@@dead "+variable_declaration"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_map.ml", line 304, characters 0-70 - +block is never used - <-- line 304 - let block : block fn = fun _self arg -> list _self.statement _self arg [@@dead "+block"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_map.ml", line 306, characters 0-173 - +program is never used - <-- line 306 - {block = _x0; exports = _x1; export_set = _x2} [@@dead "+program"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_map.ml", line 311, characters 0-233 - +deps_program is never used - <-- line 311 - {program = _x0; modules = _x1; side_effect = _x2} [@@dead "+deps_program"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_map.ml", line 317, characters 0-181 - +super is never used - <-- line 317 - } [@@dead "+super"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_shake.ml", line 1, characters 0-0 - +js_shake is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_shake.ml", line 27, characters 0-1290 - +get_initial_exports is never used - <-- line 27 - (result, Set_ident.(diff result export_set)) [@@dead "+get_initial_exports"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_shake.ml", line 62, characters 0-1801 - +shake_program is never used - <-- line 62 - {program with block = shake_block program.block program.export_set} [@@dead "+shake_program"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_shake.mli", line 1, characters 0-0 - js_shake is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_shake.mli", line 30, characters 0-42 - +shake_program is never used - <-- line 30 - val shake_program : J.program -> J.program [@@dead "+shake_program"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.ml", line 29, characters 0-69 - +return_stmt is never used - <-- line 29 - let return_stmt ?comment e : t = {statement_desc = Return e; comment} [@@dead "+return_stmt"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.ml", line 34, characters 0-67 - +throw_stmt is never used - <-- line 34 - let throw_stmt ?comment v : t = {statement_desc = Throw v; comment} [@@dead "+throw_stmt"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.ml", line 55, characters 0-320 - +declare_variable is never used - <-- line 55 - } [@@dead "+declare_variable"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.ml", line 67, characters 0-483 - +define_variable is never used - <-- line 67 - } [@@dead "+define_variable"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.ml", line 91, characters 0-1408 - +int_switch is never used - <-- line 91 - | None -> {statement_desc = J.Int_switch (e, clauses, default); comment}) [@@dead "+int_switch"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.ml", line 136, characters 0-1581 - +string_switch is never used - <-- line 136 - | None -> {statement_desc = String_switch (e, clauses, default); comment}) [@@dead "+string_switch"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.ml", line 186, characters 0-273 - +block_last_is_return_throw_or_continue is never used - <-- line 186 - | _ :: rest -> block_last_is_return_throw_or_continue rest [@@dead "+block_last_is_return_throw_or_continue"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.ml", line 233, characters 0-3141 - +if_ is never used - <-- line 233 - | false, Some (kind, id) -> block (declare_variable ~kind id :: [if_block]) [@@dead "+if_"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.ml", line 314, characters 0-90 - +assign is never used - <-- line 314 - {statement_desc = J.Exp (E.assign (E.var id) e); comment} [@@dead "+assign"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.ml", line 317, characters 0-108 - +while_ is never used - <-- line 317 - {statement_desc = While (label, e, st); comment} [@@dead "+while_"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.ml", line 320, characters 0-245 - +for_ is never used - <-- line 320 - } [@@dead "+for_"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.ml", line 329, characters 0-141 - +for_of is never used - <-- line 329 - {statement_desc = ForOf (label, id, iterable_expression, b); comment} [@@dead "+for_of"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.ml", line 332, characters 0-152 - +for_await_of is never used - <-- line 332 - {statement_desc = ForAwaitOf (label, id, iterable_expression, b); comment} [@@dead "+for_await_of"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.ml", line 335, characters 0-101 - +try_ is never used - <-- line 335 - {statement_desc = Try (body, with_, finally); comment} [@@dead "+try_"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.ml", line 338, characters 0-73 - +break_ is never used - <-- line 338 - let break_ ?label () : t = {statement_desc = Break label; comment = None} [@@dead "+break_"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.ml", line 340, characters 0-79 - +continue_ is never used - <-- line 340 - let continue_ ?label () : t = {statement_desc = Continue label; comment = None} [@@dead "+continue_"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.ml", line 342, characters 0-75 - +debugger_block is never used - <-- line 342 - let debugger_block : t list = [{statement_desc = Debugger; comment = None}] [@@dead "+debugger_block"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.mli", line 33, characters 0-53 - +throw_stmt is never used - <-- line 33 - val throw_stmt : ?comment:string -> J.expression -> t [@@dead "+throw_stmt"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.mli", line 35, characters 0-262 - +if_ is never used - <-- line 35 - t [@@dead "+if_"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.mli", line 46, characters 0-24 - +block is never used - <-- line 46 - val block : J.block -> t [@@dead "+block"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.mli", line 52, characters 0-161 - +int_switch is never used - <-- line 52 - t [@@dead "+int_switch"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.mli", line 75, characters 0-191 - +string_switch is never used - <-- line 75 - t [@@dead "+string_switch"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.mli", line 83, characters 0-120 - +declare_variable is never used - <-- line 83 - t [@@dead "+declare_variable"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.mli", line 92, characters 0-137 - +define_variable is never used - <-- line 92 - t [@@dead "+define_variable"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.mli", line 107, characters 0-60 - +assign is never used - <-- line 107 - val assign : ?comment:string -> J.ident -> J.expression -> t [@@dead "+assign"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.mli", line 133, characters 0-78 - +while_ is never used - <-- line 133 - val while_ : ?comment:string -> ?label:J.label -> J.expression -> J.block -> t [@@dead "+while_"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.mli", line 135, characters 0-172 - +for_ is never used - <-- line 135 - t [@@dead "+for_"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.mli", line 145, characters 0-91 - +for_of is never used - <-- line 145 - ?comment:string -> ?label:J.label -> J.expression -> J.ident -> J.block -> t [@@dead "+for_of"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.mli", line 148, characters 0-97 - +for_await_of is never used - <-- line 148 - ?comment:string -> ?label:J.label -> J.expression -> J.ident -> J.block -> t [@@dead "+for_await_of"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.mli", line 151, characters 0-100 - +try_ is never used - <-- line 151 - t [@@dead "+try_"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.mli", line 160, characters 0-54 - +return_stmt is never used - <-- line 160 - val return_stmt : ?comment:string -> J.expression -> t [@@dead "+return_stmt"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.mli", line 173, characters 0-40 - +break_ is never used - <-- line 173 - val break_ : ?label:J.label -> unit -> t [@@dead "+break_"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.mli", line 175, characters 0-43 - +continue_ is never used - <-- line 175 - val continue_ : ?label:J.label -> unit -> t [@@dead "+continue_"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.mli", line 177, characters 0-27 - +debugger_block is never used - <-- line 177 - val debugger_block : t list [@@dead "+debugger_block"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 138, characters 0-513 - +is_eta_conversion_exn is never used - <-- line 138 - | _, _, _ -> raise_notrace Not_simple_form [@@dead "+is_eta_conversion_exn"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 153, characters 0-2145 - +apply is never used - <-- line 153 - | _ -> Lapply {ap_func = fn; ap_args = args; ap_info; ap_transformed_jsx} [@@dead "+apply"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 208, characters 0-1950 - +eq_approx is never used - <-- line 208 - false [@@dead "+eq_approx"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 272, characters 0-148 - +eq_option is never used - <-- line 272 - | None -> false) [@@dead "+eq_option"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 280, characters 0-69 - +eq_approx_list is never used - <-- line 280 - and eq_approx_list ls ls1 = Ext_list.for_all2_no_exn ls ls1 eq_approx [@@dead "+eq_approx_list"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 282, characters 0-596 - +switch is never used - <-- line 282 - | _ -> Lswitch (lam, lam_switch) [@@dead "+switch"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 296, characters 0-217 - +stringswitch is never used - <-- line 296 - | _ -> Lstringswitch (lam, cases, default) [@@dead "+stringswitch"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 302, characters 0-36 - +true_ is never used - <-- line 302 - let true_ : t = Lconst Const_js_true [@@dead "+true_"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 303, characters 0-38 - +false_ is never used - <-- line 303 - let false_ : t = Lconst Const_js_false [@@dead "+false_"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 304, characters 0-59 - +unit is never used - <-- line 304 - let unit : t = Lconst (Const_js_undefined {is_unit = true}) [@@dead "+unit"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 305, characters 0-22 - +break is never used - <-- line 305 - let break : t = Lbreak [@@dead "+break"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 306, characters 0-28 - +continue is never used - <-- line 306 - let continue : t = Lcontinue [@@dead "+continue"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 308, characters 0-253 - +seq is never used - <-- line 308 - | _ -> Lsequence (a, b) [@@dead "+seq"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 316, characters 0-24 - +var is never used - <-- line 316 - let var id : t = Lvar id [@@dead "+var"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 317, characters 0-86 - +global_module is never used - <-- line 317 - Lglobal_module (id, dynamic_import) [@@dead "+global_module"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 319, characters 0-28 - +const is never used - <-- line 319 - let const ct : t = Lconst ct [@@dead "+const"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 321, characters 0-86 - +function_ is never used - <-- line 321 - Lfunction {arity; params; body; attr} [@@dead "+function_"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 324, characters 0-54 - +let_ is never used - <-- line 324 - let let_ kind id e body : t = Llet (kind, id, e, body) [@@dead "+let_"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 325, characters 0-55 - +letrec is never used - <-- line 325 - let letrec bindings body : t = Lletrec (bindings, body) [@@dead "+letrec"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 326, characters 0-34 - +while_ is never used - <-- line 326 - let while_ a b : t = Lwhile (a, b) [@@dead "+while_"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 327, characters 0-59 - +try_ is never used - <-- line 327 - let try_ body id handler : t = Ltrywith (body, id, handler) [@@dead "+try_"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 328, characters 0-55 - +for_ is never used - <-- line 328 - let for_ v e1 e2 dir e3 : t = Lfor (v, e1, e2, dir, e3) [@@dead "+for_"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 329, characters 0-44 - +for_of is never used - <-- line 329 - let for_of v e1 e2 : t = Lfor_of (v, e1, e2) [@@dead "+for_of"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 330, characters 0-56 - +for_await_of is never used - <-- line 330 - let for_await_of v e1 e2 : t = Lfor_await_of (v, e1, e2) [@@dead "+for_await_of"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 331, characters 0-35 - +assign is never used - <-- line 331 - let assign v l : t = Lassign (v, l) [@@dead "+assign"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 332, characters 0-50 - +staticcatch is never used - <-- line 332 - let staticcatch a b c : t = Lstaticcatch (a, b, c) [@@dead "+staticcatch"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 333, characters 0-45 - +staticraise is never used - <-- line 333 - let staticraise a b : t = Lstaticraise (a, b) [@@dead "+staticraise"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 335, characters 0-286 - +lam.Lift is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 336, characters 2-56 - Lift.+int is never used - <-- line 336 - let int i : t = Lconst (Const_int {i; comment = None}) [@@dead "Lift.+int"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 341, characters 2-42 - Lift.+bool is never used - <-- line 341 - let bool b = if b then true_ else false_ [@@dead "Lift.+bool"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 343, characters 2-60 - Lift.+string is never used - <-- line 343 - let string s : t = Lconst (Const_string {s; delim = None}) [@@dead "Lift.+string"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 345, characters 2-40 - Lift.+char is never used - <-- line 345 - let char b : t = Lconst (Const_char b) [@@dead "Lift.+char"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 348, characters 0-4192 - +prim is never used - <-- line 348 - | _ -> default ()) [@@dead "+prim"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 453, characters 0-177 - +not_ is never used - <-- line 453 - | _ -> prim ~primitive:Pnot ~args:[x] loc [@@dead "+not_"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 459, characters 0-308 - +has_boolean_type is never used - <-- line 459 - | _ -> None [@@dead "+has_boolean_type"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 475, characters 0-233 - +complete_range is never used - <-- line 475 - && complete_range rest ~start:(start + 1) ~finish [@@dead "+complete_range"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 482, characters 0-384 - +eval_const_as_bool is never used - <-- line 482 - | Const_some b -> eval_const_as_bool b [@@dead "+eval_const_as_bool"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 494, characters 0-2862 - +if_ is never used - <-- line 494 - | _ -> Lifthenelse (a, b, c))) [@@dead "+if_"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 576, characters 0-30 - +sequor is never used - <-- line 576 - let sequor l r = if_ l true_ r [@@dead "+sequor"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 579, characters 0-32 - +sequand is never used - <-- line 579 - let sequand l r = if_ l r false_ [@@dead "+sequand"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 581, characters 0-369 - +result_wrap is never used - <-- line 581 - | Return_unset | Return_identity -> result [@@dead "+result_wrap"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.ml", line 589, characters 0-352 - +handle_bs_non_obj_ffi is never used - <-- line 589 - ~args loc) [@@dead "+handle_bs_non_obj_ffi"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 94, characters 0-230 - +handle_bs_non_obj_ffi is never used - <-- line 94 - t [@@dead "+handle_bs_non_obj_ffi"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 107, characters 0-20 - +var is never used - <-- line 107 - val var : ident -> t [@@dead "+var"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 110, characters 0-54 - +global_module is never used - <-- line 110 - val global_module : ?dynamic_import:bool -> ident -> t [@@dead "+global_module"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 112, characters 0-31 - +const is never used - <-- line 112 - val const : Lam_constant.t -> t [@@dead "+const"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 114, characters 0-67 - +apply is never used - <-- line 114 - val apply : ?ap_transformed_jsx:bool -> t -> t list -> ap_info -> t [@@dead "+apply"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 116, characters 0-105 - +function_ is never used - <-- line 116 - t [@@dead "+function_"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 123, characters 0-54 - +let_ is never used - <-- line 123 - val let_ : Lam_compat.let_kind -> ident -> t -> t -> t [@@dead "+let_"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 125, characters 0-39 - +letrec is never used - <-- line 125 - val letrec : (ident * t) list -> t -> t [@@dead "+letrec"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 127, characters 0-26 - +if_ is never used - <-- line 127 - val if_ : t -> t -> t -> t [@@dead "+if_"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 130, characters 0-36 - +switch is never used - <-- line 130 - val switch : t -> lambda_switch -> t [@@dead "+switch"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 133, characters 0-58 - +stringswitch is never used - <-- line 133 - val stringswitch : t -> (string * t) list -> t option -> t [@@dead "+stringswitch"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 137, characters 0-14 - +false_ is never used - <-- line 137 - val false_ : t [@@dead "+false_"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 139, characters 0-12 - +unit is never used - <-- line 139 - val unit : t [@@dead "+unit"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 141, characters 0-24 - +sequor is never used - <-- line 141 - val sequor : t -> t -> t [@@dead "+sequor"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 144, characters 0-25 - +sequand is never used - <-- line 144 - val sequand : t -> t -> t [@@dead "+sequand"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 147, characters 0-31 - +not_ is never used - <-- line 147 - val not_ : Location.t -> t -> t [@@dead "+not_"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 150, characters 0-21 - +seq is never used - <-- line 150 - val seq : t -> t -> t [@@dead "+seq"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 153, characters 0-13 - +break is never used - <-- line 153 - val break : t [@@dead "+break"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 155, characters 0-16 - +continue is never used - <-- line 155 - val continue : t [@@dead "+continue"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 157, characters 0-24 - +while_ is never used - <-- line 157 - val while_ : t -> t -> t [@@dead "+while_"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 160, characters 0-31 - +try_ is never used - <-- line 160 - val try_ : t -> ident -> t -> t [@@dead "+try_"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 162, characters 0-28 - +assign is never used - <-- line 162 - val assign : ident -> t -> t [@@dead "+assign"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 164, characters 0-70 - +prim is never used - <-- line 164 - val prim : primitive:Lam_primitive.t -> args:t list -> Location.t -> t [@@dead "+prim"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 167, characters 0-49 - +staticcatch is never used - <-- line 167 - val staticcatch : t -> int * ident list -> t -> t [@@dead "+staticcatch"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 169, characters 0-36 - +staticraise is never used - <-- line 169 - val staticraise : int -> t list -> t [@@dead "+staticraise"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 171, characters 0-63 - +for_ is never used - <-- line 171 - val for_ : ident -> t -> t -> Asttypes.direction_flag -> t -> t [@@dead "+for_"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 173, characters 0-33 - +for_of is never used - <-- line 173 - val for_of : ident -> t -> t -> t [@@dead "+for_of"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 175, characters 0-39 - +for_await_of is never used - <-- line 175 - val for_await_of : ident -> t -> t -> t [@@dead "+for_await_of"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 179, characters 0-30 - +eq_approx is never used - <-- line 179 - val eq_approx : t -> t -> bool [@@dead "+eq_approx"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_analysis.ml", line 1, characters 0-0 - +lam_analysis is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_analysis.ml", line 26, characters 0-139 - +not_zero_constant is never used - <-- line 26 - | _ -> false [@@dead "+not_zero_constant"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_analysis.ml", line 32, characters 0-4184 - +no_side_effects is never used - <-- line 32 - | Lapply _ -> false [@@dead "+no_side_effects"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_analysis.ml", line 143, characters 0-51 - +really_big is never used - <-- line 143 - let really_big () = raise_notrace Too_big_to_inline [@@dead "+really_big"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_analysis.ml", line 147, characters 0-1563 - +size is never used - <-- line 147 - with Too_big_to_inline -> 1000 [@@dead "+size"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_analysis.ml", line 193, characters 0-381 - +size_constant is never used - <-- line 193 - Ext_list.fold_left str 0 (fun acc x -> acc + size_constant x) [@@dead "+size_constant"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_analysis.ml", line 204, characters 0-97 - +size_lams is never used - <-- line 204 - Ext_list.fold_left lams acc (fun acc l -> acc + size l) [@@dead "+size_lams"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_analysis.ml", line 207, characters 0-138 - +args_all_const is never used - <-- line 207 - | _ -> false) [@@dead "+args_all_const"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_analysis.ml", line 213, characters 0-24 - +exit_inline_size is never used - <-- line 213 - let exit_inline_size = 7 [@@dead "+exit_inline_size"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_analysis.ml", line 215, characters 0-25 - +small_inline_size is never used - <-- line 215 - let small_inline_size = 5 [@@dead "+small_inline_size"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_analysis.ml", line 226, characters 0-674 - +destruct_pattern is never used - <-- line 226 - | _ -> false [@@dead "+destruct_pattern"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_analysis.ml", line 248, characters 0-122 - +lfunction_can_be_inlined is never used - <-- line 248 - (not lfunction.attr.async) && lfunction.attr.directive = None [@@dead "+lfunction_can_be_inlined"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_analysis.ml", line 252, characters 0-379 - +ok_to_inline_fun_when_app is never used - <-- line 252 - || (args_all_const args && s < 10 && no_side_effects body)) [@@dead "+ok_to_inline_fun_when_app"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_analysis.ml", line 267, characters 0-248 - +safe_to_inline is never used - <-- line 267 - | _ -> false [@@dead "+safe_to_inline"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_analysis.mli", line 1, characters 0-0 - lam_analysis is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_analysis.mli", line 27, characters 0-35 - +no_side_effects is never used - <-- line 27 - val no_side_effects : Lam.t -> bool [@@dead "+no_side_effects"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_analysis.mli", line 30, characters 0-23 - +size is never used - <-- line 30 - val size : Lam.t -> int [@@dead "+size"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_analysis.mli", line 32, characters 0-52 - +lfunction_can_be_inlined is never used - <-- line 32 - val lfunction_can_be_inlined : Lam.lfunction -> bool [@@dead "+lfunction_can_be_inlined"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_analysis.mli", line 34, characters 0-67 - +ok_to_inline_fun_when_app is never used - <-- line 34 - val ok_to_inline_fun_when_app : Lam.lfunction -> Lam.t list -> bool [@@dead "+ok_to_inline_fun_when_app"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_analysis.mli", line 36, characters 0-27 - +small_inline_size is never used - <-- line 36 - val small_inline_size : int [@@dead "+small_inline_size"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_analysis.mli", line 38, characters 0-26 - +exit_inline_size is never used - <-- line 38 - val exit_inline_size : int [@@dead "+exit_inline_size"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_analysis.mli", line 40, characters 0-34 - +safe_to_inline is never used - <-- line 40 - val safe_to_inline : Lam.t -> bool [@@dead "+safe_to_inline"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity.ml", line 35, characters 0-144 - +merge is never used - <-- line 35 - | Arity_info (xs, tail) -> Arity_info (n :: xs, tail) [@@dead "+merge"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity.ml", line 40, characters 0-52 - +non_function_arity_info is never used - <-- line 40 - let non_function_arity_info = Arity_info ([], false) [@@dead "+non_function_arity_info"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity.ml", line 42, characters 0-44 - +raise_arity_info is never used - <-- line 42 - let raise_arity_info = Arity_info ([], true) [@@dead "+raise_arity_info"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity.ml", line 44, characters 0-17 - +na is never used - <-- line 44 - let na = Arity_na [@@dead "+na"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity.ml", line 46, characters 0-40 - +info is never used - <-- line 46 - let info args b1 = Arity_info (args, b1) [@@dead "+info"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity.ml", line 48, characters 0-100 - +first_arity_na is never used - <-- line 48 - | _ -> false [@@dead "+first_arity_na"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity.ml", line 53, characters 0-123 - +get_first_arity is never used - <-- line 53 - | Arity_info (x :: _, _) -> Some x [@@dead "+get_first_arity"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity.ml", line 58, characters 0-90 - +extract_arity is never used - <-- line 58 - | Arity_info (xs, _) -> xs [@@dead "+extract_arity"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity.ml", line 65, characters 0-451 - +merge_arities_aux is never used - <-- line 65 - | _, _ -> info (List.rev acc) false [@@dead "+merge_arities_aux"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity.ml", line 74, characters 0-62 - +merge_arities is never used - <-- line 74 - let merge_arities xs ys t t2 = merge_arities_aux [] xs ys t t2 [@@dead "+merge_arities"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity.mli", line 35, characters 0-25 - +merge is never used - <-- line 35 - val merge : int -> t -> t [@@dead "+merge"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity.mli", line 37, characters 0-31 - +non_function_arity_info is never used - <-- line 37 - val non_function_arity_info : t [@@dead "+non_function_arity_info"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity.mli", line 39, characters 0-24 - +raise_arity_info is never used - <-- line 39 - val raise_arity_info : t [@@dead "+raise_arity_info"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity.mli", line 41, characters 0-10 - +na is never used - <-- line 41 - val na : t [@@dead "+na"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity.mli", line 43, characters 0-32 - +info is never used - <-- line 43 - val info : int list -> bool -> t [@@dead "+info"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity.mli", line 45, characters 0-30 - +first_arity_na is never used - <-- line 45 - val first_arity_na : t -> bool [@@dead "+first_arity_na"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity.mli", line 47, characters 0-37 - +get_first_arity is never used - <-- line 47 - val get_first_arity : t -> int option [@@dead "+get_first_arity"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity.mli", line 49, characters 0-33 - +extract_arity is never used - <-- line 49 - val extract_arity : t -> int list [@@dead "+extract_arity"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity.mli", line 52, characters 0-61 - +merge_arities is never used - <-- line 52 - val merge_arities : int list -> int list -> bool -> bool -> t [@@dead "+merge_arities"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity_analysis.ml", line 1, characters 0-0 - +lam_arity_analysis is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity_analysis.ml", line 25, characters 0-305 - +arity_of_var is never used - <-- line 25 - | Some _ | None -> Lam_arity.na [@@dead "+arity_of_var"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity_analysis.ml", line 38, characters 0-3438 - +get_arity is never used - <-- line 38 - Lam_arity.non_function_arity_info [@@dead "+get_arity"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity_analysis.ml", line 136, characters 0-490 - +all_lambdas is never used - <-- line 136 - | [] -> Lam_arity.na [@@dead "+all_lambdas"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity_analysis.mli", line 1, characters 0-0 - lam_arity_analysis is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_arity_analysis.mli", line 27, characters 0-51 - +get_arity is never used - <-- line 27 - val get_arity : Lam_stats.t -> Lam.t -> Lam_arity.t [@@dead "+get_arity"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_beta_reduce.ml", line 1, characters 0-0 - +lam_beta_reduce is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_beta_reduce.ml", line 47, characters 0-1174 - +propagate_beta_reduce is never used - <-- line 47 - Lam_util.refine_let ~kind:Strict param arg l) [@@dead "+propagate_beta_reduce"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_beta_reduce.ml", line 76, characters 0-1728 - +propagate_beta_reduce_with_map is never used - <-- line 76 - Lam_util.refine_let ~kind:Strict param arg l) [@@dead "+propagate_beta_reduce_with_map"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_beta_reduce.ml", line 117, characters 0-256 - +no_names_beta_reduce is never used - <-- line 117 - Lam_util.refine_let ~kind:Strict param arg l) [@@dead "+no_names_beta_reduce"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_beta_reduce.mli", line 1, characters 0-0 - lam_beta_reduce is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_beta_reduce.mli", line 27, characters 0-71 - +no_names_beta_reduce is never used - <-- line 27 - val no_names_beta_reduce : Ident.t list -> Lam.t -> Lam.t list -> Lam.t [@@dead "+no_names_beta_reduce"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_beta_reduce.mli", line 45, characters 0-89 - +propagate_beta_reduce is never used - <-- line 45 - Lam_stats.t -> Ident.t list -> Lam.t -> Lam.t list -> Lam.t [@@dead "+propagate_beta_reduce"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_beta_reduce.mli", line 48, characters 0-143 - +propagate_beta_reduce_with_map is never used - <-- line 48 - Lam.t [@@dead "+propagate_beta_reduce_with_map"] - - Warning Dead Value With Side Effects - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_beta_reduce_util.ml", line 36, characters 0-54 - +param_hash is never used and could have side effects - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_beta_reduce_util.ml", line 52, characters 0-2324 - +simple_beta_reduce is never used - <-- line 52 - | _ -> None [@@dead "+simple_beta_reduce"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_beta_reduce_util.mli", line 1, characters 0-0 - lam_beta_reduce_util is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_beta_reduce_util.mli", line 25, characters 0-76 - +simple_beta_reduce is never used - <-- line 25 - val simple_beta_reduce : Ident.t list -> Lam.t -> Lam.t list -> Lam.t option [@@dead "+simple_beta_reduce"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_bounded_vars.ml", line 1, characters 0-0 - +lam_bounded_vars is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_bounded_vars.ml", line 64, characters 0-3339 - +rewrite is never used - <-- line 64 - aux lam [@@dead "+rewrite"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_bounded_vars.mli", line 1, characters 0-0 - lam_bounded_vars is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_bounded_vars.mli", line 25, characters 0-50 - +rewrite is never used - <-- line 25 - val rewrite : Lam.t Hash_ident.t -> Lam.t -> Lam.t [@@dead "+rewrite"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_check.ml", line 1, characters 0-0 - +lam_check is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_check.ml", line 30, characters 0-4704 - +check is never used - <-- line 30 - lam [@@dead "+check"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_check.mli", line 1, characters 0-0 - lam_check is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_check.mli", line 25, characters 0-36 - +check is never used - <-- line 25 - val check : string -> Lam.t -> Lam.t [@@dead "+check"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_closure.ml", line 1, characters 0-0 - +lam_closure is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_closure.ml", line 29, characters 0-276 - +adjust is never used - <-- line 29 - Lam_var_stats.update stat pos) [@@dead "+adjust"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_closure.ml", line 39, characters 0-155 - +param_map_of_list is never used - <-- line 39 - Map_ident.add acc l Lam_var_stats.fresh_stats) [@@dead "+param_map_of_list"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_closure.ml", line 44, characters 0-33 - +sink_pos is never used - <-- line 44 - let sink_pos = Lam_var_stats.sink [@@dead "+sink_pos"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_closure.ml", line 54, characters 0-3268 - +free_variables is never used - <-- line 54 - !fv [@@dead "+free_variables"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_closure.ml", line 157, characters 0-124 - +is_closed is never used - <-- line 157 - (fun k _ -> Ident.global k) [@@dead "+is_closed"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_closure.ml", line 161, characters 0-321 - +is_closed_with_map is never used - <-- line 161 - (old_count = new_count, param_map) [@@dead "+is_closed_with_map"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_closure.mli", line 1, characters 0-0 - lam_closure is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_closure.mli", line 30, characters 0-29 - +is_closed is never used - <-- line 30 - val is_closed : Lam.t -> bool [@@dead "+is_closed"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_closure.mli", line 32, characters 0-105 - +is_closed_with_map is never used - <-- line 32 - Set_ident.t -> Ident.t list -> Lam.t -> bool * Lam_var_stats.stats Map_ident.t [@@dead "+is_closed_with_map"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_closure.mli", line 36, characters 0-119 - +free_variables is never used - <-- line 36 - Lam_var_stats.stats Map_ident.t [@@dead "+free_variables"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_coercion.ml", line 82, characters 0-3547 - +handle_exports is never used - <-- line 82 - {result with export_map; groups = Lam_dce.remove export_list coerced_input} [@@dead "+handle_exports"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_coercion.ml", line 179, characters 0-411 - +flatten is never used - <-- line 179 - | x -> (x, acc) [@@dead "+flatten"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_coercion.ml", line 196, characters 0-518 - +coerce_and_group_big_lambda is never used - <-- line 196 - assert false [@@dead "+coerce_and_group_big_lambda"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_coercion.mli", line 32, characters 0-73 - +coerce_and_group_big_lambda is never used - <-- line 32 - val coerce_and_group_big_lambda : Lam_stats.t -> Lam.t -> t * Lam_stats.t [@@dead "+coerce_and_group_big_lambda"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.ml", line 27, characters 0-191 - +eq_comparison is never used - <-- line 27 - | Cneq -> p1 = Cneq [@@dead "+eq_comparison"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.ml", line 36, characters 0-178 - +cmp_int32 is never used - <-- line 36 - | Cge -> a >= b [@@dead "+cmp_int32"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.ml", line 45, characters 0-178 - +cmp_float is never used - <-- line 45 - | Cge -> a >= b [@@dead "+cmp_float"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.ml", line 57, characters 2-69 - field_dbg_info.Fld_record is a variant case which is never constructed - <-- line 57 - | Fld_record of {name: string; mutable_flag: Asttypes.mutable_flag} [@dead "field_dbg_info.Fld_record"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.ml", line 58, characters 2-32 - field_dbg_info.Fld_module is a variant case which is never constructed - <-- line 58 - | Fld_module of {name: string} [@dead "field_dbg_info.Fld_module"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.ml", line 59, characters 2-39 - field_dbg_info.Fld_record_inline is a variant case which is never constructed - <-- line 59 - | Fld_record_inline of {name: string} [@dead "field_dbg_info.Fld_record_inline"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.ml", line 60, characters 2-42 - field_dbg_info.Fld_record_extension is a variant case which is never constructed - <-- line 60 - | Fld_record_extension of {name: string} [@dead "field_dbg_info.Fld_record_extension"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.ml", line 61, characters 2-13 - field_dbg_info.Fld_tuple is a variant case which is never constructed - <-- line 61 - | Fld_tuple [@dead "field_dbg_info.Fld_tuple"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.ml", line 62, characters 2-20 - field_dbg_info.Fld_poly_var_tag is a variant case which is never constructed - <-- line 62 - | Fld_poly_var_tag [@dead "field_dbg_info.Fld_poly_var_tag"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.ml", line 63, characters 2-24 - field_dbg_info.Fld_poly_var_content is a variant case which is never constructed - <-- line 63 - | Fld_poly_var_content [@dead "field_dbg_info.Fld_poly_var_content"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.ml", line 64, characters 2-17 - field_dbg_info.Fld_extension is a variant case which is never constructed - <-- line 64 - | Fld_extension [@dead "field_dbg_info.Fld_extension"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.ml", line 65, characters 2-15 - field_dbg_info.Fld_variant is a variant case which is never constructed - <-- line 65 - | Fld_variant [@dead "field_dbg_info.Fld_variant"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.ml", line 66, characters 2-12 - field_dbg_info.Fld_cons is a variant case which is never constructed - <-- line 66 - | Fld_cons [@dead "field_dbg_info.Fld_cons"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.ml", line 82, characters 2-38 - set_field_dbg_info.Fld_record_extension_set is a variant case which is never constructed - <-- line 82 - | Fld_record_extension_set of string [@dead "set_field_dbg_info.Fld_record_extension_set"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.mli", line 30, characters 2-69 - field_dbg_info.Fld_record is a variant case which is never constructed - <-- line 30 - | Fld_record of {name: string; mutable_flag: Asttypes.mutable_flag} [@dead "field_dbg_info.Fld_record"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.mli", line 31, characters 2-32 - field_dbg_info.Fld_module is a variant case which is never constructed - <-- line 31 - | Fld_module of {name: string} [@dead "field_dbg_info.Fld_module"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.mli", line 32, characters 2-39 - field_dbg_info.Fld_record_inline is a variant case which is never constructed - <-- line 32 - | Fld_record_inline of {name: string} [@dead "field_dbg_info.Fld_record_inline"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.mli", line 33, characters 2-42 - field_dbg_info.Fld_record_extension is a variant case which is never constructed - <-- line 33 - | Fld_record_extension of {name: string} [@dead "field_dbg_info.Fld_record_extension"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.mli", line 34, characters 2-13 - field_dbg_info.Fld_tuple is a variant case which is never constructed - <-- line 34 - | Fld_tuple [@dead "field_dbg_info.Fld_tuple"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.mli", line 35, characters 2-20 - field_dbg_info.Fld_poly_var_tag is a variant case which is never constructed - <-- line 35 - | Fld_poly_var_tag [@dead "field_dbg_info.Fld_poly_var_tag"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.mli", line 36, characters 2-24 - field_dbg_info.Fld_poly_var_content is a variant case which is never constructed - <-- line 36 - | Fld_poly_var_content [@dead "field_dbg_info.Fld_poly_var_content"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.mli", line 37, characters 2-17 - field_dbg_info.Fld_extension is a variant case which is never constructed - <-- line 37 - | Fld_extension [@dead "field_dbg_info.Fld_extension"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.mli", line 38, characters 2-15 - field_dbg_info.Fld_variant is a variant case which is never constructed - <-- line 38 - | Fld_variant [@dead "field_dbg_info.Fld_variant"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.mli", line 39, characters 2-12 - field_dbg_info.Fld_cons is a variant case which is never constructed - <-- line 39 - | Fld_cons [@dead "field_dbg_info.Fld_cons"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.mli", line 46, characters 2-38 - set_field_dbg_info.Fld_record_extension_set is a variant case which is never constructed - <-- line 46 - | Fld_record_extension_set of string [@dead "set_field_dbg_info.Fld_record_extension_set"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.mli", line 48, characters 0-52 - +cmp_int32 is never used - <-- line 48 - val cmp_int32 : comparison -> int32 -> int32 -> bool [@@dead "+cmp_int32"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.mli", line 50, characters 0-52 - +cmp_float is never used - <-- line 50 - val cmp_float : comparison -> float -> float -> bool [@@dead "+cmp_float"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.mli", line 52, characters 0-52 - +eq_comparison is never used - <-- line 52 - val eq_comparison : comparison -> comparison -> bool [@@dead "+eq_comparison"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile.ml", line 28, characters 0-167 - +args_either_function_or_const is never used - <-- line 28 - | _ -> false) [@@dead "+args_either_function_or_const"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile.ml", line 34, characters 0-363 - +call_info_of_ap_status is never used - <-- line 34 - | App_na -> {arity = NA; call_info = Call_ml; call_transformed_jsx} [@@dead "+call_info_of_ap_status"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile.ml", line 42, characters 0-1264 - +apply_with_arity_aux is never used - <-- line 42 - E.call ~info:Js_call_info.dummy fn args [@@dead "+apply_with_arity_aux"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile.ml", line 77, characters 0-93 - +apply_with_arity is never used - <-- line 77 - apply_with_arity_aux fn arity args (List.length args) [@@dead "+apply_with_arity"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile.ml", line 80, characters 0-249 - +change_tail_type_in_try is never used - <-- line 80 - | Not_tail | Maybe_tail_is_return Tail_in_try -> x [@@dead "+change_tail_type_in_try"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile.ml", line 86, characters 0-268 - +in_staticcatch is never used - <-- line 86 - | _ -> x [@@dead "+in_staticcatch"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile.ml", line 104, characters 0-492 - +flat_catches is never used - <-- line 104 - | _ -> (acc, x) [@@dead "+flat_catches"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile.ml", line 116, characters 0-106 - +flatten_nested_caches is never used - <-- line 116 - flat_catches [] x [@@dead "+flatten_nested_caches"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile.ml", line 120, characters 0-200 - +morph_declare_to_assign is never used - <-- line 120 - | _ -> k cxt None [@@dead "+morph_declare_to_assign"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile.ml", line 126, characters 0-242 - +group_apply is never used - <-- line 126 - (fun group -> Ext_list.map_last group callback) [@@dead "+group_apply"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile.ml", line 139, characters 0-143 - +default_action is never used - <-- line 139 - | Some x -> if saturated then Complete else Default x [@@dead "+default_action"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile.ml", line 144, characters 0-152 - +get_const_tag is never used - <-- line 144 - | Some {consts} -> Some consts.(i) [@@dead "+get_const_tag"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile.ml", line 149, characters 0-148 - +get_block is never used - <-- line 149 - | Some {blocks} -> Some blocks.(i) [@@dead "+get_block"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile.ml", line 154, characters 0-332 - +get_tag_name is never used - <-- line 154 - | _ -> Js_dump_lit.tag) [@@dead "+get_tag_name"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile.ml", line 166, characters 0-312 - +get_block_cases is never used - <-- line 166 - !res [@@dead "+get_block_cases"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile.ml", line 176, characters 0-322 - +get_literal_cases is never used - <-- line 176 - !res [@@dead "+get_literal_cases"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile.ml", line 186, characters 0-434 - +has_null_undefined_other is never used - <-- line 186 - (!null, !undefined, !other) [@@dead "+has_null_undefined_other"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile.ml", line 199, characters 0-32 - +no_effects_const is never used - <-- line 199 - let no_effects_const = lazy true [@@dead "+no_effects_const"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile.ml", line 234, characters 0-70707 - +compile is never used - <-- line 234 - (compile_recursive_lets, compile_lambda) [@@dead "+compile"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile.ml", line 1970, characters 0-71 - +compile_recursive_lets is never used - <-- line 1970 - let compile_recursive_lets ~output_prefix = fst (compile output_prefix) [@@dead "+compile_recursive_lets"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile.ml", line 1971, characters 0-63 - +compile_lambda is never used - <-- line 1971 - let compile_lambda ~output_prefix = snd (compile output_prefix) [@@dead "+compile_lambda"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile.mli", line 1, characters 0-0 - lam_compile is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile.mli", line 27, characters 0-123 - +compile_recursive_lets is never used - <-- line 27 - Js_output.t [@@dead "+compile_recursive_lets"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile.mli", line 33, characters 0-92 - +compile_lambda is never used - <-- line 33 - output_prefix:string -> Lam_compile_context.t -> Lam.t -> Js_output.t [@@dead "+compile_lambda"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_const.ml", line 1, characters 0-0 - +lam_compile_const is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_const.ml", line 28, characters 0-180 - +is_some_none_aux is never used - <-- line 28 - | _ -> -1 [@@dead "+is_some_none_aux"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_const.ml", line 34, characters 0-108 - +nested_some_none is never used - <-- line 34 - if n = 0 then none else nested_some_none (n - 1) (E.optional_block none) [@@dead "+nested_some_none"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_const.ml", line 37, characters 0-268 - +translate_some is never used - <-- line 37 - (E.optional_block (translate (Const_js_undefined {is_unit = false}))) [@@dead "+translate_some"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_const.ml", line 44, characters 0-1124 - +translate is never used - <-- line 44 - (Ext_list.map xs translate) [@@dead "+translate"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_const.ml", line 79, characters 0-162 - +translate_arg_cst is never used - <-- line 79 - | Arg_string_lit (s, delim) -> E.str s ~delim [@@dead "+translate_arg_cst"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_const.mli", line 1, characters 0-0 - lam_compile_const is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_const.mli", line 27, characters 0-46 - +translate is never used - <-- line 27 - val translate : Lam_constant.t -> J.expression [@@dead "+translate"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_const.mli", line 29, characters 0-61 - +translate_arg_cst is never used - <-- line 29 - val translate_arg_cst : External_arg_spec.cst -> J.expression [@@dead "+translate_arg_cst"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_context.ml", line 69, characters 0-228 - +continuation_is_return is never used - <-- line 69 - | EffectCall Not_tail | NeedValue Not_tail | Declare _ | Assign _ -> false [@@dead "+continuation_is_return"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_context.ml", line 84, characters 0-41 - +empty_handler_map is never used - <-- line 84 - let empty_handler_map = Handler_map.empty [@@dead "+empty_handler_map"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_context.ml", line 86, characters 0-69 - +enter_switch is never used - <-- line 86 - let enter_switch cxt = {cxt with switch_depth = cxt.switch_depth + 1} [@@dead "+enter_switch"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_context.ml", line 88, characters 0-110 - +push_loop is never used - <-- line 88 - ({cxt with loop_stack = frame :: cxt.loop_stack}, frame) [@@dead "+push_loop"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_context.ml", line 92, characters 0-358 - +ensure_loop_label is never used - <-- line 92 - label [@@dead "+ensure_loop_label"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_context.ml", line 105, characters 0-119 - +no_static_raise_in_handler is never used - <-- line 105 - not (Lam_exit_code.has_exit_code x.handler (fun _code -> true)) [@@dead "+no_static_raise_in_handler"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_context.ml", line 114, characters 0-436 - +add_jmps is never used - <-- line 114 - (map, List.rev handlers) [@@dead "+add_jmps"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_context.ml", line 125, characters 0-274 - +add_pseudo_jmp is never used - <-- line 125 - code_table.handler ) [@@dead "+add_pseudo_jmp"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_context.ml", line 132, characters 0-53 - +find_exn is never used - <-- line 132 - let find_exn cxt i = Map_int.find_exn cxt.jmp_table i [@@dead "+find_exn"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_context.mli", line 69, characters 0-49 - +continuation_is_return is never used - <-- line 69 - val continuation_is_return : continuation -> bool [@@dead "+continuation_is_return"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_context.mli", line 80, characters 0-33 - +empty_handler_map is never used - <-- line 80 - val empty_handler_map : jmp_table [@@dead "+empty_handler_map"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_context.mli", line 81, characters 0-25 - +enter_switch is never used - <-- line 81 - val enter_switch : t -> t [@@dead "+enter_switch"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_context.mli", line 82, characters 0-35 - +push_loop is never used - <-- line 82 - val push_loop : t -> t * loop_frame [@@dead "+push_loop"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_context.mli", line 83, characters 0-50 - +ensure_loop_label is never used - <-- line 83 - val ensure_loop_label : t -> loop_frame -> J.label [@@dead "+ensure_loop_label"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_context.mli", line 87, characters 0-48 - +no_static_raise_in_handler is never used - <-- line 87 - val no_static_raise_in_handler : handler -> bool [@@dead "+no_static_raise_in_handler"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_context.mli", line 89, characters 0-93 - +add_jmps is never used - <-- line 89 - jmp_table -> Ident.t -> handler list -> jmp_table * (jbl_label * Lam.t) list [@@dead "+add_jmps"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_context.mli", line 92, characters 0-73 - +add_pseudo_jmp is never used - <-- line 92 - val add_pseudo_jmp : jmp_table -> Ident.t -> handler -> jmp_table * Lam.t [@@dead "+add_pseudo_jmp"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_context.mli", line 94, characters 0-38 - +find_exn is never used - <-- line 94 - val find_exn : t -> jbl_label -> value [@@dead "+find_exn"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_env.ml", line 33, characters 2-15 - ident_info.name is a record label never used to read a value - <-- line 33 - name: string; [@dead "ident_info.name"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_env.ml", line 34, characters 2-29 - ident_info.arity is a record label never used to read a value - <-- line 34 - arity: Js_cmj_format.arity; [@dead "ident_info.arity"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_env.ml", line 35, characters 2-41 - ident_info.persistent_closed_lambda is a record label never used to read a value - <-- line 35 - persistent_closed_lambda: Lam.t option; [@dead "ident_info.persistent_closed_lambda"] - - Warning Dead Value With Side Effects - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_env.ml", line 48, characters 0-49 - ++> is never used and could have side effects - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_env.ml", line 62, characters 0-800 - +add_js_module is never used - <-- line 62 - | Some old_key -> old_key.id [@@dead "+add_js_module"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_env.ml", line 87, characters 0-521 - +query_external_id_info is never used - <-- line 87 - Js_cmj_format.query_by_name cmj_table name [@@dead "+query_external_id_info"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_env.ml", line 101, characters 0-732 - +get_package_path_from_cmj is never used - <-- line 101 - (cmj_load_info.package_path, cmj_table.package_spec, cmj_table.case) [@@dead "+get_package_path_from_cmj"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_env.ml", line 121, characters 0-39 - +add is never used - <-- line 121 - let add = Lam_module_ident.Hash_set.add [@@dead "+add"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_env.ml", line 124, characters 0-471 - +is_pure_module is never used - <-- line 124 - | Some External -> false) [@@dead "+is_pure_module"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_env.ml", line 139, characters 0-332 - +populate_required_modules is never used - <-- line 139 - if not (is_pure_module id) then add hard_dependencies id) [@@dead "+populate_required_modules"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_env.mli", line 29, characters 0-178 - +add_js_module is never used - <-- line 29 - Ident.t [@@dead "+add_js_module"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_env.mli", line 67, characters 0-105 - +query_external_id_info is never used - <-- line 67 - ?dynamic_import:bool -> Ident.t -> string -> Js_cmj_format.keyed_cmj_value [@@dead "+query_external_id_info"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_env.mli", line 74, characters 0-47 - +is_pure_module is never used - <-- line 74 - val is_pure_module : Lam_module_ident.t -> bool [@@dead "+is_pure_module"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_env.mli", line 76, characters 0-107 - +get_package_path_from_cmj is never used - <-- line 76 - Lam_module_ident.t -> string * Js_packages_info.t * Ext_js_file_kind.case [@@dead "+get_package_path_from_cmj"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_env.mli", line 84, characters 0-100 - +populate_required_modules is never used - <-- line 84 - Lam_module_ident.Hash_set.t -> Lam_module_ident.Hash_set.t -> unit [@@dead "+populate_required_modules"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_external_call.ml", line 40, characters 0-316 - +external_var is never used - <-- line 40 - E.external_var ?import_attributes ~external_name:bundle id [@@dead "+external_var"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_external_call.ml", line 60, characters 2-24 - arg_expression.Splice2 is a variant case which is never constructed - <-- line 60 - | Splice2 of E.t * E.t [@dead "arg_expression.Splice2"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_external_call.ml", line 62, characters 0-115 - +append_list is never used - <-- line 62 - | Splice2 (a, b) -> a :: b :: xs [@@dead "+append_list"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_external_call.ml", line 90, characters 0-1788 - +ocaml_to_js_eff is never used - <-- line 90 - | Nothing -> (Splice1 arg, []) [@@dead "+ocaml_to_js_eff"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_external_call.ml", line 136, characters 0-25 - +empty_pair is never used - <-- line 136 - let empty_pair = ([], []) [@@dead "+empty_pair"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_external_call.ml", line 138, characters 0-74 - +add_eff is never used - <-- line 138 - | Some v -> E.seq v e [@@dead "+add_eff"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_external_call.ml", line 147, characters 0-812 - +keep_non_undefined_args is never used - <-- line 147 - else args [@@dead "+keep_non_undefined_args"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_external_call.ml", line 175, characters 0-900 - +assemble_args_no_splice is never used - <-- line 175 - Some (E.fuse_to_seq x xs) ) [@@dead "+assemble_args_no_splice"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_external_call.ml", line 200, characters 0-1074 - +assemble_args_has_splice is never used - <-- line 200 - !dynamic ) [@@dead "+assemble_args_has_splice"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_external_call.ml", line 231, characters 0-1224 - +translate_scoped_module_val is never used - <-- line 231 - Ext_list.fold_left (Ext_list.append_one rest fn) start E.dot) [@@dead "+translate_scoped_module_val"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_external_call.ml", line 265, characters 0-131 - +translate_scoped_access is never used - <-- line 265 - | x :: xs -> Ext_list.fold_left xs (E.dot obj x) E.dot [@@dead "+translate_scoped_access"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_external_call.ml", line 270, characters 0-6197 - +translate_ffi is never used - <-- line 270 - | _ -> assert false) [@@dead "+translate_ffi"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_external_call.mli", line 1, characters 0-0 - lam_compile_external_call is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_external_call.mli", line 25, characters 0-177 - +ocaml_to_js_eff is never used - <-- line 25 - Js_of_lam_variant.arg_expression * J.expression list [@@dead "+ocaml_to_js_eff"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_external_call.mli", line 32, characters 0-204 - +translate_ffi is never used - <-- line 32 - J.expression [@@dead "+translate_ffi"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_external_obj.ml", line 1, characters 0-0 - +lam_compile_external_obj is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_external_obj.ml", line 40, characters 0-5076 - +assemble_obj_args is never used - <-- line 40 - var_v ) [@@dead "+assemble_obj_args"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_external_obj.mli", line 1, characters 0-0 - lam_compile_external_obj is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_external_obj.mli", line 33, characters 0-101 - +assemble_obj_args is never used - <-- line 33 - External_arg_spec.obj_params -> J.expression list -> J.block * J.expression [@@dead "+assemble_obj_args"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_primitive.ml", line 1, characters 0-0 - +lam_compile_primitive is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_primitive.ml", line 30, characters 0-256 - +ensure_value_unit is never used - <-- line 30 - | EffectCall Not_tail -> e [@@dead "+ensure_value_unit"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_primitive.ml", line 39, characters 0-220 - +module_of_expression is never used - <-- line 39 - | _ -> [] [@@dead "+module_of_expression"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_primitive.ml", line 45, characters 0-396 - +get_module_system is never used - <-- line 45 - | _ -> Commonjs [@@dead "+get_module_system"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_primitive.ml", line 57, characters 0-96 - +call_info is never used - <-- line 57 - {Js_call_info.arity = Full; call_info = Call_na; call_transformed_jsx = false} [@@dead "+call_info"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_primitive.ml", line 60, characters 0-86 - +import_of_path is never used - <-- line 60 - E.call ~info:call_info (E.js_global "import") [E.str path] [@@dead "+import_of_path"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_primitive.ml", line 63, characters 0-276 - +wrap_then is never used - <-- line 63 - ] [@@dead "+wrap_then"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_primitive.ml", line 71, characters 0-19044 - +translate is never used - <-- line 71 - | _ -> assert false) [@@dead "+translate"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_primitive.mli", line 1, characters 0-0 - lam_compile_primitive is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_primitive.mli", line 31, characters 0-129 - +translate is never used - <-- line 31 - J.expression [@@dead "+translate"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_util.ml", line 1, characters 0-0 - +lam_compile_util is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_util.ml", line 25, characters 0-189 - +jsop_of_comp is never used - <-- line 25 - | Cge -> Ge [@@dead "+jsop_of_comp"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_util.ml", line 34, characters 0-215 - +runtime_of_comp is never used - <-- line 34 - | Cge -> "greaterequal" [@@dead "+runtime_of_comp"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_util.mli", line 1, characters 0-0 - lam_compile_util is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_util.mli", line 27, characters 0-55 - +jsop_of_comp is never used - <-- line 27 - val jsop_of_comp : Lam_compat.comparison -> Js_op.binop [@@dead "+jsop_of_comp"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile_util.mli", line 29, characters 0-53 - +runtime_of_comp is never used - <-- line 29 - val runtime_of_comp : Lam_compat.comparison -> string [@@dead "+runtime_of_comp"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_constant_convert.ml", line 1, characters 0-0 - +lam_constant_convert is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_constant_convert.ml", line 25, characters 0-2474 - +convert_constant is never used - <-- line 25 - | _ -> assert false)) [@@dead "+convert_constant"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_constant_convert.mli", line 1, characters 0-0 - lam_constant_convert is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_constant_convert.mli", line 25, characters 0-67 - +convert_constant is never used - <-- line 25 - val convert_constant : Lambda.structured_constant -> Lam_constant.t [@@dead "+convert_constant"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_convert.ml", line 1, characters 0-0 - +lam_convert is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_convert.ml", line 25, characters 0-118 - +caml_id_field_info is never used - <-- line 25 - Fld_record {name = Literals.exception_id; mutable_flag = Immutable} [@@dead "+caml_id_field_info"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_convert.ml", line 28, characters 0-66 - +lam_caml_id is never used - <-- line 28 - let lam_caml_id : Lam_primitive.t = Pfield (0, caml_id_field_info) [@@dead "+lam_caml_id"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_convert.ml", line 29, characters 0-19 - +prim is never used - <-- line 29 - let prim = Lam.prim [@@dead "+prim"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_convert.ml", line 31, characters 0-88 - +lam_extension_id is never used - <-- line 31 - prim ~primitive:lam_caml_id ~args:[head] loc [@@dead "+lam_extension_id"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_convert.ml", line 63, characters 0-1890 - +exception_id_destructed is never used - <-- line 63 - hit l [@@dead "+exception_id_destructed"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_convert.ml", line 109, characters 0-39 - +abs_int is never used - <-- line 109 - let abs_int x = if x < 0 then -x else x [@@dead "+abs_int"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_convert.ml", line 110, characters 0-44 - +no_over_flow is never used - <-- line 110 - let no_over_flow x = abs_int x < 0x1fff_ffff [@@dead "+no_over_flow"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_convert.ml", line 112, characters 0-103 - +lam_is_var is never used - <-- line 112 - | _ -> false [@@dead "+lam_is_var"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_convert.ml", line 120, characters 0-686 - +happens_to_be_diff is never used - <-- line 120 - | _ -> None [@@dead "+happens_to_be_diff"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_convert.ml", line 148, characters 0-17 - +seq is never used - <-- line 148 - let seq = Lam.seq [@@dead "+seq"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_convert.ml", line 150, characters 0-19 - +unit is never used - <-- line 150 - let unit = Lam.unit [@@dead "+unit"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_convert.ml", line 152, characters 0-8412 - +lam_prim is never used - <-- line 152 - | Pjs_fn_method -> prim ~primitive:Pjs_fn_method ~args loc [@@dead "+lam_prim"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_convert.ml", line 323, characters 0-46 - +may_depend is never used - <-- line 323 - let may_depend = Lam_module_ident.Hash_set.add [@@dead "+may_depend"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_convert.ml", line 325, characters 0-773 - +rename_optional_parameters is never used - <-- line 325 - | _ -> (map, body) [@@dead "+rename_optional_parameters"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_convert.ml", line 351, characters 0-11492 - +convert is never used - <-- line 351 - (convert_aux lam, may_depends) [@@dead "+convert"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_convert.mli", line 1, characters 0-0 - lam_convert is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_convert.mli", line 28, characters 0-83 - +convert is never used - <-- line 28 - Set_ident.t -> Lambda.lambda -> Lam.t * Lam_module_ident.Hash_set.t [@@dead "+convert"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_dce.ml", line 1, characters 0-0 - +lam_dce is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_dce.ml", line 25, characters 0-559 - +transitive_closure is never used - <-- line 25 - visited [@@dead "+transitive_closure"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_dce.ml", line 40, characters 0-1710 - +remove is never used - <-- line 40 - |> List.rev [@@dead "+remove"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_dce.mli", line 1, characters 0-0 - lam_dce is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_dce.mli", line 28, characters 0-65 - +remove is never used - <-- line 28 - val remove : Ident.t list -> Lam_group.t list -> Lam_group.t list [@@dead "+remove"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_eta_conversion.ml", line 1, characters 0-0 - +lam_eta_conversion is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_eta_conversion.ml", line 37, characters 0-1630 - +transform_under_supply is never used - <-- line 37 - | _, _ -> assert false [@@dead "+transform_under_supply"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_eta_conversion.ml", line 111, characters 0-6326 - +unsafe_adjust_to_arity is never used - <-- line 111 - else transform_under_supply to_ ap_info fn [] [@@dead "+unsafe_adjust_to_arity"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_eta_conversion.mli", line 1, characters 0-0 - lam_eta_conversion is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_eta_conversion.mli", line 31, characters 0-79 - +transform_under_supply is never used - <-- line 31 - val transform_under_supply : int -> Lam.ap_info -> Lam.t -> Lam.t list -> Lam.t [@@dead "+transform_under_supply"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_eta_conversion.mli", line 33, characters 0-83 - +unsafe_adjust_to_arity is never used - <-- line 33 - Location.t -> to_:int -> ?from:int -> Lam.t -> Lam.t [@@dead "+unsafe_adjust_to_arity"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_exit_code.ml", line 1, characters 0-0 - +lam_exit_code is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_exit_code.ml", line 25, characters 0-262 - +has_exit_code is never used - <-- line 25 - aux lam [@@dead "+has_exit_code"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_exit_code.ml", line 35, characters 0-150 - +has_exit is never used - <-- line 35 - | _ -> Lam_iter.inner_exists lam has_exit [@@dead "+has_exit"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_exit_code.mli", line 1, characters 0-0 - lam_exit_code is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_exit_code.mli", line 25, characters 0-50 - +has_exit_code is never used - <-- line 25 - val has_exit_code : Lam.t -> (int -> bool) -> bool [@@dead "+has_exit_code"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_exit_code.mli", line 27, characters 0-28 - +has_exit is never used - <-- line 27 - val has_exit : Lam.t -> bool [@@dead "+has_exit"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_exit_count.ml", line 1, characters 0-0 - +lam_exit_count is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_exit_count.ml", line 28, characters 0-71 - +count_exit is never used - <-- line 28 - let count_exit (exits : collection) i = Hash_int.find_default exits i 0 [@@dead "+count_exit"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_exit_count.ml", line 30, characters 0-86 - +incr_exit is never used - <-- line 30 - Hash_int.add_or_update exits i 1 ~update:succ [@@dead "+incr_exit"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_exit_count.ml", line 51, characters 0-1738 - +count_helper is never used - <-- line 51 - exits [@@dead "+count_helper"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_exit_count.mli", line 1, characters 0-0 - lam_exit_count is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_exit_count.mli", line 27, characters 0-38 - +count_helper is never used - <-- line 27 - val count_helper : Lam.t -> collection [@@dead "+count_helper"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_exit_count.mli", line 29, characters 0-41 - +count_exit is never used - <-- line 29 - val count_exit : collection -> int -> int [@@dead "+count_exit"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_free_variables.ml", line 1, characters 0-0 - +lam_free_variables is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_free_variables.ml", line 25, characters 0-2129 - +pass_free_variables is never used - <-- line 25 - !fv [@@dead "+pass_free_variables"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_free_variables.mli", line 1, characters 0-0 - lam_free_variables is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_free_variables.mli", line 25, characters 0-46 - +pass_free_variables is never used - <-- line 25 - val pass_free_variables : Lam.t -> Set_ident.t [@@dead "+pass_free_variables"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_group.ml", line 31, characters 0-192 - +single is never used - <-- line 31 - | _ -> Single (kind, id, body) [@@dead "+single"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_group.ml", line 36, characters 0-110 - +nop_cons is never used - <-- line 36 - | _ -> Nop x :: acc [@@dead "+nop_cons"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_group.ml", line 43, characters 0-139 - +str_of_kind is never used - <-- line 43 - | Variable -> "v" [@@dead "+str_of_kind"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_group.ml", line 50, characters 0-394 - +pp_group is never used - <-- line 50 - | Nop lam -> Lam_print.lambda fmt lam [@@dead "+pp_group"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_group.mli", line 32, characters 0-44 - +pp_group is never used - <-- line 32 - val pp_group : Format.formatter -> t -> unit [@@dead "+pp_group"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_group.mli", line 34, characters 0-57 - +single is never used - <-- line 34 - val single : Lam_compat.let_kind -> Ident.t -> Lam.t -> t [@@dead "+single"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_group.mli", line 36, characters 0-40 - +nop_cons is never used - <-- line 36 - val nop_cons : Lam.t -> t list -> t list [@@dead "+nop_cons"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_hit.ml", line 1, characters 0-0 - +lam_hit is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_hit.ml", line 27, characters 0-1539 - +hit_variables is never used - <-- line 27 - hit l [@@dead "+hit_variables"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_hit.ml", line 64, characters 0-1531 - +hit_variable is never used - <-- line 64 - hit l [@@dead "+hit_variable"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_hit.mli", line 1, characters 0-0 - lam_hit is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_hit.mli", line 25, characters 0-48 - +hit_variables is never used - <-- line 25 - val hit_variables : Set_ident.t -> Lam.t -> bool [@@dead "+hit_variables"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_hit.mli", line 27, characters 0-43 - +hit_variable is never used - <-- line 27 - val hit_variable : Ident.t -> Lam.t -> bool [@@dead "+hit_variable"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_id_kind.ml", line 34, characters 15-17 - element.NA is a variant case which is never constructed - <-- line 34 - type element = NA [@dead "element.NA"] | SimpleForm of Lam.t - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_id_kind.ml", line 34, characters 18-39 - element.SimpleForm is a variant case which is never constructed - <-- line 34 - type element = NA [@dead "element.NA"] | SimpleForm of Lam.t [@dead "element.SimpleForm"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_id_kind.ml", line 41, characters 2-35 - t.ImmutableBlock is a variant case which is never constructed - <-- line 41 - | ImmutableBlock of element array [@dead "t.ImmutableBlock"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_id_kind.ml", line 59, characters 0-23 - +pp is never used - <-- line 59 - let pp = Format.fprintf [@@dead "+pp"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_id_kind.ml", line 61, characters 0-434 - +print is never used - <-- line 61 - | NA -> pp fmt "NA" [@@dead "+print"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_id_kind.mli", line 34, characters 15-17 - element.NA is a variant case which is never constructed - <-- line 34 - type element = NA [@dead "element.NA"] | SimpleForm of Lam.t - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_id_kind.mli", line 34, characters 18-39 - element.SimpleForm is a variant case which is never constructed - <-- line 34 - type element = NA [@dead "element.NA"] | SimpleForm of Lam.t [@dead "element.SimpleForm"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_id_kind.mli", line 53, characters 2-35 - t.ImmutableBlock is a variant case which is never constructed - <-- line 53 - | ImmutableBlock of element array [@dead "t.ImmutableBlock"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_id_kind.mli", line 68, characters 0-41 - +print is never used - <-- line 68 - val print : Format.formatter -> t -> unit [@@dead "+print"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_iter.ml", line 1, characters 0-0 - +lam_iter is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_iter.ml", line 29, characters 0-1404 - +inner_iter is never used - <-- line 29 - | Lassign (_id, e) -> f e [@@dead "+inner_iter"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_iter.ml", line 91, characters 0-1352 - +inner_exists is never used - <-- line 91 - | Lassign (_id, e) -> f e [@@dead "+inner_exists"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_iter.mli", line 1, characters 0-0 - lam_iter is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_iter.mli", line 25, characters 0-49 - +inner_iter is never used - <-- line 25 - val inner_iter : Lam.t -> (Lam.t -> unit) -> unit [@@dead "+inner_iter"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_iter.mli", line 27, characters 0-51 - +inner_exists is never used - <-- line 27 - val inner_exists : Lam.t -> (Lam.t -> bool) -> bool [@@dead "+inner_exists"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_module_ident.ml", line 25, characters 55-75 - t.dynamic_import is a record label never used to read a value - <-- line 25 - type t = J.module_id = {id: Ident.t; kind: Js_op.kind; dynamic_import: bool [@dead "t.dynamic_import"] } - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_module_ident.ml", line 27, characters 0-15 - +id is never used - <-- line 27 - let id x = x.id [@@dead "+id"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_module_ident.ml", line 29, characters 0-72 - +of_ml is never used - <-- line 29 - let of_ml ?(dynamic_import = false) id = {id; kind = Ml; dynamic_import} [@@dead "+of_ml"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_module_ident.ml", line 31, characters 0-64 - +of_runtime is never used - <-- line 31 - let of_runtime id = {id; kind = Runtime; dynamic_import = false} [@@dead "+of_runtime"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_module_ident.ml", line 33, characters 0-106 - +name is never used - <-- line 33 - | External {name = v} -> v [@@dead "+name"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_module_ident.ml", line 38, characters 0-1115 - +lam_module_ident.Cmp is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_module_ident.ml", line 41, characters 2-317 - Cmp.+equal is never used - <-- line 41 - | Ml | Runtime -> Ext_ident.equal x.id y.id [@@dead "Cmp.+equal"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_module_ident.ml", line 63, characters 2-266 - Cmp.+hash is never used - <-- line 63 - Bs_hash_stubs.hash_stamp_and_name x_id.stamp x_id.name [@@dead "Cmp.+hash"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_module_ident.mli", line 31, characters 2-23 - t.dynamic_import is a record label never used to read a value - <-- line 31 - dynamic_import: bool; [@dead "t.dynamic_import"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_module_ident.mli", line 34, characters 0-21 - +id is never used - <-- line 34 - val id : t -> Ident.t [@@dead "+id"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_module_ident.mli", line 36, characters 0-22 - +name is never used - <-- line 36 - val name : t -> string [@@dead "+name"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_module_ident.mli", line 38, characters 0-48 - +of_ml is never used - <-- line 38 - val of_ml : ?dynamic_import:bool -> Ident.t -> t [@@dead "+of_ml"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_module_ident.mli", line 40, characters 0-29 - +of_runtime is never used - <-- line 40 - val of_runtime : Ident.t -> t [@@dead "+of_runtime"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_alpha_conversion.ml", line 1, characters 0-0 - +lam_pass_alpha_conversion is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_alpha_conversion.ml", line 25, characters 0-4205 - +alpha_conversion is never used - <-- line 25 - simpl lam [@@dead "+alpha_conversion"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_alpha_conversion.mli", line 1, characters 0-0 - lam_pass_alpha_conversion is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_alpha_conversion.mli", line 27, characters 0-52 - +alpha_conversion is never used - <-- line 27 - val alpha_conversion : Lam_stats.t -> Lam.t -> Lam.t [@@dead "+alpha_conversion"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_collect.ml", line 1, characters 0-0 - +lam_pass_collect is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_collect.ml", line 34, characters 0-184 - +annotate is never used - <-- line 34 - (FunctionId {arity; lambda = Some (lambda, rec_flag)}) [@@dead "+annotate"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_collect.ml", line 57, characters 0-3678 - +collect_info is never used - <-- line 57 - collect lam [@@dead "+collect_info"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_collect.mli", line 1, characters 0-0 - lam_pass_collect is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_collect.mli", line 71, characters 0-47 - +collect_info is never used - <-- line 71 - val collect_info : Lam_stats.t -> Lam.t -> unit [@@dead "+collect_info"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_count.ml", line 30, characters 0-49 - +dummy_info is never used - <-- line 30 - let dummy_info () = {times = 0; captured = false} [@@dead "+dummy_info"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_count.ml", line 33, characters 0-177 - +absorb_info is never used - <-- line 33 - if captured then x.captured <- true [@@dead "+absorb_info"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_count.ml", line 39, characters 0-94 - +pp_info is never used - <-- line 39 - Format.fprintf fmt "(:%d)" x.captured x.times [@@dead "+pp_info"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_count.ml", line 42, characters 0-123 - +pp_occ_tbl is never used - <-- line 42 - Format.fprintf fmt "@[%a@ %a@]@." Ident.print k pp_info v) [@@dead "+pp_occ_tbl"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_count.ml", line 59, characters 0-5126 - +collect_occurs is never used - <-- line 59 - occ [@@dead "+collect_occurs"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_count.mli", line 26, characters 0-34 - +dummy_info is never used - <-- line 26 - val dummy_info : unit -> used_info [@@dead "+dummy_info"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_count.mli", line 28, characters 0-37 - +collect_occurs is never used - <-- line 28 - val collect_occurs : Lam.t -> occ_tbl [@@dead "+collect_occurs"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_count.mli", line 30, characters 0-52 - +pp_occ_tbl is never used - <-- line 30 - val pp_occ_tbl : Format.formatter -> occ_tbl -> unit [@@dead "+pp_occ_tbl"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_deep_flatten.ml", line 1, characters 0-0 - +lam_pass_deep_flatten is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_deep_flatten.ml", line 29, characters 0-343 - +eliminate_tuple is never used - <-- line 29 - | _ -> if Lam_hit.hit_variable id lam then None else Some (acc, lam) [@@dead "+eliminate_tuple"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_deep_flatten.ml", line 103, characters 0-323 - +lambda_of_groups is never used - <-- line 103 - | Recursive bindings -> Lam.letrec bindings acc) [@@dead "+lambda_of_groups"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_deep_flatten.ml", line 117, characters 0-6033 - +deep_flatten is never used - <-- line 117 - aux lam [@@dead "+deep_flatten"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_deep_flatten.mli", line 1, characters 0-0 - lam_pass_deep_flatten is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_deep_flatten.mli", line 25, characters 0-33 - +deep_flatten is never used - <-- line 25 - val deep_flatten : Lam.t -> Lam.t [@@dead "+deep_flatten"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_eliminate_ref.ml", line 1, characters 0-0 - +lam_pass_eliminate_ref is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_eliminate_ref.ml", line 16, characters 0-3600 - +eliminate_ref is never used - <-- line 16 - | Lassign (v, e) -> Lam.assign v (eliminate_ref id e) [@@dead "+eliminate_ref"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_eliminate_ref.mli", line 1, characters 0-0 - lam_pass_eliminate_ref is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_eliminate_ref.mli", line 27, characters 0-45 - +eliminate_ref is never used - <-- line 27 - val eliminate_ref : Ident.t -> Lam.t -> Lam.t [@@dead "+eliminate_ref"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_exits.ml", line 22, characters 0-65 - +no_list is never used - <-- line 22 - let rec no_list args = Ext_list.for_all args no_bounded_variables [@@dead "+no_list"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_exits.ml", line 24, characters 0-109 - +no_list_snd is never used - <-- line 24 - fun args -> Ext_list.for_all_snd args no_bounded_variables [@@dead "+no_list_snd"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_exits.ml", line 27, characters 0-83 - +no_opt is never used - <-- line 27 - | Some a -> no_bounded_variables a [@@dead "+no_opt"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_exits.ml", line 32, characters 0-1253 - +no_bounded_variables is never used - <-- line 32 - | Lletrec (decl, body) -> decl = [] && no_bounded_variables body [@@dead "+no_bounded_variables"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_exits.ml", line 90, characters 0-43 - +to_lam is never used - <-- line 90 - | Id x -> x [@@dead "+to_lam"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_exits.ml", line 155, characters 0-3643 - +subst_helper is never used - <-- line 155 - simplif lam [@@dead "+subst_helper"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_exits.ml", line 247, characters 0-157 - +simplify_exits is never used - <-- line 247 - subst_helper (Hash_int.create 17) (Lam_exit_count.count_exit exits) lam [@@dead "+simplify_exits"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_exits.mli", line 1, characters 0-0 - lam_pass_exits is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_exits.mli", line 18, characters 0-35 - +simplify_exits is never used - <-- line 18 - val simplify_exits : Lam.t -> Lam.t [@@dead "+simplify_exits"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_lets_dce.ml", line 1, characters 0-0 - +lam_pass_lets_dce is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_lets_dce.ml", line 14, characters 0-8159 - +lets_helper is never used - <-- line 14 - simplif lam [@@dead "+lets_helper"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_lets_dce.ml", line 212, characters 0-185 - +apply_lets is never used - <-- line 212 - lets_helper count_var lambda [@@dead "+apply_lets"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_lets_dce.ml", line 220, characters 0-185 - +simplify_lets is never used - <-- line 220 - apply_lets occ lam [@@dead "+simplify_lets"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_lets_dce.mli", line 1, characters 0-0 - lam_pass_lets_dce is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_lets_dce.mli", line 14, characters 0-34 - +simplify_lets is never used - <-- line 14 - val simplify_lets : Lam.t -> Lam.t [@@dead "+simplify_lets"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_remove_alias.ml", line 27, characters 0-653 - +id_is_for_sure_true_in_boolean is never used - <-- line 27 - Eval_unknown [@@dead "+id_is_for_sure_true_in_boolean"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_remove_alias.ml", line 44, characters 0-185 - +is_const_some is never used - <-- line 44 - | _ -> false [@@dead "+is_const_some"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_remove_alias.ml", line 50, characters 0-9666 - +simplify_alias is never used - <-- line 50 - simpl lam [@@dead "+simplify_alias"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_remove_alias.mli", line 1, characters 0-0 - lam_pass_remove_alias is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_remove_alias.mli", line 38, characters 0-50 - +simplify_alias is never used - <-- line 38 - val simplify_alias : Lam_stats.t -> Lam.t -> Lam.t [@@dead "+simplify_alias"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_primitive.ml", line 178, characters 0-99 - +eq_field_dbg_info is never used - <-- line 178 - x = y [@@dead "+eq_field_dbg_info"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_primitive.ml", line 183, characters 0-111 - +eq_set_field_dbg_info is never used - <-- line 183 - x = y [@@dead "+eq_set_field_dbg_info"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_primitive.ml", line 188, characters 0-46 - +eq_tag_info is never used - <-- line 188 - let eq_tag_info (x : Lam_tag_info.t) y = x = y [@@dead "+eq_tag_info"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_primitive.ml", line 190, characters 0-4113 - +eq_primitive_approx is never used - <-- line 190 - | Praw_js_code _ -> false [@@dead "+eq_primitive_approx"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_primitive.mli", line 168, characters 0-40 - +eq_primitive_approx is never used - <-- line 168 - val eq_primitive_approx : t -> t -> bool [@@dead "+eq_primitive_approx"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_print.ml", line 482, characters 0-343 - +serialize is never used - <-- line 482 - Format.set_margin old [@@dead "+serialize"] - - Warning Dead Value With Side Effects - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_print.ml", line 493, characters 0-50 - +lambda_to_string is never used and could have side effects - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_print.mli", line 1, characters 0-0 - lam_print is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_print.mli", line 25, characters 0-46 - +lambda is never used - <-- line 25 - val lambda : Format.formatter -> Lam.t -> unit [@@dead "+lambda"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_print.mli", line 27, characters 0-59 - +primitive is never used - <-- line 27 - val primitive : Format.formatter -> Lam_primitive.t -> unit [@@dead "+primitive"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_print.mli", line 29, characters 0-39 - +serialize is never used - <-- line 29 - val serialize : string -> Lam.t -> unit [@@dead "+serialize"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_print.mli", line 31, characters 0-38 - +lambda_to_string is never used - <-- line 31 - val lambda_to_string : Lam.t -> string [@@dead "+lambda_to_string"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_scc.ml", line 1, characters 0-0 - +lam_scc is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_scc.ml", line 31, characters 0-1560 - +hit_mask is never used - <-- line 31 - hit l [@@dead "+hit_mask"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_scc.ml", line 71, characters 0-932 - +preprocess_deps is never used - <-- line 71 - (domain, int_mapping, node_vec) [@@dead "+preprocess_deps"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_scc.ml", line 91, characters 0-93 - +is_function_bind is never used - <-- line 91 - | _ -> false [@@dead "+is_function_bind"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_scc.ml", line 96, characters 0-347 - +sort_single_binding_group is never used - <-- line 96 - group [@@dead "+sort_single_binding_group"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_scc.ml", line 109, characters 0-745 - +scc_bindings is never used - <-- line 109 - clusters [] [@@dead "+scc_bindings"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_scc.ml", line 133, characters 0-1025 - +scc is never used - <-- line 133 - clusters body [@@dead "+scc"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_scc.mli", line 1, characters 0-0 - lam_scc is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_scc.mli", line 27, characters 0-44 - +scc_bindings is never used - <-- line 27 - val scc_bindings : bindings -> bindings list [@@dead "+scc_bindings"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_scc.mli", line 29, characters 0-45 - +scc is never used - <-- line 29 - val scc : bindings -> Lam.t -> Lam.t -> Lam.t [@@dead "+scc"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_stats.ml", line 53, characters 0-23 - +pp is never used - <-- line 53 - let pp = Format.fprintf [@@dead "+pp"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_stats.ml", line 58, characters 0-151 - +pp_ident_tbl is never used - <-- line 58 - pp fmt "@[%a -> %a@]@." Ident.print k Lam_id_kind.print v) [@@dead "+pp_ident_tbl"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_stats.ml", line 62, characters 0-207 - +print is never used - <-- line 62 - v.exports [@@dead "+print"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_stats.ml", line 68, characters 0-162 - +make is never used - <-- line 68 - } [@@dead "+make"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_stats.mli", line 41, characters 0-41 - +print is never used - <-- line 41 - val print : Format.formatter -> t -> unit [@@dead "+print"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_stats.mli", line 43, characters 0-75 - +make is never used - <-- line 43 - val make : export_idents:Ident.t list -> export_ident_sets:Set_ident.t -> t [@@dead "+make"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_stats_export.ml", line 1, characters 0-0 - +lam_stats_export is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_stats_export.ml", line 30, characters 0-39 - +single_na is never used - <-- line 30 - let single_na = Js_cmj_format.single_na [@@dead "+single_na"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_stats_export.ml", line 32, characters 0-3023 - +values_of_export is never used - <-- line 32 - Map_string.add acc x.name cmj_value) [@@dead "+values_of_export"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_stats_export.ml", line 111, characters 0-330 - +get_dependent_module_effect is never used - <-- line 111 - else maybe_pure [@@dead "+get_dependent_module_effect"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_stats_export.ml", line 131, characters 0-245 - +export_to_cmj is never used - <-- line 131 - ~case [@@dead "+export_to_cmj"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_stats_export.mli", line 1, characters 0-0 - lam_stats_export is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_stats_export.mli", line 25, characters 0-93 - +get_dependent_module_effect is never used - <-- line 25 - string option -> Lam_module_ident.t list -> string option [@@dead "+get_dependent_module_effect"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_stats_export.mli", line 28, characters 0-131 - +export_to_cmj is never used - <-- line 28 - Js_cmj_format.t [@@dead "+export_to_cmj"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_subst.ml", line 1, characters 0-0 - +lam_subst is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_subst.ml", line 31, characters 0-2245 - +subst is never used - <-- line 31 - subst_aux lam [@@dead "+subst"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_subst.mli", line 1, characters 0-0 - lam_subst is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_subst.mli", line 31, characters 0-47 - +subst is never used - <-- line 31 - val subst : Lam.t Map_ident.t -> Lam.t -> Lam.t [@@dead "+subst"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_util.mli", line 1, characters 0-0 - lam_util is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_util.mli", line 25, characters 0-54 - +kind_of_lambda_block is never used - <-- line 25 - val kind_of_lambda_block : Lam.t list -> Lam_id_kind.t [@@dead "+kind_of_lambda_block"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_util.mli", line 27, characters 0-126 - +field_flatten_get is never used - <-- line 27 - Lam.t [@@dead "+field_flatten_get"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_util.mli", line 52, characters 0-88 - +alias_ident_or_global is never used - <-- line 52 - Lam_stats.t -> Ident.t -> Ident.t -> Lam_id_kind.t -> unit [@@dead "+alias_ident_or_global"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_util.mli", line 55, characters 0-79 - +refine_let is never used - <-- line 55 - val refine_let : kind:Lam_compat.let_kind -> Ident.t -> Lam.t -> Lam.t -> Lam.t [@@dead "+refine_let"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_util.mli", line 57, characters 0-34 - +dump is never used - <-- line 57 - val dump : string -> Lam.t -> unit [@@dead "+dump"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_util.mli", line 60, characters 0-32 - +not_function is never used - <-- line 60 - val not_function : Lam.t -> bool [@@dead "+not_function"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_util.mli", line 62, characters 0-31 - +is_function is never used - <-- line 62 - val is_function : Lam.t -> bool [@@dead "+is_function"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_var_stats.ml", line 26, characters 0-18 - +loop_use is never used - <-- line 26 - let loop_use = 100 [@@dead "+loop_use"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_var_stats.ml", line 42, characters 0-49 - +fresh_stats is never used - <-- line 42 - let fresh_stats : stats = {top = true; times = 0} [@@dead "+fresh_stats"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_var_stats.ml", line 44, characters 0-56 - +sink_stats is never used - <-- line 44 - let sink_stats : stats = {top = false; times = loop_use} [@@dead "+sink_stats"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_var_stats.ml", line 47, characters 0-102 - +top_and_used_zero_or_one is never used - <-- line 47 - | _ -> false [@@dead "+top_and_used_zero_or_one"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_var_stats.ml", line 58, characters 0-183 - +update is never used - <-- line 58 - | Sink -> sink_stats [@@dead "+update"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_var_stats.ml", line 64, characters 0-26 - +sink is never used - <-- line 64 - let sink : position = Sink [@@dead "+sink"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_var_stats.ml", line 66, characters 0-32 - +fresh_env is never used - <-- line 66 - let fresh_env : position = Begin [@@dead "+fresh_env"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_var_stats.ml", line 69, characters 0-147 - +new_position_after_lam is never used - <-- line 69 - else Not_begin [@@dead "+new_position_after_lam"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_var_stats.mli", line 1, characters 0-0 - lam_var_stats is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_var_stats.mli", line 27, characters 0-23 - +fresh_stats is never used - <-- line 27 - val fresh_stats : stats [@@dead "+fresh_stats"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_var_stats.mli", line 29, characters 0-44 - +top_and_used_zero_or_one is never used - <-- line 29 - val top_and_used_zero_or_one : stats -> bool [@@dead "+top_and_used_zero_or_one"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_var_stats.mli", line 33, characters 0-19 - +sink is never used - <-- line 33 - val sink : position [@@dead "+sink"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_var_stats.mli", line 35, characters 0-24 - +fresh_env is never used - <-- line 35 - val fresh_env : position [@@dead "+fresh_env"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_var_stats.mli", line 37, characters 0-58 - +new_position_after_lam is never used - <-- line 37 - val new_position_after_lam : Lam.t -> position -> position [@@dead "+new_position_after_lam"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_var_stats.mli", line 39, characters 0-39 - +update is never used - <-- line 39 - val update : stats -> position -> stats [@@dead "+update"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/polyvar_pattern_match.ml", line 33, characters 0-106 - +polyvar_pattern_match.Coll is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/polyvar_pattern_match.ml", line 36, characters 2-26 - Coll.+equal is never used - <-- line 36 - let equal = Stdlib.( = ) [@@dead "Coll.+equal"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/polyvar_pattern_match.ml", line 38, characters 2-25 - Coll.+hash is never used - <-- line 38 - let hash = Hashtbl.hash [@@dead "Coll.+hash"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/depends/binary_ast.mli", line 29, characters 0-25 - +magic_sep_char is never used - <-- line 29 - val magic_sep_char : char [@@dead "+magic_sep_char"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/depends/bs_exception.ml", line 27, characters 2-26 - error.Js_not_found is a variant case which is never constructed - <-- line 27 - | Js_not_found of string [@dead "error.Js_not_found"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/depends/bs_exception.ml", line 28, characters 2-36 - error.Bs_cyclic_depends is a variant case which is never constructed - <-- line 28 - | Bs_cyclic_depends of string list [@dead "error.Bs_cyclic_depends"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/depends/bs_exception.ml", line 29, characters 2-43 - error.Bs_duplicated_module is a variant case which is never constructed - <-- line 29 - | Bs_duplicated_module of string * string [@dead "error.Bs_duplicated_module"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/depends/bs_exception.ml", line 31, characters 2-34 - error.Bs_package_not_found is a variant case which is never constructed - <-- line 31 - | Bs_package_not_found of string [@dead "error.Bs_package_not_found"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/depends/bs_exception.ml", line 32, characters 2-31 - error.Bs_main_not_exist is a variant case which is never constructed - <-- line 32 - | Bs_main_not_exist of string [@dead "error.Bs_main_not_exist"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/depends/bs_exception.ml", line 33, characters 2-29 - error.Bs_invalid_path is a variant case which is never constructed - <-- line 33 - | Bs_invalid_path of string [@dead "error.Bs_invalid_path"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/depends/bs_exception.ml", line 34, characters 2-35 - error.Missing_ml_dependency is a variant case which is never constructed - <-- line 34 - | Missing_ml_dependency of string [@dead "error.Missing_ml_dependency"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/depends/bs_exception.ml", line 35, characters 2-52 - error.Dependency_script_module_dependent_not is a variant case which is never constructed - <-- line 35 - | Dependency_script_module_dependent_not of string [@dead "error.Dependency_script_module_dependent_not"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/depends/bs_exception.mli", line 27, characters 2-26 - error.Js_not_found is a variant case which is never constructed - <-- line 27 - | Js_not_found of string [@dead "error.Js_not_found"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/depends/bs_exception.mli", line 28, characters 2-36 - error.Bs_cyclic_depends is a variant case which is never constructed - <-- line 28 - | Bs_cyclic_depends of string list [@dead "error.Bs_cyclic_depends"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/depends/bs_exception.mli", line 29, characters 2-43 - error.Bs_duplicated_module is a variant case which is never constructed - <-- line 29 - | Bs_duplicated_module of string * string [@dead "error.Bs_duplicated_module"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/depends/bs_exception.mli", line 31, characters 2-34 - error.Bs_package_not_found is a variant case which is never constructed - <-- line 31 - | Bs_package_not_found of string [@dead "error.Bs_package_not_found"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/depends/bs_exception.mli", line 32, characters 2-31 - error.Bs_main_not_exist is a variant case which is never constructed - <-- line 32 - | Bs_main_not_exist of string [@dead "error.Bs_main_not_exist"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/depends/bs_exception.mli", line 33, characters 2-29 - error.Bs_invalid_path is a variant case which is never constructed - <-- line 33 - | Bs_invalid_path of string [@dead "error.Bs_invalid_path"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/depends/bs_exception.mli", line 34, characters 2-35 - error.Missing_ml_dependency is a variant case which is never constructed - <-- line 34 - | Missing_ml_dependency of string [@dead "error.Missing_ml_dependency"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/depends/bs_exception.mli", line 35, characters 2-52 - error.Dependency_script_module_dependent_not is a variant case which is never constructed - <-- line 35 - | Dependency_script_module_dependent_not of string [@dead "error.Dependency_script_module_dependent_not"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/config.ml", line 7, characters 0-37 - +cmt_magic_number is never used - <-- line 7 - and cmt_magic_number = "Caml1999T022" [@@dead "+cmt_magic_number"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/config.mli", line 30, characters 0-29 - +cmt_magic_number is never used - <-- line 30 - val cmt_magic_number : string [@@dead "+cmt_magic_number"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.ml", line 29, characters 0-200 - +reverse_range is never used - <-- line 29 - done [@@dead "+reverse_range"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.ml", line 59, characters 0-1053 - +of_list_map is never used - <-- line 59 - fill 5 tl [@@dead "+of_list_map"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.ml", line 144, characters 0-135 - +fold_left is never used - <-- line 144 - !r [@@dead "+fold_left"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.mli", line 25, characters 0-50 - +reverse_range is never used - <-- line 25 - val reverse_range : 'a array -> int -> int -> unit [@@dead "+reverse_range"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.mli", line 32, characters 0-51 - +of_list_map is never used - <-- line 32 - val of_list_map : 'a list -> ('a -> 'b) -> 'b array [@@dead "+of_list_map"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_array.mli", line 42, characters 0-56 - +fold_left is never used - <-- line 42 - val fold_left : 'b array -> 'a -> ('a -> 'b -> 'a) -> 'a [@@dead "+fold_left"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_buffer.ml", line 42, characters 0-31 - +is_empty is never used - <-- line 42 - let is_empty b = b.position = 0 [@@dead "+is_empty"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_buffer.mli", line 48, characters 0-24 - +is_empty is never used - <-- line 48 - val is_empty : t -> bool [@@dead "+is_empty"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_char.ml", line 34, characters 0-114 - +is_lower_case is never used - <-- line 34 - || (c >= '\248' && c <= '\254') [@@dead "+is_lower_case"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_char.mli", line 29, characters 0-32 - +is_lower_case is never used - <-- line 29 - val is_lower_case : char -> bool [@@dead "+is_lower_case"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_fmt.ml", line 1, characters 0-0 - +ext_fmt is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_fmt.ml", line 1, characters 0-235 - +with_file_as_pp is never used - <-- line 1 - v) [@@dead "+with_file_as_pp"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_fmt.ml", line 8, characters 0-74 - +failwithf is never used - <-- line 8 - let failwithf ~loc fmt = Format.ksprintf (fun s -> failwith (loc ^ s)) fmt [@@dead "+failwithf"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_fmt.ml", line 10, characters 0-54 - +invalid_argf is never used - <-- line 10 - let invalid_argf fmt = Format.ksprintf invalid_arg fmt [@@dead "+invalid_argf"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_ident.ml", line 35, characters 0-30 - +js_object_flag is never used - <-- line 35 - let js_object_flag = 0b100_000 [@@dead "+js_object_flag"] (* javascript object flags *) - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_ident.ml", line 39, characters 0-63 - +is_js_or_global is never used - <-- line 39 - let is_js_or_global (i : Ident.t) = i.flags land (8 lor 1) <> 0 [@@dead "+is_js_or_global"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_ident.ml", line 41, characters 0-72 - +make_js_object is never used - <-- line 41 - let make_js_object (i : Ident.t) = i.flags <- i.flags lor js_object_flag [@@dead "+make_js_object"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_ident.ml", line 51, characters 0-54 - +create_tmp is never used - <-- line 51 - let create_tmp ?(name = Literals.tmp) () = create name [@@dead "+create_tmp"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_ident.ml", line 166, characters 0-31 - +make_unused is never used - <-- line 166 - let make_unused () = create "_" [@@dead "+make_unused"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_ident.ml", line 172, characters 0-128 - +compare is never used - <-- line 172 - if u = 0 then Ext_string.compare x.name y.name else u [@@dead "+compare"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_ident.ml", line 176, characters 0-116 - +equal is never used - <-- line 176 - if x.stamp <> 0 then x.stamp = y.stamp else y.stamp = 0 && x.name = y.name [@@dead "+equal"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_ident.mli", line 34, characters 0-36 - +make_js_object is never used - <-- line 34 - val make_js_object : Ident.t -> unit [@@dead "+make_js_object"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_ident.mli", line 36, characters 0-48 - +create_tmp is never used - <-- line 36 - val create_tmp : ?name:string -> unit -> Ident.t [@@dead "+create_tmp"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_ident.mli", line 38, characters 0-33 - +make_unused is never used - <-- line 38 - val make_unused : unit -> Ident.t [@@dead "+make_unused"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_ident.mli", line 49, characters 0-37 - +is_js_or_global is never used - <-- line 49 - val is_js_or_global : Ident.t -> bool [@@dead "+is_js_or_global"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_ident.mli", line 51, characters 0-39 - +compare is never used - <-- line 51 - val compare : Ident.t -> Ident.t -> int [@@dead "+compare"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_ident.mli", line 52, characters 0-38 - +equal is never used - <-- line 52 - val equal : Ident.t -> Ident.t -> bool [@@dead "+equal"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_int.ml", line 1, characters 0-0 - +ext_int is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_int.ml", line 27, characters 0-48 - +compare is never used - <-- line 27 - let compare (x : t) (y : t) = Stdlib.compare x y [@@dead "+compare"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_int.ml", line 29, characters 0-33 - +equal is never used - <-- line 29 - let equal (x : t) (y : t) = x = y [@@dead "+equal"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_int.ml", line 31, characters 0-24 - +move is never used - <-- line 31 - let move = 0x1_0000_0000 [@@dead "+move"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_int.ml", line 34, characters 0-105 - +int32_unsigned_to_int is never used - <-- line 34 - if i < 0 then i + move else i [@@dead "+int32_unsigned_to_int"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_int.ml", line 38, characters 0-346 - +int32_pow is never used - <-- line 38 - Int32.of_int truncated [@@dead "+int32_pow"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_int.mli", line 1, characters 0-0 - ext_int is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_int.mli", line 27, characters 0-27 - +compare is never used - <-- line 27 - val compare : t -> t -> int [@@dead "+compare"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_int.mli", line 29, characters 0-26 - +equal is never used - <-- line 29 - val equal : t -> t -> bool [@@dead "+equal"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_int.mli", line 31, characters 0-40 - +int32_unsigned_to_int is never used - <-- line 31 - val int32_unsigned_to_int : int32 -> int [@@dead "+int32_unsigned_to_int"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_int.mli", line 37, characters 0-39 - +int32_pow is never used - <-- line 37 - val int32_pow : int32 -> int32 -> int32 [@@dead "+int32_pow"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_js_file_kind.ml", line 1, characters 0-0 - +ext_js_file_kind is a dead module as all its items are dead. - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_js_file_kind.ml", line 24, characters 12-17 - case.Upper is a variant case which is never constructed - <-- line 24 - type case = Upper [@dead "case.Upper"] | Little - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_js_file_kind.ml", line 24, characters 18-26 - case.Little is a variant case which is never constructed - <-- line 24 - type case = Upper [@dead "case.Upper"] | Little [@dead "case.Little"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_js_file_kind.ml", line 26, characters 10-21 - t.case is a record label never used to read a value - <-- line 26 - type t = {case: case; [@dead "t.case"] suffix: string} [@@warning "-69"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_js_file_kind.ml", line 26, characters 22-36 - t.suffix is a record label never used to read a value - <-- line 26 - type t = {case: case; [@dead "t.case"] suffix: string [@dead "t.suffix"] } [@@warning "-69"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 96, characters 0-767 - +map_snd is never used - <-- line 96 - (v1, y1) :: (v2, y2) :: (v3, y3) :: (v4, y4) :: (v5, y5) :: map_snd tail f [@@dead "+map_snd"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 171, characters 0-355 - +append_aux is never used - <-- line 171 - a0 :: a1 :: a2 :: a3 :: a4 :: append_aux rest l2 [@@dead "+append_aux"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 182, characters 0-73 - +append is never used - <-- line 182 - | _ -> append_aux l1 l2 [@@dead "+append"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 187, characters 0-39 - +append_one is never used - <-- line 187 - let append_one l1 x = append_aux l1 [x] [@@dead "+append_one"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 249, characters 0-856 - +fold_right3 is never used - <-- line 249 - | _, _, _ -> invalid_arg "Ext_list.fold_right2" [@@dead "+fold_right3"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 304, characters 0-133 - +fold_left_with_offset is never used - <-- line 304 - | a :: l -> fold_left_with_offset l (f a accu i) (i + 1) f [@@dead "+fold_left_with_offset"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 362, characters 0-183 - +small_split_at is never used - <-- line 362 - | _ -> invalid_arg "Ext_list.split_at" [@@dead "+small_split_at"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 369, characters 0-40 - +split_at is never used - <-- line 369 - let split_at l n = small_split_at n [] l [@@dead "+split_at"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 374, characters 0-204 - +filter_mapi is never used - <-- line 374 - aux 0 xs [@@dead "+filter_mapi"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 409, characters 0-154 - +length_compare is never used - <-- line 409 - | [] -> if n = 0 then `Eq else `Lt [@@dead "+length_compare"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 416, characters 0-124 - +length_ge is never used - <-- line 416 - else true [@@dead "+length_ge"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 426, characters 0-171 - +length_larger_than_n is never used - <-- line 426 - | [], _ -> false [@@dead "+length_larger_than_n"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 432, characters 0-111 - +group is never used - <-- line 432 - | x :: xs -> aux eq x (group eq xs) [@@dead "+group"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 437, characters 0-228 - +aux is never used - <-- line 437 - | _ :: _ -> assert false [@@dead "+aux"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 445, characters 0-45 - +stable_group is never used - <-- line 445 - let stable_group lst eq = group eq lst |> rev [@@dead "+stable_group"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 452, characters 0-117 - +find_first_not is never used - <-- line 452 - | a :: l -> if p a then find_first_not l p else Some a [@@dead "+find_first_not"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 510, characters 0-101 - +for_all_snd is never used - <-- line 510 - | (_, a) :: l -> p a && for_all_snd l p [@@dead "+for_all_snd"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 537, characters 0-776 - +split_map is never used - <-- line 537 - (a1 :: a2 :: a3 :: a4 :: a5 :: ass, b1 :: b2 :: b3 :: b4 :: b5 :: bss) [@@dead "+split_map"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 567, characters 0-103 - +sort_via_array is never used - <-- line 567 - Array.to_list arr [@@dead "+sort_via_array"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 577, characters 0-214 - +assoc_by_string is never used - <-- line 577 - | (k1, v1) :: rest -> if k1 = k then v1 else assoc_by_string rest k def [@@dead "+assoc_by_string"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 585, characters 0-205 - +assoc_by_int is never used - <-- line 585 - | (k1, v1) :: rest -> if k1 = k then v1 else assoc_by_int rest k def [@@dead "+assoc_by_int"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 593, characters 0-109 - +nth_aux is never used - <-- line 593 - | a :: l -> if n = 0 then Some a else nth_aux l (n - 1) [@@dead "+nth_aux"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 598, characters 0-53 - +nth_opt is never used - <-- line 598 - let nth_opt l n = if n < 0 then None else nth_aux l n [@@dead "+nth_opt"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 600, characters 0-101 - +iter_snd is never used - <-- line 600 - iter_snd xs f [@@dead "+iter_snd"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 607, characters 0-101 - +iter_fst is never used - <-- line 607 - iter_fst xs f [@@dead "+iter_fst"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 624, characters 0-96 - +exists_snd is never used - <-- line 624 - | (_, a) :: l -> p a || exists_snd l p [@@dead "+exists_snd"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 629, characters 0-143 - +concat_append is never used - <-- line 629 - | l :: r -> append l (concat_append r xs) [@@dead "+concat_append"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 639, characters 0-180 - +fold_left2 is never used - <-- line 639 - | _, _ -> invalid_arg "Ext_list.fold_left2" [@@dead "+fold_left2"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.ml", line 645, characters 0-73 - +singleton_exn is never used - <-- line 645 - | _ -> assert false [@@dead "+singleton_exn"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 37, characters 0-60 - +map_snd is never used - <-- line 37 - val map_snd : ('a * 'b) list -> ('b -> 'c) -> ('a * 'c) list [@@dead "+map_snd"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 52, characters 0-42 - +append is never used - <-- line 52 - val append : 'a list -> 'a list -> 'a list [@@dead "+append"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 54, characters 0-41 - +append_one is never used - <-- line 54 - val append_one : 'a list -> 'a -> 'a list [@@dead "+append_one"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 62, characters 0-93 - +fold_right3 is never used - <-- line 62 - 'a list -> 'b list -> 'c list -> 'd -> ('a -> 'b -> 'c -> 'd -> 'd) -> 'd [@@dead "+fold_right3"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 67, characters 0-91 - +fold_left_with_offset is never used - <-- line 67 - 'a list -> 'acc -> int -> ('a -> 'acc -> int -> 'acc) -> 'acc [@@dead "+fold_left_with_offset"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 77, characters 0-50 - +split_at is never used - <-- line 77 - val split_at : 'a list -> int -> 'a list * 'a list [@@dead "+split_at"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 83, characters 0-64 - +filter_mapi is never used - <-- line 83 - val filter_mapi : 'a list -> ('a -> int -> 'b option) -> 'b list [@@dead "+filter_mapi"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 85, characters 0-56 - +length_compare is never used - <-- line 85 - val length_compare : 'a list -> int -> [`Gt | `Eq | `Lt] [@@dead "+length_compare"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 87, characters 0-38 - +length_ge is never used - <-- line 87 - val length_ge : 'a list -> int -> bool [@@dead "+length_ge"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 96, characters 0-60 - +length_larger_than_n is never used - <-- line 96 - val length_larger_than_n : 'a list -> 'a list -> int -> bool [@@dead "+length_larger_than_n"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 108, characters 0-64 - +stable_group is never used - <-- line 108 - val stable_group : 'a list -> ('a -> 'a -> bool) -> 'a list list [@@dead "+stable_group"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 126, characters 0-57 - +find_first_not is never used - <-- line 126 - val find_first_not : 'a list -> ('a -> bool) -> 'a option [@@dead "+find_first_not"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 147, characters 0-56 - +for_all_snd is never used - <-- line 147 - val for_all_snd : ('a * 'b) list -> ('b -> bool) -> bool [@@dead "+for_all_snd"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 155, characters 0-63 - +split_map is never used - <-- line 155 - val split_map : 'a list -> ('a -> 'b * 'c) -> 'b list * 'c list [@@dead "+split_map"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 158, characters 0-60 - +sort_via_array is never used - <-- line 158 - val sort_via_array : 'a list -> ('a -> 'a -> int) -> 'a list [@@dead "+sort_via_array"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 162, characters 0-69 - +assoc_by_string is never used - <-- line 162 - val assoc_by_string : (string * 'a) list -> string -> 'a option -> 'a [@@dead "+assoc_by_string"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 169, characters 0-60 - +assoc_by_int is never used - <-- line 169 - val assoc_by_int : (int * 'a) list -> int -> 'a option -> 'a [@@dead "+assoc_by_int"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 171, characters 0-41 - +nth_opt is never used - <-- line 171 - val nth_opt : 'a list -> int -> 'a option [@@dead "+nth_opt"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 173, characters 0-53 - +iter_snd is never used - <-- line 173 - val iter_snd : ('a * 'b) list -> ('b -> unit) -> unit [@@dead "+iter_snd"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 175, characters 0-53 - +iter_fst is never used - <-- line 175 - val iter_fst : ('a * 'b) list -> ('a -> unit) -> unit [@@dead "+iter_fst"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 181, characters 0-55 - +exists_snd is never used - <-- line 181 - val exists_snd : ('a * 'b) list -> ('b -> bool) -> bool [@@dead "+exists_snd"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 183, characters 0-54 - +concat_append is never used - <-- line 183 - val concat_append : 'a list list -> 'a list -> 'a list [@@dead "+concat_append"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 185, characters 0-73 - +fold_left2 is never used - <-- line 185 - val fold_left2 : 'a list -> 'b list -> 'c -> ('a -> 'b -> 'c -> 'c) -> 'c [@@dead "+fold_left2"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 189, characters 0-33 - +singleton_exn is never used - <-- line 189 - val singleton_exn : 'a list -> 'a [@@dead "+singleton_exn"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_modulename.ml", line 1, characters 0-0 - +ext_modulename is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_modulename.ml", line 25, characters 0-363 - +good_hint_name is never used - <-- line 25 - | _ -> false) [@@dead "+good_hint_name"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_modulename.ml", line 36, characters 0-381 - +collect_start is never used - <-- line 36 - | _ -> collect_start buf s next len [@@dead "+collect_start"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_modulename.ml", line 49, characters 0-341 - +collect_next is never used - <-- line 49 - | _ -> collect_next buf s next len [@@dead "+collect_next"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_modulename.ml", line 68, characters 0-836 - +js_id_name_of_hint_name is never used - <-- line 68 - if Ext_buffer.is_empty buf then module_name else Ext_buffer.contents buf [@@dead "+js_id_name_of_hint_name"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_modulename.mli", line 1, characters 0-0 - ext_modulename is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_modulename.mli", line 25, characters 0-46 - +js_id_name_of_hint_name is never used - <-- line 25 - val js_id_name_of_hint_name : string -> string [@@dead "+js_id_name_of_hint_name"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_namespace.ml", line 33, characters 0-147 - +change_ext_ns_suffix is never used - <-- line 33 - if i < 0 then name ^ ext else String.sub name 0 i ^ ext [@@dead "+change_ext_ns_suffix"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_namespace.ml", line 44, characters 0-208 - +js_name_of_modulename is never used - <-- line 44 - change_ext_ns_suffix s suffix [@@dead "+js_name_of_modulename"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_namespace.ml", line 59, characters 0-352 - +is_valid_npm_package_name is never used - <-- line 59 - | _ -> false [@@dead "+is_valid_npm_package_name"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_namespace.ml", line 72, characters 0-598 - +namespace_of_package_name is never used - <-- line 72 - Ext_buffer.contents buf [@@dead "+namespace_of_package_name"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_namespace.mli", line 34, characters 0-53 - +change_ext_ns_suffix is never used - <-- line 34 - val change_ext_ns_suffix : string -> string -> string [@@dead "+change_ext_ns_suffix"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_namespace.mli", line 36, characters 0-79 - +js_name_of_modulename is never used - <-- line 36 - val js_name_of_modulename : string -> Ext_js_file_kind.case -> string -> string [@@dead "+js_name_of_modulename"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_namespace.mli", line 48, characters 0-46 - +is_valid_npm_package_name is never used - <-- line 48 - val is_valid_npm_package_name : string -> bool [@@dead "+is_valid_npm_package_name"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_namespace.mli", line 50, characters 0-48 - +namespace_of_package_name is never used - <-- line 50 - val namespace_of_package_name : string -> string [@@dead "+namespace_of_package_name"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_option.ml", line 25, characters 0-70 - +map is never used - <-- line 25 - | Some x -> Some (f x) [@@dead "+map"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_option.ml", line 35, characters 0-67 - +exists is never used - <-- line 35 - | Some x -> f x [@@dead "+exists"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_option.mli", line 27, characters 0-46 - +map is never used - <-- line 27 - val map : 'a option -> ('a -> 'b) -> 'b option [@@dead "+map"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_option.mli", line 31, characters 0-46 - +exists is never used - <-- line 31 - val exists : 'a option -> ('a -> bool) -> bool [@@dead "+exists"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_path.ml", line 33, characters 0-324 - +split_by_sep_per_os is never used - <-- line 33 - else fun x -> Ext_string.split x '/' [@@dead "+split_by_sep_per_os"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_path.ml", line 44, characters 0-882 - +node_relative_path is never used - <-- line 44 - | ys -> String.concat Literals.node_sep @@ (Literals.node_current :: ys) [@@dead "+node_relative_path"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_path.ml", line 69, characters 0-58 - +node_concat is never used - <-- line 69 - let node_concat ~dir base = dir ^ Literals.node_sep ^ base [@@dead "+node_concat"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_path.ml", line 71, characters 0-178 - +node_rebase_file is never used - <-- line 71 - file [@@dead "+node_rebase_file"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_path.ml", line 118, characters 0-285 - +package_dir is never used - <-- line 118 - cli/bsc.js." [@@dead "+package_dir"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_path.mli", line 27, characters 0-68 - +node_rebase_file is never used - <-- line 27 - val node_rebase_file : from:string -> to_:string -> string -> string [@@dead "+node_rebase_file"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_path.mli", line 36, characters 0-32 - +package_dir is never used - <-- line 36 - val package_dir : unit -> string [@@dead "+package_dir"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_pervasives.ml", line 39, characters 0-87 - +with_file_as_chan is never used - <-- line 39 - finally (open_out_bin filename) ~clean:close_out f [@@dead "+with_file_as_chan"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_pervasives.ml", line 69, characters 0-221 - +int_of_string_aux is never used - <-- line 69 - else -1 [@@dead "+int_of_string_aux"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_pervasives.ml", line 77, characters 0-134 - +nat_of_string_exn is never used - <-- line 77 - if acc < 0 then invalid_arg s else acc [@@dead "+nat_of_string_exn"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_pervasives.ml", line 82, characters 0-441 - +parse_nat_of_string is never used - <-- line 82 - !acc [@@dead "+parse_nat_of_string"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_pervasives.mli", line 34, characters 0-59 - +with_file_as_chan is never used - <-- line 34 - val with_file_as_chan : string -> (out_channel -> 'a) -> 'a [@@dead "+with_file_as_chan"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_pervasives.mli", line 51, characters 0-37 - +nat_of_string_exn is never used - <-- line 51 - val nat_of_string_exn : string -> int [@@dead "+nat_of_string_exn"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_pervasives.mli", line 53, characters 0-50 - +parse_nat_of_string is never used - <-- line 53 - val parse_nat_of_string : string -> int ref -> int [@@dead "+parse_nat_of_string"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_pp.ml", line 40, characters 0-217 - +from_channel is never used - <-- line 40 - } [@@dead "+from_channel"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_pp.ml", line 162, characters 0-67 - +brace_group is never used - <-- line 162 - let brace_group st n action = group st n (fun _ -> brace st action) [@@dead "+brace_group"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_pp.mli", line 59, characters 0-48 - +brace_group is never used - <-- line 59 - val brace_group : t -> int -> (unit -> 'a) -> 'a [@@dead "+brace_group"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_pp.mli", line 71, characters 0-35 - +from_channel is never used - <-- line 71 - val from_channel : out_channel -> t [@@dead "+from_channel"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_scc.mli", line 27, characters 0-44 - +graph is never used - <-- line 27 - val graph : Vec_int.t array -> Int_vec_vec.t [@@dead "+graph"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_sys.mli", line 1, characters 0-0 - ext_sys is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_sys.mli", line 25, characters 0-40 - +is_directory_no_exn is never used - <-- line 25 - val is_directory_no_exn : string -> bool [@@dead "+is_directory_no_exn"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_sys.mli", line 27, characters 0-31 - +is_windows_or_cygwin is never used - <-- line 27 - val is_windows_or_cygwin : bool [@@dead "+is_windows_or_cygwin"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_util.ml", line 31, characters 0-123 - +power_2_above is never used - <-- line 31 - else power_2_above (x * 2) n [@@dead "+power_2_above"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_util.mli", line 25, characters 0-37 - +power_2_above is never used - <-- line 25 - val power_2_above : int -> int -> int [@@dead "+power_2_above"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_gen.ml", line 21, characters 2-78 - bucket.Cons is a variant case which is never constructed - <-- line 21 - | Cons of {mutable key: 'a; mutable data: 'b; mutable next: ('a, 'b) bucket} [@dead "bucket.Cons"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_gen.ml", line 31, characters 0-135 - +create is never used - <-- line 31 - {initial_size = s; size = 0; data = Array.make s Empty} [@@dead "+create"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_gen.ml", line 35, characters 0-132 - +clear is never used - <-- line 35 - done [@@dead "+clear"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_gen.ml", line 42, characters 0-72 - +reset is never used - <-- line 42 - h.data <- Array.make h.initial_size Empty [@@dead "+reset"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_gen.ml", line 46, characters 0-21 - +length is never used - <-- line 46 - let length h = h.size [@@dead "+length"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_gen.ml", line 48, characters 0-907 - +resize is never used - <-- line 48 - done) [@@dead "+resize"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_gen.ml", line 76, characters 0-230 - +iter is never used - <-- line 76 - done [@@dead "+iter"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_gen.ml", line 88, characters 0-294 - +fold is never used - <-- line 88 - !accu [@@dead "+fold"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_gen.ml", line 101, characters 0-63 - +to_list is never used - <-- line 101 - let to_list h f = fold h [] (fun k data acc -> f k data :: acc) [@@dead "+to_list"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_gen.ml", line 103, characters 0-347 - +small_bucket_mem is never used - <-- line 103 - | Cons lst -> eq key lst.key || small_bucket_mem lst.next eq key)) [@@dead "+small_bucket_mem"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_gen.ml", line 118, characters 0-473 - +small_bucket_opt is never used - <-- line 118 - else small_bucket_opt eq key lst.next)) [@@dead "+small_bucket_opt"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_gen.ml", line 135, characters 0-454 - +small_bucket_key_opt is never used - <-- line 135 - if eq key k then Some k else small_bucket_key_opt eq key next)) [@@dead "+small_bucket_key_opt"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_gen.ml", line 151, characters 0-480 - +small_bucket_default is never used - <-- line 151 - else small_bucket_default eq key default lst.next)) [@@dead "+small_bucket_default"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_gen.ml", line 168, characters 0-362 - +remove_bucket is never used - <-- line 168 - else remove_bucket h i key ~prec:buck next eq_key [@@dead "+remove_bucket"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_gen.ml", line 180, characters 0-256 - +replace_bucket is never used - <-- line 180 - else replace_bucket key data slot.next eq_key [@@dead "+replace_bucket"] + Warning Dead Type + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_js_file_kind.ml", line 26, characters 10-21 + t.case is a record label never used to read a value + <-- line 26 + type t = {case: case; [@dead "t.case"] suffix: string} [@@warning "-69"] Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_set_gen.ml", line 28, characters 23-75 - bucket.Cons is a variant case which is never constructed - <-- line 28 - type 'a bucket = Empty | Cons of {mutable key: 'a; mutable next: 'a bucket} [@dead "bucket.Cons"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_set_gen.ml", line 38, characters 0-135 - +create is never used - <-- line 38 - {initial_size = s; size = 0; data = Array.make s Empty} [@@dead "+create"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_set_gen.ml", line 42, characters 0-132 - +clear is never used - <-- line 42 - done [@@dead "+clear"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_set_gen.ml", line 49, characters 0-72 - +reset is never used - <-- line 49 - h.data <- Array.make h.initial_size Empty [@@dead "+reset"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_set_gen.ml", line 53, characters 0-21 - +length is never used - <-- line 53 - let length h = h.size [@@dead "+length"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_set_gen.ml", line 55, characters 0-907 - +resize is never used - <-- line 55 - done) [@@dead "+resize"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_set_gen.ml", line 83, characters 0-223 - +iter is never used - <-- line 83 - done [@@dead "+iter"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_set_gen.ml", line 95, characters 0-287 - +fold is never used - <-- line 95 - !accu [@@dead "+fold"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_set_gen.ml", line 108, characters 0-39 - +to_list is never used - <-- line 108 - let to_list set = fold set [] List.cons [@@dead "+to_list"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_set_gen.ml", line 110, characters 0-334 - +small_bucket_mem is never used - <-- line 110 - | Cons lst -> eq key lst.key || small_bucket_mem eq key lst.next)) [@@dead "+small_bucket_mem"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_set_gen.ml", line 125, characters 0-370 - +remove_bucket is never used - <-- line 125 - else remove_bucket h i key ~prec:buck next eq_key [@@dead "+remove_bucket"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_set_ident_mask.ml", line 37, characters 0-130 - +key_index_by_ident is never used - <-- line 37 - Bs_hash_stubs.hash_string_int key.name key.stamp land (Array.length h.data - 1) [@@dead "+key_index_by_ident"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_set_ident_mask.ml", line 40, characters 0-131 - +create is never used - <-- line 40 - {size = 0; data = Array.make s Empty; mask_size = 0} [@@dead "+create"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_set_ident_mask.ml", line 44, characters 0-526 - +iter_and_unmask is never used - <-- line 44 - done [@@dead "+iter_and_unmask"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_set_ident_mask.ml", line 65, characters 0-381 - +small_bucket_mem is never used - <-- line 65 - Ext_ident.equal key rst.ident || small_bucket_mem key rst.rest)) [@@dead "+small_bucket_mem"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_set_ident_mask.ml", line 81, characters 0-634 - +resize is never used - <-- line 81 - done) [@@dead "+resize"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_set_ident_mask.ml", line 101, characters 0-394 - +add_unmask is never used - <-- line 101 - if h.size > Array.length h_data lsl 1 then resize key_index_by_ident h) [@@dead "+add_unmask"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_set_ident_mask.ml", line 111, characters 0-745 - +small_bucket_mask is never used - <-- line 111 - else small_bucket_mask key rst.rest)) [@@dead "+small_bucket_mask"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_set_ident_mask.ml", line 140, characters 0-194 - +mask_and_check_all_hit is never used - <-- line 140 - h.size = h.mask_size [@@dead "+mask_and_check_all_hit"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_set_ident_mask.mli", line 1, characters 0-0 - hash_set_ident_mask is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_set_ident_mask.mli", line 6, characters 0-21 - +create is never used - <-- line 6 - val create : int -> t [@@dead "+create"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_set_ident_mask.mli", line 11, characters 0-35 - +add_unmask is never used - <-- line 11 - val add_unmask : t -> ident -> unit [@@dead "+add_unmask"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_set_ident_mask.mli", line 13, characters 0-47 - +mask_and_check_all_hit is never used - <-- line 13 - val mask_and_check_all_hit : t -> ident -> bool [@@dead "+mask_and_check_all_hit"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_set_ident_mask.mli", line 18, characters 0-58 - +iter_and_unmask is never used - <-- line 18 - val iter_and_unmask : t -> (ident -> bool -> unit) -> unit [@@dead "+iter_and_unmask"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_set_poly.mli", line 29, characters 0-24 - +clear is never used - <-- line 29 - val clear : 'a t -> unit [@@dead "+clear"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_set_poly.mli", line 31, characters 0-24 - +reset is never used - <-- line 31 - val reset : 'a t -> unit [@@dead "+reset"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_set_poly.mli", line 37, characters 0-31 - +remove is never used - <-- line 37 - val remove : 'a t -> 'a -> unit [@@dead "+remove"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_set_poly.mli", line 41, characters 0-39 - +iter is never used - <-- line 41 - val iter : 'a t -> ('a -> unit) -> unit [@@dead "+iter"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_set_poly.mli", line 43, characters 0-29 - +to_list is never used - <-- line 43 - val to_list : 'a t -> 'a list [@@dead "+to_list"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_set_poly.mli", line 45, characters 0-24 - +length is never used - <-- line 45 - val length : 'a t -> int [@@dead "+length"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ident.ml", line 44, characters 0-56 - +unique_name is never used - <-- line 44 - let unique_name i = i.name ^ "_" ^ string_of_int i.stamp [@@dead "+unique_name"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ident.ml", line 50, characters 0-35 - +equal is never used - <-- line 50 - let equal i1 i2 = i1.name = i2.name [@@dead "+equal"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ident.ml", line 72, characters 0-55 - +is_predef_exn is never used - <-- line 72 - let is_predef_exn i = i.flags land predef_exn_flag <> 0 [@@dead "+is_predef_exn"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ident.ml", line 74, characters 0-178 - +print is never used - <-- line 74 - | n -> fprintf ppf "%s/%i%s" i.name n (if global i then "g" else "") [@@dead "+print"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ident.ml", line 219, characters 0-161 - +compare is never used - <-- line 219 - if c <> 0 then c else compare x.flags y.flags [@@dead "+compare"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ident.ml", line 226, characters 0-52 - +output is never used - <-- line 226 - let output oc id = output_string oc (unique_name id) [@@dead "+output"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ident.ml", line 227, characters 0-46 - +hash is never used - <-- line 227 - let hash i = Char.code i.name.[0] lxor i.stamp [@@dead "+hash"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ident.ml", line 229, characters 0-26 - +original_equal is never used - <-- line 229 - let original_equal = equal [@@dead "+original_equal"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ident.ml", line 232, characters 2-23 - +compare is never used - <-- line 232 - let compare = compare [@@dead "+compare"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ident.ml", line 233, characters 2-21 - +output is never used - <-- line 233 - let output = output [@@dead "+output"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ident.ml", line 234, characters 2-19 - +print is never used - <-- line 234 - let print = print [@@dead "+print"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ident.ml", line 235, characters 2-17 - +hash is never used - <-- line 235 - let hash = hash [@@dead "+hash"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ident.ml", line 236, characters 2-18 - +equal is never used - <-- line 236 - let equal = same [@@dead "+equal"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ident.ml", line 238, characters 0-26 - +equal is never used - <-- line 238 - let equal = original_equal [@@dead "+equal"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ident.mli", line 32, characters 0-29 - +unique_name is never used - <-- line 32 - val unique_name : t -> string [@@dead "+unique_name"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ident.mli", line 42, characters 0-27 - +compare is never used - <-- line 42 - val compare : t -> t -> int [@@dead "+compare"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ident.mli", line 51, characters 0-29 - +is_predef_exn is never used - <-- line 51 - val is_predef_exn : t -> bool [@@dead "+is_predef_exn"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/identifiable.ml", line 20, characters 10-45 - Make.+hash is never used - <-- line 20 - include Hashtbl.HashedType with type t := t [@@dead "Make.+hash"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/identifiable.ml", line 21, characters 10-42 - Make.+compare is never used - <-- line 21 - include Map.OrderedType with type t := t [@@dead "Make.+compare"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/identifiable.mli", line 98, characters 26-46 - identifiable.Make.Tbl is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/identifiable.mli", line 98, characters 26-46 - Make.Tbl.+map is never used - <-- line 98 - module Make (T : Thing) : S with type t := T.t [@@dead "Make.Tbl.+map"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/int_vec_util.ml", line 1, characters 0-0 - +int_vec_util is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/int_vec_util.ml", line 25, characters 0-182 - +unsafe_mem_aux is never used - <-- line 25 - else false [@@dead "+unsafe_mem_aux"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/int_vec_util.ml", line 31, characters 0-167 - +mem is never used - <-- line 31 - unsafe_mem_aux internal_array 0 key (len - 1) [@@dead "+mem"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/int_vec_util.mli", line 1, characters 0-0 - int_vec_util is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/int_vec_util.mli", line 25, characters 0-34 - +mem is never used - <-- line 25 - val mem : int -> Vec_int.t -> bool [@@dead "+mem"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/int_vec_vec.ml", line 1, characters 0-0 - +int_vec_vec is a dead module as all its items are dead. - - Warning Dead Value With Side Effects - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/int_vec_vec.ml", line 28, characters 2-29 - +null is never used and could have side effects + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_js_file_kind.ml", line 26, characters 22-36 + t.suffix is a record label never used to read a value + <-- line 26 + type t = {case: case; [@dead "t.case"] suffix: string [@dead "t.suffix"] } [@@warning "-69"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 25, characters 0-29 - +js_type_number is never used - <-- line 25 - let js_type_number = "number" [@@dead "+js_type_number"] + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 85, characters 0-56 + +length_compare is never used + <-- line 85 + val length_compare : 'a list -> int -> [`Gt | `Eq | `Lt] [@@dead "+length_compare"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 27, characters 0-29 - +js_type_string is never used - <-- line 27 - let js_type_string = "string" [@@dead "+js_type_string"] + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_namespace.ml", line 59, characters 0-352 + +is_valid_npm_package_name is never used + <-- line 59 + | _ -> false [@@dead "+is_valid_npm_package_name"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 29, characters 0-29 - +js_type_object is never used - <-- line 29 - let js_type_object = "object" [@@dead "+js_type_object"] + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_namespace.ml", line 72, characters 0-598 + +namespace_of_package_name is never used + <-- line 72 + Ext_buffer.contents buf [@@dead "+namespace_of_package_name"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 31, characters 0-31 - +js_type_boolean is never used - <-- line 31 - let js_type_boolean = "boolean" [@@dead "+js_type_boolean"] + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_namespace.mli", line 48, characters 0-46 + +is_valid_npm_package_name is never used + <-- line 48 + val is_valid_npm_package_name : string -> bool [@@dead "+is_valid_npm_package_name"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 33, characters 0-19 - +param is never used - <-- line 33 - let param = "param" [@@dead "+param"] + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_namespace.mli", line 50, characters 0-48 + +namespace_of_package_name is never used + <-- line 50 + val namespace_of_package_name : string -> string [@@dead "+namespace_of_package_name"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 35, characters 0-31 - +partial_arg is never used - <-- line 35 - let partial_arg = "partial_arg" [@@dead "+partial_arg"] + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_pervasives.ml", line 69, characters 0-221 + +int_of_string_aux is never used + <-- line 69 + else -1 [@@dead "+int_of_string_aux"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 37, characters 0-15 - +tmp is never used - <-- line 37 - let tmp = "tmp" [@@dead "+tmp"] + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_pervasives.ml", line 77, characters 0-134 + +nat_of_string_exn is never used + <-- line 77 + if acc < 0 then invalid_arg s else acc [@@dead "+nat_of_string_exn"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 39, characters 0-21 - +create is never used - <-- line 39 - let create = "create" [@@dead "+create"] (* {!Caml_exceptions.create}*) - - Warning Dead Value With Side Effects - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 43, characters 0-51 - +setter_suffix_len is never used and could have side effects + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_pervasives.ml", line 82, characters 0-441 + +parse_nat_of_string is never used + <-- line 82 + !acc [@@dead "+parse_nat_of_string"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 45, characters 0-25 - +debugger is never used - <-- line 45 - let debugger = "debugger" [@@dead "+debugger"] + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_pervasives.mli", line 51, characters 0-37 + +nat_of_string_exn is never used + <-- line 51 + val nat_of_string_exn : string -> int [@@dead "+nat_of_string_exn"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 64, characters 0-18 - +node_sep is never used - <-- line 64 - let node_sep = "/" [@@dead "+node_sep"] + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_pervasives.mli", line 53, characters 0-50 + +parse_nat_of_string is never used + <-- line 53 + val parse_nat_of_string : string -> int ref -> int [@@dead "+parse_nat_of_string"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 66, characters 0-22 - +node_parent is never used - <-- line 66 - let node_parent = ".." [@@dead "+node_parent"] + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_sys.mli", line 25, characters 0-40 + +is_directory_no_exn is never used + <-- line 25 + val is_directory_no_exn : string -> bool [@@dead "+is_directory_no_exn"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 68, characters 0-22 - +node_current is never used - <-- line 68 - let node_current = "." [@@dead "+node_current"] + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_set_poly.mli", line 29, characters 0-24 + +clear is never used + <-- line 29 + val clear : 'a t -> unit [@@dead "+clear"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 92, characters 0-22 - +pure is never used - <-- line 92 - let pure = "@__PURE__" [@@dead "+pure"] + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_set_poly.mli", line 31, characters 0-24 + +reset is never used + <-- line 31 + val reset : 'a t -> unit [@@dead "+reset"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.ml", line 32, characters 0-17 - +empty is never used - <-- line 32 - let empty = Empty [@@dead "+empty"] + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_set_poly.mli", line 37, characters 0-31 + +remove is never used + <-- line 37 + val remove : 'a t -> 'a -> unit [@@dead "+remove"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.ml", line 34, characters 0-226 - +map is never used - <-- line 34 - Node {x with l = l'; v = d'; r = r'} [@@dead "+map"] + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_set_poly.mli", line 41, characters 0-39 + +iter is never used + <-- line 41 + val iter : 'a t -> ('a -> unit) -> unit [@@dead "+iter"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.ml", line 44, characters 0-236 - +mapi is never used - <-- line 44 - Node {x with l = l'; v = v'; r = r'} [@@dead "+mapi"] + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_set_poly.mli", line 43, characters 0-29 + +to_list is never used + <-- line 43 + val to_list : 'a t -> 'a list [@@dead "+to_list"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.ml", line 54, characters 0-60 - +calc_height is never used - <-- line 54 - let[@inline] calc_height a b = (if a >= b then a else b) + 1 [@@dead "+calc_height"] + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_set_poly.mli", line 45, characters 0-24 + +length is never used + <-- line 45 + val length : 'a t -> int [@@dead "+length"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.ml", line 56, characters 0-40 - +singleton is never used - <-- line 56 - let[@inline] singleton k v = Leaf {k; v} [@@dead "+singleton"] + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ident.ml", line 50, characters 0-35 + +equal is never used + <-- line 50 + let equal i1 i2 = i1.name = i2.name [@@dead "+equal"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.ml", line 58, characters 0-79 - +height is never used - <-- line 58 - | Node {h} -> h [@@dead "+height"] + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ident.ml", line 229, characters 0-26 + +original_equal is never used + <-- line 229 + let original_equal = equal [@@dead "+original_equal"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.ml", line 63, characters 0-57 - +unsafe_node is never used - <-- line 63 - let[@inline] unsafe_node k v l r h = Node {l; k; v; r; h} [@@dead "+unsafe_node"] + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ident.ml", line 238, characters 0-26 + +equal is never used + <-- line 238 + let equal = original_equal [@@dead "+equal"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/identifiable.mli", line 98, characters 26-46 + identifiable.Make.Tbl is a dead module as all its items are dead. Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.ml", line 65, characters 0-92 - +unsafe_two_elements is never used - <-- line 65 - unsafe_node k2 v2 (singleton k1 v1) empty 2 [@@dead "+unsafe_two_elements"] + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/identifiable.mli", line 98, characters 26-46 + Make.Tbl.+map is never used + <-- line 98 + module Make (T : Thing) : S with type t := T.t [@@dead "Make.Tbl.+map"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.ml", line 68, characters 0-101 - +unsafe_node_maybe_leaf is never used - <-- line 68 - if h = 1 then Leaf {k; v} else Node {l; k; v; r; h} [@@dead "+unsafe_node_maybe_leaf"] + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 45, characters 0-25 + +debugger is never used + <-- line 45 + let debugger = "debugger" [@@dead "+debugger"] Warning Dead Type File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.ml", line 72, characters 2-9 @@ -9269,138 +2207,6 @@ <-- line 74 | Node of {l: ('key, 'a) t; k: 'key; v: 'a; r: ('key, 'a) t; h: int} [@dead "t.Node"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.ml", line 76, characters 0-135 - +cardinal_aux is never used - <-- line 76 - | Node {l; r} -> cardinal_aux (cardinal_aux (acc + 1) r) l [@@dead "+cardinal_aux"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.ml", line 81, characters 0-33 - +cardinal is never used - <-- line 81 - let cardinal s = cardinal_aux 0 s [@@dead "+cardinal"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.ml", line 83, characters 0-160 - +bindings_aux is never used - <-- line 83 - | Node {l; k; v; r} -> bindings_aux ((k, v) :: bindings_aux accu r) l [@@dead "+bindings_aux"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.ml", line 88, characters 0-34 - +bindings is never used - <-- line 88 - let bindings s = bindings_aux [] s [@@dead "+bindings"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.ml", line 90, characters 0-300 - +fill_array_with_f is never used - <-- line 90 - fill_array_with_f r (inext + 1) arr f [@@dead "+fill_array_with_f"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.ml", line 101, characters 0-283 - +fill_array_aux is never used - <-- line 101 - fill_array_aux r (inext + 1) arr [@@dead "+fill_array_aux"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.ml", line 112, characters 0-289 - +to_sorted_array is never used - <-- line 112 - arr [@@dead "+to_sorted_array"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.ml", line 122, characters 0-328 - +to_sorted_array_with_f is never used - <-- line 122 - arr [@@dead "+to_sorted_array_with_f"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.ml", line 133, characters 0-132 - +keys_aux is never used - <-- line 133 - | Node {l; k; r} -> keys_aux (k :: keys_aux accu r) l [@@dead "+keys_aux"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.ml", line 138, characters 0-26 - +keys is never used - <-- line 138 - let keys s = keys_aux [] s [@@dead "+keys"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.ml", line 140, characters 0-1481 - +bal is never used - <-- line 140 - else unsafe_node_maybe_leaf x d l r (calc_height hl hr) [@@dead "+bal"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.ml", line 183, characters 0-65 - +is_empty is never used - <-- line 183 - | _ -> false [@@dead "+is_empty"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.ml", line 187, characters 0-196 - +min_binding_exn is never used - <-- line 187 - | Leaf _ | Node _ -> min_binding_exn l) [@@dead "+min_binding_exn"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.ml", line 195, characters 0-190 - +remove_min_binding is never used - <-- line 195 - | Node {l; k; v; r} -> bal (remove_min_binding l) k v r [@@dead "+remove_min_binding"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.ml", line 201, characters 0-163 - +merge is never used - <-- line 201 - bal t1 x d (remove_min_binding t2) [@@dead "+merge"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.ml", line 209, characters 0-146 - +iter is never used - <-- line 209 - iter r f [@@dead "+iter"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.ml", line 218, characters 0-144 - +fold is never used - <-- line 218 - | Node {l; k; v; r} -> fold r (f k v (fold l accu f)) f [@@dead "+fold"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.ml", line 224, characters 0-140 - +for_all is never used - <-- line 224 - | Node {l; k; v; r} -> p k v && for_all l p && for_all r p [@@dead "+for_all"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.ml", line 230, characters 0-138 - +exists is never used - <-- line 230 - | Node {l; k; v; r} -> p k v || exists l p || exists r p [@@dead "+exists"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.ml", line 244, characters 0-166 - +add_min is never used - <-- line 244 - | Node tree -> bal (add_min k v tree.l) tree.k tree.v tree.r [@@dead "+add_min"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.ml", line 249, characters 0-166 - +add_max is never used - <-- line 249 - | Node tree -> bal tree.l tree.k tree.v (add_max k v tree.r) [@@dead "+add_max"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.ml", line 257, characters 0-485 - +join is never used - <-- line 257 - else unsafe_node v d l r (calc_height lh rh)) [@@dead "+join"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.ml", line 276, characters 0-165 +concat is never used @@ -9413,10 +2219,6 @@ <-- line 284 | None -> concat t1 t2 [@@dead "+concat_or_join"] - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.mli", line 1, characters 0-0 - map_gen is a dead module as all its items are dead. - Warning Dead Type File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.mli", line 2, characters 2-9 t.Empty is a variant case which is never constructed @@ -9435,18 +2237,6 @@ <-- line 4 | Node of {l: ('key, 'a) t; k: 'key; v: 'a; r: ('key, 'a) t; h: int} [@dead "t.Node"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.mli", line 6, characters 0-32 - +cardinal is never used - <-- line 6 - val cardinal : ('a, 'b) t -> int [@@dead "+cardinal"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.mli", line 8, characters 0-43 - +bindings is never used - <-- line 8 - val bindings : ('a, 'b) t -> ('a * 'b) list [@@dead "+bindings"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.mli", line 10, characters 0-80 +fill_array_with_f is never used @@ -9459,114 +2249,6 @@ <-- line 12 val fill_array_aux : ('a, 'b) t -> int -> ('a * 'b) array -> int [@@dead "+fill_array_aux"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.mli", line 14, characters 0-55 - +to_sorted_array is never used - <-- line 14 - val to_sorted_array : ('key, 'a) t -> ('key * 'a) array [@@dead "+to_sorted_array"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.mli", line 16, characters 0-71 - +to_sorted_array_with_f is never used - <-- line 16 - val to_sorted_array_with_f : ('a, 'b) t -> ('a -> 'b -> 'c) -> 'c array [@@dead "+to_sorted_array_with_f"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.mli", line 18, characters 0-32 - +keys is never used - <-- line 18 - val keys : ('a, 'b) t -> 'a list [@@dead "+keys"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.mli", line 20, characters 0-30 - +height is never used - <-- line 20 - val height : ('a, 'b) t -> int [@@dead "+height"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.mli", line 22, characters 0-38 - +singleton is never used - <-- line 22 - val singleton : 'a -> 'b -> ('a, 'b) t [@@dead "+singleton"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.mli", line 24, characters 0-75 - +unsafe_node is never used - <-- line 24 - val unsafe_node : 'a -> 'b -> ('a, 'b) t -> ('a, 'b) t -> int -> ('a, 'b) t [@@dead "+unsafe_node"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.mli", line 26, characters 0-60 - +unsafe_two_elements is never used - <-- line 26 - val unsafe_two_elements : 'a -> 'b -> 'a -> 'b -> ('a, 'b) t [@@dead "+unsafe_two_elements"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.mli", line 29, characters 0-60 - +bal is never used - <-- line 29 - val bal : ('a, 'b) t -> 'a -> 'b -> ('a, 'b) t -> ('a, 'b) t [@@dead "+bal"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.mli", line 31, characters 0-22 - +empty is never used - <-- line 31 - val empty : ('a, 'b) t [@@dead "+empty"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.mli", line 33, characters 0-33 - +is_empty is never used - <-- line 33 - val is_empty : ('a, 'b) t -> bool [@@dead "+is_empty"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.mli", line 35, characters 0-50 - +merge is never used - <-- line 35 - val merge : ('a, 'b) t -> ('a, 'b) t -> ('a, 'b) t [@@dead "+merge"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.mli", line 37, characters 0-51 - +iter is never used - <-- line 37 - val iter : ('a, 'b) t -> ('a -> 'b -> unit) -> unit [@@dead "+iter"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.mli", line 39, characters 0-48 - +map is never used - <-- line 39 - val map : ('a, 'b) t -> ('b -> 'c) -> ('a, 'c) t [@@dead "+map"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.mli", line 41, characters 0-55 - +mapi is never used - <-- line 41 - val mapi : ('a, 'b) t -> ('a -> 'b -> 'c) -> ('a, 'c) t [@@dead "+mapi"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.mli", line 43, characters 0-59 - +fold is never used - <-- line 43 - val fold : ('a, 'b) t -> 'c -> ('a -> 'b -> 'c -> 'c) -> 'c [@@dead "+fold"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.mli", line 45, characters 0-54 - +for_all is never used - <-- line 45 - val for_all : ('a, 'b) t -> ('a -> 'b -> bool) -> bool [@@dead "+for_all"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.mli", line 47, characters 0-53 - +exists is never used - <-- line 47 - val exists : ('a, 'b) t -> ('a -> 'b -> bool) -> bool [@@dead "+exists"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.mli", line 49, characters 0-61 - +join is never used - <-- line 49 - val join : ('a, 'b) t -> 'a -> 'b -> ('a, 'b) t -> ('a, 'b) t [@@dead "+join"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.mli", line 51, characters 0-51 +concat is never used @@ -9579,37 +2261,11 @@ <-- line 53 val concat_or_join : ('a, 'b) t -> 'a -> 'b option -> ('a, 'b) t -> ('a, 'b) t [@@dead "+concat_or_join"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 107, characters 0-191 - +output_to_bin_file_directly is never used - <-- line 107 - raise e [@@dead "+output_to_bin_file_directly"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 117, characters 0-1080 +output_to_file_via_temporary is never used <-- line 117 - raise exn [@@dead "+output_to_file_via_temporary"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 243, characters 0-83 - +misc.String_map is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 245, characters 2-23 - String_map.+compare is never used - <-- line 245 - let compare = compare [@@dead "String_map.+compare"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 247, characters 0-83 - +misc.String_set is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 249, characters 2-23 - String_set.+compare is never used - <-- line 249 - let compare = compare [@@dead "String_set.+compare"] + raise exn [@@dead "+output_to_file_via_temporary"] Warning Dead Type File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 343, characters 17-21 @@ -9629,192 +2285,18 @@ <-- line 343 type setting = Auto [@dead "Color.setting.Auto"] | Always [@dead "Color.setting.Always"] | Never [@dead "Color.setting.Never"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 59, characters 0-79 - +output_to_bin_file_directly is never used - <-- line 59 - val output_to_bin_file_directly : string -> (string -> out_channel -> 'a) -> 'a [@@dead "+output_to_bin_file_directly"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 61, characters 0-106 +output_to_file_via_temporary is never used <-- line 61 ?mode:open_flag list -> string -> (string -> out_channel -> 'a) -> 'a [@@dead "+output_to_file_via_temporary"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ordered_hash_map_gen.ml", line 75, characters 0-135 - +create is never used - <-- line 75 - {initial_size = s; size = 0; data = Array.make s Empty} [@@dead "+create"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ordered_hash_map_gen.ml", line 79, characters 0-132 - +clear is never used - <-- line 79 - done [@@dead "+clear"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ordered_hash_map_gen.ml", line 86, characters 0-72 - +reset is never used - <-- line 86 - h.data <- Array.make h.initial_size Empty [@@dead "+reset"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ordered_hash_map_gen.ml", line 90, characters 0-21 - +length is never used - <-- line 90 - let length h = h.size [@@dead "+length"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ordered_hash_map_gen.ml", line 92, characters 0-628 - +resize is never used - <-- line 92 - done) [@@dead "+resize"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ordered_hash_map_gen.ml", line 112, characters 0-249 - +iter is never used - <-- line 112 - done [@@dead "+iter"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ordered_hash_map_gen.ml", line 124, characters 0-256 - +choose is never used - <-- line 124 - aux h.data 0 (Array.length h.data) [@@dead "+choose"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ordered_hash_map_gen.ml", line 134, characters 0-177 - +to_sorted_array is never used - <-- line 134 - arr [@@dead "+to_sorted_array"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ordered_hash_map_gen.ml", line 142, characters 0-313 - +fold is never used - <-- line 142 - !accu [@@dead "+fold"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ordered_hash_map_gen.ml", line 155, characters 0-58 - +elements is never used - <-- line 155 - let elements set = fold set [] (fun k _ _ acc -> k :: acc) [@@dead "+elements"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ordered_hash_map_gen.ml", line 157, characters 0-121 +bucket_length is never used <-- line 157 | Cons rhs -> bucket_length (acc + 1) rhs.next [@@dead "+bucket_length"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/primitive_modules.ml", line 25, characters 0-27 - +bool is never used - <-- line 25 - let bool = "Primitive_bool" [@@dead "+bool"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/primitive_modules.ml", line 27, characters 0-25 - +int is never used - <-- line 27 - let int = "Primitive_int" [@@dead "+int"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/primitive_modules.ml", line 29, characters 0-29 - +float is never used - <-- line 29 - let float = "Primitive_float" [@@dead "+float"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/primitive_modules.ml", line 31, characters 0-31 - +bigint is never used - <-- line 31 - let bigint = "Primitive_bigint" [@@dead "+bigint"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/primitive_modules.ml", line 33, characters 0-31 - +string is never used - <-- line 33 - let string = "Primitive_string" [@@dead "+string"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/primitive_modules.ml", line 35, characters 0-29 - +array is never used - <-- line 35 - let array = "Primitive_array" [@@dead "+array"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/primitive_modules.ml", line 39, characters 0-32 - +object_ is never used - <-- line 39 - let object_ = "Primitive_object" [@@dead "+object_"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/primitive_modules.ml", line 47, characters 0-27 - +hash is never used - <-- line 47 - let hash = "Primitive_hash" [@@dead "+hash"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/primitive_modules.ml", line 49, characters 0-39 - +exceptions is never used - <-- line 49 - let exceptions = "Primitive_exceptions" [@@dead "+exceptions"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/runtime_package.ml", line 1, characters 0-30 - +name is never used - <-- line 1 - let name = "@rescript/runtime" [@@dead "+name"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/runtime_package.mli", line 1, characters 0-17 - +name is never used - <-- line 1 - val name : string [@@dead "+name"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.ml", line 23, characters 0-17 - +empty is never used - <-- line 23 - let empty = Empty [@@dead "+empty"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.ml", line 25, characters 0-79 - +height is never used - <-- line 25 - | Node {h} -> h [@@dead "+height"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.ml", line 30, characters 0-60 - +calc_height is never used - <-- line 30 - let[@inline] calc_height a b = (if a >= b then a else b) + 1 [@@dead "+calc_height"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.ml", line 38, characters 0-52 - +unsafe_node is never used - <-- line 38 - let[@inline] unsafe_node v l r h = Node {l; v; r; h} [@@dead "+unsafe_node"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.ml", line 40, characters 0-91 - +unsafe_node_maybe_leaf is never used - <-- line 40 - if h = 1 then Leaf v else Node {l; v; r; h} [@@dead "+unsafe_node_maybe_leaf"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.ml", line 43, characters 0-33 - +singleton is never used - <-- line 43 - let[@inline] singleton x = Leaf x [@@dead "+singleton"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.ml", line 45, characters 0-74 - +unsafe_two_elements is never used - <-- line 45 - let[@inline] unsafe_two_elements x v = unsafe_node v (singleton x) empty 2 [@@dead "+unsafe_two_elements"] - Warning Dead Type File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.ml", line 48, characters 2-9 t.Empty is a variant case which is never constructed @@ -9833,154 +2315,18 @@ <-- line 50 | Node of {l: 'a t0; v: 'a; r: 'a t0; h: int} [@dead "t.Node"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.ml", line 54, characters 0-162 - +min_exn is never used - <-- line 54 - | Leaf _ | Node _ -> min_exn l) [@@dead "+min_exn"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.ml", line 62, characters 0-65 - +is_empty is never used - <-- line 62 - | _ -> false [@@dead "+is_empty"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.ml", line 66, characters 0-135 - +cardinal_aux is never used - <-- line 66 - | Node {l; r} -> cardinal_aux (cardinal_aux (acc + 1) r) l [@@dead "+cardinal_aux"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.ml", line 71, characters 0-33 - +cardinal is never used - <-- line 71 - let cardinal s = cardinal_aux 0 s [@@dead "+cardinal"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.ml", line 73, characters 0-142 - +elements_aux is never used - <-- line 73 - | Node {l; v; r} -> elements_aux (v :: elements_aux accu r) l [@@dead "+elements_aux"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.ml", line 78, characters 0-34 - +elements is never used - <-- line 78 - let elements s = elements_aux [] s [@@dead "+elements"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.ml", line 80, characters 0-20 - +choose is never used - <-- line 80 - let choose = min_exn [@@dead "+choose"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.ml", line 82, characters 0-125 - +iter is never used - <-- line 82 - iter r f [@@dead "+iter"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.ml", line 91, characters 0-132 - +fold is never used - <-- line 91 - | Node {l; v; r} -> fold r (f v (fold l accu f)) f [@@dead "+fold"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.ml", line 97, characters 0-128 - +for_all is never used - <-- line 97 - | Node {l; v; r} -> p v && for_all l p && for_all r p [@@dead "+for_all"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.ml", line 103, characters 0-126 - +exists is never used - <-- line 103 - | Node {l; v; r} -> p v || exists l p || exists r p [@@dead "+exists"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.ml", line 113, characters 0-336 - +check_height_and_diff is never used - <-- line 113 - if diff > 2 then raise Height_diff_borken else h [@@dead "+check_height_and_diff"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.ml", line 124, characters 0-52 - +check is never used - <-- line 124 - let check tree = ignore (check_height_and_diff tree) [@@dead "+check"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.ml", line 136, characters 0-1421 - +bal is never used - <-- line 136 - else unsafe_node_maybe_leaf v l r (calc_height hl hr) [@@dead "+bal"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.ml", line 179, characters 0-177 - +remove_min_elt is never used - <-- line 179 - | Node {l; v; r} -> bal (remove_min_elt l) v r [@@dead "+remove_min_elt"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.ml", line 191, characters 0-129 - +internal_merge is never used - <-- line 191 - | _, _ -> bal l (min_exn r) (remove_min_elt r) [@@dead "+internal_merge"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.ml", line 204, characters 0-133 - +add_min is never used - <-- line 204 - | Node n -> bal (add_min v n.l) n.v n.r [@@dead "+add_min"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.ml", line 209, characters 0-133 - +add_max is never used - <-- line 209 - | Node n -> bal n.l n.v (add_max v n.r) [@@dead "+add_max"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.ml", line 223, characters 0-728 - +internal_join is never used - <-- line 223 - else unsafe_node v l r (calc_height lh rh) [@@dead "+internal_join"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.ml", line 247, characters 0-147 - +internal_concat is never used - <-- line 247 - | _, _ -> internal_join t1 (min_exn t2) (remove_min_elt t2) [@@dead "+internal_concat"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.ml", line 253, characters 0-425 +partition is never used <-- line 253 else (internal_concat lt rt, internal_join lf v rf) [@@dead "+partition"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.ml", line 267, characters 0-828 - +of_sorted_array is never used - <-- line 267 - sub 0 (Array.length l) l [@@dead "+of_sorted_array"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.ml", line 292, characters 0-690 - +is_ordered is never used - <-- line 292 - is_ordered_min_max tree <> `No [@@dead "+is_ordered"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.ml", line 314, characters 0-53 +invariant is never used <-- line 314 is_ordered ~cmp t [@@dead "+invariant"] - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.mli", line 1, characters 0-0 - set_gen is a dead module as all its items are dead. - Warning Dead Type File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.mli", line 2, characters 2-9 t.Empty is a variant case which is never constructed @@ -9999,126 +2345,18 @@ <-- line 4 | Node of {l: 'a t; v: 'a; r: 'a t; h: int} [@dead "t.Node"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.mli", line 6, characters 0-16 - +empty is never used - <-- line 6 - val empty : 'a t [@@dead "+empty"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.mli", line 8, characters 0-27 - +is_empty is never used - <-- line 8 - val is_empty : 'a t -> bool [@@dead "+is_empty"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.mli", line 10, characters 0-42 - +unsafe_two_elements is never used - <-- line 10 - val unsafe_two_elements : 'a -> 'a -> 'a t [@@dead "+unsafe_two_elements"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.mli", line 12, characters 0-26 - +cardinal is never used - <-- line 12 - val cardinal : 'a t -> int [@@dead "+cardinal"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.mli", line 14, characters 0-30 - +elements is never used - <-- line 14 - val elements : 'a t -> 'a list [@@dead "+elements"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.mli", line 16, characters 0-23 - +choose is never used - <-- line 16 - val choose : 'a t -> 'a [@@dead "+choose"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.mli", line 18, characters 0-39 - +iter is never used - <-- line 18 - val iter : 'a t -> ('a -> unit) -> unit [@@dead "+iter"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.mli", line 20, characters 0-47 - +fold is never used - <-- line 20 - val fold : 'a t -> 'c -> ('a -> 'c -> 'c) -> 'c [@@dead "+fold"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.mli", line 22, characters 0-42 - +for_all is never used - <-- line 22 - val for_all : 'a t -> ('a -> bool) -> bool [@@dead "+for_all"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.mli", line 24, characters 0-41 - +exists is never used - <-- line 24 - val exists : 'a t -> ('a -> bool) -> bool [@@dead "+exists"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.mli", line 26, characters 0-24 - +check is never used - <-- line 26 - val check : 'a t -> unit [@@dead "+check"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.mli", line 28, characters 0-36 - +bal is never used - <-- line 28 - val bal : 'a t -> 'a -> 'a t -> 'a t [@@dead "+bal"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.mli", line 30, characters 0-33 +remove_min_elt is never used <-- line 30 val remove_min_elt : 'a t -> 'a t [@@dead "+remove_min_elt"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.mli", line 32, characters 0-26 - +singleton is never used - <-- line 32 - val singleton : 'a -> 'a t [@@dead "+singleton"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.mli", line 34, characters 0-41 - +internal_merge is never used - <-- line 34 - val internal_merge : 'a t -> 'a t -> 'a t [@@dead "+internal_merge"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.mli", line 36, characters 0-46 - +internal_join is never used - <-- line 36 - val internal_join : 'a t -> 'a -> 'a t -> 'a t [@@dead "+internal_join"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.mli", line 38, characters 0-42 - +internal_concat is never used - <-- line 38 - val internal_concat : 'a t -> 'a t -> 'a t [@@dead "+internal_concat"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.mli", line 40, characters 0-51 +partition is never used <-- line 40 val partition : 'a t -> ('a -> bool) -> 'a t * 'a t [@@dead "+partition"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.mli", line 42, characters 0-38 - +of_sorted_array is never used - <-- line 42 - val of_sorted_array : 'a array -> 'a t [@@dead "+of_sorted_array"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.mli", line 44, characters 0-54 - +is_ordered is never used - <-- line 44 - val is_ordered : cmp:('a -> 'a -> int) -> 'a t -> bool [@@dead "+is_ordered"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.mli", line 46, characters 0-53 +invariant is never used @@ -10137,12 +2375,6 @@ <-- line 89 val reset_fatal : unit -> unit [@@dead "+reset_fatal"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/warnings.mli", line 99, characters 0-27 - +has_warnings is never used - <-- line 99 - val has_warnings : bool ref [@@dead "+has_warnings"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_literal.ml", line 48, characters 2-74 Lid.+ignore_id is never used @@ -10155,110 +2387,6 @@ <-- line 38 val ignore_id : t [@@dead "Lid.+ignore_id"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_utf8_string.ml", line 200, characters 0-370 - +check_no_escapes_or_unicode is never used - <-- line 200 - | Invalid | Cont _ | Leading _ -> false [@@dead "+check_no_escapes_or_unicode"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_utf8_string.ml", line 210, characters 0-75 - +simple_comparison is never used - <-- line 210 - let simple_comparison s = check_no_escapes_or_unicode s 0 (String.length s) [@@dead "+simple_comparison"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/ast_utf8_string.mli", line 38, characters 0-38 - +simple_comparison is never used - <-- line 38 - val simple_comparison : string -> bool [@@dead "+simple_comparison"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/external_ffi_types.mli", line 95, characters 0-29 - +from_string is never used - <-- line 95 - val from_string : string -> t [@@dead "+from_string"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/lam_constant.ml", line 34, characters 0-190 - +string_of_pointer_info is never used - <-- line 34 - | None -> None [@@dead "+string_of_pointer_info"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/lam_constant.ml", line 58, characters 0-1153 - +eq_approx is never used - <-- line 58 - | _ -> false) [@@dead "+eq_approx"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/lam_constant.ml", line 99, characters 0-55 - +lam_none is never used - <-- line 99 - let lam_none : t = Const_js_undefined {is_unit = false} [@@dead "+lam_none"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/lam_constant.ml", line 101, characters 0-324 - +is_allocating is never used - <-- line 101 - false [@@dead "+is_allocating"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/lam_constant.mli", line 34, characters 0-58 - +string_of_pointer_info is never used - <-- line 34 - val string_of_pointer_info : pointer_info -> string option [@@dead "+string_of_pointer_info"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/lam_constant.mli", line 54, characters 0-30 - +eq_approx is never used - <-- line 54 - val eq_approx : t -> t -> bool [@@dead "+eq_approx"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/lam_constant.mli", line 56, characters 0-16 - +lam_none is never used - <-- line 56 - val lam_none : t [@@dead "+lam_none"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/frontend/lam_constant.mli", line 58, characters 0-29 - +is_allocating is never used - <-- line 58 - val is_allocating : t -> bool [@@dead "+is_allocating"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/gentype/gen_ident.ml", line 1, characters 0-102 - +gen_ident.Int_map is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/gentype/gen_ident.ml", line 4, characters 2-47 - Int_map.+compare is never used - <-- line 4 - let compare (x : int) (y : int) = compare x y [@@dead "Int_map.+compare"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/gentype/module_name.ml", line 27, characters 0-44 - +compare is never used - <-- line 27 - let compare (s1 : string) s2 = compare s1 s2 [@@dead "+compare"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/gentype/module_name.mli", line 3, characters 0-27 - +compare is never used - <-- line 3 - val compare : t -> t -> int [@@dead "+compare"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/gentype/resolved_name.ml", line 10, characters 0-336 - +resolved_name.Name_set is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/gentype/resolved_name.ml", line 13, characters 2-275 - Name_set.+compare is never used - <-- line 13 - | false -> compare rest1 rest2) [@@dead "Name_set.+compare"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 28, characters 0-182 +with_default_loc is never used @@ -10425,16 +2553,6 @@ <-- line 529 PStr [Str.eval ~loc (Exp.constant (Pconst_string (s, None)))] ) [@@dead "+attribute_of_warning"] - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_mapper.ml", line 533, characters 0-83 - +ast_mapper.String_map is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_mapper.ml", line 535, characters 2-23 - String_map.+compare is never used - <-- line 535 - let compare = compare [@@dead "String_map.+compare"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_mapper.ml", line 540, characters 0-81 +get_cookie is never used @@ -10529,236 +2647,12 @@ <-- line 188 val get_cookie : string -> Parsetree.expression option [@@dead "+get_cookie"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 530, characters 2-204 - Dynamic_checks.+size is never used - <-- line 530 - | Expr _ -> 1 [@@dead "Dynamic_checks.+size"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 538, characters 2-35 - Dynamic_checks.+bin is never used - <-- line 538 - let bin op x y = BinOp (op, x, y) [@@dead "Dynamic_checks.+bin"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 540, characters 2-25 - Dynamic_checks.+typeof is never used - <-- line 540 - let typeof x = TypeOf x [@@dead "Dynamic_checks.+typeof"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 541, characters 2-34 Dynamic_checks.+str is never used <-- line 541 let str s = String s |> tag_type [@@dead "Dynamic_checks.+str"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 542, characters 2-43 - Dynamic_checks.+is_instance is never used - <-- line 542 - let is_instance i x = IsInstanceOf (i, x) [@@dead "Dynamic_checks.+is_instance"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 543, characters 2-19 - Dynamic_checks.+not is never used - <-- line 543 - let not x = Not x [@@dead "Dynamic_checks.+not"] - - Warning Dead Value With Side Effects - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 544, characters 2-28 - Dynamic_checks.+nil is never used and could have side effects - - Warning Dead Value With Side Effects - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 545, characters 2-39 - Dynamic_checks.+undefined is never used and could have side effects - - Warning Dead Value With Side Effects - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 546, characters 2-47 - Dynamic_checks.+object_ is never used and could have side effects - - Warning Dead Value With Side Effects - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 548, characters 2-51 - Dynamic_checks.+function_ is never used and could have side effects - - Warning Dead Value With Side Effects - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 549, characters 2-46 - Dynamic_checks.+string is never used and could have side effects - - Warning Dead Value With Side Effects - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 550, characters 2-43 - Dynamic_checks.+number is never used and could have side effects - - Warning Dead Value With Side Effects - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 552, characters 2-46 - Dynamic_checks.+bigint is never used and could have side effects - - Warning Dead Value With Side Effects - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 554, characters 2-48 - Dynamic_checks.+boolean is never used and could have side effects - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 556, characters 2-33 - Dynamic_checks.+== is never used - <-- line 556 - let ( == ) x y = bin EqEqEq x y [@@dead "Dynamic_checks.+=="] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 557, characters 2-34 - Dynamic_checks.+!= is never used - <-- line 557 - let ( != ) x y = bin NotEqEq x y [@@dead "Dynamic_checks.+!="] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 558, characters 2-30 - Dynamic_checks.+||| is never used - <-- line 558 - let ( ||| ) x y = bin Or x y [@@dead "Dynamic_checks.+|||"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 559, characters 2-31 - Dynamic_checks.+&&& is never used - <-- line 559 - let ( &&& ) x y = bin And x y [@@dead "Dynamic_checks.+&&&"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 561, characters 2-2866 - Dynamic_checks.+is_a_literal_case is never used - <-- line 561 - | [] -> assert false [@@dead "Dynamic_checks.+is_a_literal_case"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 641, characters 2-411 - Dynamic_checks.+is_a_literal_case is never used - <-- line 641 - else without_literal_cases [@@dead "Dynamic_checks.+is_a_literal_case"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 652, characters 2-706 - Dynamic_checks.+is_int_tag is never used - <-- line 652 - typeof e != object_ [@@dead "Dynamic_checks.+is_int_tag"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 670, characters 2-1031 - Dynamic_checks.+add_runtime_type_check is never used - <-- line 670 - | Bool _ | Float _ | Int _ | BigInt _ | String _ | Null | Undefined -> x [@@dead "Dynamic_checks.+add_runtime_type_check"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/classify_function.ml", line 107, characters 0-210 - +classify_stmt is never used - <-- line 107 - | _ -> Js_stmt_unknown [@@dead "+classify_stmt"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/classify_function.mli", line 29, characters 0-46 - +classify_stmt is never used - <-- line 29 - val classify_stmt : string -> Js_raw_info.stmt [@@dead "+classify_stmt"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/cmi_format.ml", line 67, characters 0-369 - +output_cmi is never used - <-- line 67 - crc [@@dead "+output_cmi"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/cmi_format.mli", line 26, characters 0-63 - +output_cmi is never used - <-- line 26 - val output_cmi : string -> out_channel -> cmi_infos -> Digest.t [@@dead "+output_cmi"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/cmi_format.mli", line 31, characters 0-39 - +input_cmi is never used - <-- line 31 - val input_cmi : in_channel -> cmi_infos [@@dead "+input_cmi"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/cmt_format.mli", line 35, characters 2-43 - binary_annots.Packed is a variant case which is never constructed - <-- line 35 - | Packed of Types.signature * string list [@dead "binary_annots.Packed"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/cmt_format.mli", line 39, characters 2-42 - binary_annots.Partial_interface is a variant case which is never constructed - <-- line 39 - | Partial_interface of binary_part array [@dead "binary_annots.Partial_interface"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/cmt_format.mli", line 46, characters 2-30 - binary_part.Partial_class_expr is a variant case which is never constructed - <-- line 46 - | Partial_class_expr of unit [@dead "binary_part.Partial_class_expr"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/cmt_format.mli", line 56, characters 2-43 - cmt_infos.cmt_comments is a record label never used to read a value - <-- line 56 - cmt_comments: (string * Location.t) list; [@dead "cmt_infos.cmt_comments"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/cmt_format.mli", line 57, characters 2-25 - cmt_infos.cmt_args is a record label never used to read a value - <-- line 57 - cmt_args: string array; [@dead "cmt_infos.cmt_args"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/cmt_format.mli", line 58, characters 2-32 - cmt_infos.cmt_sourcefile is a record label never used to read a value - <-- line 58 - cmt_sourcefile: string option; [@dead "cmt_infos.cmt_sourcefile"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/cmt_format.mli", line 59, characters 2-23 - cmt_infos.cmt_builddir is a record label never used to read a value - <-- line 59 - cmt_builddir: string; [@dead "cmt_infos.cmt_builddir"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/cmt_format.mli", line 60, characters 2-28 - cmt_infos.cmt_loadpath is a record label never used to read a value - <-- line 60 - cmt_loadpath: string list; [@dead "cmt_infos.cmt_loadpath"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/cmt_format.mli", line 61, characters 2-35 - cmt_infos.cmt_source_digest is a record label never used to read a value - <-- line 61 - cmt_source_digest: string option; [@dead "cmt_infos.cmt_source_digest"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/cmt_format.mli", line 62, characters 2-25 - cmt_infos.cmt_initial_env is a record label never used to read a value - <-- line 62 - cmt_initial_env: Env.t; [@dead "cmt_infos.cmt_initial_env"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/cmt_format.mli", line 63, characters 2-47 - cmt_infos.cmt_imports is a record label never used to read a value - <-- line 63 - cmt_imports: (string * Digest.t option) list; [@dead "cmt_infos.cmt_imports"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/cmt_format.mli", line 64, characters 2-40 - cmt_infos.cmt_interface_digest is a record label never used to read a value - <-- line 64 - cmt_interface_digest: Digest.t option; [@dead "cmt_infos.cmt_interface_digest"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/cmt_format.mli", line 65, characters 2-26 - cmt_infos.cmt_use_summaries is a record label never used to read a value - <-- line 65 - cmt_use_summaries: bool; [@dead "cmt_infos.cmt_use_summaries"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/cmt_format.mli", line 69, characters 13-38 - error.Not_a_typedtree is a variant case which is never constructed - <-- line 69 - type error = Not_a_typedtree of string [@dead "error.Not_a_typedtree"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/cmt_format.mli", line 73, characters 0-67 +read is never used @@ -10795,22 +2689,6 @@ <-- line 134 nongen_level := !current_level [@@dead "+raise_nongen_level"] - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 212, characters 0-176 - +ctype.Type_pairs is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 214, characters 2-56 - Type_pairs.+equal is never used - <-- line 214 - let equal (t1, t1') (t2, t2') = t1 == t2 && t1' == t2' [@@dead "Type_pairs.+equal"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 215, characters 2-40 - Type_pairs.+hash is never used - <-- line 215 - let hash (t, t') = t.id + (93 * t'.id) [@@dead "Type_pairs.+hash"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 278, characters 0-106 +object_fields is never used @@ -11265,16 +3143,6 @@ File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/depend.ml", line 21, characters 0-20 +pp_deps is never used and could have side effects - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/depend.ml", line 23, characters 0-83 - +depend.String_set is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/depend.ml", line 25, characters 2-23 - String_set.+compare is never used - <-- line 25 - let compare = compare [@@dead "String_set.+compare"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/depend.ml", line 39, characters 0-103 +weaken_map is never used @@ -11371,16 +3239,6 @@ <-- line 604 ps_flags: pers_flags list; [@dead "pers_struct.ps_flags"] - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 615, characters 0-90 - +env.String_set is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 617, characters 2-30 - String_set.+compare is never used - <-- line 617 - let compare = String.compare [@@dead "String_set.+compare"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 762, characters 0-434 +reset_cache_toplevel is never used @@ -11409,20 +3267,6 @@ <-- line 2071 else Env_constraints (env.summary, env.local_constraints) [@@dead "+summary"] - Warning Dead Value With Side Effects - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 2075, characters 0-24 - +last_env is never used and could have side effects - - Warning Dead Value With Side Effects - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 2076, characters 0-32 - +last_reduced_env is never used and could have side effects - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 2078, characters 0-314 - +keep_only_summary is never used - <-- line 2078 - new_env [@@dead "+keep_only_summary"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 2093, characters 0-187 +env_of_only_summary is never used @@ -11471,12 +3315,6 @@ <-- line 209 val crc_of_unit : string -> Digest.t [@@dead "+crc_of_unit"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 213, characters 0-53 - +imports is never used - <-- line 213 - val imports : unit -> (string * Digest.t option) list [@@dead "+imports"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 217, characters 0-27 +crc_units is never used @@ -11495,12 +3333,6 @@ <-- line 223 val summary : t -> summary [@@dead "+summary"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 229, characters 0-30 - +keep_only_summary is never used - <-- line 229 - val keep_only_summary : t -> t [@@dead "+keep_only_summary"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 230, characters 0-61 +env_of_only_summary is never used @@ -11537,16 +3369,6 @@ <-- line 843 | _ -> None [@@dead "+type_clash_context_maybe_option"] - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/experimental_features.ml", line 12, characters 0-85 - +experimental_features.Feature_set is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/experimental_features.ml", line 14, characters 2-23 - Feature_set.+compare is never used - <-- line 14 - let compare = compare [@@dead "Feature_set.+compare"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/experimental_features.ml", line 23, characters 0-52 +reset is never used @@ -11595,24 +3417,12 @@ <-- line 38 val print_coercion : formatter -> module_coercion -> unit [@@dead "+print_coercion"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/lambda.ml", line 59, characters 0-342 - +mutable_flag_of_tag_info is never used - <-- line 59 - Immutable [@@dead "+mutable_flag_of_tag_info"] - Warning Dead Type File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/lambda.ml", line 342, characters 43-53 let_kind.Variable is a variant case which is never constructed <-- line 342 type let_kind = Strict | Alias | StrictOpt | Variable [@dead "let_kind.Variable"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/lambda.mli", line 63, characters 0-55 - +mutable_flag_of_tag_info is never used - <-- line 63 - val mutable_flag_of_tag_info : tag_info -> mutable_flag [@@dead "+mutable_flag_of_tag_info"] - Warning Dead Type File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/lambda.mli", line 299, characters 43-53 let_kind.Variable is a variant case which is never constructed @@ -11631,58 +3441,12 @@ <-- line 393 val iter : (lambda -> unit) -> lambda -> unit [@@dead "+iter"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/location.mli", line 47, characters 0-64 - +warning_printer is never used - <-- line 47 - val warning_printer : (t -> formatter -> Warnings.t -> unit) ref [@@dead "+warning_printer"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/location.mli", line 50, characters 0-42 - +formatter_for_warnings is never used - <-- line 50 - val formatter_for_warnings : formatter ref [@@dead "+formatter_for_warnings"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/location.mli", line 52, characters 0-66 - +default_warning_printer is never used - <-- line 52 - val default_warning_printer : t -> formatter -> Warnings.t -> unit [@@dead "+default_warning_printer"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/location.mli", line 110, characters 0-118 - +error_reporter is never used - <-- line 110 - ref [@@dead "+error_reporter"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/location.mli", line 119, characters 0-118 - +default_error_reporter is never used - <-- line 119 - unit [@@dead "+default_error_reporter"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/longident.mli", line 22, characters 0-39 +unflatten is never used <-- line 22 val unflatten : string list -> t option [@@dead "+unflatten"] - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 442, characters 0-143 - +matching.Store_exp is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 445, characters 2-27 - Store_exp.+compare_key is never used - <-- line 445 - let compare_key = compare [@@dead "Store_exp.+compare_key"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 446, characters 2-32 - Store_exp.+make_key is never used - <-- line 446 - let make_key = Lambda.make_key [@@dead "Store_exp.+make_key"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 452, characters 0-158 +make_catch is never used @@ -11737,106 +3501,6 @@ <-- line 1595 make_catch e (fun d -> do_make_string_test_tree loc arg sw 1 (Some d))) [@@dead "+expand_stringswitch"] - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 1709, characters 0-1398 - +matching.S_arg is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 1712, characters 2-26 - S_arg.+eqint is never used - <-- line 1712 - let eqint = Pintcomp Ceq [@@dead "S_arg.+eqint"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 1713, characters 2-27 - S_arg.+neint is never used - <-- line 1713 - let neint = Pintcomp Cneq [@@dead "S_arg.+neint"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 1714, characters 2-26 - S_arg.+leint is never used - <-- line 1714 - let leint = Pintcomp Cle [@@dead "S_arg.+leint"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 1715, characters 2-26 - S_arg.+ltint is never used - <-- line 1715 - let ltint = Pintcomp Clt [@@dead "S_arg.+ltint"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 1716, characters 2-26 - S_arg.+geint is never used - <-- line 1716 - let geint = Pintcomp Cge [@@dead "S_arg.+geint"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 1717, characters 2-26 - S_arg.+gtint is never used - <-- line 1717 - let gtint = Pintcomp Cgt [@@dead "S_arg.+gtint"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 1721, characters 2-55 - S_arg.+make_prim is never used - <-- line 1721 - let make_prim p args = Lprim (p, args, Location.none) [@@dead "S_arg.+make_prim"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 1722, characters 2-111 - S_arg.+make_offset is never used - <-- line 1722 - | _ -> Lprim (Poffsetint n, [arg], Location.none) [@@dead "S_arg.+make_offset"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 1727, characters 2-232 - S_arg.+bind is never used - <-- line 1727 - bind Alias newvar arg (body newarg) [@@dead "S_arg.+bind"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 1736, characters 2-54 - S_arg.+make_const is never used - <-- line 1736 - let make_const i = Lconst (Const_base (Const_int i)) [@@dead "S_arg.+make_const"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 1737, characters 2-64 - S_arg.+make_isout is never used - <-- line 1737 - let make_isout h arg = Lprim (Pisout, [h; arg], Location.none) [@@dead "S_arg.+make_isout"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 1738, characters 2-71 - S_arg.+make_isin is never used - <-- line 1738 - let make_isin h arg = Lprim (Pnot, [make_isout h arg], Location.none) [@@dead "S_arg.+make_isin"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 1739, characters 2-63 - S_arg.+make_if is never used - <-- line 1739 - let make_if cond ifso ifnot = Lifthenelse (cond, ifso, ifnot) [@@dead "S_arg.+make_if"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 1740, characters 2-419 - S_arg.+make_switch is never used - <-- line 1740 - loc ) [@@dead "S_arg.+make_switch"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 1756, characters 2-37 - S_arg.+make_catch is never used - <-- line 1756 - let make_catch = make_catch_delayed [@@dead "S_arg.+make_catch"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 1757, characters 2-27 - S_arg.+make_exit is never used - <-- line 1757 - let make_exit = make_exit [@@dead "S_arg.+make_exit"] - Warning Dead Value With Side Effects File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 2680, characters 0-63 +check_partial_list is never used and could have side effects @@ -12075,40 +3739,6 @@ <-- line 146 | Ophr_exception of (exn * out_value) [@dead "out_phrase.Ophr_exception"] - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/parmatch.ml", line 902, characters 0-147 - +parmatch.Constructor_tag_hashtbl is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/parmatch.ml", line 904, characters 2-25 - Constructor_tag_hashtbl.+hash is never used - <-- line 904 - let hash = Hashtbl.hash [@@dead "Constructor_tag_hashtbl.+hash"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/parmatch.ml", line 905, characters 2-29 - Constructor_tag_hashtbl.+equal is never used - <-- line 905 - let equal = Types.equal_tag [@@dead "Constructor_tag_hashtbl.+equal"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/parmatch.ml", line 2534, characters 4-193 - +enter_expression is never used - <-- line 2534 - | _ -> () [@@dead "+enter_expression"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/parmatch.ml", line 2542, characters 4-103 - +is_unpack is never used - <-- line 2542 - List.exists (fun (attr, _) -> attr.txt = "#modulepat") exp.exp_attributes [@@dead "+is_unpack"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/parmatch.ml", line 2545, characters 4-493 - +leave_expression is never used - <-- line 2545 - | _ -> assert false [@@dead "+leave_expression"] - Warning Dead Type File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/parsetree0.ml", line 98, characters 2-22 core_type_desc.Ptyp_class is a variant case which is never constructed @@ -12151,30 +3781,6 @@ <-- line 577 | Pstr_class_type of unit [@dead "structure_item_desc.Pstr_class_type"] (* Dummy AST node *) - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/path.ml", line 27, characters 0-449 - +compare is never used - <-- line 27 - | (Pdot _ | Papply _), (Pident _ | Pdot _) -> 1 [@@dead "+compare"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/path.ml", line 71, characters 0-190 - +heads is never used - <-- line 71 - heads p [] [@@dead "+heads"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/path.mli", line 21, characters 0-27 - +compare is never used - <-- line 21 - val compare : t -> t -> int [@@dead "+compare"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/path.mli", line 33, characters 0-29 - +heads is never used - <-- line 33 - val heads : t -> Ident.t list [@@dead "+heads"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/pprintast.ml", line 1354, characters 0-60 +expression is never used @@ -12559,16 +4165,6 @@ <-- line 58 val typexp : t -> Types.type_expr -> Types.type_expr [@@dead "+typexp"] - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/switch.ml", line 34, characters 2-91 - +switch.Store.A_map is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/switch.ml", line 36, characters 4-31 - Store.A_map.+compare is never used - <-- line 36 - let compare = A.compare_key [@@dead "Store.A_map.+compare"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/tbl.ml", line 66, characters 0-143 +mem is never used @@ -12701,16 +4297,6 @@ <-- line 25 type native_repr_kind = Unboxed [@dead "native_repr_kind.Unboxed"] | Untagged [@dead "native_repr_kind.Untagged"] - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typedecl.ml", line 204, characters 0-97 - +typedecl.String_set is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typedecl.ml", line 206, characters 2-37 - String_set.+compare is never used - <-- line 206 - let compare (x : t) y = compare x y [@@dead "String_set.+compare"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typedecl.mli", line 53, characters 0-48 +abstract_type_decl is never used @@ -12861,16 +4447,6 @@ <-- line 70 val iter_pattern : pattern -> unit [@@dead "Make_iterator.+iter_pattern"] - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typemod.ml", line 606, characters 0-104 - +typemod.String_set is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typemod.ml", line 608, characters 2-44 - String_set.+compare is never used - <-- line 608 - let compare (x : t) y = String.compare x y [@@dead "String_set.+compare"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typemod.mli", line 21, characters 0-73 +type_module is never used @@ -12901,64 +4477,10 @@ <-- line 52 val path_of_module : Typedtree.module_expr -> Path.t option [@@dead "+path_of_module"] - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/types.ml", line 66, characters 0-134 - +types.Type_ops is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/types.ml", line 68, characters 2-35 - Type_ops.+compare is never used - <-- line 68 - let compare t1 t2 = t1.id - t2.id [@@dead "Type_ops.+compare"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/types.ml", line 69, characters 2-19 - Type_ops.+hash is never used - <-- line 69 - let hash t = t.id [@@dead "Type_ops.+hash"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/types.ml", line 70, characters 2-28 - Type_ops.+equal is never used - <-- line 70 - let equal t1 t2 = t1 == t2 [@@dead "Type_ops.+equal"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/types.ml", line 75, characters 0-90 - +types.Ordered_string is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/types.ml", line 77, characters 2-37 - Ordered_string.+compare is never used - <-- line 77 - let compare (x : t) y = compare x y [@@dead "Ordered_string.+compare"] - Warning Dead Type File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/types.ml", line 99, characters 29-39 Variance.f.May_weak is a variant case which is never constructed <-- line 99 type f = May_pos | May_neg | May_weak [@dead "Variance.f.May_weak"] | Inj | Pos | Neg | Inv - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/types.mli", line 207, characters 0-127 - types.Type_ops is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/types.mli", line 209, characters 2-29 - Type_ops.+compare is never used - <-- line 209 - val compare : t -> t -> int [@@dead "Type_ops.+compare"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/types.mli", line 210, characters 2-28 - Type_ops.+equal is never used - <-- line 210 - val equal : t -> t -> bool [@@dead "Type_ops.+equal"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/types.mli", line 211, characters 2-21 - Type_ops.+hash is never used - <-- line 211 - val hash : t -> int [@@dead "Type_ops.+hash"] - Analysis reported 2291 issues (Warning Dead Module:145, Warning Dead Type:201, Warning Dead Value:1698, Warning Dead Value With Side Effects:28, Warning Redundant Optional Argument:195, Warning Unused Argument:24) + Analysis reported 867 issues (Warning Dead Module:4, Warning Dead Type:165, Warning Dead Value:343, Warning Dead Value With Side Effects:8, Warning Redundant Optional Argument:198, Warning Unused Argument:149) diff --git a/scripts/dce/README.md b/scripts/dce/README.md index f6563a373c4..7e59c2560a7 100644 --- a/scripts/dce/README.md +++ b/scripts/dce/README.md @@ -12,7 +12,7 @@ scripts/dce/run-dce.sh # writes _dce/report.txt Requires the host OCaml switch (5.3) with `dune` available (`eval $(opam env)`). The script fetches + builds a pinned standalone reanalyze on first run (cached in -`~/.cache/rescript-dce`). +`~/.cache/rescript-dce/reanalyze-cmt-sourcefile-fallback`). The runner excludes `tests/ounit_tests` from DCE by default. Unit tests should not keep compiler implementation details live, and test-only helpers are intentionally @@ -28,15 +28,18 @@ the old **4.06-era** ReScript cmt format (used for `.res` → `.cmt`). Pointed a compiler's own cmts it fails immediately with `Fatal error: Cmi_format.Error`. So we use the **standalone** reanalyze (`rescript-lang/reanalyze`), built against -the host `compiler-libs.common`. OCaml 5.3 support comes from -[reanalyze#203](https://github.com/rescript-lang/reanalyze/pull/203) (branch -`ocaml-5-3`), **not yet merged** — the runner pins its commit. +the host `compiler-libs.common`. OCaml 5.3 support started in +[reanalyze#203](https://github.com/rescript-lang/reanalyze/pull/203), with +follow-up source-file/dependency fixes on JonoPrest's +`jono/cmt-sourcefile-fallback` branch. The runner pins that branch commit. -## Status: it RUNS, but the output is NOT yet trustworthy +## Status: actionable, still manually validated The tooling runs end-to-end and produces a full report over all dune-built cmts. -That is the mechanical milestone. **But the results cannot currently be acted on**, -for two stacked reasons: +The pinned `jono/cmt-sourcefile-fallback` build fixes the large cross-module +false-positive class seen with the earlier `ocaml-5-3` branch. Treat the report as +an actionable worklist, but still manually validate each warning with source +searches and `dune build @check` before committing removals. ### 1. (Fixed) Entry-point roots — use `dune build @check` @@ -45,61 +48,13 @@ points = the executable mains). A plain `dune build` does native compilation and emits only `.cmti` (no impl `.cmt`) for modules with an `.mli` — including the `bsc` main — so reanalyze never sees the entry-point bodies and over-reports. The runner now uses `dune build @check`, which typecheck-builds everything and emits the impl -`.cmt` for all modules. This fixed the `Bs_version`-class false positives and cut -Dead Value ~2740 → ~2130, Dead Module ~203 → ~146. +`.cmt` for all modules. This fixed the `Bs_version`-class false positives. Residual root gap: the playground `jsoo` main is `enabled_if profile=browser` with `(modes js wasm)` (no bytecode `.cmt`), and the dune comment says not to build it by -default (slow). So code used only by the playground still shows as dead. - -### 2. (BLOCKER) reanalyze#203's 5.3 dependency tracking is incomplete - -Even with roots fixed, the report flags **obviously-live core modules as dead** — -e.g. `Ast_helper` (510 references in-tree), `Lam_compile`, `Js_dump`, `Lam_convert`. -The cause is stated in the PR itself: reanalyze#203 derives value dependencies -*"just based on the type of what's available in the new `Cmt_format.cmt_infos`"* — -a **tentative, incomplete** method that does not capture the real use edges in 5.3 -cmts. As a result the cross-reference-based categories (Dead Value / Dead Module / -Dead Type / "never constructed") are unreliable: there are real positives buried in -there, but you can't tell which without manually re-verifying every one, which -defeats the purpose. - -Local, call-site-based categories fare better — e.g. `transl_apply`'s `~inlined` is -correctly reported as always-supplied — but they rely on the same reference tracking, -so they're only trustworthy when a function has few, simple call sites. - -#### Root cause (investigated) and why the fix is non-trivial - -reanalyze's DCE is **location-keyed**: declarations are registered by source -position, and a use is connected to a declaration when the use's recorded "target -location" equals the declaration's. OCaml 5.3 broke this on two fronts: - -1. `cmt_value_dependencies` (direct location-based use→def edges) was replaced by - `cmt_declaration_dependencies`, which identifies declarations by `Shape.Uid`. A - cmt's `cmt_uid_to_decl` only maps the uids it *defines*, so cross-module uids - can't be resolved locally. (#203 also only carries a small subset of edges here — - e.g. `typecore.cmt` exposes ~35 — so this is not the main reference source anyway.) -2. The dominant reference source is the **typedtree walk** (`DeadValue.collectExpr`, - `Texp_ident` → `val_loc`). In 5.3 the `val_loc` on a cross-module reference's - `value_description` no longer matches where the declaration is registered, so the - use→decl edge is dropped → widely-used modules look dead. - -**Experiments (in a local reanalyze fix branch):** -- Added a global, order-independent `Shape.Uid → declaration` table (pre-pass over - all cmts) and resolved `cmt_declaration_dependencies` against it. Correct and - necessary foundation, but ~no effect (that channel carries few edges). -- Then resolved `Texp_ident` references via the value's `val_uid` through that table - instead of `val_loc`. This **regressed** (Dead Value 2129 → 2526), because - declarations are still registered at their old location key, so moving only the - *reference* side just relocates the mismatch. - -**Conclusion:** the fix is a real refactor, not a patch — reanalyze's DCE core must -key declarations *and* references by the same canonical identity (uid-based) so the -two sides agree. Best done upstream on reanalyze#203 (issue #202), ideally with its -author. Until then, treat the report as a lead generator needing per-item manual -verification, not a worklist. - -## Making it actionable (once #203's dependency tracking is solid) +default (slow). So code used only by the playground can still show as dead. + +## Keeping the report actionable - declare entry points live with `-live-paths` / `-live-names`, - `@live`/`@dead` source annotations (precedent: ~38 already exist in @@ -132,7 +87,7 @@ Complementary, with a subtle boundary: ## CI integration (proposed, not yet wired) -Once roots are fixed and a clean baseline exists, gate CI on **new** dead code: -run `run-dce.sh`, diff against a checked-in baseline, fail on additions. Open -question: how to depend on the external unmerged reanalyze#203 (pin a commit, vendor -it, or wait for merge). +Once the backlog is cleaned up, gate CI on **new** dead code: run `run-dce.sh`, +diff against the checked-in baseline, and fail on additions. Open question: how to +depend on the external unmerged analyzer fix long-term (pin a commit, vendor it, +or wait for merge). diff --git a/scripts/dce/run-dce.sh b/scripts/dce/run-dce.sh index cc0bc98d511..d4e4f77f389 100755 --- a/scripts/dce/run-dce.sh +++ b/scripts/dce/run-dce.sh @@ -7,8 +7,8 @@ # ReScript cmt format used for .res -> .cmt, so it CANNOT read the compiler's own # cmts (fails with Cmi_format.Error). We therefore use the STANDALONE reanalyze # built against the host compiler-libs. OCaml 5.3 support comes from -# rescript-lang/reanalyze#203 (branch `ocaml-5-3`), which is not yet merged, so we -# pin its commit here. +# rescript-lang/reanalyze#203 plus follow-up fixes from JonoPrest's +# `jono/cmt-sourcefile-fallback` branch, so we pin that branch commit here. # # Usage: scripts/dce/run-dce.sh [output-file] # Output defaults to _dce/report.txt @@ -17,10 +17,10 @@ set -euo pipefail REPO_ROOT="$(cd "$(dirname "$0")/../.." && pwd)" cd "$REPO_ROOT" -# Pinned standalone reanalyze with OCaml 5.3 support (PR #203). -REANALYZE_REPO="https://github.com/rescript-lang/reanalyze.git" -REANALYZE_REF="${REANALYZE_REF:-1327343}" # head of branch ocaml-5-3 at time of writing -REANALYZE_SRC="${REANALYZE_SRC:-$HOME/.cache/rescript-dce/reanalyze}" +# Pinned standalone reanalyze with OCaml 5.3 support and cmt source-file fixes. +REANALYZE_REPO="${REANALYZE_REPO:-https://github.com/JonoPrest/reanalyze.git}" +REANALYZE_REF="${REANALYZE_REF:-c7ee038f772e5175253527236c5eac44c02f6136}" # jono/cmt-sourcefile-fallback +REANALYZE_SRC="${REANALYZE_SRC:-$HOME/.cache/rescript-dce/reanalyze-cmt-sourcefile-fallback}" OUT="${1:-_dce/report.txt}" mkdir -p "$(dirname "$OUT")" From bd4f861f3207758fb79a77a9d22a9ee45b42f529 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 15:17:22 +0000 Subject: [PATCH 169/214] dce: trim ctype --- _dce/report.txt | 440 +----------------------------------------- compiler/ml/ctype.ml | 186 ------------------ compiler/ml/ctype.mli | 71 ------- compiler/ml/types.mli | 3 +- 4 files changed, 2 insertions(+), 698 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index c7f450743cf..eb065c675c5 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -2677,444 +2677,6 @@ <-- line 5 deprecated_text: string; [@dead "deprecated_used.deprecated_text"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 131, characters 0-111 - +begin_class_def is never used - <-- line 131 - incr current_level [@@dead "+begin_class_def"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 134, characters 0-126 - +raise_nongen_level is never used - <-- line 134 - nongen_level := !current_level [@@dead "+raise_nongen_level"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 278, characters 0-106 - +object_fields is never used - <-- line 278 - | _ -> assert false [@@dead "+object_fields"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 333, characters 0-293 - +close_object is never used - <-- line 333 - | _ -> assert false [@@dead "+close_object"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 347, characters 0-255 - +row_variable is never used - <-- line 347 - | _ -> assert false [@@dead "+row_variable"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 362, characters 0-162 - +set_object_name is never used - <-- line 362 - | _ -> assert false [@@dead "+set_object_name"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 367, characters 0-171 - +remove_object_name is never used - <-- line 367 - | _ -> fatal_error "Ctype.remove_object_name" [@@dead "+remove_object_name"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 375, characters 0-320 - +hide_private_methods is never used - <-- line 375 - | _ -> assert false [@@dead "+hide_private_methods"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 526, characters 2-54 - closed_class_failure.CC_Method is a variant case which is never constructed - <-- line 526 - | CC_Method of type_expr * bool * string * type_expr [@dead "closed_class_failure.CC_Method"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 527, characters 2-53 - closed_class_failure.CC_Value is a variant case which is never constructed - <-- line 527 - | CC_Value of type_expr * bool * string * type_expr [@dead "closed_class_failure.CC_Value"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 717, characters 0-64 - +generalize_global is never used - <-- line 717 - let generalize_global ty = generalize_structure !global_level ty [@@dead "+generalize_global"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 724, characters 0-1352 - +limited_generalize is never used - <-- line 724 - graph [@@dead "+limited_generalize"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 987, characters 0-154 - +generic_instance is never used - <-- line 987 - ty [@@dead "+generic_instance"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 1059, characters 0-219 - +instance_parameterized_type_2 is never used - <-- line 1059 - (ty_args, ty_lst, ty) [@@dead "+instance_parameterized_type_2"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 2819, characters 0-84 - +check_filter_method is never used - <-- line 2819 - ignore (filter_method env name priv ty) [@@dead "+check_filter_method"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 2822, characters 0-230 - +filter_self_method is never used - <-- line 2822 - pair [@@dead "+filter_self_method"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 3293, characters 2-20 - class_match_failure.CM_Virtual_class is a variant case which is never constructed - <-- line 3293 - | CM_Virtual_class [@dead "class_match_failure.CM_Virtual_class"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 3294, characters 2-44 - class_match_failure.CM_Parameter_arity_mismatch is a variant case which is never constructed - <-- line 3294 - | CM_Parameter_arity_mismatch of int * int [@dead "class_match_failure.CM_Parameter_arity_mismatch"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 3295, characters 2-70 - class_match_failure.CM_Type_parameter_mismatch is a variant case which is never constructed - <-- line 3295 - | CM_Type_parameter_mismatch of Env.t * (type_expr * type_expr) list [@dead "class_match_failure.CM_Type_parameter_mismatch"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 3296, characters 2-65 - class_match_failure.CM_Parameter_mismatch is a variant case which is never constructed - <-- line 3296 - | CM_Parameter_mismatch of Env.t * (type_expr * type_expr) list [@dead "class_match_failure.CM_Parameter_mismatch"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 3297, characters 2-73 - class_match_failure.CM_Val_type_mismatch is a variant case which is never constructed - <-- line 3297 - | CM_Val_type_mismatch of string * Env.t * (type_expr * type_expr) list [@dead "class_match_failure.CM_Val_type_mismatch"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 3298, characters 2-74 - class_match_failure.CM_Meth_type_mismatch is a variant case which is never constructed - <-- line 3298 - | CM_Meth_type_mismatch of string * Env.t * (type_expr * type_expr) list [@dead "class_match_failure.CM_Meth_type_mismatch"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 3299, characters 2-34 - class_match_failure.CM_Non_mutable_value is a variant case which is never constructed - <-- line 3299 - | CM_Non_mutable_value of string [@dead "class_match_failure.CM_Non_mutable_value"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 3300, characters 2-35 - class_match_failure.CM_Non_concrete_value is a variant case which is never constructed - <-- line 3300 - | CM_Non_concrete_value of string [@dead "class_match_failure.CM_Non_concrete_value"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 3301, characters 2-30 - class_match_failure.CM_Missing_value is a variant case which is never constructed - <-- line 3301 - | CM_Missing_value of string [@dead "class_match_failure.CM_Missing_value"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 3302, characters 2-31 - class_match_failure.CM_Missing_method is a variant case which is never constructed - <-- line 3302 - | CM_Missing_method of string [@dead "class_match_failure.CM_Missing_method"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 3303, characters 2-28 - class_match_failure.CM_Hide_public is a variant case which is never constructed - <-- line 3303 - | CM_Hide_public of string [@dead "class_match_failure.CM_Hide_public"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 3304, characters 2-38 - class_match_failure.CM_Hide_virtual is a variant case which is never constructed - <-- line 3304 - | CM_Hide_virtual of string * string [@dead "class_match_failure.CM_Hide_virtual"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 3305, characters 2-30 - class_match_failure.CM_Public_method is a variant case which is never constructed - <-- line 3305 - | CM_Public_method of string [@dead "class_match_failure.CM_Public_method"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 3306, characters 2-31 - class_match_failure.CM_Private_method is a variant case which is never constructed - <-- line 3306 - | CM_Private_method of string [@dead "class_match_failure.CM_Private_method"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 3307, characters 2-31 - class_match_failure.CM_Virtual_method is a variant case which is never constructed - <-- line 3307 - | CM_Virtual_method of string [@dead "class_match_failure.CM_Virtual_method"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 4053, characters 0-100 - +arity is never used - <-- line 4053 - | _ -> 0 [@@dead "+arity"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 4366, characters 0-599 - +collapse_conj is never used - <-- line 4366 - | _ -> iter_type_expr (collapse_conj env visited) ty [@@dead "+collapse_conj"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 4385, characters 0-77 - +collapse_conj_params is never used - <-- line 4385 - let collapse_conj_params env params = List.iter (collapse_conj env []) params [@@dead "+collapse_conj_params"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.mli", line 70, characters 0-34 - +begin_class_def is never used - <-- line 70 - val begin_class_def : unit -> unit [@@dead "+begin_class_def"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.mli", line 71, characters 0-37 - +raise_nongen_level is never used - <-- line 71 - val raise_nongen_level : unit -> unit [@@dead "+raise_nongen_level"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.mli", line 105, characters 0-42 - +object_fields is never used - <-- line 105 - val object_fields : type_expr -> type_expr [@@dead "+object_fields"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.mli", line 118, characters 0-36 - +close_object is never used - <-- line 118 - val close_object : type_expr -> unit [@@dead "+close_object"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.mli", line 119, characters 0-41 - +row_variable is never used - <-- line 119 - val row_variable : type_expr -> type_expr [@@dead "+row_variable"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.mli", line 122, characters 0-83 - +set_object_name is never used - <-- line 122 - Ident.t -> type_expr -> type_expr list -> type_expr -> unit [@@dead "+set_object_name"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.mli", line 124, characters 0-42 - +remove_object_name is never used - <-- line 124 - val remove_object_name : type_expr -> unit [@@dead "+remove_object_name"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.mli", line 125, characters 0-44 - +hide_private_methods is never used - <-- line 125 - val hide_private_methods : type_expr -> unit [@@dead "+hide_private_methods"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.mli", line 126, characters 0-74 - +find_cltype_for_path is never used - <-- line 126 - val find_cltype_for_path : Env.t -> Path.t -> type_declaration * type_expr [@@dead "+find_cltype_for_path"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.mli", line 129, characters 0-74 - +sort_row_fields is never used - <-- line 129 - val sort_row_fields : (label * row_field) list -> (label * row_field) list [@@dead "+sort_row_fields"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.mli", line 146, characters 0-41 - +generalize_global is never used - <-- line 146 - val generalize_global : type_expr -> unit [@@dead "+generalize_global"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.mli", line 156, characters 0-55 - +limited_generalize is never used - <-- line 156 - val limited_generalize : type_expr -> type_expr -> unit [@@dead "+limited_generalize"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.mli", line 169, characters 0-54 - +generic_instance is never used - <-- line 169 - val generic_instance : Env.t -> type_expr -> type_expr [@@dead "+generic_instance"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.mli", line 183, characters 0-136 - +instance_parameterized_type_2 is never used - <-- line 183 - type_expr list * type_expr list * type_expr [@@dead "+instance_parameterized_type_2"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.mli", line 214, characters 0-49 - +full_expand is never used - <-- line 214 - val full_expand : Env.t -> type_expr -> type_expr [@@dead "+full_expand"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.mli", line 245, characters 0-78 - +check_filter_method is never used - <-- line 245 - val check_filter_method : Env.t -> string -> private_flag -> type_expr -> unit [@@dead "+check_filter_method"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.mli", line 250, characters 0-141 - +filter_self_method is never used - <-- line 250 - Ident.t * type_expr [@@dead "+filter_self_method"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.mli", line 260, characters 0-42 - +rigidify is never used - <-- line 260 - val rigidify : type_expr -> type_expr list [@@dead "+rigidify"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.mli", line 263, characters 0-55 - +all_distinct_vars is never used - <-- line 263 - val all_distinct_vars : Env.t -> type_expr list -> bool [@@dead "+all_distinct_vars"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.mli", line 271, characters 2-20 - class_match_failure.CM_Virtual_class is a variant case which is never constructed - <-- line 271 - | CM_Virtual_class [@dead "class_match_failure.CM_Virtual_class"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.mli", line 272, characters 2-44 - class_match_failure.CM_Parameter_arity_mismatch is a variant case which is never constructed - <-- line 272 - | CM_Parameter_arity_mismatch of int * int [@dead "class_match_failure.CM_Parameter_arity_mismatch"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.mli", line 273, characters 2-70 - class_match_failure.CM_Type_parameter_mismatch is a variant case which is never constructed - <-- line 273 - | CM_Type_parameter_mismatch of Env.t * (type_expr * type_expr) list [@dead "class_match_failure.CM_Type_parameter_mismatch"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.mli", line 274, characters 2-65 - class_match_failure.CM_Parameter_mismatch is a variant case which is never constructed - <-- line 274 - | CM_Parameter_mismatch of Env.t * (type_expr * type_expr) list [@dead "class_match_failure.CM_Parameter_mismatch"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.mli", line 275, characters 2-73 - class_match_failure.CM_Val_type_mismatch is a variant case which is never constructed - <-- line 275 - | CM_Val_type_mismatch of string * Env.t * (type_expr * type_expr) list [@dead "class_match_failure.CM_Val_type_mismatch"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.mli", line 276, characters 2-74 - class_match_failure.CM_Meth_type_mismatch is a variant case which is never constructed - <-- line 276 - | CM_Meth_type_mismatch of string * Env.t * (type_expr * type_expr) list [@dead "class_match_failure.CM_Meth_type_mismatch"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.mli", line 277, characters 2-34 - class_match_failure.CM_Non_mutable_value is a variant case which is never constructed - <-- line 277 - | CM_Non_mutable_value of string [@dead "class_match_failure.CM_Non_mutable_value"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.mli", line 278, characters 2-35 - class_match_failure.CM_Non_concrete_value is a variant case which is never constructed - <-- line 278 - | CM_Non_concrete_value of string [@dead "class_match_failure.CM_Non_concrete_value"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.mli", line 279, characters 2-30 - class_match_failure.CM_Missing_value is a variant case which is never constructed - <-- line 279 - | CM_Missing_value of string [@dead "class_match_failure.CM_Missing_value"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.mli", line 280, characters 2-31 - class_match_failure.CM_Missing_method is a variant case which is never constructed - <-- line 280 - | CM_Missing_method of string [@dead "class_match_failure.CM_Missing_method"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.mli", line 281, characters 2-28 - class_match_failure.CM_Hide_public is a variant case which is never constructed - <-- line 281 - | CM_Hide_public of string [@dead "class_match_failure.CM_Hide_public"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.mli", line 282, characters 2-38 - class_match_failure.CM_Hide_virtual is a variant case which is never constructed - <-- line 282 - | CM_Hide_virtual of string * string [@dead "class_match_failure.CM_Hide_virtual"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.mli", line 283, characters 2-30 - class_match_failure.CM_Public_method is a variant case which is never constructed - <-- line 283 - | CM_Public_method of string [@dead "class_match_failure.CM_Public_method"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.mli", line 284, characters 2-31 - class_match_failure.CM_Private_method is a variant case which is never constructed - <-- line 284 - | CM_Private_method of string [@dead "class_match_failure.CM_Private_method"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.mli", line 285, characters 2-31 - class_match_failure.CM_Virtual_method is a variant case which is never constructed - <-- line 285 - | CM_Virtual_method of string [@dead "class_match_failure.CM_Virtual_method"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.mli", line 315, characters 0-44 - +is_contractive is never used - <-- line 315 - val is_contractive : Env.t -> Path.t -> bool [@@dead "+is_contractive"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.mli", line 327, characters 2-54 - closed_class_failure.CC_Method is a variant case which is never constructed - <-- line 327 - | CC_Method of type_expr * bool * string * type_expr [@dead "closed_class_failure.CC_Method"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.mli", line 328, characters 2-53 - closed_class_failure.CC_Value is a variant case which is never constructed - <-- line 328 - | CC_Value of type_expr * bool * string * type_expr [@dead "closed_class_failure.CC_Value"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.mli", line 331, characters 0-28 - +arity is never used - <-- line 331 - val arity : type_expr -> int [@@dead "+arity"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.mli", line 334, characters 0-58 - +collapse_conj_params is never used - <-- line 334 - val collapse_conj_params : Env.t -> type_expr list -> unit [@@dead "+collapse_conj_params"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/datarepr.ml", line 261, characters 0-420 +find_constr is never used @@ -4483,4 +4045,4 @@ <-- line 99 type f = May_pos | May_neg | May_weak [@dead "Variance.f.May_weak"] | Inj | Pos | Neg | Inv - Analysis reported 867 issues (Warning Dead Module:4, Warning Dead Type:165, Warning Dead Value:343, Warning Dead Value With Side Effects:8, Warning Redundant Optional Argument:198, Warning Unused Argument:149) + Analysis reported 794 issues (Warning Dead Module:4, Warning Dead Type:131, Warning Dead Value:304, Warning Dead Value With Side Effects:8, Warning Redundant Optional Argument:198, Warning Unused Argument:149) diff --git a/compiler/ml/ctype.ml b/compiler/ml/ctype.ml index 57969b3def6..531926f0253 100644 --- a/compiler/ml/ctype.ml +++ b/compiler/ml/ctype.ml @@ -128,12 +128,6 @@ let begin_def () = saved_level := (!current_level, !nongen_level) :: !saved_level; incr current_level; nongen_level := !current_level -let begin_class_def () = - saved_level := (!current_level, !nongen_level) :: !saved_level; - incr current_level -let raise_nongen_level () = - saved_level := (!current_level, !nongen_level) :: !saved_level; - nongen_level := !current_level let end_def () = let cl, nl = List.hd !saved_level in saved_level := List.tl !saved_level; @@ -275,11 +269,6 @@ let is_datatype decl = type fields = (string * Types.field_kind * Types.type_expr) list (**** Object field manipulation. ****) -let object_fields ty = - match (repr ty).desc with - | Tobject (fields, _) -> fields - | _ -> assert false - let flatten_fields (ty : Types.type_expr) : fields * _ = let rec flatten (l : fields) ty = let ty = repr ty in @@ -328,64 +317,6 @@ let concrete_object ty = | Tvar _ -> false | _ -> true -(**** Close an object ****) - -let close_object ty = - let rec close ty = - let ty = repr ty in - match ty.desc with - | Tvar _ -> link_type ty (newty2 ty.level Tnil) - | Tfield (_, _, _, ty') -> close ty' - | _ -> assert false - in - match (repr ty).desc with - | Tobject (ty, _) -> close ty - | _ -> assert false - -(**** Row variable of an object type ****) - -let row_variable ty = - let rec find ty = - let ty = repr ty in - match ty.desc with - | Tfield (_, _, _, ty) -> find ty - | Tvar _ -> ty - | _ -> assert false - in - match (repr ty).desc with - | Tobject (fi, _) -> find fi - | _ -> assert false - -(**** Object name manipulation ****) -(* +++ Bientot obsolete *) - -let set_object_name id rv params ty = - match (repr ty).desc with - | Tobject (_fi, nm) -> set_name nm (Some (Path.Pident id, rv :: params)) - | _ -> assert false - -let remove_object_name ty = - match (repr ty).desc with - | Tobject (_, nm) -> set_name nm None - | Tconstr (_, _, _) -> () - | _ -> fatal_error "Ctype.remove_object_name" - -(**** Hiding of private methods ****) - -let hide_private_methods ty = - match (repr ty).desc with - | Tobject (fi, nm) -> - nm := None; - let fl, _ = flatten_fields fi in - List.iter - (function - | _, k, _ -> ( - match field_kind_repr k with - | Fvar r -> set_kind r Fabsent - | _ -> ())) - fl - | _ -> assert false - (*******************************) (* Operations on class types *) (*******************************) @@ -522,10 +453,6 @@ let closed_extension_constructor ext = unmark_extension_constructor ext; Some ty -type closed_class_failure = - | CC_Method of type_expr * bool * string * type_expr - | CC_Value of type_expr * bool * string * type_expr - (**********************) (* Type duplication *) (**********************) @@ -714,54 +641,11 @@ let generalize_expansive env ty = try generalize_expansive env !nongen_level (Hashtbl.create 7) ty with Unify ([(_, ty')] as tr) -> raise (Unify ((ty, ty') :: tr)) -let generalize_global ty = generalize_structure !global_level ty let generalize_structure ty = generalize_structure !current_level ty (* Correct the levels of type [ty]. *) let correct_levels ty = duplicate_type ty -(* Only generalize the type ty0 in ty *) -let limited_generalize ty0 ty = - let ty0 = repr ty0 in - - let graph = Hashtbl.create 17 in - let idx = ref lowest_level in - let roots = ref [] in - - let rec inverse pty ty = - let ty = repr ty in - if ty.level > !current_level || ty.level = generic_level then ( - decr idx; - Hashtbl.add graph !idx (ty, ref pty); - if ty.level = generic_level || ty == ty0 then roots := ty :: !roots; - set_level ty !idx; - iter_type_expr (inverse [ty]) ty) - else if ty.level < lowest_level then - let _, parents = Hashtbl.find graph ty.level in - parents := pty @ !parents - and generalize_parents ty = - let idx = ty.level in - if idx <> generic_level then ( - set_level ty generic_level; - List.iter generalize_parents !(snd (Hashtbl.find graph idx)); - (* Special case for rows: must generalize the row variable *) - match ty.desc with - | Tvariant row -> - let more = row_more row in - let lv = more.level in - if (lv < lowest_level || lv > !current_level) && lv <> generic_level - then set_level more generic_level - | _ -> ()) - in - - inverse [] ty; - if ty0.level < lowest_level then iter_type_expr (inverse []) ty0; - List.iter generalize_parents !roots; - Hashtbl.iter - (fun _ (ty, _) -> - if ty.level <> generic_level then set_level ty !current_level) - graph - (* Compute statically the free univars of all nodes in a type *) (* This avoids doing it repeatedly during instantiation *) @@ -984,13 +868,6 @@ let instance_def sch = cleanup_types (); ty -let generic_instance env sch = - let old = !current_level in - current_level := generic_level; - let ty = instance env sch in - current_level := old; - ty - let instance_list env schl = let env = gadt_env env in let tyl = List.map (fun t -> copy ?env t) schl in @@ -1056,13 +933,6 @@ let instance_parameterized_type ?keep_names sch_args sch = cleanup_types (); (ty_args, ty) -let instance_parameterized_type_2 sch_args sch_lst sch = - let ty_args = List.map simple_copy sch_args in - let ty_lst = List.map simple_copy sch_lst in - let ty = copy sch in - cleanup_types (); - (ty_args, ty_lst, ty) - let map_kind f = function | Type_abstract -> Type_abstract | Type_open -> Type_open @@ -2816,17 +2686,6 @@ let filter_method env name priv ty = | Tobject (f, _) -> filter_method_field env name priv f | _ -> raise (Unify []) -let check_filter_method env name priv ty = - ignore (filter_method env name priv ty) - -let filter_self_method env lab priv meths ty = - let ty' = filter_method env lab priv ty in - try Meths.find lab !meths - with Not_found -> - let pair = (Ident.create lab, ty') in - meths := Meths.add lab pair !meths; - pair - (***********************************) (* Matching between type schemes *) (***********************************) @@ -3289,23 +3148,6 @@ let equal env rename tyl1 tyl2 = (* Class type matching *) (*************************) -type class_match_failure = - | CM_Virtual_class - | CM_Parameter_arity_mismatch of int * int - | CM_Type_parameter_mismatch of Env.t * (type_expr * type_expr) list - | CM_Parameter_mismatch of Env.t * (type_expr * type_expr) list - | CM_Val_type_mismatch of string * Env.t * (type_expr * type_expr) list - | CM_Meth_type_mismatch of string * Env.t * (type_expr * type_expr) list - | CM_Non_mutable_value of string - | CM_Non_concrete_value of string - | CM_Missing_value of string - | CM_Missing_method of string - | CM_Hide_public of string - | CM_Hide_virtual of string * string - | CM_Public_method of string - | CM_Private_method of string - | CM_Virtual_method of string - (***************) (* Subtyping *) (***************) @@ -4049,12 +3891,6 @@ let unalias ty = | Tobject (ty, nm) -> newty2 ty.level (Tobject (unalias_object ty, nm)) | _ -> newty2 ty.level ty.desc -(* Return the arity (as for curried functions) of the given type. *) -let rec arity ty = - match (repr ty).desc with - | Tarrow (_, ret, _, _) -> 1 + arity ret - | _ -> 0 - (* Check whether an abbreviation expands to itself. *) let cyclic_abbrev env id ty = let rec check_cycle seen ty = @@ -4362,28 +4198,6 @@ let nondep_extension_constructor env mid ext = clear_hash (); raise Not_found -(* collapse conjunctive types in class parameters *) -let rec collapse_conj env visited ty = - let ty = repr ty in - if List.memq ty visited then () - else - let visited = ty :: visited in - match ty.desc with - | Tvariant row -> - let row = row_repr row in - List.iter - (fun (_l, fi) -> - match row_field_repr fi with - | Reither (c, t1 :: (_ :: _ as tl), m, e) -> - List.iter (unify env t1) tl; - set_row_field e (Reither (c, [t1], m, ref None)) - | _ -> ()) - row.row_fields; - iter_row (collapse_conj env visited) row - | _ -> iter_type_expr (collapse_conj env visited) ty - -let collapse_conj_params env params = List.iter (collapse_conj env []) params - let same_constr env t1 t2 = let t1 = expand_head env t1 in let t2 = expand_head env t2 in diff --git a/compiler/ml/ctype.mli b/compiler/ml/ctype.mli index 53d0a624f9e..ac0a064dbee 100644 --- a/compiler/ml/ctype.mli +++ b/compiler/ml/ctype.mli @@ -67,8 +67,6 @@ val begin_def : unit -> unit val end_def : unit -> unit (* Lower the variable level by one at the end of a definition *) -val begin_class_def : unit -> unit -val raise_nongen_level : unit -> unit val reset_global_level : unit -> unit (* Reset the global level before typing an expression *) @@ -102,7 +100,6 @@ val none : type_expr val repr : type_expr -> type_expr (* Return the canonical representative of a type. *) -val object_fields : type_expr -> type_expr val flatten_fields : type_expr -> (string * field_kind * type_expr) list * type_expr @@ -115,18 +112,8 @@ val associate_fields : * (string * field_kind * type_expr) list * (string * field_kind * type_expr) list val opened_object : type_expr -> bool -val close_object : type_expr -> unit -val row_variable : type_expr -> type_expr -(* Return the row variable of an open object type *) - -val set_object_name : - Ident.t -> type_expr -> type_expr list -> type_expr -> unit -val remove_object_name : type_expr -> unit -val hide_private_methods : type_expr -> unit -val find_cltype_for_path : Env.t -> Path.t -> type_declaration * type_expr val lid_of_path : ?hash:string -> Path.t -> Longident.t -val sort_row_fields : (label * row_field) list -> (label * row_field) list val merge_row_fields : (label * row_field) list -> (label * row_field) list -> @@ -143,20 +130,12 @@ val generalize_expansive : Env.t -> type_expr -> unit (* Generalize the covariant part of a type, making contravariant branches non-generalizable *) -val generalize_global : type_expr -> unit -(* Generalize the structure of a type, lowering variables - to !global_level *) - val generalize_structure : type_expr -> unit (* Same, but variables are only lowered to !current_level *) val correct_levels : type_expr -> type_expr (* Returns a copy with decreasing levels *) -val limited_generalize : type_expr -> type_expr -> unit -(* Only generalize some part of the type - Make the remaining of the type non-generalizable *) - val instance : ?partial:bool -> Env.t -> type_expr -> type_expr (* Take an instance of a type scheme *) @@ -166,9 +145,6 @@ val instance : ?partial:bool -> Env.t -> type_expr -> type_expr val instance_def : type_expr -> type_expr (* use defaults *) -val generic_instance : Env.t -> type_expr -> type_expr -(* Same as instance, but new nodes at generic_level *) - val instance_list : Env.t -> type_expr list -> type_expr list (* Take an instance of a list of type schemes *) @@ -180,11 +156,6 @@ val instance_constructor : val instance_parameterized_type : ?keep_names:bool -> type_expr list -> type_expr -> type_expr list * type_expr -val instance_parameterized_type_2 : - type_expr list -> - type_expr list -> - type_expr -> - type_expr list * type_expr list * type_expr val instance_declaration : type_declaration -> type_declaration val instance_poly : ?keep_names:bool -> @@ -211,7 +182,6 @@ val expand_head_opt : Env.t -> type_expr -> type_expr (** The compiler's own version of [expand_head] necessary for type-based optimisations. *) -val full_expand : Env.t -> type_expr -> type_expr val extract_concrete_typedecl : Env.t -> type_expr -> Path.t * Path.t * type_declaration (* Return the original path of the types, and the first concrete @@ -242,47 +212,15 @@ val filter_arrow : val filter_method : Env.t -> string -> private_flag -> type_expr -> type_expr (* A special case of unification (with {m : 'a; 'b}). *) -val check_filter_method : Env.t -> string -> private_flag -> type_expr -> unit -(* A special case of unification (with {m : 'a; 'b}), returning unit. *) - val occur_in : Env.t -> type_expr -> type_expr -> bool val deep_occur : type_expr -> type_expr -> bool -val filter_self_method : - Env.t -> - string -> - private_flag -> - (Ident.t * type_expr) Meths.t ref -> - type_expr -> - Ident.t * type_expr val moregeneral : Env.t -> bool -> type_expr -> type_expr -> bool (* Check if the first type scheme is more general than the second. *) -val rigidify : type_expr -> type_expr list -(* "Rigidify" a type and return its type variable *) - -val all_distinct_vars : Env.t -> type_expr list -> bool -(* Check those types are all distinct type variables *) - val matches : Env.t -> type_expr -> type_expr -> bool (* Same as [moregeneral false], implemented using the two above functions and backtracking. Ignore levels *) -type class_match_failure = - | CM_Virtual_class - | CM_Parameter_arity_mismatch of int * int - | CM_Type_parameter_mismatch of Env.t * (type_expr * type_expr) list - | CM_Parameter_mismatch of Env.t * (type_expr * type_expr) list - | CM_Val_type_mismatch of string * Env.t * (type_expr * type_expr) list - | CM_Meth_type_mismatch of string * Env.t * (type_expr * type_expr) list - | CM_Non_mutable_value of string - | CM_Non_concrete_value of string - | CM_Missing_value of string - | CM_Missing_method of string - | CM_Hide_public of string - | CM_Hide_virtual of string * string - | CM_Public_method of string - | CM_Private_method of string - | CM_Virtual_method of string val equal : Env.t -> bool -> type_expr list -> type_expr list -> bool (* [equal env [x1...xn] tau [y1...yn] sigma] checks whether the parameterized types @@ -312,7 +250,6 @@ val nondep_extension_constructor : (* Same for extension constructor *) (*val correct_abbrev: Env.t -> Path.t -> type_expr list -> type_expr -> unit*) val cyclic_abbrev : Env.t -> Ident.t -> type_expr -> bool -val is_contractive : Env.t -> Path.t -> bool val normalize_type : Env.t -> type_expr -> unit val closed_schema : Env.t -> type_expr -> bool @@ -323,16 +260,8 @@ val free_variables : type_expr -> type_expr list val closed_type_decl : type_declaration -> type_expr option val closed_extension_constructor : extension_constructor -> type_expr option -type closed_class_failure = - | CC_Method of type_expr * bool * string * type_expr - | CC_Value of type_expr * bool * string * type_expr val unalias : type_expr -> type_expr -val arity : type_expr -> int -(* Return the arity (as for curried functions) of the given type. *) - -val collapse_conj_params : Env.t -> type_expr list -> unit -(* Collapse conjunctive types in class parameters *) val get_current_level : unit -> int val wrap_trace_gadt_instances : Env.t -> ('a -> 'b) -> 'a -> 'b diff --git a/compiler/ml/types.mli b/compiler/ml/types.mli index 598030ff12e..29d20e0755c 100644 --- a/compiler/ml/types.mli +++ b/compiler/ml/types.mli @@ -81,8 +81,7 @@ and type_desc = [Tobject (_, `Some (`A.ct', [t1;...;tn]')] ==> [(t1, ..., tn) A.ct]. where A.ct is the type of some class. - There are also special cases for so-called "class-types", cf. [Typeclass] - and [Ctype.set_object_name]: + There are also special cases for so-called "class-types", cf. [Typeclass]: [Tobject (Tfield(_,_,...(Tfield(_,_,rv)...), Some(`A.#ct`, [rv;t1;...;tn])] From ff1867c0cda75b250f1eed8c2b22b029208e1342 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 15:18:58 +0000 Subject: [PATCH 170/214] dce: trim ml deps --- _dce/report.txt | 78 +--------------------------------------- compiler/ml/datarepr.ml | 14 -------- compiler/ml/datarepr.mli | 13 ------- compiler/ml/depend.ml | 6 ---- compiler/ml/depend.mli | 9 ----- 5 files changed, 1 insertion(+), 119 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index eb065c675c5..84ff128b195 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -2677,82 +2677,6 @@ <-- line 5 deprecated_text: string; [@dead "deprecated_used.deprecated_text"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/datarepr.ml", line 261, characters 0-420 - +find_constr is never used - <-- line 261 - else find_constr tag num_const (num_nonconst + 1) rem [@@dead "+find_constr"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/datarepr.ml", line 271, characters 0-66 - +find_constr_by_tag is never used - <-- line 271 - let find_constr_by_tag tag cstrlist = find_constr tag 0 0 cstrlist [@@dead "+find_constr_by_tag"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/datarepr.mli", line 32, characters 0-101 - +find_constr_by_tag is never used - <-- line 32 - constructor_tag -> constructor_declaration list -> constructor_declaration [@@dead "+find_constr_by_tag"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/datarepr.mli", line 35, characters 0-109 - +constructor_existentials is never used - <-- line 35 - constructor_arguments -> type_expr option -> type_expr list * type_expr list [@@dead "+constructor_existentials"] - - Warning Dead Value With Side Effects - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/depend.ml", line 21, characters 0-20 - +pp_deps is never used and could have side effects - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/depend.ml", line 39, characters 0-103 - +weaken_map is never used - <-- line 39 - Node (String_set.union s s0, String_map.map (weaken_map s) m0) [@@dead "+weaken_map"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/depend.ml", line 526, characters 0-70 - +add_implementation_binding is never used - <-- line 526 - and add_implementation_binding bv l = snd (add_structure_binding bv l) [@@dead "+add_implementation_binding"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/depend.mli", line 23, characters 0-34 - +make_leaf is never used - <-- line 23 - val make_leaf : string -> map_tree [@@dead "+make_leaf"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/depend.mli", line 24, characters 0-37 - +make_node is never used - <-- line 24 - val make_node : bound_map -> map_tree [@@dead "+make_node"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/depend.mli", line 25, characters 0-53 - +weaken_map is never used - <-- line 25 - val weaken_map : String_set.t -> map_tree -> map_tree [@@dead "+weaken_map"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/depend.mli", line 30, characters 0-29 - +pp_deps is never used - <-- line 30 - val pp_deps : string list ref [@@dead "+pp_deps"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/depend.mli", line 38, characters 0-78 - +add_implementation_binding is never used - <-- line 38 - val add_implementation_binding : bound_map -> Parsetree.structure -> bound_map [@@dead "+add_implementation_binding"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/depend.mli", line 39, characters 0-73 - +add_signature_binding is never used - <-- line 39 - val add_signature_binding : bound_map -> Parsetree.signature -> bound_map [@@dead "+add_signature_binding"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 230, characters 2-188 Tycomp_tbl.+local_keys is never used @@ -4045,4 +3969,4 @@ <-- line 99 type f = May_pos | May_neg | May_weak [@dead "Variance.f.May_weak"] | Inj | Pos | Neg | Inv - Analysis reported 794 issues (Warning Dead Module:4, Warning Dead Type:131, Warning Dead Value:304, Warning Dead Value With Side Effects:8, Warning Redundant Optional Argument:198, Warning Unused Argument:149) + Analysis reported 781 issues (Warning Dead Module:4, Warning Dead Type:131, Warning Dead Value:292, Warning Dead Value With Side Effects:7, Warning Redundant Optional Argument:198, Warning Unused Argument:149) diff --git a/compiler/ml/datarepr.ml b/compiler/ml/datarepr.ml index 44e2ba9afa2..a33e2c57f19 100644 --- a/compiler/ml/datarepr.ml +++ b/compiler/ml/datarepr.ml @@ -256,20 +256,6 @@ let label_descrs ty_res lbls repres priv = in describe_labels 0 lbls -exception Constr_not_found - -let rec find_constr tag num_const num_nonconst = function - | [] -> raise Constr_not_found - | ({cd_args = Cstr_tuple []; _} as c) :: rem -> - if Types.equal_tag tag (Cstr_constant num_const) then c - else find_constr tag (num_const + 1) num_nonconst rem - | c :: rem -> - if Types.equal_tag tag (Cstr_block num_nonconst) || tag = Cstr_unboxed then - c - else find_constr tag num_const (num_nonconst + 1) rem - -let find_constr_by_tag tag cstrlist = find_constr tag 0 0 cstrlist - let constructors_of_type ty_path decl = match decl.type_kind with | Type_variant cstrs -> constructor_descrs ty_path decl cstrs diff --git a/compiler/ml/datarepr.mli b/compiler/ml/datarepr.mli index 47113d87e8e..bf60c253a8b 100644 --- a/compiler/ml/datarepr.mli +++ b/compiler/ml/datarepr.mli @@ -27,18 +27,5 @@ val labels_of_type : val constructors_of_type : Path.t -> type_declaration -> (Ident.t * constructor_description) list -exception Constr_not_found - -val find_constr_by_tag : - constructor_tag -> constructor_declaration list -> constructor_declaration - -val constructor_existentials : - constructor_arguments -> type_expr option -> type_expr list * type_expr list -(** Takes [cd_args] and [cd_res] from a [constructor_declaration] and - returns: - - the types of the constructor's arguments - - the existential variables introduced by the constructor - *) - (* Set the polymorphic variant row_name field *) val set_row_name : type_declaration -> Path.t -> unit diff --git a/compiler/ml/depend.ml b/compiler/ml/depend.ml index 3b00ff9e5a3..bf3b216da90 100644 --- a/compiler/ml/depend.ml +++ b/compiler/ml/depend.ml @@ -18,8 +18,6 @@ open Location open Longident open Parsetree -let pp_deps = ref [] - module String_set = Set.Make (struct type t = string let compare = compare @@ -36,8 +34,6 @@ let bound = Node (String_set.empty, String_map.empty) let get_map (Node (_s, m)) = m let make_leaf s = Node (String_set.singleton s, String_map.empty) let make_node m = Node (String_set.empty, m) -let rec weaken_map s (Node (s0, m0)) = - Node (String_set.union s s0, String_map.map (weaken_map s) m0) let rec collect_free (Node (s, m)) = String_map.fold (fun _ n -> String_set.union (collect_free n)) m s @@ -522,5 +518,3 @@ and add_struct_item (bv, m) item : _ String_map.t * _ String_map.t = and add_implementation bv l = if !Clflags.transparent_modules then ignore (add_structure_binding bv l) else ignore (add_structure bv l) - -and add_implementation_binding bv l = snd (add_structure_binding bv l) diff --git a/compiler/ml/depend.mli b/compiler/ml/depend.mli index aa41f121e5e..75106446056 100644 --- a/compiler/ml/depend.mli +++ b/compiler/ml/depend.mli @@ -20,20 +20,11 @@ module String_map : Map.S with type key = string type map_tree = Node of String_set.t * bound_map and bound_map = map_tree String_map.t -val make_leaf : string -> map_tree -val make_node : bound_map -> map_tree -val weaken_map : String_set.t -> map_tree -> map_tree val free_structure_names : String_set.t ref -(* dependencies found by preprocessing tools (plugins) *) -val pp_deps : string list ref - val open_module : bound_map -> Longident.t -> bound_map val add_signature : bound_map -> Parsetree.signature -> unit val add_implementation : bound_map -> Parsetree.structure -> unit - -val add_implementation_binding : bound_map -> Parsetree.structure -> bound_map -val add_signature_binding : bound_map -> Parsetree.signature -> bound_map From d9ab0e7a2c81ad992403c18805ba04735cece538 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 15:25:02 +0000 Subject: [PATCH 171/214] dce: trim env --- _dce/report.txt | 188 ++++++-------------------------------------- compiler/ml/env.ml | 74 ----------------- compiler/ml/env.mli | 34 +------- 3 files changed, 24 insertions(+), 272 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index 84ff128b195..2f8f2a48555 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -1316,59 +1316,59 @@ optional argument from_type of function +unbound_constructor_error is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 116, characters 0-90 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 112, characters 0-90 optional argument loc of function +lookup_modtype is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 110, characters 0-63 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 106, characters 0-63 optional argument loc of function +lookup_type is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 105, characters 0-112 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 101, characters 0-112 optional argument loc of function +lookup_all_labels is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 99, characters 0-124 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 96, characters 0-124 optional argument loc of function +lookup_all_constructors is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 97, characters 0-89 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 94, characters 0-89 optional argument loc of function +lookup_constructor is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 95, characters 0-86 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 92, characters 0-86 optional argument loc of function +lookup_value is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 1268, characters 0-295 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 1216, characters 0-295 optional argument loc of function +lookup_all_labels is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 1234, characters 0-313 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 1190, characters 0-313 optional argument loc of function +lookup_all_constructors is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 1222, characters 0-206 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 1178, characters 0-206 optional argument loc of function +lookup_constructor is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 1206, characters 0-137 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 1162, characters 0-137 optional argument loc of function +lookup_type is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 1201, characters 0-138 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 1157, characters 0-138 optional argument loc of function +lookup_value is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 1145, characters 0-84 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 1101, characters 0-84 optional argument loc of function +lookup_modtype is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 1104, characters 0-663 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 1060, characters 0-663 optional argument loc of function +lookup_all_simple is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 1092, characters 0-391 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 1048, characters 0-391 optional argument loc of function +lookup is never used Warning Redundant Optional Argument @@ -2678,169 +2678,27 @@ deprecated_text: string; [@dead "deprecated_used.deprecated_text"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 230, characters 2-188 - Tycomp_tbl.+local_keys is never used - <-- line 230 - | None -> acc [@@dead "Tycomp_tbl.+local_keys"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 236, characters 2-257 - Tycomp_tbl.+diff_keys is never used - <-- line 236 - with Not_found -> true) [@@dead "Tycomp_tbl.+diff_keys"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 360, characters 2-188 - Id_tbl.+local_keys is never used - <-- line 360 - | None -> acc [@@dead "Id_tbl.+local_keys"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 377, characters 2-200 - Id_tbl.+diff_keys is never used - <-- line 377 - with Not_found -> true) [@@dead "Id_tbl.+diff_keys"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 509, characters 0-75 - +is_ident is never used - <-- line 509 - | Pdot _ | Papply _ -> false [@@dead "+is_ident"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 513, characters 0-90 - +is_local_ext is never used - <-- line 513 - | _ -> false [@@dead "+is_local_ext"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 517, characters 0-174 - +diff is never used - <-- line 517 - @ Id_tbl.diff_keys env1.modules env2.modules [@@dead "+diff"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 604, characters 2-28 - pers_struct.ps_flags is a record label never used to read a value - <-- line 604 - ps_flags: pers_flags list; [@dead "pers_struct.ps_flags"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 762, characters 0-434 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 718, characters 0-434 +reset_cache_toplevel is never used - <-- line 762 + <-- line 718 Hashtbl.clear prefixed_sg [@@dead "+reset_cache_toplevel"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 1260, characters 0-193 - +lookup_label is never used - <-- line 1260 - desc [@@dead "+lookup_label"] - - Warning Dead Value With Side Effects - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 1810, characters 0-57 - +enter_extension is never used and could have side effects - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 1921, characters 0-199 - +crc_of_unit is never used - <-- line 1921 - | Some crc -> crc [@@dead "+crc_of_unit"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 2071, characters 0-139 - +summary is never used - <-- line 2071 - else Env_constraints (env.summary, env.local_constraints) [@@dead "+summary"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 2093, characters 0-187 - +env_of_only_summary is never used - <-- line 2093 - {new_env with local_constraints = env.local_constraints; flags = env.flags} [@@dead "+env_of_only_summary"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 40, characters 0-33 - +diff is never used - <-- line 40 - val diff : t -> t -> Ident.t list [@@dead "+diff"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 74, characters 0-39 - +add_functor_arg is never used - <-- line 74 - val add_functor_arg : Ident.t -> t -> t [@@dead "+add_functor_arg"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 104, characters 0-75 - +lookup_label is never used - <-- line 104 - val lookup_label : ?loc:Location.t -> Longident.t -> t -> label_description [@@dead "+lookup_label"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 166, characters 0-73 - +enter_extension is never used - <-- line 166 - val enter_extension : string -> extension_constructor -> t -> Ident.t * t [@@dead "+enter_extension"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 176, characters 0-39 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 171, characters 0-39 +reset_cache_toplevel is never used - <-- line 176 + <-- line 171 val reset_cache_toplevel : unit -> unit [@@dead "+reset_cache_toplevel"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 196, characters 0-186 - +save_signature_with_imports is never used - <-- line 196 - Cmi_format.cmi_infos [@@dead "+save_signature_with_imports"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 209, characters 0-36 - +crc_of_unit is never used - <-- line 209 - val crc_of_unit : string -> Digest.t [@@dead "+crc_of_unit"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 217, characters 0-27 - +crc_units is never used - <-- line 217 - val crc_units : Consistbl.t [@@dead "+crc_units"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 218, characters 0-31 - +add_import is never used - <-- line 218 - val add_import : string -> unit [@@dead "+add_import"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 223, characters 0-26 - +summary is never used - <-- line 223 - val summary : t -> summary [@@dead "+summary"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 230, characters 0-61 - +env_of_only_summary is never used - <-- line 230 - val env_of_only_summary : (summary -> Subst.t -> t) -> t -> t [@@dead "+env_of_only_summary"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 244, characters 0-45 - +report_error is never used - <-- line 244 - val report_error : formatter -> error -> unit [@@dead "+report_error"] - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 320, characters 4-21 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 288, characters 4-21 t.filename is a record label never used to read a value - <-- line 320 + <-- line 288 filename: string; [@dead "t.filename"] (** Name of the file containing the signature. *) Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 321, characters 4-30 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.mli", line 289, characters 4-30 t.cmi is a record label never used to read a value - <-- line 321 + <-- line 289 cmi: Cmi_format.cmi_infos; [@dead "t.cmi"] Warning Dead Value @@ -3969,4 +3827,4 @@ <-- line 99 type f = May_pos | May_neg | May_weak [@dead "Variance.f.May_weak"] | Inj | Pos | Neg | Inv - Analysis reported 781 issues (Warning Dead Module:4, Warning Dead Type:131, Warning Dead Value:292, Warning Dead Value With Side Effects:7, Warning Redundant Optional Argument:198, Warning Unused Argument:149) + Analysis reported 757 issues (Warning Dead Module:4, Warning Dead Type:130, Warning Dead Value:270, Warning Dead Value With Side Effects:6, Warning Redundant Optional Argument:198, Warning Unused Argument:149) diff --git a/compiler/ml/env.ml b/compiler/ml/env.ml index 5dc7310f303..c4d16d23eb6 100644 --- a/compiler/ml/env.ml +++ b/compiler/ml/env.ml @@ -148,7 +148,6 @@ type summary = | Env_modtype of summary * Ident.t * modtype_declaration | Env_open of summary * Path.t | Env_functor_arg of summary * Ident.t - | Env_constraints of summary * type_declaration Path_map.t | Env_copy_types of summary * string list module Tycomp_tbl = struct @@ -227,21 +226,6 @@ module Tycomp_tbl = struct |> fold_name f next | None -> acc - let rec local_keys tbl acc = - let acc = Ident.fold_all (fun k _ accu -> k :: accu) tbl.current acc in - match tbl.opened with - | Some o -> local_keys o.next acc - | None -> acc - - let diff_keys is_local tbl1 tbl2 = - let keys2 = local_keys tbl2 [] in - Ext_list.filter keys2 (fun id -> - is_local (find_same id tbl2) - && - try - ignore (find_same id tbl1); - false - with Not_found -> true) end module Id_tbl = struct @@ -357,12 +341,6 @@ module Id_tbl = struct |> fold_name f next | None -> acc - let rec local_keys tbl acc = - let acc = Ident.fold_all (fun k _ accu -> k :: accu) tbl.current acc in - match tbl.opened with - | Some o -> local_keys o.next acc - | None -> acc - let rec iter f tbl = Ident.iter (fun id desc -> f id (Pident id, desc)) tbl.current; match tbl.opened with @@ -374,13 +352,6 @@ module Id_tbl = struct iter f next | None -> () - let diff_keys tbl1 tbl2 = - let keys2 = local_keys tbl2 [] in - Ext_list.filter keys2 (fun id -> - try - ignore (find_same id tbl1); - false - with Not_found -> true) end type type_descriptions = constructor_description list * label_description list @@ -506,19 +477,6 @@ let implicit_coercion env = let is_in_signature env = env.flags land in_signature_flag <> 0 let is_implicit_coercion env = env.flags land implicit_coercion_flag <> 0 -let is_ident = function - | Pident _ -> true - | Pdot _ | Papply _ -> false - -let is_local_ext = function - | {cstr_tag = Cstr_extension p} -> is_ident p - | _ -> false - -let diff env1 env2 = - Id_tbl.diff_keys env1.values env2.values - @ Tycomp_tbl.diff_keys is_local_ext env1.constrs env2.constrs - @ Id_tbl.diff_keys env1.modules env2.modules - type can_load_cmis = Can_load_cmis | Cannot_load_cmis of Env_lazy.log let can_load_cmis = ref Can_load_cmis @@ -601,7 +559,6 @@ type pers_struct = { ps_comps: module_components; ps_crcs: (string * Digest.t option) list; ps_filename: string; - ps_flags: pers_flags list; } [@@warning "-69"] @@ -679,7 +636,6 @@ let acknowledge_pers_struct check modname {Persistent_signature.filename; cmi} = ps_comps = comps; ps_crcs = crcs; ps_filename = filename; - ps_flags = flags; } in if ps.ps_name <> modname then @@ -1257,14 +1213,6 @@ let mark_constructor usage env name desc = let ty_name = Path.last ty_path in mark_constructor_used usage env ty_name ty_decl name -let lookup_label ?loc lid env = - match lookup_all_labels ?loc lid env with - | [] -> raise Not_found - | (desc, use) :: _ -> - mark_type_path env (ty_path desc.lbl_res); - use (); - desc - let lookup_all_labels ?loc lid env = try let lbls = lookup_all_labels ?loc lid env in @@ -1807,8 +1755,6 @@ let enter_value ?check = enter (store_value ?check) and enter_type = enter (store_type ~check:true) -and enter_extension = enter (store_extension ~check:true) - and enter_module_declaration ?arg id md env = add_module_declaration ?arg ~check:true id md env (* let (id, env) = enter store_module name md env in @@ -1916,15 +1862,6 @@ let read_signature modname filename = let ps = read_pers_struct modname filename in Lazy.force ps.ps_sig -(* Return the CRC of the interface of the given compilation unit *) - -let crc_of_unit name = - let ps = find_pers_struct name in - let crco = try List.assoc name ps.ps_crcs with Not_found -> assert false in - match crco with - | None -> assert false - | Some crc -> crc - (* Return the list of imported interfaces with their CRCs *) let imports () = @@ -1971,7 +1908,6 @@ let save_signature_with_imports ?check_exists ~deprecated sg modname filename ps_comps = comps; ps_crcs = (cmi.cmi_name, Some crc) :: imports; ps_filename = filename; - ps_flags = cmi.cmi_flags; } in save_pers_struct crc ps; @@ -2066,12 +2002,6 @@ let initial_safe_string = (add_extension ~check:false) empty -(* Return the environment summary *) - -let summary env = - if Path_map.is_empty env.local_constraints then env.summary - else Env_constraints (env.summary, env.local_constraints) - let last_env = ref empty let last_reduced_env = ref empty @@ -2090,10 +2020,6 @@ let keep_only_summary env = last_reduced_env := new_env; new_env -let env_of_only_summary env_from_summary env = - let new_env = env_from_summary env.summary Subst.identity in - {new_env with local_constraints = env.local_constraints; flags = env.flags} - (* Error report *) open Format diff --git a/compiler/ml/env.mli b/compiler/ml/env.mli index 908edc8af2e..2497d5ede09 100644 --- a/compiler/ml/env.mli +++ b/compiler/ml/env.mli @@ -29,7 +29,6 @@ type summary = | Env_modtype of summary * Ident.t * modtype_declaration | Env_open of summary * Path.t | Env_functor_arg of summary * Ident.t - | Env_constraints of summary * type_declaration Path_map.t | Env_copy_types of summary * string list type t @@ -37,7 +36,6 @@ type t val empty : t val initial_safe_string : t -val diff : t -> t -> Ident.t list val copy_local : from:t -> t -> t type type_descriptions = constructor_description list * label_description list @@ -71,7 +69,6 @@ val find_type_expansion_opt : (* Find the manifest type information associated to a type for the sake of the compiler's type-based optimisations. *) val find_modtype_expansion : Path.t -> t -> module_type -val add_functor_arg : Ident.t -> t -> t val is_functor_arg : Path.t -> t -> bool val normalize_path : Location.t option -> t -> Path.t -> Path.t @@ -101,7 +98,6 @@ val lookup_all_constructors : Longident.t -> t -> (constructor_description * (unit -> unit)) list -val lookup_label : ?loc:Location.t -> Longident.t -> t -> label_description val lookup_all_labels : ?loc:Location.t -> Longident.t -> @@ -163,7 +159,6 @@ val enter_value : t -> Ident.t * t val enter_type : string -> type_declaration -> t -> Ident.t * t -val enter_extension : string -> extension_constructor -> t -> Ident.t * t val enter_module : ?arg:bool -> string -> module_type -> t -> Ident.t * t val enter_module_declaration : ?arg:bool -> Ident.t -> module_declaration -> t -> t @@ -193,41 +188,18 @@ val save_signature : Cmi_format.cmi_infos (* Arguments: signature, module name, file name. *) -val save_signature_with_imports : - ?check_exists:unit -> - deprecated:string option -> - signature -> - string -> - string -> - (string * Digest.t option) list -> - Cmi_format.cmi_infos -(* Arguments: signature, module name, file name, - imported units with their CRCs. *) - -(* Return the CRC of the interface of the given compilation unit *) - -val crc_of_unit : string -> Digest.t - (* Return the set of compilation units imported, with their CRC *) val imports : unit -> (string * Digest.t option) list -(* Direct access to the table of imported compilation units with their CRC *) - -val crc_units : Consistbl.t -val add_import : string -> unit - (* Summaries -- compact representation of an environment, to be exported in debugging information. *) -val summary : t -> summary - (* Return an equivalent environment where all fields have been reset, except the summary. The initial environment can be rebuilt from the - summary, using Envaux.env_of_only_summary. *) + summary. *) val keep_only_summary : t -> t -val env_of_only_summary : (summary -> Subst.t -> t) -> t -> t (* Error report *) @@ -239,10 +211,6 @@ type error = exception Error of error -open Format - -val report_error : formatter -> error -> unit - val mark_value_used : t -> string -> value_description -> unit val mark_module_used : t -> string -> Location.t -> unit val mark_type_used : t -> string -> type_declaration -> unit From cc8e43c890db9b62d955ccf6d33ebc922da81857 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 15:25:35 +0000 Subject: [PATCH 172/214] dce: note env liveness --- scripts/dce/live-findings.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/scripts/dce/live-findings.md b/scripts/dce/live-findings.md index 61f03ea7aef..02943ed2131 100644 --- a/scripts/dce/live-findings.md +++ b/scripts/dce/live-findings.md @@ -112,6 +112,23 @@ live after manual validation. warnings. Removing the labels from the wrappers would drop source locations for those diagnostics even though reanalyze does not see the cross-module flow. +### `Env` external roots + +- Report: `Warning Dead Value` / `Warning Dead Type`, `compiler/ml/env.ml` and + `compiler/ml/env.mli`, for `reset_cache_toplevel` and the + `Persistent_signature.t` fields `filename` and `cmi`. +- Verdict: live; false positives. +- Validation: `compiler/jsoo/jsoo_playground_main.ml` calls + `Env.reset_cache_toplevel` from the playground reset path. + `compiler/core/bs_cmi_load.ml` returns + `Env.Persistent_signature.t option`, `compiler/core/bs_conditional_initial.ml` + installs that loader into `Env.Persistent_signature.load`, and + `compiler/ml/env.ml` reads both `filename` and `cmi` when acknowledging the + persistent signature. +- Context: the playground and core CMI loader are outside the roots reanalyze is + following for this report, so the exported reset hook and loader payload fields + look dead even though they are part of the live compiler setup. + ### `Location.report_error ?custom_intro ?src` - Report: `Warning Redundant Optional Argument`, `compiler/ml/location.ml` and From cd657661a23f2002546f075db88794245efa94a5 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 15:30:28 +0000 Subject: [PATCH 173/214] dce: trim ml matching --- _dce/report.txt | 150 +---------------------------- compiler/ml/error_message_utils.ml | 21 +--- compiler/ml/includemod.ml | 35 ------- compiler/ml/includemod.mli | 2 - compiler/ml/lambda.mli | 2 - compiler/ml/longident.mli | 1 - compiler/ml/matching.ml | 118 ----------------------- compiler/ml/matching.mli | 13 --- 8 files changed, 2 insertions(+), 340 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index 2f8f2a48555..a38ada4116a 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -2701,18 +2701,6 @@ <-- line 289 cmi: Cmi_format.cmi_infos; [@dead "t.cmi"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/error_message_utils.ml", line 20, characters 2-90 - Parser.+parse_expr_at_loc is never used - <-- line 20 - Warnings.loc -> (Parsetree.expression * comment list) option [@@dead "Parser.+parse_expr_at_loc"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/error_message_utils.ml", line 843, characters 0-347 - +type_clash_context_maybe_option is never used - <-- line 843 - | _ -> None [@@dead "+type_clash_context_maybe_option"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/experimental_features.ml", line 23, characters 0-52 +reset is never used @@ -2725,42 +2713,6 @@ <-- line 6 val reset : unit -> unit [@@dead "+reset"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/includemod.ml", line 146, characters 0-151 - +print_list is never used - <-- line 146 - print_list pr ppf l [@@dead "+print_list"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/includemod.ml", line 153, characters 0-73 - +print_list is never used - <-- line 153 - let print_list pr ppf l = Format.fprintf ppf "[@[%a@]]" (print_list pr) l [@@dead "+print_list"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/includemod.ml", line 155, characters 0-614 - +print_coercion is never used - <-- line 155 - pr "@[<2>alias %a@ (%a)@]" Printtyp.path p print_coercion c [@@dead "+print_coercion"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/includemod.ml", line 173, characters 0-86 - +print_coercion2 is never used - <-- line 173 - Format.fprintf ppf "@[%d,@ %a@]" n print_coercion c [@@dead "+print_coercion2"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/includemod.ml", line 176, characters 0-115 - +print_coercion3 is never used - <-- line 176 - Format.fprintf ppf "@[%s, %d,@ %a@]" (Ident.unique_name i) n print_coercion c [@@dead "+print_coercion3"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/includemod.mli", line 38, characters 0-57 - +print_coercion is never used - <-- line 38 - val print_coercion : formatter -> module_coercion -> unit [@@dead "+print_coercion"] - Warning Dead Type File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/lambda.ml", line 342, characters 43-53 let_kind.Variable is a variant case which is never constructed @@ -2773,106 +2725,6 @@ <-- line 299 type let_kind = Strict | Alias | StrictOpt | Variable [@dead "let_kind.Variable"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/lambda.mli", line 387, characters 0-36 - +const_unit is never used - <-- line 387 - val const_unit : structured_constant [@@dead "+const_unit"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/lambda.mli", line 393, characters 0-45 - +iter is never used - <-- line 393 - val iter : (lambda -> unit) -> lambda -> unit [@@dead "+iter"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/longident.mli", line 22, characters 0-39 - +unflatten is never used - <-- line 22 - val unflatten : string list -> t option [@@dead "+unflatten"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 452, characters 0-158 - +make_catch is never used - <-- line 452 - Lstaticcatch (k (make_exit e), (e, []), d) [@@dead "+make_catch"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 1532, characters 0-30 - +strings_test_threshold is never used - <-- line 1532 - let strings_test_threshold = 8 [@@dead "+strings_test_threshold"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 1534, characters 0-152 - +bind_sw is never used - <-- line 1534 - Llet (Strict, Pgenval, id, arg, k (Lvar id)) [@@dead "+bind_sw"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 1543, characters 0-429 - +make_string_test_sequence is never used - <-- line 1543 - sw d) [@@dead "+make_string_test_sequence"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 1561, characters 0-184 - +split is never used - <-- line 1561 - (x0 :: xs, y0, ys) [@@dead "+split"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 1570, characters 0-48 - +zero_lam is never used - <-- line 1570 - let zero_lam = Lconst (Const_base (Const_int 0)) [@@dead "+zero_lam"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 1572, characters 0-183 - +tree_way_test is never used - <-- line 1572 - Lifthenelse (Lprim (Pintcomp Clt, [zero_lam; arg], loc), gt, eq) ) [@@dead "+tree_way_test"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 1580, characters 0-479 - +do_make_string_test_tree is never used - <-- line 1580 - (do_make_string_test_tree loc arg gt delta d)) [@@dead "+do_make_string_test_tree"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 1595, characters 0-255 - +expand_stringswitch is never used - <-- line 1595 - make_catch e (fun d -> do_make_string_test_tree loc arg sw 1 (Some d))) [@@dead "+expand_stringswitch"] - - Warning Dead Value With Side Effects - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 2680, characters 0-63 - +check_partial_list is never used and could have side effects - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 2817, characters 0-577 - +for_tupled_function is never used - <-- line 2817 - with Unused -> partial_function loc () [@@dead "+for_tupled_function"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.mli", line 59, characters 0-115 - +for_tupled_function is never used - <-- line 59 - lambda [@@dead "+for_tupled_function"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.mli", line 68, characters 0-52 - +flatten_pattern is never used - <-- line 68 - val flatten_pattern : int -> pattern -> pattern list [@@dead "+flatten_pattern"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.mli", line 71, characters 0-101 - +expand_stringswitch is never used - <-- line 71 - Location.t -> lambda -> (string * lambda) list -> lambda option -> lambda [@@dead "+expand_stringswitch"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/mtype.ml", line 235, characters 0-248 +no_code_needed is never used @@ -3827,4 +3679,4 @@ <-- line 99 type f = May_pos | May_neg | May_weak [@dead "Variance.f.May_weak"] | Inj | Pos | Neg | Inv - Analysis reported 757 issues (Warning Dead Module:4, Warning Dead Type:130, Warning Dead Value:270, Warning Dead Value With Side Effects:6, Warning Redundant Optional Argument:198, Warning Unused Argument:149) + Analysis reported 732 issues (Warning Dead Module:4, Warning Dead Type:130, Warning Dead Value:246, Warning Dead Value With Side Effects:5, Warning Redundant Optional Argument:198, Warning Unused Argument:149) diff --git a/compiler/ml/error_message_utils.ml b/compiler/ml/error_message_utils.ml index 76867174493..6313fd75566 100644 --- a/compiler/ml/error_message_utils.ml +++ b/compiler/ml/error_message_utils.ml @@ -17,9 +17,6 @@ module Parser : sig val reprint_source : (Parsetree.structure -> comment list -> string) ref - val parse_expr_at_loc : - Warnings.loc -> (Parsetree.expression * comment list) option - val reprint_expr_at_loc : ?mapper:(Parsetree.expression -> Parsetree.expression option) -> Warnings.loc -> @@ -91,7 +88,6 @@ type type_clash_context = } | ArrayValue | TaggedTemplateValue - | MaybeUnwrapOption | IfCondition | AssertCondition | IfReturn @@ -189,7 +185,7 @@ let error_expected_type_text ppf type_clash_context = fprintf ppf "But you're using @{await@} on this expression, so it is expected \ to be of type:" - | Some MaybeUnwrapOption | Some BracedIdent | None -> + | Some BracedIdent | None -> fprintf ppf "But it's expected to have type:" let is_record_type ~(extract_concrete_typedecl : extract_concrete_typedecl) ~env @@ -407,12 +403,6 @@ let print_extra_type_clash_help ~extract_concrete_typedecl ~env loc ppf "\n\n\ \ Ternaries (@{?@} and @{:@}) must return the same type in \ both branches." - | Some MaybeUnwrapOption, _ -> - fprintf ppf - "\n\n\ - \ Possible solutions:\n\ - \ - Unwrap the option to its underlying value using \ - `yourValue->Option.getOr(someDefaultValue)`" | Some ComparisonOperator, _ -> fprintf ppf "\n\n You can only compare things of the same type." | Some ArrayValue, _ -> @@ -840,15 +830,6 @@ let type_clash_context_for_function_argument ~label type_clash_context sarg0 = }) | type_clash_context -> type_clash_context -let type_clash_context_maybe_option ty_expected ty_res = - match (ty_expected, ty_res) with - | ( {Types.desc = Tconstr (expected_path, _, _)}, - {Types.desc = Tconstr (type_path, _, _)} ) - when Path.same Predef.path_option type_path - && Path.same expected_path Predef.path_option = false -> - Some MaybeUnwrapOption - | _ -> None - let type_clash_context_in_statement sexp = match sexp.Parsetree.pexp_desc with | Pexp_apply {transformed_jsx = false} -> Some (Statement FunctionCall) diff --git a/compiler/ml/includemod.ml b/compiler/ml/includemod.ml index d4c01d405e5..d3fa5031d44 100644 --- a/compiler/ml/includemod.ml +++ b/compiler/ml/includemod.ml @@ -141,41 +141,6 @@ let is_runtime_component = function | Sig_class () -> true -(* Print a coercion *) - -let rec print_list pr ppf = function - | [] -> () - | [a] -> pr ppf a - | a :: l -> - pr ppf a; - Format.fprintf ppf ";@ "; - print_list pr ppf l -let print_list pr ppf l = Format.fprintf ppf "[@[%a@]]" (print_list pr) l - -let rec print_coercion ppf c = - let pr fmt = Format.fprintf ppf fmt in - match c with - | Tcoerce_none -> pr "id" - | Tcoerce_structure (fl, nl, _) -> - pr "@[<2>struct@ %a@ %a@]" - (print_list print_coercion2) - fl - (print_list print_coercion3) - nl - | Tcoerce_functor (inp, out) -> - pr "@[<2>functor@ (%a)@ (%a)@]" print_coercion inp print_coercion out - | Tcoerce_primitive {pc_desc; pc_env = _; pc_type} -> - pr "prim %s@ (%a)" pc_desc.Primitive.prim_name Printtyp.raw_type_expr - pc_type - | Tcoerce_alias (p, c) -> - pr "@[<2>alias %a@ (%a)@]" Printtyp.path p print_coercion c - -and print_coercion2 ppf (n, c) = - Format.fprintf ppf "@[%d,@ %a@]" n print_coercion c - -and print_coercion3 ppf (i, n, c) = - Format.fprintf ppf "@[%s, %d,@ %a@]" (Ident.unique_name i) n print_coercion c - (* Simplify a structure coercion *) let simplify_structure_coercion cc id_pos_list runtime_fields = diff --git a/compiler/ml/includemod.mli b/compiler/ml/includemod.mli index 9399f2b63a9..ea810c5bb11 100644 --- a/compiler/ml/includemod.mli +++ b/compiler/ml/includemod.mli @@ -35,8 +35,6 @@ val type_declarations : type_declaration -> unit -val print_coercion : formatter -> module_coercion -> unit - type symptom = | Missing_field of Ident.t * Location.t * string (* kind *) | Value_descriptions of Ident.t * value_description * value_description diff --git a/compiler/ml/lambda.mli b/compiler/ml/lambda.mli index 99f399aa0ac..08a1d2415a1 100644 --- a/compiler/ml/lambda.mli +++ b/compiler/ml/lambda.mli @@ -384,13 +384,11 @@ and lambda_switch = { (* Sharing key *) val make_key : lambda -> lambda option -val const_unit : structured_constant val lambda_assert_false : lambda val lambda_unit : lambda val lambda_module_alias : lambda val name_lambda : let_kind -> lambda -> (Ident.t -> lambda) -> lambda -val iter : (lambda -> unit) -> lambda -> unit module Ident_set : Set.S with type elt = Ident.t val free_variables : lambda -> Ident_set.t diff --git a/compiler/ml/longident.mli b/compiler/ml/longident.mli index 26ed938e846..d0a724d6101 100644 --- a/compiler/ml/longident.mli +++ b/compiler/ml/longident.mli @@ -19,6 +19,5 @@ type t = Lident of string | Ldot of t * string | Lapply of t * t val cmp : t -> t -> int val flatten : t -> string list -val unflatten : string list -> t option val last : t -> string val parse : string -> t diff --git a/compiler/ml/matching.ml b/compiler/ml/matching.ml index 916646ea08a..70a84c5faff 100644 --- a/compiler/ml/matching.ml +++ b/compiler/ml/matching.ml @@ -448,14 +448,6 @@ end) let make_exit i = Lstaticraise (i, []) -(* Introduce a catch, if worth it *) -let make_catch d k = - match d with - | Lstaticraise (_, []) -> k d - | _ -> - let e = next_raise_count () in - Lstaticcatch (k (make_exit e), (e, []), d) - (* Introduce a catch, if worth it, delayed version *) let rec as_simple_exit = function | Lstaticraise (i, []) -> Some i @@ -1515,94 +1507,6 @@ let make_array_matching p def ctx = function let divide_array ctx pm = divide make_array_matching ( = ) get_key_array get_args_array ctx pm -(* - Specific string test sequence - Will be called by the bytecode compiler, from bytegen.ml. - The strategy is first dichotomic search (we perform 3-way tests - with compare_string), then sequence of equality tests - when there are less then T=strings_test_threshold static strings to match. - - Increasing T entails (slightly) less code, decreasing T - (slightly) favors runtime speed. - T=8 looks a decent tradeoff. -*) - -(* Utilities *) - -let strings_test_threshold = 8 - -let bind_sw arg k = - match arg with - | Lvar _ -> k arg - | _ -> - let id = Ident.create "switch" in - Llet (Strict, Pgenval, id, arg, k (Lvar id)) - -(* Sequential equality tests *) - -let make_string_test_sequence loc arg sw d = - let d, sw = - match d with - | None -> ( - match sw with - | (_, d) :: sw -> (d, sw) - | [] -> assert false) - | Some d -> (d, sw) - in - bind_sw arg (fun arg -> - List.fold_right - (fun (s, lam) k -> - Lifthenelse - ( Lprim (Pstringcomp Cneq, [arg; Lconst (Const_immstring s)], loc), - k, - lam )) - sw d) - -let rec split k xs = - match xs with - | [] -> assert false - | x0 :: xs -> - if k <= 1 then ([], x0, xs) - else - let xs, y0, ys = split (k - 2) xs in - (x0 :: xs, y0, ys) - -let zero_lam = Lconst (Const_base (Const_int 0)) - -let tree_way_test loc arg lt eq gt = - Lifthenelse - ( Lprim (Pintcomp Clt, [arg; zero_lam], loc), - lt, - Lifthenelse (Lprim (Pintcomp Clt, [zero_lam; arg], loc), gt, eq) ) - -(* Dichotomic tree *) - -let rec do_make_string_test_tree loc arg sw delta d = - let len = List.length sw in - if len <= strings_test_threshold + delta then - make_string_test_sequence loc arg sw d - else - let lt, (s, act), gt = split len sw in - bind_sw - (Lprim (Pstringcomp Ceq, [arg; Lconst (Const_immstring s)], loc)) - (fun r -> - tree_way_test loc r - (do_make_string_test_tree loc arg lt delta d) - act - (do_make_string_test_tree loc arg gt delta d)) - -(* Entry point *) -let expand_stringswitch loc arg sw d = - match d with - | None -> bind_sw arg (fun arg -> do_make_string_test_tree loc arg sw 0 None) - | Some e -> - bind_sw arg (fun arg -> - make_catch e (fun d -> do_make_string_test_tree loc arg sw 1 (Some d))) - -(**********************) -(* Generic test trees *) -(**********************) - (* Sharing *) (* Add handler, if shared *) @@ -2677,7 +2581,6 @@ let check_partial is_mutable pat_act_list = function then Partial else Total -let check_partial_list = check_partial (List.exists is_mutable) let check_partial = check_partial is_mutable (* have toplevel handler when appropriate *) @@ -2811,27 +2714,6 @@ let for_let loc param pat body = Llet (Strict, Pgenval, id, param, body) | _ -> simple_for_let loc param pat body -(* Handling of tupled functions and matchings *) - -(* Easy case since variables are available *) -let for_tupled_function loc paraml pats_act_list partial = - let partial = check_partial_list pats_act_list partial in - let raise_num = next_raise_count () in - let omegas = [List.map (fun _ -> omega) paraml] in - let pm = - { - cases = pats_act_list; - args = List.map (fun id -> (Lvar id, Strict)) paraml; - default = [(omegas, raise_num)]; - } - in - try - let lambda, total = - compile_match None partial (start_ctx (List.length paraml)) pm - in - check_total total lambda raise_num (partial_function loc) - with Unused -> partial_function loc () - let flatten_pattern size p = match p.pat_desc with | Tpat_tuple args -> args diff --git a/compiler/ml/matching.mli b/compiler/ml/matching.mli index 43d1d2cec3c..95fbd9e2826 100644 --- a/compiler/ml/matching.mli +++ b/compiler/ml/matching.mli @@ -56,21 +56,8 @@ val for_let : Location.t -> lambda -> pattern -> lambda -> lambda val for_multiple_match : Location.t -> lambda list -> (pattern * lambda) list -> partial -> lambda -val for_tupled_function : - Location.t -> - Ident.t list -> - (pattern list * lambda) list -> - partial -> - lambda - exception Cannot_flatten -val flatten_pattern : int -> pattern -> pattern list - -(* Expand stringswitch to string test tree *) -val expand_stringswitch : - Location.t -> lambda -> (string * lambda) list -> lambda option -> lambda - (* To be set by Lam_compile *) val names_from_construct_pattern : (pattern -> Ast_untagged_variants.switch_names option) ref From 7acb7835efa7a44afac3d0409f9998b4ec575be6 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 15:31:05 +0000 Subject: [PATCH 174/214] dce: note ml liveness --- scripts/dce/live-findings.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/scripts/dce/live-findings.md b/scripts/dce/live-findings.md index 02943ed2131..0b87a787f78 100644 --- a/scripts/dce/live-findings.md +++ b/scripts/dce/live-findings.md @@ -129,6 +129,18 @@ live after manual validation. following for this report, so the exported reset hook and loader payload fields look dead even though they are part of the live compiler setup. +### `Experimental_features.reset` + +- Report: `Warning Dead Value`, `compiler/ml/experimental_features.ml` and + `.mli`, for `reset`. +- Verdict: live; false positive. +- Validation: `compiler/jsoo/jsoo_playground_main.ml` calls + `Experimental_features.reset` from the playground compiler reset path, next to + other global compiler-state resets. +- Context: the playground entry point is outside the roots used for this report. + Removing this hook would let experimental feature flags leak between + playground compilations. + ### `Location.report_error ?custom_intro ?src` - Report: `Warning Redundant Optional Argument`, `compiler/ml/location.ml` and @@ -697,6 +709,20 @@ live after manual validation. smart constructors used cross-module, which this DCE run does not root correctly. +### `Lambda.let_kind.Variable` + +- Report: `Warning Dead Type`, `compiler/ml/lambda.ml` and `.mli`, + `let_kind.Variable`. +- Verdict: live; false positive. +- Validation: `compiler/core/lam_compat.ml` aliases + `type let_kind = Lambda.let_kind = Strict | Alias | StrictOpt | Variable`. + The `Variable` constructor is then used through `Lam_compat.let_kind` by + lambda DCE, conversion, scope, printing, JS statement generation, and JS + operator metadata. +- Context: reanalyze reports the original constructor as unconstructed because + the live construction happens through the cross-module alias. Removing it from + `Lambda.let_kind` would break the shared let-kind model used by core lowering. + ### `Lam_id_kind` block metadata - Report: `Warning Dead Type` / `Warning Dead Value`, From 91c992d4e632a8670e5b9d1e04544c64b651fa39 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 15:34:40 +0000 Subject: [PATCH 175/214] dce: trim ml exports --- _dce/report.txt | 92 +------------------------------ compiler/ml/mtype.ml | 24 -------- compiler/ml/mtype.mli | 5 -- compiler/ml/printast.mli | 2 - compiler/ml/printlambda.ml | 2 - compiler/ml/printlambda.mli | 1 - compiler/ml/record_type_spread.ml | 2 - compiler/ml/translmod.mli | 2 - compiler/ml/typedecl.ml | 2 - compiler/ml/typedecl.mli | 3 - 10 files changed, 1 insertion(+), 134 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index a38ada4116a..1254f134cfe 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -2725,30 +2725,6 @@ <-- line 299 type let_kind = Strict | Alias | StrictOpt | Variable [@dead "let_kind.Variable"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/mtype.ml", line 235, characters 0-248 - +no_code_needed is never used - <-- line 235 - | Mty_alias (Mta_present, _) -> false [@@dead "+no_code_needed"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/mtype.ml", line 243, characters 0-505 - +no_code_needed_sig is never used - <-- line 243 - | (Sig_typext _ | Sig_class _) :: _ -> false [@@dead "+no_code_needed_sig"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/mtype.mli", line 40, characters 0-49 - +no_code_needed is never used - <-- line 40 - val no_code_needed : Env.t -> module_type -> bool [@@dead "+no_code_needed"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/mtype.mli", line 41, characters 0-51 - +no_code_needed_sig is never used - <-- line 41 - val no_code_needed_sig : Env.t -> signature -> bool [@@dead "+no_code_needed_sig"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/oprint.mli", line 24, characters 0-62 +out_class_type is never used @@ -3133,30 +3109,6 @@ <-- line 83 val all_predef_exns : Ident.t list [@@dead "+all_predef_exns"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/printast.mli", line 22, characters 0-55 - +expression is never used - <-- line 22 - val expression : int -> formatter -> expression -> unit [@@dead "+expression"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/printast.mli", line 23, characters 0-53 - +structure is never used - <-- line 23 - val structure : int -> formatter -> structure -> unit [@@dead "+structure"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/printlambda.ml", line 406, characters 0-38 - +structured_constant is never used - <-- line 406 - let structured_constant = struct_const [@@dead "+structured_constant"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/printlambda.mli", line 20, characters 0-66 - +structured_constant is never used - <-- line 20 - val structured_constant : formatter -> structured_constant -> unit [@@dead "+structured_constant"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/printtyp.ml", line 964, characters 0-40 +type_sch is never used @@ -3247,12 +3199,6 @@ <-- line 111 (out_sig_item * 'a option) list [@@dead "+print_items"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/record_type_spread.ml", line 3, characters 0-69 - +t_equals is never used - <-- line 3 - let t_equals t1 t2 = t1.Types.level = t2.Types.level && t1.id = t2.id [@@dead "+t_equals"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/stypes.ml", line 30, characters 0-56 +output_int is never used @@ -3415,12 +3361,6 @@ <-- line 33 unit [@@dead "+print"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/translmod.mli", line 27, characters 0-52 - +report_error is never used - <-- line 27 - val report_error : Format.formatter -> error -> unit [@@dead "+report_error"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typecore.mli", line 22, characters 0-50 +is_nonexpansive is never used @@ -3481,36 +3421,6 @@ <-- line 157 val constant : Parsetree.constant -> (Asttypes.constant, error) result [@@dead "+constant"] - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typedecl.ml", line 25, characters 24-31 - native_repr_kind.Unboxed is a variant case which is never constructed - <-- line 25 - type native_repr_kind = Unboxed [@dead "native_repr_kind.Unboxed"] | Untagged - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typedecl.ml", line 25, characters 32-42 - native_repr_kind.Untagged is a variant case which is never constructed - <-- line 25 - type native_repr_kind = Unboxed [@dead "native_repr_kind.Unboxed"] | Untagged [@dead "native_repr_kind.Untagged"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typedecl.mli", line 53, characters 0-48 - +abstract_type_decl is never used - <-- line 53 - val abstract_type_decl : int -> type_declaration [@@dead "+abstract_type_decl"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typedecl.mli", line 67, characters 24-31 - native_repr_kind.Unboxed is a variant case which is never constructed - <-- line 67 - type native_repr_kind = Unboxed [@dead "native_repr_kind.Unboxed"] | Untagged - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typedecl.mli", line 67, characters 32-42 - native_repr_kind.Untagged is a variant case which is never constructed - <-- line 67 - type native_repr_kind = Unboxed [@dead "native_repr_kind.Unboxed"] | Untagged [@dead "native_repr_kind.Untagged"] - Warning Dead Type File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typedtree.ml", line 281, characters 2-23 open_description.open_loc is a record label never used to read a value @@ -3679,4 +3589,4 @@ <-- line 99 type f = May_pos | May_neg | May_weak [@dead "Variance.f.May_weak"] | Inj | Pos | Neg | Inv - Analysis reported 732 issues (Warning Dead Module:4, Warning Dead Type:130, Warning Dead Value:246, Warning Dead Value With Side Effects:5, Warning Redundant Optional Argument:198, Warning Unused Argument:149) + Analysis reported 717 issues (Warning Dead Module:4, Warning Dead Type:126, Warning Dead Value:235, Warning Dead Value With Side Effects:5, Warning Redundant Optional Argument:198, Warning Unused Argument:149) diff --git a/compiler/ml/mtype.ml b/compiler/ml/mtype.ml index 4ed00e0054e..53cf218e7de 100644 --- a/compiler/ml/mtype.ml +++ b/compiler/ml/mtype.ml @@ -232,30 +232,6 @@ and type_paths_sig env p pos sg = | (Sig_typext _ | Sig_class _) :: rem -> type_paths_sig env p (pos + 1) rem | Sig_class_type _ :: rem -> type_paths_sig env p pos rem -let rec no_code_needed env mty = - match scrape env mty with - | Mty_ident _ -> false - | Mty_signature sg -> no_code_needed_sig env sg - | Mty_functor (_, _, _) -> false - | Mty_alias (Mta_absent, _) -> true - | Mty_alias (Mta_present, _) -> false - -and no_code_needed_sig env sg = - match sg with - | [] -> true - | Sig_value (_id, decl) :: rem -> ( - match decl.val_kind with - | Val_prim _ -> no_code_needed_sig env rem - | _ -> false) - | Sig_module (id, md, _) :: rem -> - no_code_needed env md.md_type - && no_code_needed_sig - (Env.add_module_declaration ~check:false id md env) - rem - | (Sig_type _ | Sig_modtype _ | Sig_class_type _) :: rem -> - no_code_needed_sig env rem - | (Sig_typext _ | Sig_class _) :: _ -> false - (* Check whether a module type may return types *) let rec contains_type env = function diff --git a/compiler/ml/mtype.mli b/compiler/ml/mtype.mli index 64198df4bd0..fec90b15d3a 100644 --- a/compiler/ml/mtype.mli +++ b/compiler/ml/mtype.mli @@ -37,11 +37,6 @@ val nondep_supertype : Env.t -> Ident.t -> module_type -> module_type in which the given ident does not appear. Raise [Not_found] if no such type exists. *) -val no_code_needed : Env.t -> module_type -> bool -val no_code_needed_sig : Env.t -> signature -> bool -(* Determine whether a module needs no implementation code, - i.e. consists only of type definitions. *) - val enrich_modtype : Env.t -> Path.t -> module_type -> module_type val enrich_typedecl : Env.t -> Path.t -> type_declaration -> type_declaration val type_paths : Env.t -> Path.t -> module_type -> Path.t list diff --git a/compiler/ml/printast.mli b/compiler/ml/printast.mli index 87da25385c9..6471a9509c0 100644 --- a/compiler/ml/printast.mli +++ b/compiler/ml/printast.mli @@ -19,6 +19,4 @@ open Format val interface : formatter -> signature_item list -> unit val implementation : formatter -> structure_item list -> unit -val expression : int -> formatter -> expression -> unit -val structure : int -> formatter -> structure -> unit val payload : int -> formatter -> payload -> unit diff --git a/compiler/ml/printlambda.ml b/compiler/ml/printlambda.ml index e30f3c867f2..9ef8bacfb29 100644 --- a/compiler/ml/printlambda.ml +++ b/compiler/ml/printlambda.ml @@ -403,6 +403,4 @@ and sequence ppf = function | Lsequence (l1, l2) -> fprintf ppf "%a@ %a" sequence l1 sequence l2 | l -> lam ppf l -let structured_constant = struct_const - let lambda = lam diff --git a/compiler/ml/printlambda.mli b/compiler/ml/printlambda.mli index d20fa3ece0f..b2942ca9851 100644 --- a/compiler/ml/printlambda.mli +++ b/compiler/ml/printlambda.mli @@ -17,5 +17,4 @@ open Lambda open Format -val structured_constant : formatter -> structured_constant -> unit val lambda : formatter -> lambda -> unit diff --git a/compiler/ml/record_type_spread.ml b/compiler/ml/record_type_spread.ml index 0156db4b99c..f831f6af202 100644 --- a/compiler/ml/record_type_spread.ml +++ b/compiler/ml/record_type_spread.ml @@ -1,7 +1,5 @@ module String_map = Map.Make (String) -let t_equals t1 t2 = t1.Types.level = t2.Types.level && t1.id = t2.id - let substitute_types ~type_map (t : Types.type_expr) = if String_map.is_empty type_map then t else diff --git a/compiler/ml/translmod.mli b/compiler/ml/translmod.mli index 74ef747e105..9ff6fe6ef93 100644 --- a/compiler/ml/translmod.mli +++ b/compiler/ml/translmod.mli @@ -23,5 +23,3 @@ val transl_implementation : type error (* exception Error of Location.t * error *) - -val report_error : Format.formatter -> error -> unit diff --git a/compiler/ml/typedecl.ml b/compiler/ml/typedecl.ml index 94328b70160..e70c75344aa 100644 --- a/compiler/ml/typedecl.ml +++ b/compiler/ml/typedecl.ml @@ -22,8 +22,6 @@ open Primitive open Types open Typetexp -type native_repr_kind = Unboxed | Untagged - type error = | Repeated_parameter | Duplicate_constructor of string diff --git a/compiler/ml/typedecl.mli b/compiler/ml/typedecl.mli index b9910bf8837..2bb43c4fdbc 100644 --- a/compiler/ml/typedecl.mli +++ b/compiler/ml/typedecl.mli @@ -50,7 +50,6 @@ val transl_with_constraint : Parsetree.type_declaration -> Typedtree.type_declaration -val abstract_type_decl : int -> type_declaration val approx_type_decl : Parsetree.type_declaration list -> (Ident.t * type_declaration) list val check_recmod_typedecl : @@ -64,8 +63,6 @@ val is_fixed_type : Parsetree.type_declaration -> bool val get_unboxed_type_representation : Env.t -> type_expr -> type_expr option val is_not_undefined_attr : Parsetree.attribute -> bool -type native_repr_kind = Unboxed | Untagged - type error exception Error of Location.t * error From b41f3b427daa5fd89f55286221842c77e9068d6a Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 15:38:46 +0000 Subject: [PATCH 176/214] dce: trim debug helpers --- _dce/report.txt | 308 +------------------------------------- compiler/ml/pprintast.ml | 16 -- compiler/ml/pprintast.mli | 6 - compiler/ml/predef.ml | 29 +--- compiler/ml/predef.mli | 19 --- compiler/ml/stypes.ml | 128 +--------------- compiler/ml/stypes.mli | 5 - compiler/ml/tbl.ml | 35 ----- compiler/ml/tbl.mli | 12 -- 9 files changed, 5 insertions(+), 553 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index 1254f134cfe..cd06a26cba7 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -2953,162 +2953,6 @@ <-- line 577 | Pstr_class_type of unit [@dead "structure_item_desc.Pstr_class_type"] (* Dummy AST node *) - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/pprintast.ml", line 1354, characters 0-60 - +expression is never used - <-- line 1354 - let expression f x = pp f "@[%a@]" (expression reset_ctxt) x [@@dead "+expression"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/pprintast.ml", line 1356, characters 0-133 - +string_of_expression is never used - <-- line 1356 - flush_str_formatter () [@@dead "+string_of_expression"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/pprintast.ml", line 1362, characters 0-142 - +string_of_structure is never used - <-- line 1362 - flush_str_formatter () [@@dead "+string_of_structure"] - - Warning Dead Value With Side Effects - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/pprintast.ml", line 1368, characters 0-36 - +core_type is never used and could have side effects - - Warning Dead Value With Side Effects - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/pprintast.ml", line 1369, characters 0-32 - +pattern is never used and could have side effects - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/pprintast.mli", line 18, characters 0-65 - +expression is never used - <-- line 18 - val expression : Format.formatter -> Parsetree.expression -> unit [@@dead "+expression"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/pprintast.mli", line 19, characters 0-57 - +string_of_expression is never used - <-- line 19 - val string_of_expression : Parsetree.expression -> string [@@dead "+string_of_expression"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/pprintast.mli", line 21, characters 0-63 - +core_type is never used - <-- line 21 - val core_type : Format.formatter -> Parsetree.core_type -> unit [@@dead "+core_type"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/pprintast.mli", line 22, characters 0-59 - +pattern is never used - <-- line 22 - val pattern : Format.formatter -> Parsetree.pattern -> unit [@@dead "+pattern"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/pprintast.mli", line 25, characters 0-55 - +string_of_structure is never used - <-- line 25 - val string_of_structure : Parsetree.structure -> string [@@dead "+string_of_structure"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/predef.ml", line 140, characters 0-67 - +type_option is never used - <-- line 140 - and type_option t = newgenty (Tconstr (path_option, [t], ref Mnil)) [@@dead "+type_option"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/predef.ml", line 142, characters 0-76 - +type_result is never used - <-- line 142 - and type_result t1 t2 = newgenty (Tconstr (path_result, [t1; t2], ref Mnil)) [@@dead "+type_result"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/predef.ml", line 144, characters 0-63 - +type_dict is never used - <-- line 144 - and type_dict t = newgenty (Tconstr (path_dict, [t], ref Mnil)) [@@dead "+type_dict"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/predef.ml", line 181, characters 0-255 - +all_predef_exns is never used - <-- line 181 - ] [@@dead "+all_predef_exns"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/predef.ml", line 198, characters 0-77 - +path_undefined_recursive_module is never used - <-- line 198 - and path_undefined_recursive_module = Pident ident_undefined_recursive_module [@@dead "+path_undefined_recursive_module"] - - Warning Dead Value With Side Effects - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/predef.ml", line 439, characters 0-357 - +builtin_values is never used and could have side effects - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/predef.mli", line 30, characters 0-38 - +type_list is never used - <-- line 30 - val type_list : type_expr -> type_expr [@@dead "+type_list"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/predef.mli", line 31, characters 0-40 - +type_option is never used - <-- line 31 - val type_option : type_expr -> type_expr [@@dead "+type_option"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/predef.mli", line 32, characters 0-53 - +type_result is never used - <-- line 32 - val type_result : type_expr -> type_expr -> type_expr [@@dead "+type_result"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/predef.mli", line 33, characters 0-38 - +type_dict is never used - <-- line 33 - val type_dict : type_expr -> type_expr [@@dead "+type_dict"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/predef.mli", line 46, characters 0-26 - +path_iterable is never used - <-- line 46 - val path_iterable : Path.t [@@dead "+path_iterable"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/predef.mli", line 47, characters 0-32 - +path_async_iterable is never used - <-- line 47 - val path_async_iterable : Path.t [@@dead "+path_async_iterable"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/predef.mli", line 54, characters 0-39 - +path_extension_constructor is never used - <-- line 54 - val path_extension_constructor : Path.t [@@dead "+path_extension_constructor"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/predef.mli", line 60, characters 0-44 - +path_undefined_recursive_module is never used - <-- line 60 - val path_undefined_recursive_module : Path.t [@@dead "+path_undefined_recursive_module"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/predef.mli", line 74, characters 0-44 - +builtin_values is never used - <-- line 74 - val builtin_values : (string * Ident.t) list [@@dead "+builtin_values"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/predef.mli", line 77, characters 0-36 - +ident_division_by_zero is never used - <-- line 77 - val ident_division_by_zero : Ident.t [@@dead "+ident_division_by_zero"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/predef.mli", line 83, characters 0-34 - +all_predef_exns is never used - <-- line 83 - val all_predef_exns : Ident.t list [@@dead "+all_predef_exns"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/printtyp.ml", line 964, characters 0-40 +type_sch is never used @@ -3199,102 +3043,6 @@ <-- line 111 (out_sig_item * 'a option) list [@@dead "+print_items"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/stypes.ml", line 30, characters 0-56 - +output_int is never used - <-- line 30 - let output_int oc i = output_string oc (string_of_int i) [@@dead "+output_int"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/stypes.ml", line 35, characters 2-20 - annotation.Ti_class is a variant case which is never constructed - <-- line 35 - | Ti_class of unit [@dead "annotation.Ti_class"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/stypes.ml", line 60, characters 0-176 - +cmp_loc_inner_first is never used - <-- line 60 - | x -> x [@@dead "+cmp_loc_inner_first"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/stypes.ml", line 64, characters 0-92 - +cmp_ti_inner_first is never used - <-- line 64 - cmp_loc_inner_first (get_location ti1) (get_location ti2) [@@dead "+cmp_ti_inner_first"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/stypes.ml", line 67, characters 0-333 - +print_position is never used - <-- line 67 - output_int pp pos.pos_cnum) [@@dead "+print_position"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/stypes.ml", line 79, characters 0-116 - +print_location is never used - <-- line 79 - print_position pp loc.loc_end [@@dead "+print_location"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/stypes.ml", line 84, characters 0-406 - +sort_filter_phrases is never used - <-- line 84 - phrases := loop [] Location.none ph [@@dead "+sort_filter_phrases"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/stypes.ml", line 98, characters 0-208 - +printtyp_reset_maybe is never used - <-- line 98 - | _ -> () [@@dead "+printtyp_reset_maybe"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/stypes.ml", line 106, characters 0-448 - +print_ident_annot is never used - <-- line 106 - output_char pp '\n' [@@dead "+print_ident_annot"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/stypes.ml", line 127, characters 0-914 - +print_info is never used - <-- line 127 - loc [@@dead "+print_info"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/stypes.ml", line 155, characters 0-108 - +get_info is never used - <-- line 155 - info [@@dead "+get_info"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/stypes.ml", line 160, characters 0-423 - +dump is never used - <-- line 160 - else annotations := [] [@@dead "+dump"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/stypes.mli", line 25, characters 2-20 - annotation.Ti_class is a variant case which is never constructed - <-- line 25 - | Ti_class of unit [@dead "annotation.Ti_class"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/stypes.mli", line 31, characters 0-32 - +dump is never used - <-- line 31 - val dump : string option -> unit [@@dead "+dump"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/stypes.mli", line 33, characters 0-43 - +get_location is never used - <-- line 33 - val get_location : annotation -> Location.t [@@dead "+get_location"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/stypes.mli", line 34, characters 0-38 - +get_info is never used - <-- line 34 - val get_info : unit -> annotation list [@@dead "+get_info"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/subst.mli", line 57, characters 0-70 +module_declaration is never used @@ -3307,60 +3055,6 @@ <-- line 58 val typexp : t -> Types.type_expr -> Types.type_expr [@@dead "+typexp"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/tbl.ml", line 66, characters 0-143 - +mem is never used - <-- line 66 - c = 0 || mem x (if c < 0 then l else r) [@@dead "+mem"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/tbl.ml", line 72, characters 0-187 - +merge is never used - <-- line 72 - bal l1 v1 d1 (bal (merge r1 l2) v2 d2 r2) [@@dead "+merge"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/tbl.ml", line 79, characters 0-208 - +remove is never used - <-- line 79 - else bal l v d (remove x r) [@@dead "+remove"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/tbl.ml", line 94, characters 0-108 - +map is never used - <-- line 94 - | Node (l, v, d, r, h) -> Node (map f l, v, f v d, map f r, h) [@@dead "+map"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/tbl.ml", line 105, characters 0-215 - +print is never used - <-- line 105 - fprintf ppf "@[[[%a]]@]" print_tbl tbl [@@dead "+print"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/tbl.mli", line 25, characters 0-34 - +mem is never used - <-- line 25 - val mem : 'k -> ('k, 'v) t -> bool [@@dead "+mem"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/tbl.mli", line 26, characters 0-43 - +remove is never used - <-- line 26 - val remove : 'k -> ('k, 'v) t -> ('k, 'v) t [@@dead "+remove"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/tbl.mli", line 28, characters 0-58 - +map is never used - <-- line 28 - val map : ('k -> 'v1 -> 'v2) -> ('k, 'v1) t -> ('k, 'v2) t [@@dead "+map"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/tbl.mli", line 33, characters 0-111 - +print is never used - <-- line 33 - unit [@@dead "+print"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typecore.mli", line 22, characters 0-50 +is_nonexpansive is never used @@ -3589,4 +3283,4 @@ <-- line 99 type f = May_pos | May_neg | May_weak [@dead "Variance.f.May_weak"] | Inj | Pos | Neg | Inv - Analysis reported 717 issues (Warning Dead Module:4, Warning Dead Type:126, Warning Dead Value:235, Warning Dead Value With Side Effects:5, Warning Redundant Optional Argument:198, Warning Unused Argument:149) + Analysis reported 665 issues (Warning Dead Module:4, Warning Dead Type:124, Warning Dead Value:188, Warning Dead Value With Side Effects:2, Warning Redundant Optional Argument:198, Warning Unused Argument:149) diff --git a/compiler/ml/pprintast.ml b/compiler/ml/pprintast.ml index b8bcf6d5b38..212429aae9d 100644 --- a/compiler/ml/pprintast.ml +++ b/compiler/ml/pprintast.ml @@ -1351,21 +1351,5 @@ and label_x_expression_param ctxt f (l, e) = if Some lbl = simple_name then pp f "~%s" lbl else pp f "~%s:%a" lbl (simple_expr ctxt) e -let expression f x = pp f "@[%a@]" (expression reset_ctxt) x - -let string_of_expression x = - ignore (flush_str_formatter ()); - let f = str_formatter in - expression f x; - flush_str_formatter () - -let string_of_structure x = - ignore (flush_str_formatter ()); - let f = str_formatter in - structure reset_ctxt f x; - flush_str_formatter () - -let core_type = core_type reset_ctxt -let pattern = pattern reset_ctxt let signature = signature reset_ctxt let structure = structure reset_ctxt diff --git a/compiler/ml/pprintast.mli b/compiler/ml/pprintast.mli index fb26664584f..502d3743c2e 100644 --- a/compiler/ml/pprintast.mli +++ b/compiler/ml/pprintast.mli @@ -15,12 +15,6 @@ type space_formatter = (unit, Format.formatter, unit) format -val expression : Format.formatter -> Parsetree.expression -> unit -val string_of_expression : Parsetree.expression -> string - -val core_type : Format.formatter -> Parsetree.core_type -> unit -val pattern : Format.formatter -> Parsetree.pattern -> unit val signature : Format.formatter -> Parsetree.signature -> unit val structure : Format.formatter -> Parsetree.structure -> unit -val string_of_structure : Parsetree.structure -> string val string_of_int_as_char : int -> string diff --git a/compiler/ml/predef.ml b/compiler/ml/predef.ml index 348cb1ce337..aa63e8d7e44 100644 --- a/compiler/ml/predef.ml +++ b/compiler/ml/predef.ml @@ -137,12 +137,6 @@ and type_async_iterable t = and type_list t = newgenty (Tconstr (path_list, [t], ref Mnil)) -and type_option t = newgenty (Tconstr (path_option, [t], ref Mnil)) - -and type_result t1 t2 = newgenty (Tconstr (path_result, [t1; t2], ref Mnil)) - -and type_dict t = newgenty (Tconstr (path_dict, [t], ref Mnil)) - and type_bigint = newgenty (Tconstr (path_bigint, [], ref Mnil)) and type_string = newgenty (Tconstr (path_string, [], ref Mnil)) @@ -178,25 +172,10 @@ and ident_assert_failure = ident_create_predef_exn "Assert_failure" and ident_undefined_recursive_module = ident_create_predef_exn "Undefined_recursive_module" -let all_predef_exns = - [ - ident_match_failure; - ident_invalid_argument; - ident_failure; - ident_js_exn; - ident_not_found; - ident_end_of_file; - ident_division_by_zero; - ident_assert_failure; - ident_undefined_recursive_module; - ] - let path_match_failure = Pident ident_match_failure and path_assert_failure = Pident ident_assert_failure -and path_undefined_recursive_module = Pident ident_undefined_recursive_module - let decl_abstr = { type_params = []; @@ -436,11 +415,9 @@ let build_initial_env add_type add_exception empty_env = in add_type ident_char decl_type_char common -let builtin_values = - List.map - (fun id -> - Ident.make_global id; - (Ident.name id, id)) +let () = + List.iter + Ident.make_global [ ident_match_failure; ident_invalid_argument; diff --git a/compiler/ml/predef.mli b/compiler/ml/predef.mli index 802be290dee..945dc15b26a 100644 --- a/compiler/ml/predef.mli +++ b/compiler/ml/predef.mli @@ -27,10 +27,6 @@ val type_exn : type_expr val type_array : type_expr -> type_expr val type_iterable : type_expr -> type_expr val type_async_iterable : type_expr -> type_expr -val type_list : type_expr -> type_expr -val type_option : type_expr -> type_expr -val type_result : type_expr -> type_expr -> type_expr -val type_dict : type_expr -> type_expr val type_bigint : type_expr val type_extension_constructor : type_expr @@ -43,21 +39,17 @@ val path_bool : Path.t val path_unit : Path.t val path_exn : Path.t val path_array : Path.t -val path_iterable : Path.t -val path_async_iterable : Path.t val path_list : Path.t val path_option : Path.t val path_result : Path.t val path_dict : Path.t val path_bigint : Path.t -val path_extension_constructor : Path.t val path_promise : Path.t val path_tagged_template : Path.t val path_match_failure : Path.t val path_assert_failure : Path.t -val path_undefined_recursive_module : Path.t (* To build the initial environment. Since there is a nasty mutual recursion between predef and env, we break it by parameterizing @@ -69,19 +61,8 @@ val build_initial_env : 'a -> 'a -(* To initialize linker tables *) - -val builtin_values : (string * Ident.t) list val builtin_idents : (string * Ident.t) list -val ident_division_by_zero : Ident.t -(** All predefined exceptions, exposed as [Ident.t] for flambda (for - building value approximations). - The [Ident.t] for division by zero is also exported explicitly - so flambda can generate code to raise it. *) - -val all_predef_exns : Ident.t list - type test = For_sure_yes | For_sure_no | NA val type_is_builtin_path_but_option : Path.t -> test diff --git a/compiler/ml/stypes.ml b/compiler/ml/stypes.ml index 4d0eaa41a10..d57a8c8b75a 100644 --- a/compiler/ml/stypes.ml +++ b/compiler/ml/stypes.ml @@ -22,17 +22,11 @@ interesting in case of errors. *) -open Annot -open Lexing -open Location open Typedtree -let output_int oc i = output_string oc (string_of_int i) - type annotation = | Ti_pat of pattern | Ti_expr of expression - | Ti_class of unit | Ti_mod of module_expr | An_ident of Location.t * string * Annot.ident @@ -40,133 +34,13 @@ let get_location ti = match ti with | Ti_pat p -> p.pat_loc | Ti_expr e -> e.exp_loc - | Ti_class () -> assert false | Ti_mod m -> m.mod_loc | An_ident (l, _s, _k) -> l let annotations = ref ([] : annotation list) -let phrases = ref ([] : Location.t list) let record ti = if !Clflags.annotations && not (get_location ti).Location.loc_ghost then annotations := ti :: !annotations -let record_phrase loc = if !Clflags.annotations then phrases := loc :: !phrases - -(* comparison order: - the intervals are sorted by order of increasing upper bound - same upper bound -> sorted by decreasing lower bound -*) -let cmp_loc_inner_first loc1 loc2 = - match compare loc1.loc_end.pos_cnum loc2.loc_end.pos_cnum with - | 0 -> compare loc2.loc_start.pos_cnum loc1.loc_start.pos_cnum - | x -> x -let cmp_ti_inner_first ti1 ti2 = - cmp_loc_inner_first (get_location ti1) (get_location ti2) - -let print_position pp pos = - if pos = dummy_pos then output_string pp "--" - else ( - output_char pp '\"'; - output_string pp (String.escaped pos.pos_fname); - output_string pp "\" "; - output_int pp pos.pos_lnum; - output_char pp ' '; - output_int pp pos.pos_bol; - output_char pp ' '; - output_int pp pos.pos_cnum) - -let print_location pp loc = - print_position pp loc.loc_start; - output_char pp ' '; - print_position pp loc.loc_end - -let sort_filter_phrases () = - let ph = List.sort (fun x y -> cmp_loc_inner_first y x) !phrases in - let rec loop accu cur l = - match l with - | [] -> accu - | loc :: t -> - if - cur.loc_start.pos_cnum <= loc.loc_start.pos_cnum - && cur.loc_end.pos_cnum >= loc.loc_end.pos_cnum - then loop accu cur t - else loop (loc :: accu) loc t - in - phrases := loop [] Location.none ph - -let rec printtyp_reset_maybe loc = - match !phrases with - | cur :: t when cur.loc_start.pos_cnum <= loc.loc_start.pos_cnum -> - Printtyp.reset (); - phrases := t; - printtyp_reset_maybe loc - | _ -> () - -let print_ident_annot pp str k = - match k with - | Idef l -> - output_string pp "def "; - output_string pp str; - output_char pp ' '; - print_location pp l; - output_char pp '\n' - | Iref_internal l -> - output_string pp "int_ref "; - output_string pp str; - output_char pp ' '; - print_location pp l; - output_char pp '\n' - | Iref_external -> - output_string pp "ext_ref "; - output_string pp str; - output_char pp '\n' - -(* The format of the annotation file is documented in emacs/caml-types.el. *) - -let print_info pp prev_loc ti = - match ti with - | Ti_class _ | Ti_mod _ -> prev_loc - | Ti_pat {pat_loc = loc; pat_type = typ; pat_env = env} - | Ti_expr {exp_loc = loc; exp_type = typ; exp_env = env} -> - if loc <> prev_loc then ( - print_location pp loc; - output_char pp '\n'); - output_string pp "type(\n"; - printtyp_reset_maybe loc; - Printtyp.mark_loops typ; - Format.pp_print_string Format.str_formatter " "; - Printtyp.wrap_printing_env env (fun () -> - Printtyp.type_sch Format.str_formatter typ); - Format.pp_print_newline Format.str_formatter (); - let s = Format.flush_str_formatter () in - output_string pp s; - output_string pp ")\n"; - loc - | An_ident (loc, str, k) -> - if loc <> prev_loc then ( - print_location pp loc; - output_char pp '\n'); - output_string pp "ident(\n "; - print_ident_annot pp str k; - output_string pp ")\n"; - loc - -let get_info () = - let info = List.fast_sort cmp_ti_inner_first !annotations in - annotations := []; - info - -let dump filename = - if !Clflags.annotations then ( - let do_dump _temp_filename pp = - let info = get_info () in - sort_filter_phrases (); - ignore (List.fold_left (print_info pp) Location.none info) - in - (match filename with - | None -> do_dump "" stdout - | Some filename -> - Misc.output_to_file_via_temporary ~mode:[Open_text] filename do_dump); - phrases := []) - else annotations := [] +let record_phrase _loc = () diff --git a/compiler/ml/stypes.mli b/compiler/ml/stypes.mli index 6ad1c36c865..14145cf51c9 100644 --- a/compiler/ml/stypes.mli +++ b/compiler/ml/stypes.mli @@ -22,13 +22,8 @@ open Typedtree type annotation = | Ti_pat of pattern | Ti_expr of expression - | Ti_class of unit | Ti_mod of module_expr | An_ident of Location.t * string * Annot.ident val record : annotation -> unit val record_phrase : Location.t -> unit -val dump : string option -> unit - -val get_location : annotation -> Location.t -val get_info : unit -> annotation list diff --git a/compiler/ml/tbl.ml b/compiler/ml/tbl.ml index d37ba50e775..54fa8c9c092 100644 --- a/compiler/ml/tbl.ml +++ b/compiler/ml/tbl.ml @@ -63,27 +63,6 @@ let rec find_str (x : string) = function let c = compare x v in if c = 0 then d else find_str x (if c < 0 then l else r) -let rec mem x = function - | Empty -> false - | Node (l, v, _d, r, _) -> - let c = compare x v in - c = 0 || mem x (if c < 0 then l else r) - -let rec merge t1 t2 = - match (t1, t2) with - | Empty, t -> t - | t, Empty -> t - | Node (l1, v1, d1, r1, _h1), Node (l2, v2, d2, r2, _h2) -> - bal l1 v1 d1 (bal (merge r1 l2) v2 d2 r2) - -let rec remove x = function - | Empty -> Empty - | Node (l, v, d, r, _h) -> - let c = compare x v in - if c = 0 then merge l r - else if c < 0 then bal (remove x l) v d r - else bal l v d (remove x r) - let rec iter f = function | Empty -> () | Node (l, v, d, r, _) -> @@ -91,21 +70,7 @@ let rec iter f = function f v d; iter f r -let rec map f = function - | Empty -> Empty - | Node (l, v, d, r, h) -> Node (map f l, v, f v d, map f r, h) - let rec fold f m accu = match m with | Empty -> accu | Node (l, v, d, r, _) -> fold f r (f v d (fold f l accu)) - -open Format - -let print print_key print_data ppf tbl = - let print_tbl ppf tbl = - iter - (fun k d -> fprintf ppf "@[<2>%a ->@ %a;@]@ " print_key k print_data d) - tbl - in - fprintf ppf "@[[[%a]]@]" print_tbl tbl diff --git a/compiler/ml/tbl.mli b/compiler/ml/tbl.mli index 7d9296eb253..9b678307153 100644 --- a/compiler/ml/tbl.mli +++ b/compiler/ml/tbl.mli @@ -22,17 +22,5 @@ val empty : ('k, 'v) t val add : 'k -> 'v -> ('k, 'v) t -> ('k, 'v) t val find : 'k -> ('k, 'v) t -> 'v val find_str : string -> (string, 'v) t -> 'v -val mem : 'k -> ('k, 'v) t -> bool -val remove : 'k -> ('k, 'v) t -> ('k, 'v) t val iter : ('k -> 'v -> unit) -> ('k, 'v) t -> unit -val map : ('k -> 'v1 -> 'v2) -> ('k, 'v1) t -> ('k, 'v2) t val fold : ('k -> 'v -> 'acc -> 'acc) -> ('k, 'v) t -> 'acc -> 'acc - -open Format - -val print : - (formatter -> 'k -> unit) -> - (formatter -> 'v -> unit) -> - formatter -> - ('k, 'v) t -> - unit From 7a0bb42b90ebe1b2849476706892ad53ee758c79 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 15:43:43 +0000 Subject: [PATCH 177/214] dce: trim typing exports --- _dce/report.txt | 194 +-------------------------------------- compiler/ml/printtyp.ml | 41 +-------- compiler/ml/printtyp.mli | 17 ---- compiler/ml/subst.mli | 2 - compiler/ml/typecore.mli | 23 ----- compiler/ml/typemod.mli | 11 --- 6 files changed, 3 insertions(+), 285 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index cd06a26cba7..82ed8ba606f 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -2953,168 +2953,6 @@ <-- line 577 | Pstr_class_type of unit [@dead "structure_item_desc.Pstr_class_type"] (* Dummy AST node *) - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/printtyp.ml", line 964, characters 0-40 - +type_sch is never used - <-- line 964 - and type_sch ppf ty = typexp true ppf ty [@@dead "+type_sch"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/printtyp.ml", line 971, characters 0-113 - +type_scheme_max is never used - <-- line 971 - typexp true ppf ty [@@dead "+type_scheme_max"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/printtyp.ml", line 1185, characters 0-299 - +refresh_weak is never used - <-- line 1185 - weak_var_map := m [@@dead "+refresh_weak"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/printtyp.ml", line 1197, characters 0-358 - +print_items is never used - <-- line 1197 - print showval env x [@@dead "+print_items"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/printtyp.mli", line 31, characters 0-50 - +raw_type_expr is never used - <-- line 31 - val raw_type_expr : formatter -> type_expr -> unit [@@dead "+raw_type_expr"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/printtyp.mli", line 38, characters 0-24 - +reset is never used - <-- line 38 - val reset : unit -> unit [@@dead "+reset"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/printtyp.mli", line 44, characters 0-47 - +tree_of_type_scheme is never used - <-- line 44 - val tree_of_type_scheme : type_expr -> out_type [@@dead "+tree_of_type_scheme"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/printtyp.mli", line 45, characters 0-45 - +type_sch is never used - <-- line 45 - val type_sch : formatter -> type_expr -> unit [@@dead "+type_sch"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/printtyp.mli", line 50, characters 0-75 - +type_scheme_max is never used - <-- line 50 - val type_scheme_max : ?b_reset_names:bool -> formatter -> type_expr -> unit [@@dead "+type_scheme_max"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/printtyp.mli", line 62, characters 0-93 - +tree_of_module is never used - <-- line 62 - Ident.t -> ?ellipsis:bool -> module_type -> rec_status -> out_sig_item [@@dead "+tree_of_module"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/printtyp.mli", line 66, characters 0-80 - +tree_of_modtype_declaration is never used - <-- line 66 - val tree_of_modtype_declaration : Ident.t -> modtype_declaration -> out_sig_item [@@dead "+tree_of_modtype_declaration"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/printtyp.mli", line 71, characters 0-71 - +type_expansion is never used - <-- line 71 - val type_expansion : type_expr -> Format.formatter -> type_expr -> unit [@@dead "+type_expansion"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/printtyp.mli", line 72, characters 0-70 - +prepare_expansion is never used - <-- line 72 - val prepare_expansion : type_expr * type_expr -> type_expr * type_expr [@@dead "+prepare_expansion"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/printtyp.mli", line 73, characters 0-89 - +trace is never used - <-- line 73 - bool -> bool -> string -> formatter -> (type_expr * type_expr) list -> unit [@@dead "+trace"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/printtyp.mli", line 111, characters 0-131 - +print_items is never used - <-- line 111 - (out_sig_item * 'a option) list [@@dead "+print_items"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/subst.mli", line 57, characters 0-70 - +module_declaration is never used - <-- line 57 - val module_declaration : t -> module_declaration -> module_declaration [@@dead "+module_declaration"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/subst.mli", line 58, characters 0-52 - +typexp is never used - <-- line 58 - val typexp : t -> Types.type_expr -> Types.type_expr [@@dead "+typexp"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typecore.mli", line 22, characters 0-50 - +is_nonexpansive is never used - <-- line 22 - val is_nonexpansive : Typedtree.expression -> bool [@@dead "+is_nonexpansive"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typecore.mli", line 36, characters 0-160 - +check_partial is never used - <-- line 36 - Typedtree.partial [@@dead "+check_partial"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typecore.mli", line 49, characters 0-60 - +type_approx is never used - <-- line 49 - val type_approx : Env.t -> Parsetree.expression -> type_expr [@@dead "+type_approx"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typecore.mli", line 51, characters 0-62 - +option_some is never used - <-- line 51 - val option_some : Typedtree.expression -> Typedtree.expression [@@dead "+option_some"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typecore.mli", line 52, characters 0-65 - +option_none is never used - <-- line 52 - val option_none : type_expr -> Location.t -> Typedtree.expression [@@dead "+option_none"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typecore.mli", line 53, characters 0-57 - +extract_option_type is never used - <-- line 53 - val extract_option_type : Env.t -> type_expr -> type_expr [@@dead "+extract_option_type"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typecore.mli", line 54, characters 0-75 - +iter_pattern is never used - <-- line 54 - val iter_pattern : (Typedtree.pattern -> unit) -> Typedtree.pattern -> unit [@@dead "+iter_pattern"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typecore.mli", line 55, characters 0-44 - +generalizable is never used - <-- line 55 - val generalizable : int -> type_expr -> bool [@@dead "+generalizable"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typecore.mli", line 137, characters 0-68 - +report_error is never used - <-- line 137 - val report_error : Env.t -> Location.t -> formatter -> error -> unit [@@dead "+report_error"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typecore.mli", line 157, characters 0-70 - +constant is never used - <-- line 157 - val constant : Parsetree.constant -> (Asttypes.constant, error) result [@@dead "+constant"] - Warning Dead Type File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typedtree.ml", line 281, characters 2-23 open_description.open_loc is a record label never used to read a value @@ -3247,40 +3085,10 @@ <-- line 70 val iter_pattern : pattern -> unit [@@dead "Make_iterator.+iter_pattern"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typemod.mli", line 21, characters 0-73 - +type_module is never used - <-- line 21 - val type_module : Env.t -> Parsetree.module_expr -> Typedtree.module_expr [@@dead "+type_module"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typemod.mli", line 22, characters 0-120 - +type_structure is never used - <-- line 22 - Typedtree.structure * Types.signature * Env.t [@@dead "+type_structure"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typemod.mli", line 42, characters 0-59 - +check_nongen_schemes is never used - <-- line 42 - val check_nongen_schemes : Env.t -> Types.signature -> unit [@@dead "+check_nongen_schemes"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typemod.mli", line 50, characters 0-47 - +simplify_signature is never used - <-- line 50 - val simplify_signature : signature -> signature [@@dead "+simplify_signature"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typemod.mli", line 52, characters 0-59 - +path_of_module is never used - <-- line 52 - val path_of_module : Typedtree.module_expr -> Path.t option [@@dead "+path_of_module"] - Warning Dead Type File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/types.ml", line 99, characters 29-39 Variance.f.May_weak is a variant case which is never constructed <-- line 99 type f = May_pos | May_neg | May_weak [@dead "Variance.f.May_weak"] | Inj | Pos | Neg | Inv - Analysis reported 665 issues (Warning Dead Module:4, Warning Dead Type:124, Warning Dead Value:188, Warning Dead Value With Side Effects:2, Warning Redundant Optional Argument:198, Warning Unused Argument:149) + Analysis reported 633 issues (Warning Dead Module:4, Warning Dead Type:124, Warning Dead Value:156, Warning Dead Value With Side Effects:2, Warning Redundant Optional Argument:198, Warning Unused Argument:149) diff --git a/compiler/ml/printtyp.ml b/compiler/ml/printtyp.ml index 4337c2a736e..254b65ac9da 100644 --- a/compiler/ml/printtyp.ml +++ b/compiler/ml/printtyp.ml @@ -961,18 +961,10 @@ let typexp sch ppf ty = !Oprint.out_type ppf (tree_of_typexp sch ty) let type_expr ppf ty = typexp false ppf ty -and type_sch ppf ty = typexp true ppf ty - and type_scheme ppf ty = reset_and_mark_loops ty; typexp true ppf ty -(* Maxence *) -let type_scheme_max ?(b_reset_names = true) ppf ty = - if b_reset_names then reset_names (); - typexp true ppf ty -(* End Maxence *) - let tree_of_type_scheme ty = reset_and_mark_loops ty; tree_of_typexp true ty @@ -1172,42 +1164,13 @@ and tree_of_modtype_declaration id decl = in Osig_modtype (Ident.name id, mty) -and tree_of_module id ?ellipsis mty rs = - Osig_module (Ident.name id, tree_of_modtype ?ellipsis mty, tree_of_rec rs) +and tree_of_module id ~ellipsis mty rs = + Osig_module (Ident.name id, tree_of_modtype ~ellipsis mty, tree_of_rec rs) let modtype ppf mty = !Oprint.out_module_type ppf (tree_of_modtype mty) let modtype_declaration id ppf decl = !Oprint.out_sig_item ppf (tree_of_modtype_declaration id decl) -(* For the toplevel: merge with tree_of_signature? *) - -(* Refresh weak variable map in the toplevel *) -let refresh_weak () = - let refresh t name (m, s) = - if is_non_gen true (repr t) then - (Type_map.add t name m, String_set.add name s) - else (m, s) - in - let m, s = - Type_map.fold refresh !weak_var_map (Type_map.empty, String_set.empty) - in - named_weak_vars := s; - weak_var_map := m - -let print_items showval env x = - refresh_weak (); - let rec print showval env = function - | [] -> [] - | item :: rem as items -> - let _sg, rem = filter_rem_sig item rem in - hide_rec_items items; - let trees = trees_of_sigitem item in - List.map (fun d -> (d, showval env item)) trees @ print showval env rem - in - print showval env x - -(* Print a signature body (used by -i when compiling a .ml) *) - let print_signature ppf tree = fprintf ppf "@[%a@]" !Oprint.out_signature tree diff --git a/compiler/ml/printtyp.mli b/compiler/ml/printtyp.mli index e217b95c8af..98bcf15d0c6 100644 --- a/compiler/ml/printtyp.mli +++ b/compiler/ml/printtyp.mli @@ -28,26 +28,21 @@ val ident : formatter -> Ident.t -> unit val tree_of_path : Path.t -> out_ident val path : formatter -> Path.t -> unit val string_of_path : Path.t -> string -val raw_type_expr : formatter -> type_expr -> unit val string_of_label : Asttypes.arg_label -> string val wrap_printing_env : Env.t -> (unit -> 'a) -> 'a (* Call the function using the environment for type path shortening *) (* This affects all the printing functions below *) -val reset : unit -> unit val mark_loops : type_expr -> unit val reset_and_mark_loops : type_expr -> unit val reset_and_mark_loops_list : type_expr list -> unit val type_expr : formatter -> type_expr -> unit val constructor_arguments : formatter -> constructor_arguments -> unit -val tree_of_type_scheme : type_expr -> out_type -val type_sch : formatter -> type_expr -> unit val type_scheme : formatter -> type_expr -> unit (* Maxence *) val reset_names : unit -> unit -val type_scheme_max : ?b_reset_names:bool -> formatter -> type_expr -> unit (* End Maxence *) val tree_of_value_description : Ident.t -> value_description -> out_sig_item @@ -59,19 +54,12 @@ val tree_of_extension_constructor : Ident.t -> extension_constructor -> ext_status -> out_sig_item val extension_constructor : Ident.t -> formatter -> extension_constructor -> unit -val tree_of_module : - Ident.t -> ?ellipsis:bool -> module_type -> rec_status -> out_sig_item val modtype : formatter -> module_type -> unit val signature : formatter -> signature -> unit -val tree_of_modtype_declaration : Ident.t -> modtype_declaration -> out_sig_item val tree_of_signature : Types.signature -> out_sig_item list val tree_of_typexp : ?printing_context:printing_context -> bool -> type_expr -> out_type val modtype_declaration : Ident.t -> formatter -> modtype_declaration -> unit -val type_expansion : type_expr -> Format.formatter -> type_expr -> unit -val prepare_expansion : type_expr * type_expr -> type_expr * type_expr -val trace : - bool -> bool -> string -> formatter -> (type_expr * type_expr) list -> unit val report_unification_error : formatter -> Env.t -> @@ -108,8 +96,3 @@ val report_ambiguous_type_error : unit (* for toploop *) -val print_items : - (Env.t -> signature_item -> 'a option) -> - Env.t -> - signature_item list -> - (out_sig_item * 'a option) list diff --git a/compiler/ml/subst.mli b/compiler/ml/subst.mli index 62ed5d51ab6..85cef795c61 100644 --- a/compiler/ml/subst.mli +++ b/compiler/ml/subst.mli @@ -54,8 +54,6 @@ val extension_constructor : t -> extension_constructor -> extension_constructor val modtype : t -> module_type -> module_type val signature : t -> signature -> signature val modtype_declaration : t -> modtype_declaration -> modtype_declaration -val module_declaration : t -> module_declaration -> module_declaration -val typexp : t -> Types.type_expr -> Types.type_expr (* A forward reference to be filled in ctype.ml. *) val ctype_apply_env_empty : diff --git a/compiler/ml/typecore.mli b/compiler/ml/typecore.mli index 5d5225039d5..ea791cd00f5 100644 --- a/compiler/ml/typecore.mli +++ b/compiler/ml/typecore.mli @@ -17,9 +17,6 @@ open Asttypes open Types -open Format - -val is_nonexpansive : Typedtree.expression -> bool val type_binding : context:Error_message_utils.type_clash_context option -> @@ -33,26 +30,11 @@ val type_expression : Env.t -> Parsetree.expression -> Typedtree.expression -val check_partial : - ?lev:int -> - ?partial_match_warning_hint:string -> - Env.t -> - type_expr -> - Location.t -> - Typedtree.case list -> - Typedtree.partial val type_exp : Env.t -> Parsetree.expression -> context:Error_message_utils.type_clash_context option -> Typedtree.expression -val type_approx : Env.t -> Parsetree.expression -> type_expr - -val option_some : Typedtree.expression -> Typedtree.expression -val option_none : type_expr -> Location.t -> Typedtree.expression -val extract_option_type : Env.t -> type_expr -> type_expr -val iter_pattern : (Typedtree.pattern -> unit) -> Typedtree.pattern -> unit -val generalizable : int -> type_expr -> bool val id_of_pattern : Typedtree.pattern -> Ident.t option val name_pattern : string -> Typedtree.case list -> Ident.t @@ -134,9 +116,6 @@ type error = exception Error of Location.t * Env.t * error exception Error_forward of Location.error -val report_error : Env.t -> Location.t -> formatter -> error -> unit -(* Deprecated. Use Location.{error_of_exn, report_error}. *) - (* Forward declaration, to be filled in by Typemod.type_module *) val type_module : (Env.t -> Parsetree.module_expr -> Typedtree.module_expr) ref @@ -153,5 +132,3 @@ val type_package : Longident.t list -> Typedtree.module_expr * type_expr list) ref - -val constant : Parsetree.constant -> (Asttypes.constant, error) result diff --git a/compiler/ml/typemod.mli b/compiler/ml/typemod.mli index 5840233cd04..4f08d580c7e 100644 --- a/compiler/ml/typemod.mli +++ b/compiler/ml/typemod.mli @@ -18,12 +18,6 @@ open Types open Format -val type_module : Env.t -> Parsetree.module_expr -> Typedtree.module_expr -val type_structure : - Env.t -> - Parsetree.structure -> - Location.t -> - Typedtree.structure * Types.signature * Env.t val type_toplevel_phrase : Env.t -> Parsetree.structure -> Typedtree.structure * Types.signature * Env.t @@ -39,7 +33,6 @@ val type_implementation_more : Typedtree.structure * Typedtree.module_coercion * Env.t * Types.signature val transl_signature : Env.t -> Parsetree.signature -> Typedtree.signature -val check_nongen_schemes : Env.t -> Types.signature -> unit val type_open_ : ?toplevel:bool -> Asttypes.override_flag -> @@ -47,10 +40,6 @@ val type_open_ : Location.t -> Longident.t Asttypes.loc -> Path.t * Env.t -val simplify_signature : signature -> signature - -val path_of_module : Typedtree.module_expr -> Path.t option - val save_signature : string -> Typedtree.signature -> From d20275d295e27579ae921e932bae2a39b01d76a1 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 15:44:51 +0000 Subject: [PATCH 178/214] dce: note typedtree liveness --- scripts/dce/live-findings.md | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/scripts/dce/live-findings.md b/scripts/dce/live-findings.md index 0b87a787f78..e1f802bb34f 100644 --- a/scripts/dce/live-findings.md +++ b/scripts/dce/live-findings.md @@ -262,8 +262,10 @@ live after manual validation. - Report: `Warning Dead Value` / `Warning Dead Type`, `compiler/ml/classify_function.ml` / `.mli`, - `compiler/ml/cmi_format.ml` / `.mli`, `compiler/ml/cmt_format.mli`, and - `compiler/ml/cmt_utils.ml`. + `compiler/ml/cmi_format.ml` / `.mli`, `compiler/ml/cmt_format.mli`, + `compiler/ml/cmt_utils.ml`, and typedtree artifact fields such as + `open_description.open_loc`, `package_type.pack_type`, `package_type.pack_txt`, + `type_extension.tyext_txt`, and `extension_constructor.ext_name`. - Verdict: live; false positives for compiler, GenType, and analysis tooling. - Validation: `compiler/core/lam_convert.ml` calls `Classify_function.classify_stmt` when lowering raw JavaScript statement @@ -272,7 +274,10 @@ live after manual validation. writing `.cmi`, `.cmt`, and `.cmti` artifacts. `analysis/src/*`, `analysis/reanalyze/src/*`, and `compiler/gentype/*` call `Cmt_format.read_cmt`, inspect `Partial_interface` / `Packed` typed - artifacts, and traverse `Partial_class_expr` where present. + artifacts, and traverse `Partial_class_expr` where present. The reported + typedtree fields are filled by `typemod.ml`, `typetexp.ml`, and + `typedecl.ml`, then carried in the typedtree payload serialized into `.cmt` + files. - Context: the reported `cmt_infos` fields are serialized into typed artifact files by `cmt_format.cppo.ml` and are part of the reader/writer schema even when a specific field is not read back by current in-repo code. The @@ -281,6 +286,22 @@ live after manual validation. `compiler/ml/builtin_attributes.ml`, with `deprecated_text` carried in the recorded payload. +### Typedtree iterators + +- Report: `Warning Dead Value`, `compiler/ml/typedtree_iter.ml` / `.mli`, for + `Make_iterator` and traversal callbacks such as `iter_structure_item`, + `iter_signature_item_desc`, `iter_module_expr_desc`, `iter_class_expr_desc`, + and `iter_expression_desc`. +- Verdict: live; false positive. +- Validation: `compiler/jsoo/jsoo_playground_main.ml` instantiates + `Typedtree_iter.Make_iterator` with `Default_iterator_argument` and calls + `Iter.iter_structure_item` while building playground type hints. + `compiler/ml/parmatch.ml` also instantiates the functor to collect expression + identifiers for pattern-match analysis. +- Context: reanalyze does not root these callbacks through functor + instantiation and the jsoo playground entry point, so the generated iterator + methods look unused even though they run in live compiler tooling. + ### `Misc` live utility surface - Report: remaining `Warning Dead Value`, `Warning Dead Module`, and constructor From 094b8c282a85b6908e736b30a4b91f43a3abb90c Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 15:51:16 +0000 Subject: [PATCH 179/214] dce: trim outcome printers --- _dce/report.txt | 188 +------------ compiler/ml/oprint.ml | 290 +-------------------- compiler/ml/oprint.mli | 3 - compiler/ml/outcometree.ml | 60 +---- compiler/ml/primitive.ml | 2 +- compiler/ml/printtyp.ml | 4 +- compiler/syntax/src/res_outcome_printer.ml | 280 +------------------- 7 files changed, 9 insertions(+), 818 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index 82ed8ba606f..61b3b60f476 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -2725,192 +2725,6 @@ <-- line 299 type let_kind = Strict | Alias | StrictOpt | Variable [@dead "let_kind.Variable"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/oprint.mli", line 24, characters 0-62 - +out_class_type is never used - <-- line 24 - val out_class_type : (formatter -> out_class_type -> unit) ref [@@dead "+out_class_type"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/outcometree.ml", line 30, characters 18-29 - out_string.Ostr_string is a variant case which is never constructed - <-- line 30 - type out_string = Ostr_string [@dead "out_string.Ostr_string"] | Ostr_bytes - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/outcometree.ml", line 30, characters 30-42 - out_string.Ostr_bytes is a variant case which is never constructed - <-- line 30 - type out_string = Ostr_string [@dead "out_string.Ostr_string"] | Ostr_bytes [@dead "out_string.Ostr_bytes"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/outcometree.ml", line 35, characters 2-32 - out_value.Oval_array is a variant case which is never constructed - <-- line 35 - | Oval_array of out_value list [@dead "out_value.Oval_array"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/outcometree.ml", line 36, characters 2-21 - out_value.Oval_char is a variant case which is never constructed - <-- line 36 - | Oval_char of char [@dead "out_value.Oval_char"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/outcometree.ml", line 37, characters 2-45 - out_value.Oval_constr is a variant case which is never constructed - <-- line 37 - | Oval_constr of out_ident * out_value list [@dead "out_value.Oval_constr"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/outcometree.ml", line 38, characters 2-17 - out_value.Oval_ellipsis is a variant case which is never constructed - <-- line 38 - | Oval_ellipsis [@dead "out_value.Oval_ellipsis"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/outcometree.ml", line 39, characters 2-23 - out_value.Oval_float is a variant case which is never constructed - <-- line 39 - | Oval_float of float [@dead "out_value.Oval_float"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/outcometree.ml", line 40, characters 2-19 - out_value.Oval_int is a variant case which is never constructed - <-- line 40 - | Oval_int of int [@dead "out_value.Oval_int"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/outcometree.ml", line 41, characters 2-23 - out_value.Oval_int32 is a variant case which is never constructed - <-- line 41 - | Oval_int32 of int32 [@dead "out_value.Oval_int32"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/outcometree.ml", line 42, characters 2-23 - out_value.Oval_int64 is a variant case which is never constructed - <-- line 42 - | Oval_int64 of int64 [@dead "out_value.Oval_int64"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/outcometree.ml", line 43, characters 2-31 - out_value.Oval_nativeint is a variant case which is never constructed - <-- line 43 - | Oval_nativeint of nativeint [@dead "out_value.Oval_nativeint"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/outcometree.ml", line 44, characters 2-31 - out_value.Oval_list is a variant case which is never constructed - <-- line 44 - | Oval_list of out_value list [@dead "out_value.Oval_list"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/outcometree.ml", line 45, characters 2-46 - out_value.Oval_printer is a variant case which is never constructed - <-- line 45 - | Oval_printer of (Format.formatter -> unit) [@dead "out_value.Oval_printer"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/outcometree.ml", line 46, characters 2-47 - out_value.Oval_record is a variant case which is never constructed - <-- line 46 - | Oval_record of (out_ident * out_value) list [@dead "out_value.Oval_record"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/outcometree.ml", line 47, characters 2-44 - out_value.Oval_string is a variant case which is never constructed - <-- line 47 - | Oval_string of string * int * out_string [@dead "out_value.Oval_string"] (* string, size-to-print, kind *) - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/outcometree.ml", line 48, characters 2-24 - out_value.Oval_stuff is a variant case which is never constructed - <-- line 48 - | Oval_stuff of string [@dead "out_value.Oval_stuff"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/outcometree.ml", line 49, characters 2-32 - out_value.Oval_tuple is a variant case which is never constructed - <-- line 49 - | Oval_tuple of out_value list [@dead "out_value.Oval_tuple"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/outcometree.ml", line 50, characters 2-45 - out_value.Oval_variant is a variant case which is never constructed - <-- line 50 - | Oval_variant of string * out_value option [@dead "out_value.Oval_variant"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/outcometree.ml", line 69, characters 2-46 - out_type.Otyp_attribute is a variant case which is never constructed - <-- line 69 - | Otyp_attribute of out_type * out_attribute [@dead "out_type.Otyp_attribute"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/outcometree.ml", line 76, characters 2-44 - out_class_type.Octy_constr is a variant case which is never constructed - <-- line 76 - | Octy_constr of out_ident * out_type list [@dead "out_class_type.Octy_constr"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/outcometree.ml", line 77, characters 2-52 - out_class_type.Octy_arrow is a variant case which is never constructed - <-- line 77 - | Octy_arrow of string * out_type * out_class_type [@dead "out_class_type.Octy_arrow"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/outcometree.ml", line 78, characters 2-63 - out_class_type.Octy_signature is a variant case which is never constructed - <-- line 78 - | Octy_signature of out_type option * out_class_sig_item list [@dead "out_class_type.Octy_signature"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/outcometree.ml", line 80, characters 2-42 - out_class_sig_item.Ocsg_constraint is a variant case which is never constructed - <-- line 80 - | Ocsg_constraint of out_type * out_type [@dead "out_class_sig_item.Ocsg_constraint"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/outcometree.ml", line 81, characters 2-50 - out_class_sig_item.Ocsg_method is a variant case which is never constructed - <-- line 81 - | Ocsg_method of string * bool * bool * out_type [@dead "out_class_sig_item.Ocsg_method"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/outcometree.ml", line 82, characters 2-49 - out_class_sig_item.Ocsg_value is a variant case which is never constructed - <-- line 82 - | Ocsg_value of string * bool * bool * out_type [@dead "out_class_sig_item.Ocsg_value"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/outcometree.ml", line 91, characters 2-127 - out_sig_item.Osig_class is a variant case which is never constructed - <-- line 91 - * out_rec_status [@dead "out_sig_item.Osig_class"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/outcometree.ml", line 97, characters 2-132 - out_sig_item.Osig_class_type is a variant case which is never constructed - <-- line 97 - * out_rec_status [@dead "out_sig_item.Osig_class_type"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/outcometree.ml", line 144, characters 2-37 - out_phrase.Ophr_eval is a variant case which is never constructed - <-- line 144 - | Ophr_eval of out_value * out_type [@dead "out_phrase.Ophr_eval"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/outcometree.ml", line 145, characters 2-60 - out_phrase.Ophr_signature is a variant case which is never constructed - <-- line 145 - | Ophr_signature of (out_sig_item * out_value option) list [@dead "out_phrase.Ophr_signature"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/outcometree.ml", line 146, characters 2-39 - out_phrase.Ophr_exception is a variant case which is never constructed - <-- line 146 - | Ophr_exception of (exn * out_value) [@dead "out_phrase.Ophr_exception"] - Warning Dead Type File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/parsetree0.ml", line 98, characters 2-22 core_type_desc.Ptyp_class is a variant case which is never constructed @@ -3091,4 +2905,4 @@ <-- line 99 type f = May_pos | May_neg | May_weak [@dead "Variance.f.May_weak"] | Inj | Pos | Neg | Inv - Analysis reported 633 issues (Warning Dead Module:4, Warning Dead Type:124, Warning Dead Value:156, Warning Dead Value With Side Effects:2, Warning Redundant Optional Argument:198, Warning Unused Argument:149) + Analysis reported 602 issues (Warning Dead Module:4, Warning Dead Type:94, Warning Dead Value:155, Warning Dead Value With Side Effects:2, Warning Redundant Optional Argument:198, Warning Unused Argument:149) diff --git a/compiler/ml/oprint.ml b/compiler/ml/oprint.ml index 153d68fb183..339c673426d 100644 --- a/compiler/ml/oprint.ml +++ b/compiler/ml/oprint.ml @@ -16,10 +16,6 @@ open Format open Outcometree -exception Ellipsis - -let cautious f ppf arg = try f ppf arg with Ellipsis -> fprintf ppf "..." - let out_ident = ref pp_print_string let map_primitive_name = ref (fun x -> x) @@ -47,178 +43,6 @@ let value_ident ppf name = if parenthesized_ident name then fprintf ppf "( %s )" name else pp_print_string ppf name -(* Values *) - -let valid_float_lexeme s = - let l = String.length s in - let rec loop i = - if i >= l then s ^ "." - else - match s.[i] with - | '0' .. '9' | '-' -> loop (i + 1) - | _ -> s - in - loop 0 - -let float_repres f = - match classify_float f with - | FP_nan -> "nan" - | FP_infinite -> if f < 0.0 then "neg_infinity" else "infinity" - | _ -> - let float_val = - let s1 = Printf.sprintf "%.12g" f in - if f = float_of_string s1 then s1 - else - let s2 = Printf.sprintf "%.15g" f in - if f = float_of_string s2 then s2 else Printf.sprintf "%.18g" f - in - valid_float_lexeme float_val - -let parenthesize_if_neg ppf fmt v isneg = - if isneg then pp_print_char ppf '('; - fprintf ppf fmt v; - if isneg then pp_print_char ppf ')' - -let escape_string s = - (* Escape only C0 control characters (bytes <= 0x1F), DEL(0x7F), '\\' and '"' *) - let n = ref 0 in - for i = 0 to String.length s - 1 do - n := - !n - + - match String.unsafe_get s i with - | '\"' | '\\' | '\n' | '\t' | '\r' | '\b' -> 2 - | '\x00' .. '\x1F' | '\x7F' -> 4 - | _ -> 1 - done; - if !n = String.length s then s - else - let s' = Bytes.create !n in - n := 0; - for i = 0 to String.length s - 1 do - (match String.unsafe_get s i with - | ('\"' | '\\') as c -> - Bytes.unsafe_set s' !n '\\'; - incr n; - Bytes.unsafe_set s' !n c - | '\n' -> - Bytes.unsafe_set s' !n '\\'; - incr n; - Bytes.unsafe_set s' !n 'n' - | '\t' -> - Bytes.unsafe_set s' !n '\\'; - incr n; - Bytes.unsafe_set s' !n 't' - | '\r' -> - Bytes.unsafe_set s' !n '\\'; - incr n; - Bytes.unsafe_set s' !n 'r' - | '\b' -> - Bytes.unsafe_set s' !n '\\'; - incr n; - Bytes.unsafe_set s' !n 'b' - | ('\x00' .. '\x1F' | '\x7F') as c -> - let a = Char.code c in - Bytes.unsafe_set s' !n '\\'; - incr n; - Bytes.unsafe_set s' !n (Char.chr (48 + (a / 100))); - incr n; - Bytes.unsafe_set s' !n (Char.chr (48 + (a / 10 mod 10))); - incr n; - Bytes.unsafe_set s' !n (Char.chr (48 + (a mod 10))) - | c -> Bytes.unsafe_set s' !n c); - incr n - done; - Bytes.to_string s' - -let print_out_string ppf s = - let not_escaped = - (* let the user dynamically choose if strings should be escaped: *) - match Sys.getenv_opt "OCAMLTOP_UTF_8" with - | None -> true - | Some x -> ( - match bool_of_string_opt x with - | None -> true - | Some f -> f) - in - if not_escaped then fprintf ppf "\"%s\"" (escape_string s) - else fprintf ppf "%S" s - -let print_out_value ppf tree = - let rec print_tree_1 ppf = function - | Oval_constr (name, [param]) -> - fprintf ppf "@[<1>%a@ %a@]" print_ident name print_constr_param param - | Oval_constr (name, (_ :: _ as params)) -> - fprintf ppf "@[<1>%a@ (%a)@]" print_ident name - (print_tree_list print_tree_1 ",") - params - | Oval_variant (name, Some param) -> - fprintf ppf "@[<2>`%s@ %a@]" name print_constr_param param - | tree -> print_simple_tree ppf tree - and print_constr_param ppf = function - | Oval_int i -> parenthesize_if_neg ppf "%i" i (i < 0) - | Oval_int32 i -> parenthesize_if_neg ppf "%lil" i (i < 0l) - | Oval_int64 i -> parenthesize_if_neg ppf "%LiL" i (i < 0L) - | Oval_nativeint i -> parenthesize_if_neg ppf "%nin" i (i < 0n) - | Oval_float f -> parenthesize_if_neg ppf "%s" (float_repres f) (f < 0.0) - | Oval_string (_, _, Ostr_bytes) as tree -> - pp_print_char ppf '('; - print_simple_tree ppf tree; - pp_print_char ppf ')' - | tree -> print_simple_tree ppf tree - and print_simple_tree ppf = function - | Oval_int i -> fprintf ppf "%i" i - | Oval_int32 i -> fprintf ppf "%lil" i - | Oval_int64 i -> fprintf ppf "%LiL" i - | Oval_nativeint i -> fprintf ppf "%nin" i - | Oval_float f -> pp_print_string ppf (float_repres f) - | Oval_char c -> fprintf ppf "%C" c - | Oval_string (s, maxlen, kind) -> ( - try - let len = String.length s in - let s = if len > maxlen then String.sub s 0 maxlen else s in - (match kind with - | Ostr_bytes -> fprintf ppf "Bytes.of_string %S" s - | Ostr_string -> print_out_string ppf s); - if len > maxlen then - fprintf ppf "... (* string length %d; truncated *)" len - with Invalid_argument _ (* "String.create" *) -> - fprintf ppf "") - | Oval_list tl -> - fprintf ppf "@[<1>[%a]@]" (print_tree_list print_tree_1 ";") tl - | Oval_array tl -> - fprintf ppf "@[<2>[|%a|]@]" (print_tree_list print_tree_1 ";") tl - | Oval_constr (name, []) -> print_ident ppf name - | Oval_variant (name, None) -> fprintf ppf "`%s" name - | Oval_stuff s -> pp_print_string ppf s - | Oval_record fel -> - fprintf ppf "@[<1>{%a}@]" (cautious (print_fields true)) fel - | Oval_ellipsis -> raise Ellipsis - | Oval_printer f -> f ppf - | Oval_tuple tree_list -> - fprintf ppf "@[<1>(%a)@]" (print_tree_list print_tree_1 ",") tree_list - | tree -> fprintf ppf "@[<1>(%a)@]" (cautious print_tree_1) tree - and print_fields first ppf = function - | [] -> () - | (name, tree) :: fields -> - if not first then fprintf ppf ";@ "; - fprintf ppf "@[<1>%a@ =@ %a@]" print_ident name (cautious print_tree_1) - tree; - print_fields false ppf fields - and print_tree_list print_item sep ppf tree_list = - let rec print_list first ppf = function - | [] -> () - | tree :: tree_list -> - if not first then fprintf ppf "%s@ " sep; - print_item ppf tree; - print_list false ppf tree_list - in - cautious (print_list true) ppf tree_list - in - cautious print_tree_1 ppf tree - -let out_value = ref print_out_value - (* Types *) let rec print_list_init pr sep ppf = function @@ -320,8 +144,6 @@ and print_simple_out_type ppf = function fprintf ppf " %s type %s = %a" sep s print_out_type t) n tyl; fprintf ppf ")@]" - | Otyp_attribute (t, attr) -> - fprintf ppf "@[<1>(%a [@@%s])@]" print_out_type t attr.oattr_name and print_record_decl ppf lbls = fprintf ppf "{%a@;<1 -2>}" @@ -382,56 +204,13 @@ and print_out_label ppf (name, mut, opt, arg) = let out_type = ref print_out_type -(* Class types *) +(* Type parameters *) let type_parameter ppf (ty, (co, cn)) = fprintf ppf "%s%s" (if not cn then "+" else if not co then "-" else "") (if ty = "_" then ty else "'" ^ ty) -let print_out_class_params ppf = function - | [] -> () - | tyl -> - fprintf ppf "@[<1>[%a]@]@ " - (print_list type_parameter (fun ppf -> fprintf ppf ", ")) - tyl - -let rec print_out_class_type ppf = function - | Octy_constr (id, tyl) -> - let pr_tyl ppf = function - | [] -> () - | tyl -> fprintf ppf "@[<1>[%a]@]@ " (print_typlist !out_type ",") tyl - in - fprintf ppf "@[%a%a@]" pr_tyl tyl print_ident id - | Octy_arrow (lab, ty, cty) -> - fprintf ppf "@[%s%a ->@ %a@]" - (if lab <> "" then lab ^ ":" else "") - print_out_type_2 ty print_out_class_type cty - | Octy_signature (self_ty, csil) -> - let pr_param ppf = function - | Some ty -> fprintf ppf "@ @[(%a)@]" !out_type ty - | None -> () - in - fprintf ppf "@[@[<2>object%a@]@ %a@;<1 -2>end@]" pr_param self_ty - (print_list print_out_class_sig_item (fun ppf -> fprintf ppf "@ ")) - csil - -and print_out_class_sig_item ppf = function - | Ocsg_constraint (ty1, ty2) -> - fprintf ppf "@[<2>constraint %a =@ %a@]" !out_type ty1 !out_type ty2 - | Ocsg_method (name, priv, virt, ty) -> - fprintf ppf "@[<2>method %s%s%s :@ %a@]" - (if priv then "private " else "") - (if virt then "virtual " else "") - name !out_type ty - | Ocsg_value (name, mut, vr, ty) -> - fprintf ppf "@[<2>val %s%s%s :@ %a@]" - (if mut then "mutable " else "") - (if vr then "virtual " else "") - name !out_type ty - -let out_class_type = ref print_out_class_type - (* Signature *) let out_module_type = ref (fun _ -> failwith "Oprint.out_module_type") @@ -501,16 +280,6 @@ and print_out_signature ppf = function fprintf ppf "%a@ %a" !out_sig_item item print_out_signature items and print_out_sig_item ppf = function - | Osig_class (vir_flag, name, params, clt, rs) -> - fprintf ppf "@[<2>%s%s@ %a%s@ :@ %a@]" - (if rs = Orec_next then "and" else "class") - (if vir_flag then " virtual" else "") - print_out_class_params params name !out_class_type clt - | Osig_class_type (vir_flag, name, params, clt, rs) -> - fprintf ppf "@[<2>%s%s@ %a%s@ =@ %a@]" - (if rs = Orec_next then "and" else "class type") - (if vir_flag then " virtual" else "") - print_out_class_params params name !out_class_type clt | Osig_typext (ext, Oext_exception) -> fprintf ppf "@[<2>exception %a@]" print_out_constr (ext.oext_name, ext.oext_args, ext.oext_ret_type, ext.oext_repr) @@ -548,10 +317,8 @@ and print_out_sig_item ppf = function fprintf ppf "@ \"%s\"" (!map_primitive_name s)) sl in - fprintf ppf "@[<2>%s %a :@ %a%a%a@]" kwd value_ident vd.oval_name !out_type + fprintf ppf "@[<2>%s %a :@ %a%a@]" kwd value_ident vd.oval_name !out_type vd.oval_type pr_prims vd.oval_prims - (fun ppf -> List.iter (fun a -> fprintf ppf "@ [@@@@%s]" a.oattr_name)) - vd.oval_attributes | Osig_ellipsis -> fprintf ppf "..." and print_out_type_decl kwd ppf td = @@ -677,56 +444,3 @@ let _ = out_module_type := print_out_module_type let _ = out_signature := print_out_signature let _ = out_sig_item := print_out_sig_item let _ = out_type_extension := print_out_type_extension - -(* Phrases *) - -let print_out_exception ppf exn outv = - match exn with - | Sys.Break -> fprintf ppf "Interrupted.@." - | Out_of_memory -> fprintf ppf "Out of memory during evaluation.@." - | Stack_overflow -> - fprintf ppf "Stack overflow during evaluation (looping recursion?).@." - | _ -> fprintf ppf "@[Exception:@ %a.@]@." !out_value outv - -let rec print_items ppf = function - | [] -> () - | (Osig_typext (ext, Oext_first), None) :: items -> - (* Gather together extension constructors *) - let rec gather_extensions acc items = - match items with - | (Osig_typext (ext, Oext_next), None) :: items -> - gather_extensions - ((ext.oext_name, ext.oext_args, ext.oext_ret_type, ext.oext_repr) - :: acc) - items - | _ -> (List.rev acc, items) - in - let exts, items = - gather_extensions - [(ext.oext_name, ext.oext_args, ext.oext_ret_type, ext.oext_repr)] - items - in - let te = - { - otyext_name = ext.oext_type_name; - otyext_params = ext.oext_type_params; - otyext_constructors = exts; - otyext_private = ext.oext_private; - } - in - fprintf ppf "@[%a@]" !out_type_extension te; - if items <> [] then fprintf ppf "@ %a" print_items items - | (tree, valopt) :: items -> - (match valopt with - | Some v -> fprintf ppf "@[<2>%a =@ %a@]" !out_sig_item tree !out_value v - | None -> fprintf ppf "@[%a@]" !out_sig_item tree); - if items <> [] then fprintf ppf "@ %a" print_items items - -let print_out_phrase ppf = function - | Ophr_eval (outv, ty) -> - fprintf ppf "@[- : %a@ =@ %a@]@." !out_type ty !out_value outv - | Ophr_signature [] -> () - | Ophr_signature items -> fprintf ppf "@[%a@]@." print_items items - | Ophr_exception (exn, outv) -> print_out_exception ppf exn outv - -let out_phrase = ref print_out_phrase diff --git a/compiler/ml/oprint.mli b/compiler/ml/oprint.mli index 4bdd95ad7e9..2e68b914f06 100644 --- a/compiler/ml/oprint.mli +++ b/compiler/ml/oprint.mli @@ -19,13 +19,10 @@ open Outcometree val out_ident : (formatter -> string -> unit) ref val map_primitive_name : (string -> string) ref -val out_value : (formatter -> out_value -> unit) ref val out_type : (formatter -> out_type -> unit) ref -val out_class_type : (formatter -> out_class_type -> unit) ref val out_module_type : (formatter -> out_module_type -> unit) ref val out_sig_item : (formatter -> out_sig_item -> unit) ref val out_signature : (formatter -> out_sig_item list -> unit) ref val out_type_extension : (formatter -> out_type_extension -> unit) ref -val out_phrase : (formatter -> out_phrase -> unit) ref val parenthesized_ident : string -> bool diff --git a/compiler/ml/outcometree.ml b/compiler/ml/outcometree.ml index 13724209fa1..82444743925 100644 --- a/compiler/ml/outcometree.ml +++ b/compiler/ml/outcometree.ml @@ -13,42 +13,14 @@ (* *) (**************************************************************************) -(* Module [Outcometree]: results displayed by the toplevel *) - -(* These types represent messages that the toplevel displays as normal - results or errors. The real displaying is customisable using the hooks: - [Toploop.print_out_value] - [Toploop.print_out_type] - [Toploop.print_out_sig_item] - [Toploop.print_out_phrase] *) +(* Module [Outcometree]: type and signature output displayed by diagnostics and + editor tooling. The rendering is customizable through [Oprint] hooks. *) type out_ident = | Oide_apply of out_ident * out_ident | Oide_dot of out_ident * string | Oide_ident of string -type out_string = Ostr_string | Ostr_bytes - -type out_attribute = {oattr_name: string} - -type out_value = - | Oval_array of out_value list - | Oval_char of char - | Oval_constr of out_ident * out_value list - | Oval_ellipsis - | Oval_float of float - | Oval_int of int - | Oval_int32 of int32 - | Oval_int64 of int64 - | Oval_nativeint of nativeint - | Oval_list of out_value list - | Oval_printer of (Format.formatter -> unit) - | Oval_record of (out_ident * out_value) list - | Oval_string of string * int * out_string (* string, size-to-print, kind *) - | Oval_stuff of string - | Oval_tuple of out_value list - | Oval_variant of string * out_value option - type out_type = | Otyp_abstract | Otyp_open @@ -66,21 +38,11 @@ type out_type = | Otyp_variant of bool * out_variant * bool * string list option | Otyp_poly of string list * out_type | Otyp_module of string * string list * out_type list - | Otyp_attribute of out_type * out_attribute and out_variant = | Ovar_fields of (string * bool * out_type list) list | Ovar_typ of out_type -type out_class_type = - | Octy_constr of out_ident * out_type list - | Octy_arrow of string * out_type * out_class_type - | Octy_signature of out_type option * out_class_sig_item list -and out_class_sig_item = - | Ocsg_constraint of out_type * out_type - | Ocsg_method of string * bool * bool * out_type - | Ocsg_value of string * bool * bool * out_type - type out_module_type = | Omty_abstract | Omty_functor of string * out_module_type option * out_module_type @@ -88,18 +50,6 @@ type out_module_type = | Omty_signature of out_sig_item list | Omty_alias of out_ident and out_sig_item = - | Osig_class of - bool - * string - * (string * (bool * bool)) list - * out_class_type - * out_rec_status - | Osig_class_type of - bool - * string - * (string * (bool * bool)) list - * out_class_type - * out_rec_status | Osig_typext of out_extension_constructor * out_ext_status | Osig_modtype of string * out_module_type | Osig_module of string * out_module_type * out_rec_status @@ -135,12 +85,6 @@ and out_val_decl = { oval_name: string; oval_type: out_type; oval_prims: string list; - oval_attributes: out_attribute list; } and out_rec_status = Orec_not | Orec_first | Orec_next and out_ext_status = Oext_first | Oext_next | Oext_exception - -type out_phrase = - | Ophr_eval of out_value * out_type - | Ophr_signature of (out_sig_item * out_value option) list - | Ophr_exception of (exn * out_value) diff --git a/compiler/ml/primitive.ml b/compiler/ml/primitive.ml index f632606e9a4..9387bbc4378 100644 --- a/compiler/ml/primitive.ml +++ b/compiler/ml/primitive.ml @@ -59,4 +59,4 @@ let print p osig_val_decl = if p.prim_native_name <> "" then [p.prim_name; p.prim_native_name] else [p.prim_name] in - {osig_val_decl with oval_prims = prims; oval_attributes = []} + {osig_val_decl with oval_prims = prims} diff --git a/compiler/ml/printtyp.ml b/compiler/ml/printtyp.ml index 254b65ac9da..f54f6481933 100644 --- a/compiler/ml/printtyp.ml +++ b/compiler/ml/printtyp.ml @@ -1039,9 +1039,7 @@ let tree_of_value_description id decl = (* Format.eprintf "@[%a@]@." raw_type_expr decl.val_type; *) let id = Ident.name id in let ty = tree_of_type_scheme decl.val_type in - let vd = - {oval_name = id; oval_type = ty; oval_prims = []; oval_attributes = []} - in + let vd = {oval_name = id; oval_type = ty; oval_prims = []} in let vd = match decl.val_kind with | Val_prim p -> Primitive.print p vd diff --git a/compiler/syntax/src/res_outcome_printer.ml b/compiler/syntax/src/res_outcome_printer.ml index f6fd5aec84c..6e68f556e13 100644 --- a/compiler/syntax/src/res_outcome_printer.ml +++ b/compiler/syntax/src/res_outcome_printer.ml @@ -14,34 +14,6 @@ module Printer = Res_printer * We don't support custom operators. *) let parenthesized_ident _name = true -(* TODO: better allocation strategy for the buffer *) -let escape_string_contents s = - let len = String.length s in - let b = Buffer.create len in - for i = 0 to len - 1 do - let c = (String.get [@doesNotRaise]) s i in - if c = '\008' then ( - Buffer.add_char b '\\'; - Buffer.add_char b 'b') - else if c = '\009' then ( - Buffer.add_char b '\\'; - Buffer.add_char b 't') - else if c = '\010' then ( - Buffer.add_char b '\\'; - Buffer.add_char b 'n') - else if c = '\013' then ( - Buffer.add_char b '\\'; - Buffer.add_char b 'r') - else if c = '\034' then ( - Buffer.add_char b '\\'; - Buffer.add_char b '"') - else if c = '\092' then ( - Buffer.add_char b '\\'; - Buffer.add_char b '\\') - else Buffer.add_char b c - done; - Buffer.contents b - (* let rec print_ident fmt ident = match ident with | Outcometree.Oide_ident s -> Format.pp_print_string fmt s | Oide_dot (id, s) -> @@ -66,20 +38,6 @@ let rec print_out_ident_doc ?(allow_uident = true) print_out_ident_doc call; Doc.lparen; print_out_ident_doc arg; Doc.rparen; ] -let print_out_attribute_doc (out_attribute : Outcometree.out_attribute) = - Doc.concat [Doc.text "@"; Doc.text out_attribute.oattr_name] - -let print_out_attributes_doc (attrs : Outcometree.out_attribute list) = - match attrs with - | [] -> Doc.nil - | attrs -> - Doc.concat - [ - Doc.group - (Doc.join ~sep:Doc.line (List.map print_out_attribute_doc attrs)); - Doc.line; - ] - let rec collect_arrow_args (out_type : Outcometree.out_type) args = match out_type with | Otyp_arrow (label, arg_type, return_type, arity) @@ -146,10 +104,6 @@ let rec print_out_type_doc (out_type : Outcometree.out_type) = Doc.concat [Doc.text ("'" ^ if ng then "_" else ""); Doc.text s] | Otyp_object (fields, rest) -> print_object_fields fields rest | Otyp_class _ -> Doc.nil - | Otyp_attribute (typ, attribute) -> - Doc.group - (Doc.concat - [print_out_attribute_doc attribute; Doc.line; print_out_type_doc typ]) (* example: Red | Blue | Green | CustomColour(float, float, float) *) | Otyp_sum constructors -> print_out_constructors_doc constructors (* example: {"name": string, "age": int} *) @@ -490,13 +444,11 @@ let print_type_parameter_doc (typ, (co, cn)) = let rec print_out_sig_item_doc ?(print_name_as_is = false) (out_sig_item : Outcometree.out_sig_item) = match out_sig_item with - | Osig_class _ | Osig_class_type _ -> Doc.nil | Osig_ellipsis -> Doc.dotdotdot | Osig_value value_decl -> Doc.group (Doc.concat [ - print_out_attributes_doc value_decl.oval_attributes; Doc.text (match value_decl.oval_prims with | [] -> "let " @@ -849,226 +801,6 @@ let print_out_signature fmt signature = Format.pp_print_string fmt (Doc.to_string ~width:80 (print_out_signature_doc signature)) -let valid_float_lexeme s = - let l = String.length s in - let rec loop i = - if i >= l then s ^ "." - else - match s.[i] [@doesNotRaise] with - | '0' .. '9' | '-' -> loop (i + 1) - | _ -> s - in - loop 0 - -let float_repres f = - match classify_float f with - | FP_nan -> "nan" - | FP_infinite -> if f < 0.0 then "neg_infinity" else "infinity" - | _ -> - let float_val = - let s1 = Printf.sprintf "%.12g" f in - if f = (float_of_string [@doesNotRaise]) s1 then s1 - else - let s2 = Printf.sprintf "%.15g" f in - if f = (float_of_string [@doesNotRaise]) s2 then s2 - else Printf.sprintf "%.18g" f - in - valid_float_lexeme float_val - -let rec print_out_value_doc (out_value : Outcometree.out_value) = - match out_value with - | Oval_array out_values -> - Doc.group - (Doc.concat - [ - Doc.lbracket; - Doc.indent - (Doc.concat - [ - Doc.soft_line; - Doc.join - ~sep:(Doc.concat [Doc.comma; Doc.line]) - (List.map print_out_value_doc out_values); - ]); - Doc.trailing_comma; - Doc.soft_line; - Doc.rbracket; - ]) - | Oval_char c -> Doc.text ("'" ^ Char.escaped c ^ "'") - | Oval_constr (out_ident, out_values) -> - Doc.group - (Doc.concat - [ - print_out_ident_doc out_ident; - Doc.lparen; - Doc.indent - (Doc.concat - [ - Doc.soft_line; - Doc.join - ~sep:(Doc.concat [Doc.comma; Doc.line]) - (List.map print_out_value_doc out_values); - ]); - Doc.trailing_comma; - Doc.soft_line; - Doc.rparen; - ]) - | Oval_ellipsis -> Doc.text "..." - | Oval_int i -> Doc.text (Format.sprintf "%i" i) - | Oval_int32 i -> Doc.text (Format.sprintf "%lil" i) - | Oval_int64 i -> Doc.text (Format.sprintf "%LiL" i) - | Oval_nativeint i -> Doc.text (Format.sprintf "%nin" i) - | Oval_float f -> Doc.text (float_repres f) - | Oval_list out_values -> - Doc.group - (Doc.concat - [ - Doc.text "list["; - Doc.indent - (Doc.concat - [ - Doc.soft_line; - Doc.join - ~sep:(Doc.concat [Doc.comma; Doc.line]) - (List.map print_out_value_doc out_values); - ]); - Doc.trailing_comma; - Doc.soft_line; - Doc.rbracket; - ]) - | Oval_printer fn -> - let fmt = Format.str_formatter in - fn fmt; - let str = Format.flush_str_formatter () in - Doc.text str - | Oval_record rows -> - Doc.group - (Doc.concat - [ - Doc.lparen; - Doc.indent - (Doc.concat - [ - Doc.soft_line; - Doc.join - ~sep:(Doc.concat [Doc.comma; Doc.line]) - (List.map - (fun (out_ident, out_value) -> - Doc.group - (Doc.concat - [ - print_out_ident_doc out_ident; - Doc.text ": "; - print_out_value_doc out_value; - ])) - rows); - ]); - Doc.trailing_comma; - Doc.soft_line; - Doc.rparen; - ]) - | Oval_string (txt, _sizeToPrint, _kind) -> - Doc.text (escape_string_contents txt) - | Oval_stuff txt -> Doc.text txt - | Oval_tuple out_values -> - Doc.group - (Doc.concat - [ - Doc.lparen; - Doc.indent - (Doc.concat - [ - Doc.soft_line; - Doc.join - ~sep:(Doc.concat [Doc.comma; Doc.line]) - (List.map print_out_value_doc out_values); - ]); - Doc.trailing_comma; - Doc.soft_line; - Doc.rparen; - ]) - (* Not supported by ReScript *) - | Oval_variant _ -> Doc.nil - -let print_out_exception_doc exc out_value = - match exc with - | Sys.Break -> Doc.text "Interrupted." - | Out_of_memory -> Doc.text "Out of memory during evaluation." - | Stack_overflow -> - Doc.text "Stack overflow during evaluation (looping recursion?)." - | _ -> - Doc.group - (Doc.indent - (Doc.concat - [Doc.text "Exception:"; Doc.line; print_out_value_doc out_value])) - -let print_out_phrase_signature signature = - let rec loop signature acc = - match signature with - | [] -> List.rev acc - | (Outcometree.Osig_typext (ext, Oext_first), None) :: signature -> - (* Gather together extension constructors *) - let rec gather_extensions acc items = - match items with - | (Outcometree.Osig_typext (ext, Oext_next), None) :: items -> - gather_extensions - ((ext.oext_name, ext.oext_args, ext.oext_ret_type, ext.oext_repr) - :: acc) - items - | _ -> (List.rev acc, items) - in - let exts, signature = - gather_extensions - [(ext.oext_name, ext.oext_args, ext.oext_ret_type, ext.oext_repr)] - signature - in - let te = - { - Outcometree.otyext_name = ext.oext_type_name; - otyext_params = ext.oext_type_params; - otyext_constructors = exts; - otyext_private = ext.oext_private; - } - in - let doc = print_out_type_extension_doc te in - loop signature (doc :: acc) - | (sig_item, opt_out_value) :: signature -> - let doc = - match opt_out_value with - | None -> print_out_sig_item_doc sig_item - | Some out_value -> - Doc.group - (Doc.concat - [ - print_out_sig_item_doc sig_item; - Doc.text " = "; - print_out_value_doc out_value; - ]) - in - loop signature (doc :: acc) - in - Doc.breakable_group ~force_break:true - (Doc.join ~sep:Doc.line (loop signature [])) - -let print_out_phrase_doc (out_phrase : Outcometree.out_phrase) = - match out_phrase with - | Ophr_eval (out_value, out_type) -> - Doc.group - (Doc.concat - [ - Doc.text "- : "; - print_out_type_doc out_type; - Doc.text " ="; - Doc.indent (Doc.concat [Doc.line; print_out_value_doc out_value]); - ]) - | Ophr_signature [] -> Doc.nil - | Ophr_signature signature -> print_out_phrase_signature signature - | Ophr_exception (exc, out_value) -> print_out_exception_doc exc out_value - -let print_out_phrase fmt out_phrase = - Format.pp_print_string fmt - (Doc.to_string ~width:80 (print_out_phrase_doc out_phrase)) - let print_out_module_type fmt out_module_type = Format.pp_print_string fmt (Doc.to_string ~width:80 (print_out_module_type_doc out_module_type)) @@ -1077,18 +809,10 @@ let print_out_type_extension fmt type_extension = Format.pp_print_string fmt (Doc.to_string ~width:80 (print_out_type_extension_doc type_extension)) -let print_out_value fmt out_value = - Format.pp_print_string fmt - (Doc.to_string ~width:80 (print_out_value_doc out_value)) - -(* Not supported in ReScript *) -(* Oprint.out_class_type *) let setup = lazy - (Oprint.out_value := print_out_value; - Oprint.out_type := print_out_type; + (Oprint.out_type := print_out_type; Oprint.out_module_type := print_out_module_type; Oprint.out_sig_item := print_out_sig_item; Oprint.out_signature := print_out_signature; - Oprint.out_type_extension := print_out_type_extension; - Oprint.out_phrase := print_out_phrase) + Oprint.out_type_extension := print_out_type_extension) From 42fea08114768584bf35f94b5089f8f38ffd67b6 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 15:52:27 +0000 Subject: [PATCH 180/214] dce: trim bs exception --- _dce/report.txt | 62 +------------------------------ compiler/depends/bs_exception.ml | 20 ---------- compiler/depends/bs_exception.mli | 5 --- 3 files changed, 1 insertion(+), 86 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index 61b3b60f476..5d8a485bf9e 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -1963,66 +1963,6 @@ <-- line 29 val magic_sep_char : char [@@dead "+magic_sep_char"] - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/depends/bs_exception.ml", line 28, characters 2-36 - error.Bs_cyclic_depends is a variant case which is never constructed - <-- line 28 - | Bs_cyclic_depends of string list [@dead "error.Bs_cyclic_depends"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/depends/bs_exception.ml", line 29, characters 2-43 - error.Bs_duplicated_module is a variant case which is never constructed - <-- line 29 - | Bs_duplicated_module of string * string [@dead "error.Bs_duplicated_module"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/depends/bs_exception.ml", line 31, characters 2-34 - error.Bs_package_not_found is a variant case which is never constructed - <-- line 31 - | Bs_package_not_found of string [@dead "error.Bs_package_not_found"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/depends/bs_exception.ml", line 32, characters 2-31 - error.Bs_main_not_exist is a variant case which is never constructed - <-- line 32 - | Bs_main_not_exist of string [@dead "error.Bs_main_not_exist"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/depends/bs_exception.ml", line 33, characters 2-29 - error.Bs_invalid_path is a variant case which is never constructed - <-- line 33 - | Bs_invalid_path of string [@dead "error.Bs_invalid_path"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/depends/bs_exception.mli", line 28, characters 2-36 - error.Bs_cyclic_depends is a variant case which is never constructed - <-- line 28 - | Bs_cyclic_depends of string list [@dead "error.Bs_cyclic_depends"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/depends/bs_exception.mli", line 29, characters 2-43 - error.Bs_duplicated_module is a variant case which is never constructed - <-- line 29 - | Bs_duplicated_module of string * string [@dead "error.Bs_duplicated_module"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/depends/bs_exception.mli", line 31, characters 2-34 - error.Bs_package_not_found is a variant case which is never constructed - <-- line 31 - | Bs_package_not_found of string [@dead "error.Bs_package_not_found"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/depends/bs_exception.mli", line 32, characters 2-31 - error.Bs_main_not_exist is a variant case which is never constructed - <-- line 32 - | Bs_main_not_exist of string [@dead "error.Bs_main_not_exist"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/depends/bs_exception.mli", line 33, characters 2-29 - error.Bs_invalid_path is a variant case which is never constructed - <-- line 33 - | Bs_invalid_path of string [@dead "error.Bs_invalid_path"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_fmt.ml", line 10, characters 0-54 +invalid_argf is never used @@ -2905,4 +2845,4 @@ <-- line 99 type f = May_pos | May_neg | May_weak [@dead "Variance.f.May_weak"] | Inj | Pos | Neg | Inv - Analysis reported 602 issues (Warning Dead Module:4, Warning Dead Type:94, Warning Dead Value:155, Warning Dead Value With Side Effects:2, Warning Redundant Optional Argument:198, Warning Unused Argument:149) + Analysis reported 592 issues (Warning Dead Module:4, Warning Dead Type:84, Warning Dead Value:155, Warning Dead Value With Side Effects:2, Warning Redundant Optional Argument:198, Warning Unused Argument:149) diff --git a/compiler/depends/bs_exception.ml b/compiler/depends/bs_exception.ml index bd1e498d9c1..7f2d34f7094 100644 --- a/compiler/depends/bs_exception.ml +++ b/compiler/depends/bs_exception.ml @@ -25,12 +25,7 @@ type error = | Cmj_not_found of string | Js_not_found of string - | Bs_cyclic_depends of string list - | Bs_duplicated_module of string * string | Bs_duplicate_exports of string (* gpr_974 *) - | Bs_package_not_found of string - | Bs_main_not_exist of string - | Bs_invalid_path of string | Missing_ml_dependency of string | Dependency_script_module_dependent_not of string (** TODO: we need add location handling *) @@ -52,22 +47,7 @@ let report_error ppf = function s | Js_not_found s -> Format.fprintf ppf "%s not found, needed in script mode " s - | Bs_cyclic_depends str -> - Format.fprintf ppf "Cyclic depends : @[%a@]" - (Format.pp_print_list ~pp_sep:Format.pp_print_space Format.pp_print_string) - str | Bs_duplicate_exports str -> Format.fprintf ppf "%s is exported twice" str - | Bs_duplicated_module (a, b) -> - Format.fprintf ppf - "The build system does not support two files with same names yet %s, %s" a - b - | Bs_main_not_exist main -> Format.fprintf ppf "File %s not found " main - | Bs_package_not_found package -> - Format.fprintf ppf - "Package %s not found or %s/lib/ocaml does not exist or set \ - npm_config_prefix correctly" - package package - | Bs_invalid_path path -> Format.pp_print_string ppf ("Invalid path: " ^ path) let () = Location.register_error_of_exn (function diff --git a/compiler/depends/bs_exception.mli b/compiler/depends/bs_exception.mli index 53efde0a03b..a0fc7a75956 100644 --- a/compiler/depends/bs_exception.mli +++ b/compiler/depends/bs_exception.mli @@ -25,12 +25,7 @@ type error = | Cmj_not_found of string | Js_not_found of string - | Bs_cyclic_depends of string list - | Bs_duplicated_module of string * string | Bs_duplicate_exports of string (* gpr_974 *) - | Bs_package_not_found of string - | Bs_main_not_exist of string - | Bs_invalid_path of string | Missing_ml_dependency of string | Dependency_script_module_dependent_not of string (* From bb25604f47dde5e552591308f0df6f677188d722 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 15:54:33 +0000 Subject: [PATCH 181/214] dce: trim lambda helpers --- _dce/report.txt | 38 +----------------- compiler/core/lam_iter.ml | 62 ------------------------------ compiler/core/lam_iter.mli | 2 - compiler/core/lam_pass_count.ml | 7 ---- compiler/core/lam_pass_count.mli | 2 - compiler/core/lam_pass_lets_dce.ml | 1 - compiler/depends/binary_ast.mli | 2 - 7 files changed, 1 insertion(+), 113 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index 5d8a485bf9e..c8a400c83b8 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -1881,18 +1881,6 @@ <-- line 60 | Splice2 of E.t * E.t [@dead "arg_expression.Splice2"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_iter.ml", line 29, characters 0-1404 - +inner_iter is never used - <-- line 29 - | Lassign (_id, e) -> f e [@@dead "+inner_iter"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_iter.mli", line 25, characters 0-49 - +inner_iter is never used - <-- line 25 - val inner_iter : Lam.t -> (Lam.t -> unit) -> unit [@@dead "+inner_iter"] - Warning Dead Type File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_module_ident.ml", line 25, characters 55-75 t.dynamic_import is a record label never used to read a value @@ -1917,24 +1905,6 @@ <-- line 34 val id : t -> Ident.t [@@dead "+id"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_count.ml", line 39, characters 0-94 - +pp_info is never used - <-- line 39 - Format.fprintf fmt "(:%d)" x.captured x.times [@@dead "+pp_info"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_count.ml", line 42, characters 0-123 - +pp_occ_tbl is never used - <-- line 42 - Format.fprintf fmt "@[%a@ %a@]@." Ident.print k pp_info v) [@@dead "+pp_occ_tbl"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_count.mli", line 30, characters 0-52 - +pp_occ_tbl is never used - <-- line 30 - val pp_occ_tbl : Format.formatter -> occ_tbl -> unit [@@dead "+pp_occ_tbl"] - Warning Dead Value With Side Effects File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_print.ml", line 493, characters 0-50 +lambda_to_string is never used and could have side effects @@ -1957,12 +1927,6 @@ <-- line 62 val is_function : Lam.t -> bool [@@dead "+is_function"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/depends/binary_ast.mli", line 29, characters 0-25 - +magic_sep_char is never used - <-- line 29 - val magic_sep_char : char [@@dead "+magic_sep_char"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_fmt.ml", line 10, characters 0-54 +invalid_argf is never used @@ -2845,4 +2809,4 @@ <-- line 99 type f = May_pos | May_neg | May_weak [@dead "Variance.f.May_weak"] | Inj | Pos | Neg | Inv - Analysis reported 592 issues (Warning Dead Module:4, Warning Dead Type:84, Warning Dead Value:155, Warning Dead Value With Side Effects:2, Warning Redundant Optional Argument:198, Warning Unused Argument:149) + Analysis reported 586 issues (Warning Dead Module:4, Warning Dead Type:84, Warning Dead Value:149, Warning Dead Value With Side Effects:2, Warning Redundant Optional Argument:198, Warning Unused Argument:149) diff --git a/compiler/core/lam_iter.ml b/compiler/core/lam_iter.ml index eae83894b77..f5902d82faa 100644 --- a/compiler/core/lam_iter.ml +++ b/compiler/core/lam_iter.ml @@ -26,68 +26,6 @@ type t = Lam.t type ident = Ident.t -let inner_iter (l : t) (f : t -> unit) : unit = - match l with - | Lvar (_ : ident) | Lconst (_ : Lam_constant.t) -> () - | Lapply {ap_func; ap_args; ap_info = _} -> - f ap_func; - List.iter f ap_args - | Lfunction {body; arity = _; params = _} -> f body - | Llet (_str, _id, arg, body) -> - f arg; - f body - | Lletrec (decl, body) -> - f body; - Ext_list.iter_snd decl f - | Lswitch - ( arg, - { - sw_consts; - sw_consts_full = _; - sw_blocks; - sw_blocks_full = _; - sw_failaction; - } ) -> - f arg; - Ext_list.iter_snd sw_consts f; - Ext_list.iter_snd sw_blocks f; - Ext_option.iter sw_failaction f - | Lstringswitch (arg, cases, default) -> - f arg; - Ext_list.iter_snd cases f; - Ext_option.iter default f - | Lglobal_module _ -> () - | Lprim {args; primitive = _; loc = _} -> List.iter f args - | Lstaticraise (_id, args) -> List.iter f args - | Lstaticcatch (e1, _vars, e2) -> - f e1; - f e2 - | Ltrywith (e1, _exn, e2) -> - f e1; - f e2 - | Lifthenelse (e1, e2, e3) -> - f e1; - f e2; - f e3 - | Lsequence (e1, e2) -> - f e1; - f e2 - | Lbreak | Lcontinue -> () - | Lwhile (e1, e2) -> - f e1; - f e2 - | Lfor (_v, e1, e2, _dir, e3) -> - f e1; - f e2; - f e3 - | Lfor_of (_v, e1, e2) -> - f e1; - f e2 - | Lfor_await_of (_v, e1, e2) -> - f e1; - f e2 - | Lassign (_id, e) -> f e - let inner_exists (l : t) (f : t -> bool) : bool = match l with | Lvar (_ : ident) | Lglobal_module _ | Lconst (_ : Lam_constant.t) -> false diff --git a/compiler/core/lam_iter.mli b/compiler/core/lam_iter.mli index fd52fcf9cc3..0077b5a860d 100644 --- a/compiler/core/lam_iter.mli +++ b/compiler/core/lam_iter.mli @@ -22,6 +22,4 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *) -val inner_iter : Lam.t -> (Lam.t -> unit) -> unit - val inner_exists : Lam.t -> (Lam.t -> bool) -> bool diff --git a/compiler/core/lam_pass_count.ml b/compiler/core/lam_pass_count.ml index 53bdf406ddf..0e3aa02b0ad 100644 --- a/compiler/core/lam_pass_count.ml +++ b/compiler/core/lam_pass_count.ml @@ -36,13 +36,6 @@ let absorb_info (x : used_info) (y : used_info) = x.times <- x0 + y0; if captured then x.captured <- true -let pp_info fmt (x : used_info) = - Format.fprintf fmt "(:%d)" x.captured x.times - -let pp_occ_tbl fmt tbl = - Hash_ident.iter tbl (fun k v -> - Format.fprintf fmt "@[%a@ %a@]@." Ident.print k pp_info v) - (* The global table [occ] associates to each let-bound identifier the number of its uses (as a reference): - 0 if never used diff --git a/compiler/core/lam_pass_count.mli b/compiler/core/lam_pass_count.mli index 547551b0dc6..727aaa40cf5 100644 --- a/compiler/core/lam_pass_count.mli +++ b/compiler/core/lam_pass_count.mli @@ -26,5 +26,3 @@ type occ_tbl = used_info Hash_ident.t val dummy_info : unit -> used_info val collect_occurs : Lam.t -> occ_tbl - -val pp_occ_tbl : Format.formatter -> occ_tbl -> unit diff --git a/compiler/core/lam_pass_lets_dce.ml b/compiler/core/lam_pass_lets_dce.ml index 503e90c1f81..18606751ca6 100644 --- a/compiler/core/lam_pass_lets_dce.ml +++ b/compiler/core/lam_pass_lets_dce.ml @@ -219,5 +219,4 @@ let apply_lets occ lambda = let simplify_lets (lam : Lam.t) : Lam.t = let occ = Lam_pass_count.collect_occurs lam in - (* Ext_log.dwarn ~__POS__ "@[%a@]@." Lam_pass_count.pp_occ_tbl occ ; *) apply_lets occ lam diff --git a/compiler/depends/binary_ast.mli b/compiler/depends/binary_ast.mli index 97c98cb12bf..3b4d875c60f 100644 --- a/compiler/depends/binary_ast.mli +++ b/compiler/depends/binary_ast.mli @@ -26,8 +26,6 @@ type _ kind = Ml : Parsetree.structure kind | Mli : Parsetree.signature kind val read_ast_exn : fname:string -> 'a kind -> 'a -val magic_sep_char : char - val write_ast : sourcefile:string -> output:string -> 'a kind -> 'a -> unit (** Check out {!Bsb_depfile_gen} for set decoding From 1a9ff6fb869fc488698d2d724c7ae2da8904cfb4 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 15:58:53 +0000 Subject: [PATCH 182/214] dce: trim js helpers --- _dce/report.txt | 354 ++++++++------------------- compiler/core/js_exp_make.ml | 33 --- compiler/core/js_exp_make.mli | 21 -- compiler/core/js_of_lam_option.mli | 2 - compiler/core/js_of_lam_string.ml | 3 - compiler/core/js_of_lam_string.mli | 2 - compiler/core/lam_module_ident.ml | 2 - compiler/core/lam_module_ident.mli | 2 - compiler/ext/ordered_hash_map_gen.ml | 5 - 9 files changed, 102 insertions(+), 322 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index c8a400c83b8..5b8c1183e78 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -912,391 +912,391 @@ optional argument from_type of function Label.+unbound_name_error is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 361, characters 0-49 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 340, characters 0-49 optional argument comment of function +is_null_undefined is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 357, characters 0-39 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 336, characters 0-39 optional argument comment of function +is_null is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 353, characters 0-73 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 332, characters 0-73 optional argument comment of function +raw_js_code is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 350, characters 0-74 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 329, characters 0-74 optional argument comment of function +of_block is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 347, characters 0-54 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 326, characters 0-54 optional argument comment of function +dummy_obj is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 341, characters 0-40 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 320, characters 0-40 optional argument comment of function +or_ is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 339, characters 0-41 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 318, characters 0-41 optional argument comment of function +and_ is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 337, characters 0-53 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 316, characters 0-53 optional argument comment of function +obj_length is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 330, characters 0-62 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 309, characters 0-62 optional argument comment of function +tag is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 317, characters 0-69 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 296, characters 0-69 optional argument comment of function +obj is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 303, characters 0-147 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 282, characters 0-147 optional argument comment of function +make_block is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 293, characters 0-67 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 272, characters 0-67 optional argument comment of function +tagged_template is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 285, characters 0-69 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 266, characters 0-69 optional argument comment of function +js_comp is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 283, characters 0-63 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 264, characters 0-63 optional argument comment of function +bigint_mod is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 281, characters 0-63 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 262, characters 0-63 optional argument comment of function +bigint_div is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 279, characters 0-73 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 260, characters 0-73 optional argument comment of function +bigint_comp is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 271, characters 0-71 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 254, characters 0-71 optional argument comment of function +bool_comp is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 265, characters 0-46 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 248, characters 0-46 optional argument comment of function +float_mod is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 251, characters 0-47 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 236, characters 0-47 optional argument comment of function +int32_band is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 249, characters 0-47 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 234, characters 0-47 optional argument comment of function +int32_bxor is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 247, characters 0-46 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 232, characters 0-46 optional argument comment of function +int32_asr is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 243, characters 0-46 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 228, characters 0-46 optional argument comment of function +int32_lsl is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 241, characters 0-46 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 226, characters 0-46 optional argument comment of function +int32_pow is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 239, characters 0-62 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 224, characters 0-62 optional argument comment of function +int32_mod is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 237, characters 0-62 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 222, characters 0-62 optional argument comment of function +int32_div is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 233, characters 0-46 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 220, characters 0-46 optional argument comment of function +int32_mul is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 231, characters 0-48 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 218, characters 0-48 optional argument comment of function +int32_minus is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 225, characters 0-46 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 214, characters 0-46 optional argument comment of function +int32_add is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 221, characters 0-40 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 212, characters 0-40 optional argument comment of function +to_int32 is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 217, characters 0-38 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 209, characters 0-38 optional argument comment of function +typeof is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 203, characters 0-46 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 197, characters 0-46 optional argument comment of function +is_type_number is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 201, characters 0-63 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 195, characters 0-63 optional argument comment of function +neq_null_undefined_boolean is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 199, characters 0-62 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 193, characters 0-62 optional argument comment of function +eq_null_undefined_boolean is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 195, characters 0-40 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 189, characters 0-40 optional argument comment of function +int_bnot is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 193, characters 0-46 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 187, characters 0-46 optional argument comment of function +int_equal is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 182, characters 0-43 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 178, characters 0-43 optional argument comment of function +assign is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 158, characters 0-48 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 154, characters 0-48 optional argument comment of function +array_index is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 141, characters 0-47 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 139, characters 0-47 optional argument comment of function +function_length is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 139, characters 0-45 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 137, characters 0-45 optional argument comment of function +string_length is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 137, characters 0-44 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 135, characters 0-44 optional argument comment of function +array_length is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 133, characters 0-45 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 131, characters 0-45 optional argument comment of function +dot is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 100, characters 0-139 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 98, characters 0-139 optional argument comment of function +method_ is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 100, characters 0-139 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 98, characters 0-139 optional argument immutable_mask of function +method_ is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 89, characters 0-187 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 87, characters 0-187 optional argument comment of function +ocaml_fun is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 76, characters 0-78 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 74, characters 0-78 optional argument comment of function +ml_module_as_var is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 69, characters 0-143 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 67, characters 0-143 optional argument comment of function +external_var is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 57, characters 0-185 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 55, characters 0-185 optional argument comment of function +external_var_field is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 52, characters 0-84 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 50, characters 0-84 optional argument comment of function +ml_var_dot is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1754, characters 0-605 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1721, characters 0-605 optional argument comment of function +neq_null_undefined_boolean is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1739, characters 0-605 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1706, characters 0-605 optional argument comment of function +eq_null_undefined_boolean is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1733, characters 0-216 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1700, characters 0-216 optional argument comment of function +is_null_undefined is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1727, characters 0-58 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1694, characters 0-58 optional argument comment of function +is_null is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1703, characters 0-596 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1670, characters 0-596 optional argument comment of function +of_block is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1696, characters 0-160 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1663, characters 0-160 optional argument comment of function +bigint_mod is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1692, characters 0-159 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1659, characters 0-159 optional argument comment of function +bigint_div is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1665, characters 0-992 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1632, characters 0-992 optional argument comment of function +bigint_comp is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1649, characters 0-384 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1616, characters 0-384 optional argument comment of function +int32_band is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1639, characters 0-445 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1606, characters 0-445 optional argument comment of function +int32_bxor is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1633, characters 0-251 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1600, characters 0-251 optional argument comment of function +int32_pow is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1628, characters 0-179 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1595, characters 0-179 optional argument comment of function +int_bnot is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1609, characters 0-702 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1579, characters 0-702 optional argument comment of function +int32_mul is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1592, characters 0-316 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1562, characters 0-316 optional argument comment of function +int32_lsl is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1582, characters 0-316 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1552, characters 0-316 optional argument comment of function +int32_mod is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1571, characters 0-482 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1541, characters 0-482 optional argument comment of function +int32_div is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1567, characters 0-94 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1537, characters 0-94 optional argument comment of function +int32_asr is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1557, characters 0-87 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1531, characters 0-87 optional argument comment of function +int32_minus is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1552, characters 0-66 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1526, characters 0-66 optional argument comment of function +int32_add is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1442, characters 0-89 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1417, characters 0-89 optional argument comment of function +js_comp is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1412, characters 0-901 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1390, characters 0-901 optional argument comment of function +bool_comp is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1372, characters 0-94 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1350, characters 0-94 optional argument comment of function +obj_length is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1364, characters 0-91 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1345, characters 0-91 optional argument comment of function +is_type_number is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1349, characters 0-97 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1330, characters 0-97 optional argument comment of function +to_int32 is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1315, characters 0-106 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1296, characters 0-106 optional argument comment of function +tag is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1251, characters 0-27 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1232, characters 0-27 optional argument comment of function +int_equal is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1126, characters 0-516 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1107, characters 0-516 optional argument comment of function +or_ is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1106, characters 0-751 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1087, characters 0-751 optional argument comment of function +and_ is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 587, characters 0-94 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 568, characters 0-94 optional argument comment of function +obj is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 553, characters 0-304 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 534, characters 0-304 optional argument comment of function +function_length is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 547, characters 0-242 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 528, characters 0-242 optional argument comment of function +string_length is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 540, characters 0-277 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 521, characters 0-277 optional argument comment of function +array_length is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 485, characters 0-77 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 466, characters 0-77 optional argument comment of function +assign is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 379, characters 0-422 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 373, characters 0-422 optional argument comment of function +array_index is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 376, characters 0-94 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 370, characters 0-94 optional argument comment of function +float_mod is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 273, characters 0-465 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 267, characters 0-465 optional argument comment of function +dummy_obj is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 255, characters 0-365 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 249, characters 0-365 optional argument comment of function +method_ is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 255, characters 0-365 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 249, characters 0-365 optional argument immutable_mask of function +method_ is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 236, characters 0-444 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 230, characters 0-444 optional argument comment of function +ocaml_fun is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 206, characters 0-103 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 200, characters 0-103 optional argument comment of function +instanceof is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 198, characters 0-301 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 192, characters 0-301 optional argument comment of function +typeof is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 191, characters 0-189 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 185, characters 0-189 optional argument comment of function +make_block is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 178, characters 0-104 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 172, characters 0-104 optional argument comment of function +dot is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 160, characters 0-134 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 154, characters 0-134 optional argument comment of function +raw_js_code is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 140, characters 0-176 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 134, characters 0-176 optional argument comment of function +ml_module_as_var is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 124, characters 0-390 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 118, characters 0-390 optional argument comment of function +external_var is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 109, characters 0-367 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 103, characters 0-367 optional argument comment of function +external_var_field is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 96, characters 0-189 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 90, characters 0-189 optional argument comment of function +ml_var_dot is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 76, characters 0-164 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 70, characters 0-164 optional argument comment of function +tagged_template is never used Warning Unused Argument @@ -1468,131 +1468,17 @@ unit [@@dead "+pp_deps_program"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 73, characters 0-83 - +flat_call is never used - <-- line 73 - {expression_desc = FlatCall (e0, es); comment} [@@dead "+flat_call"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 472, characters 0-487 - +string_index is never used - <-- line 472 - | _ -> {expression_desc = String_index (e0, e1); comment} [@@dead "+string_index"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 487, characters 0-419 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 468, characters 0-419 +assign_by_exp is never used - <-- line 487 + <-- line 468 | _ -> assign {expression_desc = Array_index (e, index); comment = None} value [@@dead "+assign_by_exp"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1367, characters 0-91 - +is_type_string is never used - <-- line 1367 - string_equal ?comment (typeof e) (str "string") [@@dead "+is_type_string"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1439, characters 0-92 - +float_comp is never used - <-- line 1439 - bin ?comment (Lam_compile_util.jsop_of_comp cmp) e0 e1 [@@dead "+float_comp"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1551, characters 0-65 - +unchecked_int32_add is never used - <-- line 1551 - let unchecked_int32_add ?comment e1 e2 = float_add ?comment e1 e2 [@@dead "+unchecked_int32_add"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1560, characters 0-86 - +unchecked_int32_minus is never used - <-- line 1560 - float_minus ?comment e1 e2 [@@dead "+unchecked_int32_minus"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1565, characters 0-62 - +float_notequal is never used - <-- line 1565 - let float_notequal ?comment e1 e2 = bin ?comment NotEqEq e1 e2 [@@dead "+float_notequal"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1625, characters 0-104 - +unchecked_int32_mul is never used - <-- line 1625 - {comment; expression_desc = Bin (Mul, e1, e2)} [@@dead "+unchecked_int32_mul"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 48, characters 0-43 - +runtime_var_dot is never used - <-- line 48 - val runtime_var_dot : string -> string -> t [@@dead "+runtime_var_dot"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 156, characters 0-49 - +string_index is never used - <-- line 156 - val string_index : ?comment:string -> t -> t -> t [@@dead "+string_index"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 180, characters 0-36 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 176, characters 0-36 +assign_by_exp is never used - <-- line 180 + <-- line 176 val assign_by_exp : t -> t -> t -> t [@@dead "+assign_by_exp"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 191, characters 0-48 - +float_equal is never used - <-- line 191 - val float_equal : ?comment:string -> t -> t -> t [@@dead "+float_equal"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 213, characters 0-46 - +is_type_string is never used - <-- line 213 - val is_type_string : ?comment:string -> t -> t [@@dead "+is_type_string"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 218, characters 0-47 - +instanceof is never used - <-- line 218 - val instanceof : ?comment:string -> t -> t -> t [@@dead "+instanceof"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 223, characters 0-56 - +unchecked_int32_add is never used - <-- line 223 - val unchecked_int32_add : ?comment:string -> t -> t -> t [@@dead "+unchecked_int32_add"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 229, characters 0-58 - +unchecked_int32_minus is never used - <-- line 229 - val unchecked_int32_minus : ?comment:string -> t -> t -> t [@@dead "+unchecked_int32_minus"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 235, characters 0-56 - +unchecked_int32_mul is never used - <-- line 235 - val unchecked_int32_mul : ?comment:string -> t -> t -> t [@@dead "+unchecked_int32_mul"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 263, characters 0-51 - +float_notequal is never used - <-- line 263 - val float_notequal : ?comment:string -> t -> t -> t [@@dead "+float_notequal"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 275, characters 0-72 - +float_comp is never used - <-- line 275 - val float_comp : Lam_compat.comparison -> ?comment:string -> t -> t -> t [@@dead "+float_comp"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 291, characters 0-46 - +flat_call is never used - <-- line 291 - val flat_call : ?comment:string -> t -> t -> t [@@dead "+flat_call"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_block.ml", line 48, characters 0-40 +field_by_exp is never used @@ -1617,24 +1503,6 @@ <-- line 45 J.expression -> J.expression -> J.expression -> J.expression [@@dead "+set_field_by_exp"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_option.mli", line 42, characters 0-39 - +some is never used - <-- line 42 - val some : J.expression -> J.expression [@@dead "+some"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_string.ml", line 35, characters 0-41 - +ref_string is never used - <-- line 35 - let ref_string e e1 = E.string_index e e1 [@@dead "+ref_string"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_string.mli", line 31, characters 0-61 - +ref_string is never used - <-- line 31 - val ref_string : J.expression -> J.expression -> J.expression [@@dead "+ref_string"] - Warning Dead Type File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_variant.ml", line 28, characters 22-29 arg_expression.Splice0 is a variant case which is never constructed @@ -1887,24 +1755,12 @@ <-- line 25 type t = J.module_id = {id: Ident.t; kind: Js_op.kind; dynamic_import: bool [@dead "t.dynamic_import"] } - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_module_ident.ml", line 27, characters 0-15 - +id is never used - <-- line 27 - let id x = x.id [@@dead "+id"] - Warning Dead Type File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_module_ident.mli", line 31, characters 2-23 t.dynamic_import is a record label never used to read a value <-- line 31 dynamic_import: bool; [@dead "t.dynamic_import"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_module_ident.mli", line 34, characters 0-21 - +id is never used - <-- line 34 - val id : t -> Ident.t [@@dead "+id"] - Warning Dead Value With Side Effects File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_print.ml", line 493, characters 0-50 +lambda_to_string is never used and could have side effects @@ -2195,12 +2051,6 @@ <-- line 61 ?mode:open_flag list -> string -> (string -> out_channel -> 'a) -> 'a [@@dead "+output_to_file_via_temporary"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ordered_hash_map_gen.ml", line 157, characters 0-121 - +bucket_length is never used - <-- line 157 - | Cons rhs -> bucket_length (acc + 1) rhs.next [@@dead "+bucket_length"] - Warning Dead Type File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.ml", line 48, characters 2-9 t.Empty is a variant case which is never constructed @@ -2809,4 +2659,4 @@ <-- line 99 type f = May_pos | May_neg | May_weak [@dead "Variance.f.May_weak"] | Inj | Pos | Neg | Inv - Analysis reported 586 issues (Warning Dead Module:4, Warning Dead Type:84, Warning Dead Value:149, Warning Dead Value With Side Effects:2, Warning Redundant Optional Argument:198, Warning Unused Argument:149) + Analysis reported 561 issues (Warning Dead Module:4, Warning Dead Type:84, Warning Dead Value:124, Warning Dead Value With Side Effects:2, Warning Redundant Optional Argument:198, Warning Unused Argument:149) diff --git a/compiler/core/js_exp_make.ml b/compiler/core/js_exp_make.ml index 7a9c85f1917..28004e7769a 100644 --- a/compiler/core/js_exp_make.ml +++ b/compiler/core/js_exp_make.ml @@ -67,12 +67,6 @@ let nil : t = {expression_desc = Null; comment = None} let call ?comment ~info e0 args : t = {expression_desc = Call (e0, args, info); comment} -(* TODO: optimization when es is known at compile time - to be an array -*) -let flat_call ?comment e0 es : t = - {expression_desc = FlatCall (e0, es); comment} - let tagged_template ?comment call_expr string_args value_args : t = { expression_desc = Tagged_template (call_expr, string_args, value_args); @@ -469,19 +463,6 @@ let extension_access (e : t) name (pos : int32) : t = in {expression_desc = Static_index (e, name, Some pos); comment = None} -let string_index ?comment (e0 : t) (e1 : t) : t = - match (e0.expression_desc, e1.expression_desc) with - | Str {txt}, Number (Int {i; _}) -> - (* Don't optimize {j||j} *) - let i = Int32.to_int i in - if i >= 0 && i < String.length txt then - (* TODO: check exception when i is out of range.. - RangeError? - *) - str (String.make 1 txt.[i]) - else {expression_desc = String_index (e0, e1); comment} - | _ -> {expression_desc = String_index (e0, e1); comment} - let assign ?comment e0 e1 : t = {expression_desc = Bin (Eq, e0, e1); comment} let assign_by_exp (e : t) index value : t = @@ -1364,9 +1345,6 @@ let string_equal ?comment (e0 : t) (e1 : t) : t = string_comp Ceq ?comment e0 e1 let is_type_number ?comment (e : t) : t = string_equal ?comment (typeof e) (str "number") -let is_type_string ?comment (e : t) : t = - string_equal ?comment (typeof e) (str "string") - let is_type_object (e : t) : t = string_equal (typeof e) (str "object") let obj_length ?comment e : t = @@ -1436,9 +1414,6 @@ let bool_comp (cmp : Lam_compat.comparison) ?comment (e0 : t) (e1 : t) = bin ?comment (Lam_compile_util.jsop_of_comp cmp) e0 e1) | _, _ -> bin ?comment (Lam_compile_util.jsop_of_comp cmp) e0 e1 -let float_comp cmp ?comment e0 e1 = - bin ?comment (Lam_compile_util.jsop_of_comp cmp) e0 e1 - let js_comp cmp ?comment e0 e1 = bin ?comment (Lam_compile_util.jsop_of_comp cmp) e0 e1 @@ -1548,7 +1523,6 @@ and float_minus ?comment (e1 : t) (e2 : t) : t = | _ -> {comment; expression_desc = Bin (Minus, e1, e2)} (* bin ?comment Minus e1 e2 *) -let unchecked_int32_add ?comment e1 e2 = float_add ?comment e1 e2 let int32_add ?comment e1 e2 = to_int32 (float_add ?comment e1 e2) let offset e1 (offset : int) = @@ -1557,12 +1531,8 @@ let offset e1 (offset : int) = let int32_minus ?comment e1 e2 : J.expression = to_int32 (float_minus ?comment e1 e2) -let unchecked_int32_minus ?comment e1 e2 : J.expression = - float_minus ?comment e1 e2 - let float_div ?comment e1 e2 = bin ?comment Div e1 e2 let float_pow ?comment e1 e2 = bin ?comment Pow e1 e2 -let float_notequal ?comment e1 e2 = bin ?comment NotEqEq e1 e2 let int32_asr ?comment e1 e2 : J.expression = {comment; expression_desc = Bin (Asr, e1, e2)} @@ -1622,9 +1592,6 @@ let int32_mul ?comment (e1 : J.expression) (e2 : J.expression) : J.expression = else to_int32 (float_mul ?comment e1 e2) | _ -> to_int32 (float_mul ?comment e1 e2) -let unchecked_int32_mul ?comment e1 e2 : J.expression = - {comment; expression_desc = Bin (Mul, e1, e2)} - let int_bnot ?comment (e : t) : J.expression = match e.expression_desc with | Number (Int {i}) -> int ?comment (Int32.lognot i) diff --git a/compiler/core/js_exp_make.mli b/compiler/core/js_exp_make.mli index 4bcfd538e2e..f0e20275efe 100644 --- a/compiler/core/js_exp_make.mli +++ b/compiler/core/js_exp_make.mli @@ -45,8 +45,6 @@ val var : J.ident -> t val js_global : string -> t -val runtime_var_dot : string -> string -> t - (* val runtime_var_vid : string -> string -> J.vident *) val ml_var_dot : @@ -153,8 +151,6 @@ val string_append : ?comment:string -> t -> t -> t (* val bind_call : ?comment:string -> J.expression -> string -> J.expression list -> t *) (* val js_global_dot : ?comment:string -> string -> string -> t *) -val string_index : ?comment:string -> t -> t -> t - val array_index : ?comment:string -> t -> t -> t val array_index_by_int : ?comment:string -> t -> Int32.t -> t @@ -188,8 +184,6 @@ val emit_check : t Ast_untagged_variants.Dynamic_checks.t -> t val triple_equal : ?comment:string -> t -> t -> t (* TODO: reduce [triple_equal] use *) -val float_equal : ?comment:string -> t -> t -> t - val int_equal : ?comment:string -> t -> t -> t val int_bnot : ?comment:string -> t -> t @@ -210,30 +204,21 @@ val is_a_literal_case : t -> t -val is_type_string : ?comment:string -> t -> t - val is_type_object : t -> t val typeof : ?comment:string -> t -> t -val instanceof : ?comment:string -> t -> t -> t val is_array : t -> t val to_int32 : ?comment:string -> t -> t -val unchecked_int32_add : ?comment:string -> t -> t -> t - val int32_add : ?comment:string -> t -> t -> t val offset : t -> int -> t -val unchecked_int32_minus : ?comment:string -> t -> t -> t - val int32_minus : ?comment:string -> t -> t -> t val int32_mul : ?comment:string -> t -> t -> t -val unchecked_int32_mul : ?comment:string -> t -> t -> t - val int32_div : checked:bool -> ?comment:string -> t -> t -> t val int32_mod : checked:bool -> ?comment:string -> t -> t -> t @@ -260,8 +245,6 @@ val float_mul : ?comment:string -> t -> t -> t val float_div : ?comment:string -> t -> t -> t -val float_notequal : ?comment:string -> t -> t -> t - val float_mod : ?comment:string -> t -> t -> t val float_pow : ?comment:string -> t -> t -> t @@ -272,8 +255,6 @@ val bool_comp : Lam_compat.comparison -> ?comment:string -> t -> t -> t val string_comp : Lam_compat.comparison -> ?comment:string -> t -> t -> t -val float_comp : Lam_compat.comparison -> ?comment:string -> t -> t -> t - val bigint_op : ?comment:string -> Js_op.binop -> t -> t -> t val bigint_comp : Lam_compat.comparison -> ?comment:string -> t -> t -> t @@ -288,8 +269,6 @@ val not : t -> t val call : ?comment:string -> info:Js_call_info.t -> t -> t list -> t -val flat_call : ?comment:string -> t -> t -> t - val tagged_template : ?comment:string -> t -> t list -> t list -> t val new_ : J.expression -> J.expression list -> t diff --git a/compiler/core/js_of_lam_option.mli b/compiler/core/js_of_lam_option.mli index c4b6285099a..1acdb952aed 100644 --- a/compiler/core/js_of_lam_option.mli +++ b/compiler/core/js_of_lam_option.mli @@ -39,8 +39,6 @@ val destruct_optional : J.expression -> 'a -val some : J.expression -> J.expression - val is_not_none : J.expression -> J.expression val null_to_opt : J.expression -> J.expression diff --git a/compiler/core/js_of_lam_string.ml b/compiler/core/js_of_lam_string.ml index 765a9d3ee71..2805e0976ce 100644 --- a/compiler/core/js_of_lam_string.ml +++ b/compiler/core/js_of_lam_string.ml @@ -31,9 +31,6 @@ module E = Js_exp_make let const_char (i : int) = E.int ~c:i (Int32.of_int @@ i) -(* string [s[i]] expects to return a [ocaml_char] *) -let ref_string e e1 = E.string_index e e1 - (** Note that [String.fromCharCode] also works, but it only work for small arrays, however, for {bytes_to_string} it is likely the bytes diff --git a/compiler/core/js_of_lam_string.mli b/compiler/core/js_of_lam_string.mli index 68feda72ad2..1d6624270a0 100644 --- a/compiler/core/js_of_lam_string.mli +++ b/compiler/core/js_of_lam_string.mli @@ -28,6 +28,4 @@ [string] is Immutable, so there is not [set_string] method *) -val ref_string : J.expression -> J.expression -> J.expression - val const_char : int -> J.expression diff --git a/compiler/core/lam_module_ident.ml b/compiler/core/lam_module_ident.ml index e92cdb4db0d..dd90d47d860 100644 --- a/compiler/core/lam_module_ident.ml +++ b/compiler/core/lam_module_ident.ml @@ -24,8 +24,6 @@ type t = J.module_id = {id: Ident.t; kind: Js_op.kind; dynamic_import: bool} -let id x = x.id - let of_ml ?(dynamic_import = false) id = {id; kind = Ml; dynamic_import} let of_runtime id = {id; kind = Runtime; dynamic_import = false} diff --git a/compiler/core/lam_module_ident.mli b/compiler/core/lam_module_ident.mli index 46ae23b06c6..639c4083551 100644 --- a/compiler/core/lam_module_ident.mli +++ b/compiler/core/lam_module_ident.mli @@ -31,8 +31,6 @@ type t = J.module_id = { dynamic_import: bool; } -val id : t -> Ident.t - val name : t -> string val of_ml : ?dynamic_import:bool -> Ident.t -> t diff --git a/compiler/ext/ordered_hash_map_gen.ml b/compiler/ext/ordered_hash_map_gen.ml index b85ce6e96bb..469902c735a 100644 --- a/compiler/ext/ordered_hash_map_gen.ml +++ b/compiler/ext/ordered_hash_map_gen.ml @@ -153,8 +153,3 @@ let fold h init f = !accu let elements set = fold set [] (fun k _ _ acc -> k :: acc) - -let rec bucket_length acc (x : _ bucket) = - match x with - | Empty -> 0 - | Cons rhs -> bucket_length (acc + 1) rhs.next From 25d4d86d0ea34207d481dee1d0db16d3ba517ec2 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 15:59:21 +0000 Subject: [PATCH 183/214] dce: note js liveness --- scripts/dce/live-findings.md | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/scripts/dce/live-findings.md b/scripts/dce/live-findings.md index e1f802bb34f..ab7110cb3d0 100644 --- a/scripts/dce/live-findings.md +++ b/scripts/dce/live-findings.md @@ -688,9 +688,11 @@ live after manual validation. `pure_runtime_call` had no callers and were removed. The remaining zero direct-call entries, such as `bin`, `str_equal`, `push_negation`, and the `simplify_*` helpers, are local dependencies of exported builders that are - used through `E.*`. The debug-printer ref is intentionally left because - removing its `Js_dump` hook unroots a large live dump-printer subgraph in the - current DCE report. + used through `E.*`. `assign_by_exp` is called from + `compiler/core/js_of_lam_block.ml` through the usual `module E = Js_exp_make` + alias. The debug-printer ref is intentionally left because removing its + `Js_dump` hook unroots a large live dump-printer subgraph in the current DCE + report. ### `Js_stmt_make` statement builders @@ -848,8 +850,8 @@ live after manual validation. - Report: `Warning Dead Value` / `Warning Dead Module` clusters in `compiler/core/lam_compile_env.ml`, `lam_compile_external_call.ml`, - `lam_compile_external_obj.ml`, and `lam_compile_primitive.ml` plus their - `.mli` files. + `lam_compile_external_obj.ml`, `lam_compile_primitive.ml`, and + `lam_module_ident.ml` plus their `.mli` files. - Verdict: live; false positive. - Validation: `Lam_compile_env` is used by `lam_compile.ml`, `lam_pass_remove_alias.ml`, `lam_arity_analysis.ml`, @@ -857,9 +859,11 @@ live after manual validation. and `lam_compile_main.cppo.ml`. `Lam_compile_external_call.translate_ffi` is called by `lam_compile_primitive.ml`, and `ocaml_to_js_eff` is used by `lam_compile_external_obj.ml`. `Lam_compile_external_obj.assemble_obj_args` - and `Lam_compile_primitive.translate` are called by `lam_compile.ml`. The - reported helper functions in those modules are local dependencies of those - exported lowering entry points. + and `Lam_compile_primitive.translate` are called by `lam_compile.ml`. + `Lam_module_ident.t` is a manifest alias of `J.module_id`; `dynamic_import` + is filled by `Lam_module_ident.of_ml` and read by `js_dump_program.ml` when + emitting dynamic imports. The reported helper functions in those modules are + local dependencies of those exported lowering entry points. - Context: `lam_compile_external_call.arg_expression` is a manifest alias of `Js_of_lam_variant.arg_expression`; constructor warnings there are false positives for the same aliasing reason documented in the JS lowering section. From 4cc3ca9609953ef867dcfbaced8afde8f0323cb9 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 16:00:08 +0000 Subject: [PATCH 184/214] dce: note parsetree0 liveness --- scripts/dce/live-findings.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/scripts/dce/live-findings.md b/scripts/dce/live-findings.md index ab7110cb3d0..ef0225c2844 100644 --- a/scripts/dce/live-findings.md +++ b/scripts/dce/live-findings.md @@ -21,8 +21,9 @@ live after manual validation. - Report: many `Warning Dead Value`, `Warning Dead Module`, and `Warning Redundant Optional Argument` entries in `compiler/ml/ast_helper0.ml` - / `.mli`, including helper submodules such as `Const`, `Typ`, `Pat`, `Exp`, - `Mty`, `Mod`, and `Te`, plus optional labels on `Te.constructor`, `Te.mk`, + / `.mli`, plus frozen v0 constructors in `compiler/ml/parsetree0.ml`, + including helper submodules such as `Const`, `Typ`, `Pat`, `Exp`, `Mty`, + `Mod`, and `Te`, plus optional labels on `Te.constructor`, `Te.mk`, `Type.field`, and `Type.constructor`. - Verdict: live compatibility surface; do not remove as part of this DCE pass. - Validation: `compiler/ml/ast_mapper_to0.ml` opens `Ast_helper0` and uses these @@ -30,9 +31,10 @@ live after manual validation. locations, attributes, privacy flags, constructor arguments, and similar data from the source tree. - Context: `Ast_helper0` mirrors the helper shape for the frozen v0 parsetree. - The repository guidance says v0 PPX compatibility must be preserved, so - changing this helper API for locally redundant labels is higher risk than the - DCE warning suggests. + The repository guidance says `parsetree0.ml` must not be modified and v0 PPX + compatibility must be preserved, so changing this helper API or pruning v0 + AST constructors for locally redundant labels is higher risk than the DCE + warning suggests. ### `Ast_mapper` PPX compatibility API From e334b06575e6050d185510d47cba2ce55580a632 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 16:02:11 +0000 Subject: [PATCH 185/214] dce: note callback liveness --- _dce/report.txt | 662 ++++++++++++++++++++++++++++++++++- scripts/dce/live-findings.md | 12 + 2 files changed, 673 insertions(+), 1 deletion(-) diff --git a/_dce/report.txt b/_dce/report.txt index 5b8c1183e78..d472669224e 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -1387,6 +1387,146 @@ File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/location.ml", line 253, characters 0-108 optional argument src of function +report_error is always supplied (1 calls) + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/arnold.ml", line 33, characters 2-134 + Function_args.+compare_arg is never used + <-- line 33 + if n <> 0 then n else compare a1.function_name a2.function_name [@@dead "Function_args.+compare_arg"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/arnold.ml", line 37, characters 2-217 + Function_args.+compare is never used + <-- line 37 + if n <> 0 then n else compare l1 l2 [@@dead "Function_args.+compare"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/arnold.ml", line 74, characters 2-170 + Function_call.+compare is never used + <-- line 74 + else Function_args.compare x1.function_args x2.function_args [@@dead "Function_call.+compare"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/dead_exception.ml", line 3, characters 0-93 + +dead_exception.Path_map is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/dead_exception.ml", line 6, characters 2-30 + Path_map.+compare is never used + <-- line 6 + let compare = Stdlib.compare [@@dead "Path_map.+compare"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/dead_type.ml", line 69, characters 0-93 + +dead_type.Path_map is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/dead_type.ml", line 72, characters 2-30 + Path_map.+compare is never used + <-- line 72 + let compare = Stdlib.compare [@@dead "Path_map.+compare"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/exn.ml", line 3, characters 0-28 + +compare is never used + <-- line 3 + let compare = String.compare [@@dead "+compare"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/exn.mli", line 3, characters 0-27 + +compare is never used + <-- line 3 + val compare : t -> t -> int [@@dead "+compare"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/file_deps.ml", line 6, characters 0-129 + +file_deps.File_hash is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/file_deps.ml", line 9, characters 2-35 + File_hash.+hash is never used + <-- line 9 + let hash (x : t) = Hashtbl.hash x [@@dead "File_hash.+hash"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/file_deps.ml", line 10, characters 2-29 + File_hash.+equal is never used + <-- line 10 + let equal (x : t) y = x = y [@@dead "File_hash.+equal"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/file_hash.ml", line 1, characters 0-0 + +file_hash is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/file_hash.ml", line 6, characters 2-35 + +hash is never used + <-- line 6 + let hash (x : t) = Hashtbl.hash x [@@dead "+hash"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/file_hash.ml", line 7, characters 2-29 + +equal is never used + <-- line 7 + let equal (x : t) y = x = y [@@dead "+equal"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/loc_set.ml", line 1, characters 0-0 + +loc_set is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/loc_set.ml", line 4, characters 2-23 + +compare is never used + <-- line 4 + let compare = compare [@@dead "+compare"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/name.ml", line 3, characters 0-28 + +compare is never used + <-- line 3 + let compare = String.compare [@@dead "+compare"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/name.mli", line 3, characters 0-27 + +compare is never used + <-- line 3 + val compare : t -> t -> int [@@dead "+compare"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/pos_hash.ml", line 1, characters 0-0 + +pos_hash is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/pos_hash.ml", line 7, characters 2-106 + +hash is never used + <-- line 7 + Hashtbl.hash (x.Lexing.pos_cnum, s) [@@dead "+hash"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/pos_hash.ml", line 11, characters 2-29 + +equal is never used + <-- line 11 + let equal (x : t) y = x = y [@@dead "+equal"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/pos_set.ml", line 1, characters 0-0 + +pos_set is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/pos_set.ml", line 7, characters 2-23 + +compare is never used + <-- line 7 + let compare = compare [@@dead "+compare"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/shared_types.ml", line 488, characters 0-149 + +shared_types.Location_set is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/shared_types.ml", line 491, characters 2-43 + Location_set.+compare is never used + <-- line 491 + let compare loc1 loc2 = compare loc2 loc1 [@@dead "Location_set.+compare"] + Warning Dead Type File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/shared_types.ml", line 523, characters 2-30 package.rescript_version is a record label never used to read a value @@ -1755,6 +1895,22 @@ <-- line 25 type t = J.module_id = {id: Ident.t; kind: Js_op.kind; dynamic_import: bool [@dead "t.dynamic_import"] } + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_module_ident.ml", line 36, characters 0-1115 + +lam_module_ident.Cmp is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_module_ident.ml", line 39, characters 2-317 + Cmp.+equal is never used + <-- line 39 + | Ml | Runtime -> Ext_ident.equal x.id y.id [@@dead "Cmp.+equal"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_module_ident.ml", line 61, characters 2-266 + Cmp.+hash is never used + <-- line 61 + Bs_hash_stubs.hash_stamp_and_name x_id.stamp x_id.name [@@dead "Cmp.+hash"] + Warning Dead Type File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_module_ident.mli", line 31, characters 2-23 t.dynamic_import is a record label never used to read a value @@ -1783,6 +1939,22 @@ <-- line 62 val is_function : Lam.t -> bool [@@dead "+is_function"] + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/polyvar_pattern_match.ml", line 33, characters 0-106 + +polyvar_pattern_match.Coll is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/polyvar_pattern_match.ml", line 36, characters 2-26 + Coll.+equal is never used + <-- line 36 + let equal = Stdlib.( = ) [@@dead "Coll.+equal"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/polyvar_pattern_match.ml", line 38, characters 2-25 + Coll.+hash is never used + <-- line 38 + let hash = Hashtbl.hash [@@dead "Coll.+hash"] + Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_fmt.ml", line 10, characters 0-54 +invalid_argf is never used @@ -1915,24 +2087,108 @@ <-- line 45 val length : 'a t -> int [@@dead "+length"] + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ident.ml", line 44, characters 0-56 + +unique_name is never used + <-- line 44 + let unique_name i = i.name ^ "_" ^ string_of_int i.stamp [@@dead "+unique_name"] + Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ident.ml", line 50, characters 0-35 +equal is never used <-- line 50 let equal i1 i2 = i1.name = i2.name [@@dead "+equal"] + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ident.ml", line 74, characters 0-178 + +print is never used + <-- line 74 + | n -> fprintf ppf "%s/%i%s" i.name n (if global i then "g" else "") [@@dead "+print"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ident.ml", line 219, characters 0-161 + +compare is never used + <-- line 219 + if c <> 0 then c else compare x.flags y.flags [@@dead "+compare"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ident.ml", line 226, characters 0-52 + +output is never used + <-- line 226 + let output oc id = output_string oc (unique_name id) [@@dead "+output"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ident.ml", line 227, characters 0-46 + +hash is never used + <-- line 227 + let hash i = Char.code i.name.[0] lxor i.stamp [@@dead "+hash"] + Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ident.ml", line 229, characters 0-26 +original_equal is never used <-- line 229 let original_equal = equal [@@dead "+original_equal"] + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ident.ml", line 232, characters 2-23 + +compare is never used + <-- line 232 + let compare = compare [@@dead "+compare"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ident.ml", line 233, characters 2-21 + +output is never used + <-- line 233 + let output = output [@@dead "+output"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ident.ml", line 234, characters 2-19 + +print is never used + <-- line 234 + let print = print [@@dead "+print"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ident.ml", line 235, characters 2-17 + +hash is never used + <-- line 235 + let hash = hash [@@dead "+hash"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ident.ml", line 236, characters 2-18 + +equal is never used + <-- line 236 + let equal = same [@@dead "+equal"] + Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ident.ml", line 238, characters 0-26 +equal is never used <-- line 238 let equal = original_equal [@@dead "+equal"] + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ident.mli", line 32, characters 0-29 + +unique_name is never used + <-- line 32 + val unique_name : t -> string [@@dead "+unique_name"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ident.mli", line 42, characters 0-27 + +compare is never used + <-- line 42 + val compare : t -> t -> int [@@dead "+compare"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/identifiable.ml", line 20, characters 10-45 + Make.+hash is never used + <-- line 20 + include Hashtbl.HashedType with type t := t [@@dead "Make.+hash"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/identifiable.ml", line 21, characters 10-42 + Make.+compare is never used + <-- line 21 + include Map.OrderedType with type t := t [@@dead "Make.+compare"] + Warning Dead Module File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/identifiable.mli", line 98, characters 26-46 identifiable.Make.Tbl is a dead module as all its items are dead. @@ -1943,6 +2199,14 @@ <-- line 98 module Make (T : Thing) : S with type t := T.t [@@dead "Make.Tbl.+map"] + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/int_vec_vec.ml", line 1, characters 0-0 + +int_vec_vec is a dead module as all its items are dead. + + Warning Dead Value With Side Effects + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/int_vec_vec.ml", line 28, characters 2-29 + +null is never used and could have side effects + Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 45, characters 0-25 +debugger is never used @@ -2027,6 +2291,26 @@ <-- line 117 raise exn [@@dead "+output_to_file_via_temporary"] + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 243, characters 0-83 + +misc.String_map is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 245, characters 2-23 + String_map.+compare is never used + <-- line 245 + let compare = compare [@@dead "String_map.+compare"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 247, characters 0-83 + +misc.String_set is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 249, characters 2-23 + String_set.+compare is never used + <-- line 249 + let compare = compare [@@dead "String_set.+compare"] + Warning Dead Type File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 343, characters 17-21 Color.setting.Auto is a variant case which is never constructed @@ -2141,6 +2425,38 @@ <-- line 38 val ignore_id : t [@@dead "Lid.+ignore_id"] + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/gentype/gen_ident.ml", line 1, characters 0-102 + +gen_ident.Int_map is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/gentype/gen_ident.ml", line 4, characters 2-47 + Int_map.+compare is never used + <-- line 4 + let compare (x : int) (y : int) = compare x y [@@dead "Int_map.+compare"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/gentype/module_name.ml", line 27, characters 0-44 + +compare is never used + <-- line 27 + let compare (s1 : string) s2 = compare s1 s2 [@@dead "+compare"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/gentype/module_name.mli", line 3, characters 0-27 + +compare is never used + <-- line 3 + val compare : t -> t -> int [@@dead "+compare"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/gentype/resolved_name.ml", line 10, characters 0-336 + +resolved_name.Name_set is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/gentype/resolved_name.ml", line 13, characters 2-275 + Name_set.+compare is never used + <-- line 13 + | false -> compare rest1 rest2) [@@dead "Name_set.+compare"] + Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 28, characters 0-182 +with_default_loc is never used @@ -2307,6 +2623,16 @@ <-- line 529 PStr [Str.eval ~loc (Exp.constant (Pconst_string (s, None)))] ) [@@dead "+attribute_of_warning"] + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_mapper.ml", line 533, characters 0-83 + +ast_mapper.String_map is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_mapper.ml", line 535, characters 2-23 + String_map.+compare is never used + <-- line 535 + let compare = compare [@@dead "String_map.+compare"] + Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_mapper.ml", line 540, characters 0-81 +get_cookie is never used @@ -2431,6 +2757,42 @@ <-- line 5 deprecated_text: string; [@dead "deprecated_used.deprecated_text"] + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 206, characters 0-176 + +ctype.Type_pairs is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 208, characters 2-56 + Type_pairs.+equal is never used + <-- line 208 + let equal (t1, t1') (t2, t2') = t1 == t2 && t1' == t2' [@@dead "Type_pairs.+equal"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 209, characters 2-40 + Type_pairs.+hash is never used + <-- line 209 + let hash (t, t') = t.id + (93 * t'.id) [@@dead "Type_pairs.+hash"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/depend.ml", line 21, characters 0-83 + +depend.String_set is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/depend.ml", line 23, characters 2-23 + String_set.+compare is never used + <-- line 23 + let compare = compare [@@dead "String_set.+compare"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 572, characters 0-90 + +env.String_set is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 574, characters 2-30 + String_set.+compare is never used + <-- line 574 + let compare = String.compare [@@dead "String_set.+compare"] + Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 718, characters 0-434 +reset_cache_toplevel is never used @@ -2455,6 +2817,16 @@ <-- line 289 cmi: Cmi_format.cmi_infos; [@dead "t.cmi"] + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/experimental_features.ml", line 12, characters 0-85 + +experimental_features.Feature_set is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/experimental_features.ml", line 14, characters 2-23 + Feature_set.+compare is never used + <-- line 14 + let compare = compare [@@dead "Feature_set.+compare"] + Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/experimental_features.ml", line 23, characters 0-52 +reset is never used @@ -2479,6 +2851,186 @@ <-- line 299 type let_kind = Strict | Alias | StrictOpt | Variable [@dead "let_kind.Variable"] + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/location.mli", line 47, characters 0-64 + +warning_printer is never used + <-- line 47 + val warning_printer : (t -> formatter -> Warnings.t -> unit) ref [@@dead "+warning_printer"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/location.mli", line 50, characters 0-42 + +formatter_for_warnings is never used + <-- line 50 + val formatter_for_warnings : formatter ref [@@dead "+formatter_for_warnings"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/location.mli", line 52, characters 0-66 + +default_warning_printer is never used + <-- line 52 + val default_warning_printer : t -> formatter -> Warnings.t -> unit [@@dead "+default_warning_printer"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/location.mli", line 110, characters 0-118 + +error_reporter is never used + <-- line 110 + ref [@@dead "+error_reporter"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/location.mli", line 119, characters 0-118 + +default_error_reporter is never used + <-- line 119 + unit [@@dead "+default_error_reporter"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 442, characters 0-143 + +matching.Store_exp is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 445, characters 2-27 + Store_exp.+compare_key is never used + <-- line 445 + let compare_key = compare [@@dead "Store_exp.+compare_key"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 446, characters 2-32 + Store_exp.+make_key is never used + <-- line 446 + let make_key = Lambda.make_key [@@dead "Store_exp.+make_key"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 1613, characters 0-1398 + +matching.S_arg is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 1616, characters 2-26 + S_arg.+eqint is never used + <-- line 1616 + let eqint = Pintcomp Ceq [@@dead "S_arg.+eqint"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 1617, characters 2-27 + S_arg.+neint is never used + <-- line 1617 + let neint = Pintcomp Cneq [@@dead "S_arg.+neint"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 1618, characters 2-26 + S_arg.+leint is never used + <-- line 1618 + let leint = Pintcomp Cle [@@dead "S_arg.+leint"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 1619, characters 2-26 + S_arg.+ltint is never used + <-- line 1619 + let ltint = Pintcomp Clt [@@dead "S_arg.+ltint"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 1620, characters 2-26 + S_arg.+geint is never used + <-- line 1620 + let geint = Pintcomp Cge [@@dead "S_arg.+geint"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 1621, characters 2-26 + S_arg.+gtint is never used + <-- line 1621 + let gtint = Pintcomp Cgt [@@dead "S_arg.+gtint"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 1625, characters 2-55 + S_arg.+make_prim is never used + <-- line 1625 + let make_prim p args = Lprim (p, args, Location.none) [@@dead "S_arg.+make_prim"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 1626, characters 2-111 + S_arg.+make_offset is never used + <-- line 1626 + | _ -> Lprim (Poffsetint n, [arg], Location.none) [@@dead "S_arg.+make_offset"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 1631, characters 2-232 + S_arg.+bind is never used + <-- line 1631 + bind Alias newvar arg (body newarg) [@@dead "S_arg.+bind"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 1640, characters 2-54 + S_arg.+make_const is never used + <-- line 1640 + let make_const i = Lconst (Const_base (Const_int i)) [@@dead "S_arg.+make_const"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 1641, characters 2-64 + S_arg.+make_isout is never used + <-- line 1641 + let make_isout h arg = Lprim (Pisout, [h; arg], Location.none) [@@dead "S_arg.+make_isout"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 1642, characters 2-71 + S_arg.+make_isin is never used + <-- line 1642 + let make_isin h arg = Lprim (Pnot, [make_isout h arg], Location.none) [@@dead "S_arg.+make_isin"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 1643, characters 2-63 + S_arg.+make_if is never used + <-- line 1643 + let make_if cond ifso ifnot = Lifthenelse (cond, ifso, ifnot) [@@dead "S_arg.+make_if"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 1644, characters 2-419 + S_arg.+make_switch is never used + <-- line 1644 + loc ) [@@dead "S_arg.+make_switch"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 1660, characters 2-37 + S_arg.+make_catch is never used + <-- line 1660 + let make_catch = make_catch_delayed [@@dead "S_arg.+make_catch"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 1661, characters 2-27 + S_arg.+make_exit is never used + <-- line 1661 + let make_exit = make_exit [@@dead "S_arg.+make_exit"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/parmatch.ml", line 902, characters 0-147 + +parmatch.Constructor_tag_hashtbl is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/parmatch.ml", line 904, characters 2-25 + Constructor_tag_hashtbl.+hash is never used + <-- line 904 + let hash = Hashtbl.hash [@@dead "Constructor_tag_hashtbl.+hash"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/parmatch.ml", line 905, characters 2-29 + Constructor_tag_hashtbl.+equal is never used + <-- line 905 + let equal = Types.equal_tag [@@dead "Constructor_tag_hashtbl.+equal"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/parmatch.ml", line 2534, characters 4-193 + +enter_expression is never used + <-- line 2534 + | _ -> () [@@dead "+enter_expression"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/parmatch.ml", line 2542, characters 4-103 + +is_unpack is never used + <-- line 2542 + List.exists (fun (attr, _) -> attr.txt = "#modulepat") exp.exp_attributes [@@dead "+is_unpack"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/parmatch.ml", line 2545, characters 4-493 + +leave_expression is never used + <-- line 2545 + | _ -> assert false [@@dead "+leave_expression"] + Warning Dead Type File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/parsetree0.ml", line 98, characters 2-22 core_type_desc.Ptyp_class is a variant case which is never constructed @@ -2521,6 +3073,50 @@ <-- line 577 | Pstr_class_type of unit [@dead "structure_item_desc.Pstr_class_type"] (* Dummy AST node *) + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/path.ml", line 27, characters 0-449 + +compare is never used + <-- line 27 + | (Pdot _ | Papply _), (Pident _ | Pdot _) -> 1 [@@dead "+compare"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/path.ml", line 71, characters 0-190 + +heads is never used + <-- line 71 + heads p [] [@@dead "+heads"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/path.mli", line 21, characters 0-27 + +compare is never used + <-- line 21 + val compare : t -> t -> int [@@dead "+compare"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/path.mli", line 33, characters 0-29 + +heads is never used + <-- line 33 + val heads : t -> Ident.t list [@@dead "+heads"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/switch.ml", line 34, characters 2-91 + +switch.Store.A_map is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/switch.ml", line 36, characters 4-31 + Store.A_map.+compare is never used + <-- line 36 + let compare = A.compare_key [@@dead "Store.A_map.+compare"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typedecl.ml", line 202, characters 0-97 + +typedecl.String_set is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typedecl.ml", line 204, characters 2-37 + String_set.+compare is never used + <-- line 204 + let compare (x : t) y = compare x y [@@dead "String_set.+compare"] + Warning Dead Type File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typedtree.ml", line 281, characters 2-23 open_description.open_loc is a record label never used to read a value @@ -2653,10 +3249,74 @@ <-- line 70 val iter_pattern : pattern -> unit [@@dead "Make_iterator.+iter_pattern"] + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typemod.ml", line 606, characters 0-104 + +typemod.String_set is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typemod.ml", line 608, characters 2-44 + String_set.+compare is never used + <-- line 608 + let compare (x : t) y = String.compare x y [@@dead "String_set.+compare"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/types.ml", line 66, characters 0-134 + +types.Type_ops is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/types.ml", line 68, characters 2-35 + Type_ops.+compare is never used + <-- line 68 + let compare t1 t2 = t1.id - t2.id [@@dead "Type_ops.+compare"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/types.ml", line 69, characters 2-19 + Type_ops.+hash is never used + <-- line 69 + let hash t = t.id [@@dead "Type_ops.+hash"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/types.ml", line 70, characters 2-28 + Type_ops.+equal is never used + <-- line 70 + let equal t1 t2 = t1 == t2 [@@dead "Type_ops.+equal"] + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/types.ml", line 75, characters 0-90 + +types.Ordered_string is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/types.ml", line 77, characters 2-37 + Ordered_string.+compare is never used + <-- line 77 + let compare (x : t) y = compare x y [@@dead "Ordered_string.+compare"] + Warning Dead Type File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/types.ml", line 99, characters 29-39 Variance.f.May_weak is a variant case which is never constructed <-- line 99 type f = May_pos | May_neg | May_weak [@dead "Variance.f.May_weak"] | Inj | Pos | Neg | Inv + + Warning Dead Module + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/types.mli", line 206, characters 0-127 + types.Type_ops is a dead module as all its items are dead. + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/types.mli", line 208, characters 2-29 + Type_ops.+compare is never used + <-- line 208 + val compare : t -> t -> int [@@dead "Type_ops.+compare"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/types.mli", line 209, characters 2-28 + Type_ops.+equal is never used + <-- line 209 + val equal : t -> t -> bool [@@dead "Type_ops.+equal"] + + Warning Dead Value + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/types.mli", line 210, characters 2-21 + Type_ops.+hash is never used + <-- line 210 + val hash : t -> int [@@dead "Type_ops.+hash"] - Analysis reported 561 issues (Warning Dead Module:4, Warning Dead Type:84, Warning Dead Value:124, Warning Dead Value With Side Effects:2, Warning Redundant Optional Argument:198, Warning Unused Argument:149) + Analysis reported 681 issues (Warning Dead Module:33, Warning Dead Type:84, Warning Dead Value:214, Warning Dead Value With Side Effects:3, Warning Redundant Optional Argument:198, Warning Unused Argument:149) diff --git a/scripts/dce/live-findings.md b/scripts/dce/live-findings.md index ef0225c2844..77a90530068 100644 --- a/scripts/dce/live-findings.md +++ b/scripts/dce/live-findings.md @@ -230,6 +230,18 @@ live after manual validation. - Context: the `compare` function is consumed by `Set.Make`, so it can look unused as a plain value even though every set operation depends on it. +### ML type-checker collection callbacks + +- Report: `Warning Dead Module` and `Warning Dead Value`, + `compiler/ml/ctype.ml`, `Type_pairs.equal` and `Type_pairs.hash`. +- Verdict: live; false positive. +- Validation: `Ctype.Type_pairs` is the hashtable used throughout type + equality, unification, subtyping, and generalization paths. `ctype.ml` calls + `Type_pairs.create`, `find`, `add`, `mem`, and `clear` in those algorithms. +- Context: `equal` and `hash` are callbacks consumed by `Hashtbl.Make`, so they + can look unreferenced as ordinary values even though every generated table + operation depends on them. + ### `Shared_types.package.rescript_version` - Report: `Warning Dead Type`, `analysis/src/shared_types.ml`, From df4b2cc8f763d1bcccf11d07f4f2d9bde0d07ccd Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 16:10:08 +0000 Subject: [PATCH 186/214] dce: note callback liveness --- scripts/dce/live-findings.md | 63 ++++++++++++++++++++++++++++++------ 1 file changed, 54 insertions(+), 9 deletions(-) diff --git a/scripts/dce/live-findings.md b/scripts/dce/live-findings.md index 77a90530068..65e976d2ba6 100644 --- a/scripts/dce/live-findings.md +++ b/scripts/dce/live-findings.md @@ -131,17 +131,23 @@ live after manual validation. following for this report, so the exported reset hook and loader payload fields look dead even though they are part of the live compiler setup. -### `Experimental_features.reset` +### Experimental feature set and reset hook -- Report: `Warning Dead Value`, `compiler/ml/experimental_features.ml` and - `.mli`, for `reset`. +- Report: `Warning Dead Module` / `Warning Dead Value`, + `compiler/ml/experimental_features.ml` and `.mli`, for `Feature_set`, + `Feature_set.compare`, and `reset`. - Verdict: live; false positive. -- Validation: `compiler/jsoo/jsoo_playground_main.ml` calls +- Validation: `compiler/bsc/rescript_compiler_main.ml` enables feature flags + through `Experimental_features.enable_from_string`, while + `compiler/frontend/bs_builtin_ppx.ml` and `compiler/ml/typecore.ml` query + `Experimental_features.is_enabled`. `Feature_set.add`, `mem`, and `empty` + back that state. `compiler/jsoo/jsoo_playground_main.ml` calls `Experimental_features.reset` from the playground compiler reset path, next to other global compiler-state resets. -- Context: the playground entry point is outside the roots used for this report. - Removing this hook would let experimental feature flags leak between - playground compilations. +- Context: the playground entry point and several frontend/type-checker call + sites are outside the roots followed by this DCE report. The `compare` + callback is consumed by `Set.Make`, and removing the reset hook would let + experimental feature flags leak between playground compilations. ### `Location.report_error ?custom_intro ?src` @@ -242,6 +248,34 @@ live after manual validation. can look unreferenced as ordinary values even though every generated table operation depends on them. +### ML collection and variance callbacks + +- Report: `Warning Dead Module`, `Warning Dead Value`, and constructor warnings + in `compiler/ml/depend.ml`, `env.ml`, `experimental_features.ml`, + `matching.ml`, `parmatch.ml`, `path.ml` / `.mli`, `switch.ml`, + `typedecl.ml`, `typemod.ml`, and `types.ml` / `.mli`. +- Verdict: live; false positives. +- Validation: `Depend.String_set`, `Env.String_set`, `Typedecl.String_set`, + and `Typemod.String_set` are all local set helpers whose generated `empty`, + `add`, `mem`, `union`, `fold`, or `elements` functions are used in those + modules. `Types.Type_ops` feeds `Btype.Type_set`, `Type_map`, and + `Type_hash`; `Types.Ordered_string` feeds `Meths`, `Vars`, and `Concr`. + `Path.compare` is consumed by `Map.Make (Path)` / `Set.Make (Path)` in + `env.ml`, `mtype.ml`, `printtyp.ml`, and `subst.ml`, while `Path.heads` is + called by the `Typedtree_iter.Make_iterator` instance in `parmatch.ml`. + `Switch.Store.A_map` is the action-sharing map used by `Switch.Store`, and + `matching.ml` instantiates that functor as `Store_exp`. The same module + instantiates `Switch.Make (S_arg)` and calls the resulting `Switcher` + functions from pattern-matching compilation. `Parmatch.Constructor_tag_hashtbl` + is used by constructor-coverage checks, and the local `enter_expression` / + `leave_expression` callbacks are invoked by `Typedtree_iter.Make_iterator`. + `Types.Variance.May_weak` is set and queried by `typedecl.ml`, `typemod.ml`, + and `ctype.ml` while computing weak variance for type declarations. +- Context: these warnings are all callback, functor-instantiation, manifest + signature, or cross-module edges. Removing them would break dependency + analysis, environment consistency, variance checks, match compilation, or + exhaustiveness analysis. + ### `Shared_types.package.rescript_version` - Report: `Warning Dead Type`, `analysis/src/shared_types.ml`, @@ -876,11 +910,16 @@ live after manual validation. and `Lam_compile_primitive.translate` are called by `lam_compile.ml`. `Lam_module_ident.t` is a manifest alias of `J.module_id`; `dynamic_import` is filled by `Lam_module_ident.of_ml` and read by `js_dump_program.ml` when - emitting dynamic imports. The reported helper functions in those modules are - local dependencies of those exported lowering entry points. + emitting dynamic imports. `Lam_module_ident.Cmp` is passed to `Hash.Make` and + `Hash_set.Make`; the resulting tables and sets are used by + `lam_compile_env.ml` for module dependency caching and hard-dependency + collection. The reported helper functions in those modules are local + dependencies of those exported lowering entry points. - Context: `lam_compile_external_call.arg_expression` is a manifest alias of `Js_of_lam_variant.arg_expression`; constructor warnings there are false positives for the same aliasing reason documented in the JS lowering section. + `Cmp.equal` and `Cmp.hash` are functor callbacks consumed by generated hash + modules, so they can look unused as standalone values. ### Core JS lowering helpers @@ -899,12 +938,18 @@ live after manual validation. string, and variant lowering helpers are called from `lam_compile.ml`, `lam_compile_const.ml`, `lam_compile_primitive.ml`, `lam_compile_external_obj.ml`, and `lam_compile_external_call.ml`. + `Polyvar_pattern_match.Coll` is the hash table used by + `Polyvar_pattern_match.convert` while coalescing variant tag actions; its + generated operations are reached through the switcher hooks installed by + `compiler/core/bs_conditional_initial.ml`. - Context: `Js_of_lam_option.option_unwrap_time` and `undef_to_opt` had no callers and were removed. The `Js_of_lam_variant.arg_expression` constructor warnings are false positives: `lam_compile_external_call.ml` re-exports the same constructors with `type arg_expression = Js_of_lam_variant.arg_expression = ...`, then constructs and pattern matches `Splice0`, `Splice1`, and `Splice2`. + `Polyvar_pattern_match.Coll.equal` and `hash` are callbacks consumed by the + hash-table functor. ### Core JS operators and output state From cae2dfad3446dc415be40e47dadf6c8ccb95d26f Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 16:11:40 +0000 Subject: [PATCH 187/214] dce: trim js debug exports --- _dce/report.txt | 650 +--------------------------------- compiler/core/js_analyzer.mli | 2 - compiler/core/js_dump.ml | 7 - compiler/core/js_dump.mli | 3 - compiler/core/lam.mli | 3 - 5 files changed, 1 insertion(+), 664 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index d472669224e..faaa9d93942 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -1387,146 +1387,6 @@ File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/location.ml", line 253, characters 0-108 optional argument src of function +report_error is always supplied (1 calls) - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/arnold.ml", line 33, characters 2-134 - Function_args.+compare_arg is never used - <-- line 33 - if n <> 0 then n else compare a1.function_name a2.function_name [@@dead "Function_args.+compare_arg"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/arnold.ml", line 37, characters 2-217 - Function_args.+compare is never used - <-- line 37 - if n <> 0 then n else compare l1 l2 [@@dead "Function_args.+compare"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/arnold.ml", line 74, characters 2-170 - Function_call.+compare is never used - <-- line 74 - else Function_args.compare x1.function_args x2.function_args [@@dead "Function_call.+compare"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/dead_exception.ml", line 3, characters 0-93 - +dead_exception.Path_map is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/dead_exception.ml", line 6, characters 2-30 - Path_map.+compare is never used - <-- line 6 - let compare = Stdlib.compare [@@dead "Path_map.+compare"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/dead_type.ml", line 69, characters 0-93 - +dead_type.Path_map is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/dead_type.ml", line 72, characters 2-30 - Path_map.+compare is never used - <-- line 72 - let compare = Stdlib.compare [@@dead "Path_map.+compare"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/exn.ml", line 3, characters 0-28 - +compare is never used - <-- line 3 - let compare = String.compare [@@dead "+compare"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/exn.mli", line 3, characters 0-27 - +compare is never used - <-- line 3 - val compare : t -> t -> int [@@dead "+compare"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/file_deps.ml", line 6, characters 0-129 - +file_deps.File_hash is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/file_deps.ml", line 9, characters 2-35 - File_hash.+hash is never used - <-- line 9 - let hash (x : t) = Hashtbl.hash x [@@dead "File_hash.+hash"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/file_deps.ml", line 10, characters 2-29 - File_hash.+equal is never used - <-- line 10 - let equal (x : t) y = x = y [@@dead "File_hash.+equal"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/file_hash.ml", line 1, characters 0-0 - +file_hash is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/file_hash.ml", line 6, characters 2-35 - +hash is never used - <-- line 6 - let hash (x : t) = Hashtbl.hash x [@@dead "+hash"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/file_hash.ml", line 7, characters 2-29 - +equal is never used - <-- line 7 - let equal (x : t) y = x = y [@@dead "+equal"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/loc_set.ml", line 1, characters 0-0 - +loc_set is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/loc_set.ml", line 4, characters 2-23 - +compare is never used - <-- line 4 - let compare = compare [@@dead "+compare"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/name.ml", line 3, characters 0-28 - +compare is never used - <-- line 3 - let compare = String.compare [@@dead "+compare"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/name.mli", line 3, characters 0-27 - +compare is never used - <-- line 3 - val compare : t -> t -> int [@@dead "+compare"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/pos_hash.ml", line 1, characters 0-0 - +pos_hash is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/pos_hash.ml", line 7, characters 2-106 - +hash is never used - <-- line 7 - Hashtbl.hash (x.Lexing.pos_cnum, s) [@@dead "+hash"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/pos_hash.ml", line 11, characters 2-29 - +equal is never used - <-- line 11 - let equal (x : t) y = x = y [@@dead "+equal"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/pos_set.ml", line 1, characters 0-0 - +pos_set is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/pos_set.ml", line 7, characters 2-23 - +compare is never used - <-- line 7 - let compare = compare [@@dead "+compare"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/shared_types.ml", line 488, characters 0-149 - +shared_types.Location_set is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/shared_types.ml", line 491, characters 2-43 - Location_set.+compare is never used - <-- line 491 - let compare loc1 loc2 = compare loc2 loc1 [@@dead "Location_set.+compare"] - Warning Dead Type File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/shared_types.ml", line 523, characters 2-30 package.rescript_version is a record label never used to read a value @@ -1583,24 +1443,6 @@ <-- line 77 and delim = External_arg_spec.delim = DNone | DStarJ | DNoQuotes | DBackQuotes [@dead "delim.DBackQuotes"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_analyzer.mli", line 58, characters 0-53 - +eq_statement is never used - <-- line 58 - val eq_statement : J.statement -> J.statement -> bool [@@dead "+eq_statement"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump.ml", line 1715, characters 0-213 - +string_of_block is never used - <-- line 1715 - Buffer.contents buffer [@@dead "+string_of_block"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump.mli", line 28, characters 0-39 - +string_of_block is never used - <-- line 28 - val string_of_block : J.block -> string [@@dead "+string_of_block"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_dump_program.mli", line 28, characters 0-124 +pp_deps_program is never used @@ -1727,12 +1569,6 @@ <-- line 311 {program = _x0; modules = _x1; side_effect = _x2} [@@dead "+deps_program"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam.mli", line 137, characters 0-14 - +false_ is never used - <-- line 137 - val false_ : t [@@dead "+false_"] - Warning Dead Type File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.ml", line 57, characters 2-69 field_dbg_info.Fld_record is a variant case which is never constructed @@ -1895,22 +1731,6 @@ <-- line 25 type t = J.module_id = {id: Ident.t; kind: Js_op.kind; dynamic_import: bool [@dead "t.dynamic_import"] } - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_module_ident.ml", line 36, characters 0-1115 - +lam_module_ident.Cmp is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_module_ident.ml", line 39, characters 2-317 - Cmp.+equal is never used - <-- line 39 - | Ml | Runtime -> Ext_ident.equal x.id y.id [@@dead "Cmp.+equal"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_module_ident.ml", line 61, characters 2-266 - Cmp.+hash is never used - <-- line 61 - Bs_hash_stubs.hash_stamp_and_name x_id.stamp x_id.name [@@dead "Cmp.+hash"] - Warning Dead Type File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_module_ident.mli", line 31, characters 2-23 t.dynamic_import is a record label never used to read a value @@ -1939,22 +1759,6 @@ <-- line 62 val is_function : Lam.t -> bool [@@dead "+is_function"] - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/polyvar_pattern_match.ml", line 33, characters 0-106 - +polyvar_pattern_match.Coll is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/polyvar_pattern_match.ml", line 36, characters 2-26 - Coll.+equal is never used - <-- line 36 - let equal = Stdlib.( = ) [@@dead "Coll.+equal"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/polyvar_pattern_match.ml", line 38, characters 2-25 - Coll.+hash is never used - <-- line 38 - let hash = Hashtbl.hash [@@dead "Coll.+hash"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_fmt.ml", line 10, characters 0-54 +invalid_argf is never used @@ -2087,78 +1891,18 @@ <-- line 45 val length : 'a t -> int [@@dead "+length"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ident.ml", line 44, characters 0-56 - +unique_name is never used - <-- line 44 - let unique_name i = i.name ^ "_" ^ string_of_int i.stamp [@@dead "+unique_name"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ident.ml", line 50, characters 0-35 +equal is never used <-- line 50 let equal i1 i2 = i1.name = i2.name [@@dead "+equal"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ident.ml", line 74, characters 0-178 - +print is never used - <-- line 74 - | n -> fprintf ppf "%s/%i%s" i.name n (if global i then "g" else "") [@@dead "+print"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ident.ml", line 219, characters 0-161 - +compare is never used - <-- line 219 - if c <> 0 then c else compare x.flags y.flags [@@dead "+compare"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ident.ml", line 226, characters 0-52 - +output is never used - <-- line 226 - let output oc id = output_string oc (unique_name id) [@@dead "+output"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ident.ml", line 227, characters 0-46 - +hash is never used - <-- line 227 - let hash i = Char.code i.name.[0] lxor i.stamp [@@dead "+hash"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ident.ml", line 229, characters 0-26 +original_equal is never used <-- line 229 let original_equal = equal [@@dead "+original_equal"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ident.ml", line 232, characters 2-23 - +compare is never used - <-- line 232 - let compare = compare [@@dead "+compare"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ident.ml", line 233, characters 2-21 - +output is never used - <-- line 233 - let output = output [@@dead "+output"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ident.ml", line 234, characters 2-19 - +print is never used - <-- line 234 - let print = print [@@dead "+print"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ident.ml", line 235, characters 2-17 - +hash is never used - <-- line 235 - let hash = hash [@@dead "+hash"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ident.ml", line 236, characters 2-18 - +equal is never used - <-- line 236 - let equal = same [@@dead "+equal"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ident.ml", line 238, characters 0-26 +equal is never used @@ -2171,24 +1915,6 @@ <-- line 32 val unique_name : t -> string [@@dead "+unique_name"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ident.mli", line 42, characters 0-27 - +compare is never used - <-- line 42 - val compare : t -> t -> int [@@dead "+compare"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/identifiable.ml", line 20, characters 10-45 - Make.+hash is never used - <-- line 20 - include Hashtbl.HashedType with type t := t [@@dead "Make.+hash"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/identifiable.ml", line 21, characters 10-42 - Make.+compare is never used - <-- line 21 - include Map.OrderedType with type t := t [@@dead "Make.+compare"] - Warning Dead Module File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/identifiable.mli", line 98, characters 26-46 identifiable.Make.Tbl is a dead module as all its items are dead. @@ -2199,14 +1925,6 @@ <-- line 98 module Make (T : Thing) : S with type t := T.t [@@dead "Make.Tbl.+map"] - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/int_vec_vec.ml", line 1, characters 0-0 - +int_vec_vec is a dead module as all its items are dead. - - Warning Dead Value With Side Effects - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/int_vec_vec.ml", line 28, characters 2-29 - +null is never used and could have side effects - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 45, characters 0-25 +debugger is never used @@ -2291,26 +2009,6 @@ <-- line 117 raise exn [@@dead "+output_to_file_via_temporary"] - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 243, characters 0-83 - +misc.String_map is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 245, characters 2-23 - String_map.+compare is never used - <-- line 245 - let compare = compare [@@dead "String_map.+compare"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 247, characters 0-83 - +misc.String_set is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 249, characters 2-23 - String_set.+compare is never used - <-- line 249 - let compare = compare [@@dead "String_set.+compare"] - Warning Dead Type File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 343, characters 17-21 Color.setting.Auto is a variant case which is never constructed @@ -2425,38 +2123,6 @@ <-- line 38 val ignore_id : t [@@dead "Lid.+ignore_id"] - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/gentype/gen_ident.ml", line 1, characters 0-102 - +gen_ident.Int_map is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/gentype/gen_ident.ml", line 4, characters 2-47 - Int_map.+compare is never used - <-- line 4 - let compare (x : int) (y : int) = compare x y [@@dead "Int_map.+compare"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/gentype/module_name.ml", line 27, characters 0-44 - +compare is never used - <-- line 27 - let compare (s1 : string) s2 = compare s1 s2 [@@dead "+compare"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/gentype/module_name.mli", line 3, characters 0-27 - +compare is never used - <-- line 3 - val compare : t -> t -> int [@@dead "+compare"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/gentype/resolved_name.ml", line 10, characters 0-336 - +resolved_name.Name_set is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/gentype/resolved_name.ml", line 13, characters 2-275 - Name_set.+compare is never used - <-- line 13 - | false -> compare rest1 rest2) [@@dead "Name_set.+compare"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_helper0.ml", line 28, characters 0-182 +with_default_loc is never used @@ -2623,16 +2289,6 @@ <-- line 529 PStr [Str.eval ~loc (Exp.constant (Pconst_string (s, None)))] ) [@@dead "+attribute_of_warning"] - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_mapper.ml", line 533, characters 0-83 - +ast_mapper.String_map is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_mapper.ml", line 535, characters 2-23 - String_map.+compare is never used - <-- line 535 - let compare = compare [@@dead "String_map.+compare"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_mapper.ml", line 540, characters 0-81 +get_cookie is never used @@ -2757,42 +2413,6 @@ <-- line 5 deprecated_text: string; [@dead "deprecated_used.deprecated_text"] - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 206, characters 0-176 - +ctype.Type_pairs is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 208, characters 2-56 - Type_pairs.+equal is never used - <-- line 208 - let equal (t1, t1') (t2, t2') = t1 == t2 && t1' == t2' [@@dead "Type_pairs.+equal"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ctype.ml", line 209, characters 2-40 - Type_pairs.+hash is never used - <-- line 209 - let hash (t, t') = t.id + (93 * t'.id) [@@dead "Type_pairs.+hash"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/depend.ml", line 21, characters 0-83 - +depend.String_set is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/depend.ml", line 23, characters 2-23 - String_set.+compare is never used - <-- line 23 - let compare = compare [@@dead "String_set.+compare"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 572, characters 0-90 - +env.String_set is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 574, characters 2-30 - String_set.+compare is never used - <-- line 574 - let compare = String.compare [@@dead "String_set.+compare"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 718, characters 0-434 +reset_cache_toplevel is never used @@ -2817,16 +2437,6 @@ <-- line 289 cmi: Cmi_format.cmi_infos; [@dead "t.cmi"] - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/experimental_features.ml", line 12, characters 0-85 - +experimental_features.Feature_set is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/experimental_features.ml", line 14, characters 2-23 - Feature_set.+compare is never used - <-- line 14 - let compare = compare [@@dead "Feature_set.+compare"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/experimental_features.ml", line 23, characters 0-52 +reset is never used @@ -2881,156 +2491,6 @@ <-- line 119 unit [@@dead "+default_error_reporter"] - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 442, characters 0-143 - +matching.Store_exp is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 445, characters 2-27 - Store_exp.+compare_key is never used - <-- line 445 - let compare_key = compare [@@dead "Store_exp.+compare_key"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 446, characters 2-32 - Store_exp.+make_key is never used - <-- line 446 - let make_key = Lambda.make_key [@@dead "Store_exp.+make_key"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 1613, characters 0-1398 - +matching.S_arg is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 1616, characters 2-26 - S_arg.+eqint is never used - <-- line 1616 - let eqint = Pintcomp Ceq [@@dead "S_arg.+eqint"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 1617, characters 2-27 - S_arg.+neint is never used - <-- line 1617 - let neint = Pintcomp Cneq [@@dead "S_arg.+neint"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 1618, characters 2-26 - S_arg.+leint is never used - <-- line 1618 - let leint = Pintcomp Cle [@@dead "S_arg.+leint"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 1619, characters 2-26 - S_arg.+ltint is never used - <-- line 1619 - let ltint = Pintcomp Clt [@@dead "S_arg.+ltint"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 1620, characters 2-26 - S_arg.+geint is never used - <-- line 1620 - let geint = Pintcomp Cge [@@dead "S_arg.+geint"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 1621, characters 2-26 - S_arg.+gtint is never used - <-- line 1621 - let gtint = Pintcomp Cgt [@@dead "S_arg.+gtint"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 1625, characters 2-55 - S_arg.+make_prim is never used - <-- line 1625 - let make_prim p args = Lprim (p, args, Location.none) [@@dead "S_arg.+make_prim"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 1626, characters 2-111 - S_arg.+make_offset is never used - <-- line 1626 - | _ -> Lprim (Poffsetint n, [arg], Location.none) [@@dead "S_arg.+make_offset"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 1631, characters 2-232 - S_arg.+bind is never used - <-- line 1631 - bind Alias newvar arg (body newarg) [@@dead "S_arg.+bind"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 1640, characters 2-54 - S_arg.+make_const is never used - <-- line 1640 - let make_const i = Lconst (Const_base (Const_int i)) [@@dead "S_arg.+make_const"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 1641, characters 2-64 - S_arg.+make_isout is never used - <-- line 1641 - let make_isout h arg = Lprim (Pisout, [h; arg], Location.none) [@@dead "S_arg.+make_isout"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 1642, characters 2-71 - S_arg.+make_isin is never used - <-- line 1642 - let make_isin h arg = Lprim (Pnot, [make_isout h arg], Location.none) [@@dead "S_arg.+make_isin"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 1643, characters 2-63 - S_arg.+make_if is never used - <-- line 1643 - let make_if cond ifso ifnot = Lifthenelse (cond, ifso, ifnot) [@@dead "S_arg.+make_if"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 1644, characters 2-419 - S_arg.+make_switch is never used - <-- line 1644 - loc ) [@@dead "S_arg.+make_switch"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 1660, characters 2-37 - S_arg.+make_catch is never used - <-- line 1660 - let make_catch = make_catch_delayed [@@dead "S_arg.+make_catch"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/matching.ml", line 1661, characters 2-27 - S_arg.+make_exit is never used - <-- line 1661 - let make_exit = make_exit [@@dead "S_arg.+make_exit"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/parmatch.ml", line 902, characters 0-147 - +parmatch.Constructor_tag_hashtbl is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/parmatch.ml", line 904, characters 2-25 - Constructor_tag_hashtbl.+hash is never used - <-- line 904 - let hash = Hashtbl.hash [@@dead "Constructor_tag_hashtbl.+hash"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/parmatch.ml", line 905, characters 2-29 - Constructor_tag_hashtbl.+equal is never used - <-- line 905 - let equal = Types.equal_tag [@@dead "Constructor_tag_hashtbl.+equal"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/parmatch.ml", line 2534, characters 4-193 - +enter_expression is never used - <-- line 2534 - | _ -> () [@@dead "+enter_expression"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/parmatch.ml", line 2542, characters 4-103 - +is_unpack is never used - <-- line 2542 - List.exists (fun (attr, _) -> attr.txt = "#modulepat") exp.exp_attributes [@@dead "+is_unpack"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/parmatch.ml", line 2545, characters 4-493 - +leave_expression is never used - <-- line 2545 - | _ -> assert false [@@dead "+leave_expression"] - Warning Dead Type File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/parsetree0.ml", line 98, characters 2-22 core_type_desc.Ptyp_class is a variant case which is never constructed @@ -3073,50 +2533,6 @@ <-- line 577 | Pstr_class_type of unit [@dead "structure_item_desc.Pstr_class_type"] (* Dummy AST node *) - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/path.ml", line 27, characters 0-449 - +compare is never used - <-- line 27 - | (Pdot _ | Papply _), (Pident _ | Pdot _) -> 1 [@@dead "+compare"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/path.ml", line 71, characters 0-190 - +heads is never used - <-- line 71 - heads p [] [@@dead "+heads"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/path.mli", line 21, characters 0-27 - +compare is never used - <-- line 21 - val compare : t -> t -> int [@@dead "+compare"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/path.mli", line 33, characters 0-29 - +heads is never used - <-- line 33 - val heads : t -> Ident.t list [@@dead "+heads"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/switch.ml", line 34, characters 2-91 - +switch.Store.A_map is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/switch.ml", line 36, characters 4-31 - Store.A_map.+compare is never used - <-- line 36 - let compare = A.compare_key [@@dead "Store.A_map.+compare"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typedecl.ml", line 202, characters 0-97 - +typedecl.String_set is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typedecl.ml", line 204, characters 2-37 - String_set.+compare is never used - <-- line 204 - let compare (x : t) y = compare x y [@@dead "String_set.+compare"] - Warning Dead Type File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typedtree.ml", line 281, characters 2-23 open_description.open_loc is a record label never used to read a value @@ -3249,74 +2665,10 @@ <-- line 70 val iter_pattern : pattern -> unit [@@dead "Make_iterator.+iter_pattern"] - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typemod.ml", line 606, characters 0-104 - +typemod.String_set is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typemod.ml", line 608, characters 2-44 - String_set.+compare is never used - <-- line 608 - let compare (x : t) y = String.compare x y [@@dead "String_set.+compare"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/types.ml", line 66, characters 0-134 - +types.Type_ops is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/types.ml", line 68, characters 2-35 - Type_ops.+compare is never used - <-- line 68 - let compare t1 t2 = t1.id - t2.id [@@dead "Type_ops.+compare"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/types.ml", line 69, characters 2-19 - Type_ops.+hash is never used - <-- line 69 - let hash t = t.id [@@dead "Type_ops.+hash"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/types.ml", line 70, characters 2-28 - Type_ops.+equal is never used - <-- line 70 - let equal t1 t2 = t1 == t2 [@@dead "Type_ops.+equal"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/types.ml", line 75, characters 0-90 - +types.Ordered_string is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/types.ml", line 77, characters 2-37 - Ordered_string.+compare is never used - <-- line 77 - let compare (x : t) y = compare x y [@@dead "Ordered_string.+compare"] - Warning Dead Type File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/types.ml", line 99, characters 29-39 Variance.f.May_weak is a variant case which is never constructed <-- line 99 type f = May_pos | May_neg | May_weak [@dead "Variance.f.May_weak"] | Inj | Pos | Neg | Inv - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/types.mli", line 206, characters 0-127 - types.Type_ops is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/types.mli", line 208, characters 2-29 - Type_ops.+compare is never used - <-- line 208 - val compare : t -> t -> int [@@dead "Type_ops.+compare"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/types.mli", line 209, characters 2-28 - Type_ops.+equal is never used - <-- line 209 - val equal : t -> t -> bool [@@dead "Type_ops.+equal"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/types.mli", line 210, characters 2-21 - Type_ops.+hash is never used - <-- line 210 - val hash : t -> int [@@dead "Type_ops.+hash"] - Analysis reported 681 issues (Warning Dead Module:33, Warning Dead Type:84, Warning Dead Value:214, Warning Dead Value With Side Effects:3, Warning Redundant Optional Argument:198, Warning Unused Argument:149) + Analysis reported 563 issues (Warning Dead Module:4, Warning Dead Type:84, Warning Dead Value:126, Warning Dead Value With Side Effects:2, Warning Redundant Optional Argument:198, Warning Unused Argument:149) diff --git a/compiler/core/js_analyzer.mli b/compiler/core/js_analyzer.mli index 786c29fece1..d9bc5a334e7 100644 --- a/compiler/core/js_analyzer.mli +++ b/compiler/core/js_analyzer.mli @@ -55,8 +55,6 @@ val no_side_effect_statement : J.statement -> bool val eq_expression : J.expression -> J.expression -> bool -val eq_statement : J.statement -> J.statement -> bool - val eq_block : J.block -> J.block -> bool val rev_flatten_seq : J.expression -> J.block diff --git a/compiler/core/js_dump.ml b/compiler/core/js_dump.ml index 6f6da8b605c..1f2441e0bae 100644 --- a/compiler/core/js_dump.ml +++ b/compiler/core/js_dump.ml @@ -1712,13 +1712,6 @@ and statements top cxt f b = (fun cxt f s -> statement top cxt f s) (if top then P.at_least_two_lines else P.newline) -let string_of_block (block : J.block) = - let buffer = Buffer.create 50 in - let f = P.from_buffer buffer in - let (_ : cxt) = statements true Ext_pp_scope.empty f block in - P.flush f (); - Buffer.contents buffer - let string_of_expression (e : J.expression) = let buffer = Buffer.create 50 in let f = P.from_buffer buffer in diff --git a/compiler/core/js_dump.mli b/compiler/core/js_dump.mli index 0db4b4a2483..88da12c1edb 100644 --- a/compiler/core/js_dump.mli +++ b/compiler/core/js_dump.mli @@ -24,6 +24,3 @@ val statements : bool -> Ext_pp_scope.t -> Ext_pp.t -> J.block -> Ext_pp_scope.t (** Print JS IR to vanilla Javascript code Called by module {!Js_dump_program} *) - -val string_of_block : J.block -> string -(** Only used for debugging *) diff --git a/compiler/core/lam.mli b/compiler/core/lam.mli index 2285dee941e..408e4567615 100644 --- a/compiler/core/lam.mli +++ b/compiler/core/lam.mli @@ -133,9 +133,6 @@ val switch : t -> lambda_switch -> t val stringswitch : t -> (string * t) list -> t option -> t (** constant folding*) -(* val true_ : t *) -val false_ : t - val unit : t val sequor : t -> t -> t From a7b3e87d433d7405d6cbef289b2234c5cdf3435a Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 16:13:29 +0000 Subject: [PATCH 188/214] dce: trim dead helpers --- _dce/report.txt | 186 +++++++++++------------------- compiler/core/js_exp_make.ml | 15 --- compiler/core/js_exp_make.mli | 2 - compiler/core/js_of_lam_block.ml | 5 - compiler/core/js_of_lam_block.mli | 5 - compiler/ext/ext_fmt.ml | 2 - compiler/ext/ext_list.mli | 2 - 7 files changed, 69 insertions(+), 148 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index faaa9d93942..5887f92f5a2 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -912,147 +912,147 @@ optional argument from_type of function Label.+unbound_name_error is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 340, characters 0-49 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 338, characters 0-49 optional argument comment of function +is_null_undefined is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 336, characters 0-39 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 334, characters 0-39 optional argument comment of function +is_null is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 332, characters 0-73 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 330, characters 0-73 optional argument comment of function +raw_js_code is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 329, characters 0-74 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 327, characters 0-74 optional argument comment of function +of_block is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 326, characters 0-54 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 324, characters 0-54 optional argument comment of function +dummy_obj is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 320, characters 0-40 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 318, characters 0-40 optional argument comment of function +or_ is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 318, characters 0-41 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 316, characters 0-41 optional argument comment of function +and_ is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 316, characters 0-53 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 314, characters 0-53 optional argument comment of function +obj_length is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 309, characters 0-62 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 307, characters 0-62 optional argument comment of function +tag is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 296, characters 0-69 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 294, characters 0-69 optional argument comment of function +obj is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 282, characters 0-147 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 280, characters 0-147 optional argument comment of function +make_block is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 272, characters 0-67 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 270, characters 0-67 optional argument comment of function +tagged_template is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 266, characters 0-69 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 264, characters 0-69 optional argument comment of function +js_comp is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 264, characters 0-63 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 262, characters 0-63 optional argument comment of function +bigint_mod is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 262, characters 0-63 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 260, characters 0-63 optional argument comment of function +bigint_div is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 260, characters 0-73 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 258, characters 0-73 optional argument comment of function +bigint_comp is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 254, characters 0-71 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 252, characters 0-71 optional argument comment of function +bool_comp is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 248, characters 0-46 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 246, characters 0-46 optional argument comment of function +float_mod is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 236, characters 0-47 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 234, characters 0-47 optional argument comment of function +int32_band is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 234, characters 0-47 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 232, characters 0-47 optional argument comment of function +int32_bxor is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 232, characters 0-46 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 230, characters 0-46 optional argument comment of function +int32_asr is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 228, characters 0-46 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 226, characters 0-46 optional argument comment of function +int32_lsl is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 226, characters 0-46 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 224, characters 0-46 optional argument comment of function +int32_pow is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 224, characters 0-62 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 222, characters 0-62 optional argument comment of function +int32_mod is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 222, characters 0-62 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 220, characters 0-62 optional argument comment of function +int32_div is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 220, characters 0-46 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 218, characters 0-46 optional argument comment of function +int32_mul is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 218, characters 0-48 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 216, characters 0-48 optional argument comment of function +int32_minus is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 214, characters 0-46 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 212, characters 0-46 optional argument comment of function +int32_add is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 212, characters 0-40 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 210, characters 0-40 optional argument comment of function +to_int32 is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 209, characters 0-38 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 207, characters 0-38 optional argument comment of function +typeof is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 197, characters 0-46 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 195, characters 0-46 optional argument comment of function +is_type_number is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 195, characters 0-63 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 193, characters 0-63 optional argument comment of function +neq_null_undefined_boolean is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 193, characters 0-62 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 191, characters 0-62 optional argument comment of function +eq_null_undefined_boolean is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 189, characters 0-40 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 187, characters 0-40 optional argument comment of function +int_bnot is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 187, characters 0-46 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 185, characters 0-46 optional argument comment of function +int_equal is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 178, characters 0-43 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 176, characters 0-43 optional argument comment of function +assign is never used Warning Unused Argument @@ -1104,131 +1104,131 @@ optional argument comment of function +ml_var_dot is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1721, characters 0-605 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1706, characters 0-605 optional argument comment of function +neq_null_undefined_boolean is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1706, characters 0-605 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1691, characters 0-605 optional argument comment of function +eq_null_undefined_boolean is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1700, characters 0-216 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1685, characters 0-216 optional argument comment of function +is_null_undefined is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1694, characters 0-58 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1679, characters 0-58 optional argument comment of function +is_null is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1670, characters 0-596 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1655, characters 0-596 optional argument comment of function +of_block is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1663, characters 0-160 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1648, characters 0-160 optional argument comment of function +bigint_mod is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1659, characters 0-159 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1644, characters 0-159 optional argument comment of function +bigint_div is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1632, characters 0-992 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1617, characters 0-992 optional argument comment of function +bigint_comp is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1616, characters 0-384 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1601, characters 0-384 optional argument comment of function +int32_band is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1606, characters 0-445 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1591, characters 0-445 optional argument comment of function +int32_bxor is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1600, characters 0-251 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1585, characters 0-251 optional argument comment of function +int32_pow is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1595, characters 0-179 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1580, characters 0-179 optional argument comment of function +int_bnot is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1579, characters 0-702 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1564, characters 0-702 optional argument comment of function +int32_mul is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1562, characters 0-316 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1547, characters 0-316 optional argument comment of function +int32_lsl is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1552, characters 0-316 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1537, characters 0-316 optional argument comment of function +int32_mod is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1541, characters 0-482 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1526, characters 0-482 optional argument comment of function +int32_div is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1537, characters 0-94 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1522, characters 0-94 optional argument comment of function +int32_asr is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1531, characters 0-87 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1516, characters 0-87 optional argument comment of function +int32_minus is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1526, characters 0-66 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1511, characters 0-66 optional argument comment of function +int32_add is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1417, characters 0-89 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1402, characters 0-89 optional argument comment of function +js_comp is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1390, characters 0-901 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1375, characters 0-901 optional argument comment of function +bool_comp is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1350, characters 0-94 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1335, characters 0-94 optional argument comment of function +obj_length is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1345, characters 0-91 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1330, characters 0-91 optional argument comment of function +is_type_number is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1330, characters 0-97 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1315, characters 0-97 optional argument comment of function +to_int32 is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1296, characters 0-106 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1281, characters 0-106 optional argument comment of function +tag is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1232, characters 0-27 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1217, characters 0-27 optional argument comment of function +int_equal is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1107, characters 0-516 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1092, characters 0-516 optional argument comment of function +or_ is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1087, characters 0-751 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1072, characters 0-751 optional argument comment of function +and_ is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 568, characters 0-94 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 553, characters 0-94 optional argument comment of function +obj is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 534, characters 0-304 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 519, characters 0-304 optional argument comment of function +function_length is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 528, characters 0-242 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 513, characters 0-242 optional argument comment of function +string_length is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 521, characters 0-277 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 506, characters 0-277 optional argument comment of function +array_length is never used Warning Unused Argument @@ -1449,42 +1449,6 @@ <-- line 28 unit [@@dead "+pp_deps_program"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 468, characters 0-419 - +assign_by_exp is never used - <-- line 468 - | _ -> assign {expression_desc = Array_index (e, index); comment = None} value [@@dead "+assign_by_exp"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 176, characters 0-36 - +assign_by_exp is never used - <-- line 176 - val assign_by_exp : t -> t -> t -> t [@@dead "+assign_by_exp"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_block.ml", line 48, characters 0-40 - +field_by_exp is never used - <-- line 48 - let field_by_exp e i = E.array_index e i [@@dead "+field_by_exp"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_block.ml", line 57, characters 0-72 - +set_field_by_exp is never used - <-- line 57 - let set_field_by_exp self index value = E.assign_by_exp self index value [@@dead "+set_field_by_exp"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_block.mli", line 36, characters 0-63 - +field_by_exp is never used - <-- line 36 - val field_by_exp : J.expression -> J.expression -> J.expression [@@dead "+field_by_exp"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_block.mli", line 45, characters 0-85 - +set_field_by_exp is never used - <-- line 45 - J.expression -> J.expression -> J.expression -> J.expression [@@dead "+set_field_by_exp"] - Warning Dead Type File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_of_lam_variant.ml", line 28, characters 22-29 arg_expression.Splice0 is a variant case which is never constructed @@ -1759,12 +1723,6 @@ <-- line 62 val is_function : Lam.t -> bool [@@dead "+is_function"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_fmt.ml", line 10, characters 0-54 - +invalid_argf is never used - <-- line 10 - let invalid_argf fmt = Format.ksprintf invalid_arg fmt [@@dead "+invalid_argf"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_ident.ml", line 166, characters 0-31 +make_unused is never used @@ -1789,12 +1747,6 @@ <-- line 26 type t = {case: case; [@dead "t.case"] suffix: string [@dead "t.suffix"] } [@@warning "-69"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_list.mli", line 85, characters 0-56 - +length_compare is never used - <-- line 85 - val length_compare : 'a list -> int -> [`Gt | `Eq | `Lt] [@@dead "+length_compare"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_namespace.ml", line 59, characters 0-352 +is_valid_npm_package_name is never used @@ -2671,4 +2623,4 @@ <-- line 99 type f = May_pos | May_neg | May_weak [@dead "Variance.f.May_weak"] | Inj | Pos | Neg | Inv - Analysis reported 563 issues (Warning Dead Module:4, Warning Dead Type:84, Warning Dead Value:126, Warning Dead Value With Side Effects:2, Warning Redundant Optional Argument:198, Warning Unused Argument:149) + Analysis reported 555 issues (Warning Dead Module:4, Warning Dead Type:84, Warning Dead Value:118, Warning Dead Value With Side Effects:2, Warning Redundant Optional Argument:198, Warning Unused Argument:149) diff --git a/compiler/core/js_exp_make.ml b/compiler/core/js_exp_make.ml index 28004e7769a..9fd3df2f16e 100644 --- a/compiler/core/js_exp_make.ml +++ b/compiler/core/js_exp_make.ml @@ -465,21 +465,6 @@ let extension_access (e : t) name (pos : int32) : t = let assign ?comment e0 e1 : t = {expression_desc = Bin (Eq, e0, e1); comment} -let assign_by_exp (e : t) index value : t = - match e.expression_desc with - | Array _ - (* - Temporary block -- address not held - Optimize cases like this which is really - rare {[ - (ref x) := 3 - ]} - *) - | Caml_block _ - when no_side_effect e && no_side_effect index -> - value - | _ -> assign {expression_desc = Array_index (e, index); comment = None} value - let record_assign (e : t) (pos : int32) (name : string) (value : t) = match e.expression_desc with | Array _ diff --git a/compiler/core/js_exp_make.mli b/compiler/core/js_exp_make.mli index f0e20275efe..d21f0f4297f 100644 --- a/compiler/core/js_exp_make.mli +++ b/compiler/core/js_exp_make.mli @@ -173,8 +173,6 @@ val poly_var_value_access : t -> t val extension_assign : t -> int32 -> string -> t -> t -val assign_by_exp : t -> t -> t -> t - val assign : ?comment:string -> t -> t -> t val tag_type : Ast_untagged_variants.tag_type -> t diff --git a/compiler/core/js_of_lam_block.ml b/compiler/core/js_of_lam_block.ml index 850e8ad2f94..ef11c715d7e 100644 --- a/compiler/core/js_of_lam_block.ml +++ b/compiler/core/js_of_lam_block.ml @@ -45,13 +45,8 @@ let field (field_info : Lam_compat.field_dbg_info) e (i : int32) = | Fld_record {name} -> E.record_access e name i | Fld_module {name} -> E.module_access e name i -let field_by_exp e i = E.array_index e i - let set_field (field_info : Lam_compat.set_field_dbg_info) e i e0 = match field_info with | Fld_record_extension_set name -> E.extension_assign e i name e0 | Fld_record_inline_set name | Fld_record_set name -> E.record_assign e i name e0 - -(* This dynamism commes from oo compilaton, it should not happen in record *) -let set_field_by_exp self index value = E.assign_by_exp self index value diff --git a/compiler/core/js_of_lam_block.mli b/compiler/core/js_of_lam_block.mli index 903baa7ee47..4718461dfb6 100644 --- a/compiler/core/js_of_lam_block.mli +++ b/compiler/core/js_of_lam_block.mli @@ -33,14 +33,9 @@ val make_block : val field : Lam_compat.field_dbg_info -> J.expression -> int32 -> J.expression -val field_by_exp : J.expression -> J.expression -> J.expression - val set_field : Lam_compat.set_field_dbg_info -> J.expression -> int32 -> J.expression -> J.expression - -val set_field_by_exp : - J.expression -> J.expression -> J.expression -> J.expression diff --git a/compiler/ext/ext_fmt.ml b/compiler/ext/ext_fmt.ml index ea59637c491..7658c4dfd3f 100644 --- a/compiler/ext/ext_fmt.ml +++ b/compiler/ext/ext_fmt.ml @@ -6,5 +6,3 @@ let with_file_as_pp filename f = v) let failwithf ~loc fmt = Format.ksprintf (fun s -> failwith (loc ^ s)) fmt - -let invalid_argf fmt = Format.ksprintf invalid_arg fmt diff --git a/compiler/ext/ext_list.mli b/compiler/ext/ext_list.mli index fba672eabff..0a6c16ec7ef 100644 --- a/compiler/ext/ext_list.mli +++ b/compiler/ext/ext_list.mli @@ -82,8 +82,6 @@ val split_at : 'a list -> int -> 'a list * 'a list val filter_mapi : 'a list -> ('a -> int -> 'b option) -> 'b list -val length_compare : 'a list -> int -> [`Gt | `Eq | `Lt] - val length_ge : 'a list -> int -> bool (** From c05a03a93662c5a8de55452c1084ff4ac48a3beb Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 16:14:38 +0000 Subject: [PATCH 189/214] dce: trim js traversals --- _dce/report.txt | 38 +-------------------------------- compiler/core/js_record_fold.ml | 9 -------- compiler/core/js_record_iter.ml | 8 ------- compiler/core/js_record_map.ml | 9 -------- 4 files changed, 1 insertion(+), 63 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index 5887f92f5a2..1538353d13b 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -1497,42 +1497,6 @@ <-- line 99 type property = Lam_compat.let_kind = Strict [@dead "property.Strict"] | Alias [@dead "property.Alias"] | StrictOpt [@dead "property.StrictOpt"] | Variable [@dead "property.Variable"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_fold.ml", line 63, characters 0-109 - +required_modules is never used - <-- line 63 - fun _self st arg -> list _self.module_id _self st arg [@@dead "+required_modules"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_fold.ml", line 314, characters 0-203 - +deps_program is never used - <-- line 314 - st [@@dead "+deps_program"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_iter.ml", line 61, characters 0-93 - +required_modules is never used - <-- line 61 - fun _self arg -> list _self.module_id _self arg [@@dead "+required_modules"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_iter.ml", line 229, characters 0-156 - +deps_program is never used - <-- line 229 - required_modules _self _x1 [@@dead "+deps_program"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_map.ml", line 63, characters 0-93 - +required_modules is never used - <-- line 63 - fun _self arg -> list _self.module_id _self arg [@@dead "+required_modules"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_record_map.ml", line 311, characters 0-233 - +deps_program is never used - <-- line 311 - {program = _x0; modules = _x1; side_effect = _x2} [@@dead "+deps_program"] - Warning Dead Type File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compat.ml", line 57, characters 2-69 field_dbg_info.Fld_record is a variant case which is never constructed @@ -2623,4 +2587,4 @@ <-- line 99 type f = May_pos | May_neg | May_weak [@dead "Variance.f.May_weak"] | Inj | Pos | Neg | Inv - Analysis reported 555 issues (Warning Dead Module:4, Warning Dead Type:84, Warning Dead Value:118, Warning Dead Value With Side Effects:2, Warning Redundant Optional Argument:198, Warning Unused Argument:149) + Analysis reported 549 issues (Warning Dead Module:4, Warning Dead Type:84, Warning Dead Value:112, Warning Dead Value With Side Effects:2, Warning Redundant Optional Argument:198, Warning Unused Argument:149) diff --git a/compiler/core/js_record_fold.ml b/compiler/core/js_record_fold.ml index d3e0de74358..6279874c1dc 100644 --- a/compiler/core/js_record_fold.ml +++ b/compiler/core/js_record_fold.ml @@ -60,9 +60,6 @@ let module_id : 'a. ('a, module_id) fn = let st = _self.ident _self st _x0 in st -let required_modules : 'a. ('a, required_modules) fn = - fun _self st arg -> list _self.module_id _self st arg - let vident : 'a. ('a, vident) fn = fun _self st -> function | Id _x0 -> @@ -311,12 +308,6 @@ let program : 'a. ('a, program) fn = let st = _self.block _self st _x0 in st -let deps_program : 'a. ('a, deps_program) fn = - fun _self st {program = _x0; modules = _x1; side_effect = _x2} -> - let st = _self.program _self st _x0 in - let st = required_modules _self st _x1 in - st - let super : 'state iter = { ident; diff --git a/compiler/core/js_record_iter.ml b/compiler/core/js_record_iter.ml index da86618ae3c..a12b017f0ab 100644 --- a/compiler/core/js_record_iter.ml +++ b/compiler/core/js_record_iter.ml @@ -58,9 +58,6 @@ let ident : ident fn = unknown let module_id : module_id fn = fun _self {id = _x0; kind = _x1} -> _self.ident _self _x0 -let required_modules : required_modules fn = - fun _self arg -> list _self.module_id _self arg - let vident : vident fn = fun _self -> function | Id _x0 -> _self.ident _self _x0 @@ -226,11 +223,6 @@ let program : program fn = fun _self {block = _x0; exports = _x1; export_set = _x2} -> _self.block _self _x0 -let deps_program : deps_program fn = - fun _self {program = _x0; modules = _x1; side_effect = _x2} -> - _self.program _self _x0; - required_modules _self _x1 - let super : iter = { ident; diff --git a/compiler/core/js_record_map.ml b/compiler/core/js_record_map.ml index 26551861718..a88ceebd096 100644 --- a/compiler/core/js_record_map.ml +++ b/compiler/core/js_record_map.ml @@ -60,9 +60,6 @@ let module_id : module_id fn = let _x0 = _self.ident _self _x0 in {id = _x0; kind = _x1; dynamic_import = _x2} -let required_modules : required_modules fn = - fun _self arg -> list _self.module_id _self arg - let vident : vident fn = fun _self -> function | Id _x0 -> @@ -308,12 +305,6 @@ let program : program fn = let _x0 = _self.block _self _x0 in {block = _x0; exports = _x1; export_set = _x2} -let deps_program : deps_program fn = - fun _self {program = _x0; modules = _x1; side_effect = _x2} -> - let _x0 = _self.program _self _x0 in - let _x1 = required_modules _self _x1 in - {program = _x0; modules = _x1; side_effect = _x2} - let super : iter = { ident; From 0348e21082d7ebcba099428d578c703da30a2988 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 16:15:37 +0000 Subject: [PATCH 190/214] dce: trim lambda optionals --- _dce/report.txt | 14 +------------- compiler/core/lam_compile.ml | 6 +++--- compiler/core/lam_pass_alpha_conversion.ml | 2 +- 3 files changed, 5 insertions(+), 17 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index 1538353d13b..e311f467067 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -7,18 +7,6 @@ File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile.ml", line 820, characters 4-2265 optional argument default of function +switch is never used - Warning Redundant Optional Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile.ml", line 272, characters 2-2044 - optional argument dynamic_import of function +compile_external_field_apply is always supplied (1 calls) - - Warning Redundant Optional Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_compile.ml", line 235, characters 2-511 - optional argument dynamic_import of function +compile_external_field is always supplied (1 calls) - - Warning Redundant Optional Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_pass_alpha_conversion.ml", line 26, characters 2-955 - optional argument ap_transformed_jsx of function +populate_apply_info is always supplied (1 calls) - Warning Unused Argument File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/reanalyze/src/reanalyze.ml", line 199, characters 0-11133 optional argument file_stats of function +run_analysis is never used @@ -2587,4 +2575,4 @@ <-- line 99 type f = May_pos | May_neg | May_weak [@dead "Variance.f.May_weak"] | Inj | Pos | Neg | Inv - Analysis reported 549 issues (Warning Dead Module:4, Warning Dead Type:84, Warning Dead Value:112, Warning Dead Value With Side Effects:2, Warning Redundant Optional Argument:198, Warning Unused Argument:149) + Analysis reported 546 issues (Warning Dead Module:4, Warning Dead Type:84, Warning Dead Value:112, Warning Dead Value With Side Effects:2, Warning Redundant Optional Argument:195, Warning Unused Argument:149) diff --git a/compiler/core/lam_compile.ml b/compiler/core/lam_compile.ml index 97f6bec84e5..6cd1d02b1d9 100644 --- a/compiler/core/lam_compile.ml +++ b/compiler/core/lam_compile.ml @@ -233,8 +233,8 @@ type initialization = J.block let compile output_prefix = let rec compile_external_field (* Like [List.empty]*) - ?(dynamic_import = false) (lamba_cxt : Lam_compile_context.t) - (id : Ident.t) name : Js_output.t = + ~dynamic_import (lamba_cxt : Lam_compile_context.t) (id : Ident.t) name : + Js_output.t = match Lam_compile_env.query_external_id_info ~dynamic_import id name with | {persistent_closed_lambda = Some lam} when Lam_util.not_function lam -> compile_lambda lamba_cxt lam @@ -269,7 +269,7 @@ let compile output_prefix = for the function, generative module or functor can be a function, however it can not be global -- global can only module *) - and compile_external_field_apply ?(dynamic_import = false) + and compile_external_field_apply ~dynamic_import (appinfo : Lam.apply) (module_id : Ident.t) (field_name : string) (lambda_cxt : Lam_compile_context.t) : Js_output.t = let ident_info = diff --git a/compiler/core/lam_pass_alpha_conversion.ml b/compiler/core/lam_pass_alpha_conversion.ml index 7965cfc6011..9427d17028c 100644 --- a/compiler/core/lam_pass_alpha_conversion.ml +++ b/compiler/core/lam_pass_alpha_conversion.ml @@ -23,7 +23,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *) let alpha_conversion (meta : Lam_stats.t) (lam : Lam.t) : Lam.t = - let rec populate_apply_info ?(ap_transformed_jsx = false) + let rec populate_apply_info ~ap_transformed_jsx (args_arity : int list) (len : int) (fn : Lam.t) (args : Lam.t list) ap_info : Lam.t = match args_arity with From bf7a2cf453f1c8a7352202377c1f72ddfd7c17fd Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 16:17:27 +0000 Subject: [PATCH 191/214] dce: trim js stmt optionals --- _dce/report.txt | 106 +-------------------------- compiler/core/js_stmt_make.ml | 128 +++++++++++++++++---------------- compiler/core/js_stmt_make.mli | 35 +++------ 3 files changed, 75 insertions(+), 194 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index e311f467067..6c900cc65a5 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -779,58 +779,6 @@ File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/type_utils.ml", line 179, characters 0-2146 optional argument type_arg_context of function +instantiate_type2 is never used - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.mli", line 160, characters 0-54 - optional argument comment of function +return_stmt is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.mli", line 151, characters 0-100 - optional argument comment of function +try_ is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.mli", line 151, characters 0-100 - optional argument finally of function +try_ is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.mli", line 148, characters 0-97 - optional argument comment of function +for_await_of is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.mli", line 145, characters 0-91 - optional argument comment of function +for_of is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.mli", line 135, characters 0-172 - optional argument comment of function +for_ is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.mli", line 133, characters 0-78 - optional argument comment of function +while_ is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.mli", line 107, characters 0-60 - optional argument comment of function +assign is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.mli", line 92, characters 0-137 - optional argument ident_info of function +define_variable is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.mli", line 75, characters 0-191 - optional argument comment of function +string_switch is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.mli", line 52, characters 0-161 - optional argument comment of function +int_switch is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.mli", line 35, characters 0-262 - optional argument comment of function +if_ is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.mli", line 33, characters 0-53 - optional argument comment of function +throw_stmt is never used - Warning Redundant Optional Argument File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/syntax/src/res_driver.ml", line 192, characters 0-399 optional argument ignore_parse_errors of function +parse_interface is always supplied (1 calls) @@ -839,58 +787,6 @@ File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/syntax/src/res_driver.ml", line 181, characters 0-409 optional argument ignore_parse_errors of function +parse_implementation is always supplied (1 calls) - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.ml", line 335, characters 0-101 - optional argument comment of function +try_ is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.ml", line 335, characters 0-101 - optional argument finally of function +try_ is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.ml", line 332, characters 0-152 - optional argument comment of function +for_await_of is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.ml", line 329, characters 0-141 - optional argument comment of function +for_of is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.ml", line 320, characters 0-245 - optional argument comment of function +for_ is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.ml", line 317, characters 0-108 - optional argument comment of function +while_ is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.ml", line 314, characters 0-90 - optional argument comment of function +assign is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.ml", line 233, characters 0-3141 - optional argument comment of function +if_ is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.ml", line 136, characters 0-1581 - optional argument comment of function +string_switch is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.ml", line 91, characters 0-1408 - optional argument comment of function +int_switch is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.ml", line 67, characters 0-483 - optional argument ident_info of function +define_variable is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.ml", line 34, characters 0-67 - optional argument comment of function +throw_stmt is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_stmt_make.ml", line 29, characters 0-69 - optional argument comment of function +return_stmt is never used - Warning Unused Argument File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typecore.ml", line 1145, characters 2-61 optional argument from_type of function Constructor.+unbound_name_error is never used @@ -2575,4 +2471,4 @@ <-- line 99 type f = May_pos | May_neg | May_weak [@dead "Variance.f.May_weak"] | Inj | Pos | Neg | Inv - Analysis reported 546 issues (Warning Dead Module:4, Warning Dead Type:84, Warning Dead Value:112, Warning Dead Value With Side Effects:2, Warning Redundant Optional Argument:195, Warning Unused Argument:149) + Analysis reported 520 issues (Warning Dead Module:4, Warning Dead Type:84, Warning Dead Value:112, Warning Dead Value With Side Effects:2, Warning Redundant Optional Argument:195, Warning Unused Argument:123) diff --git a/compiler/core/js_stmt_make.ml b/compiler/core/js_stmt_make.ml index 051660d28f4..36c71a918b6 100644 --- a/compiler/core/js_stmt_make.ml +++ b/compiler/core/js_stmt_make.ml @@ -26,12 +26,12 @@ module E = Js_exp_make type t = J.statement -let return_stmt ?comment e : t = {statement_desc = Return e; comment} +let return_stmt e : t = {statement_desc = Return e; comment = None} let empty_stmt : t = {statement_desc = Block []; comment = None} (* let empty_block : J.block = [] *) -let throw_stmt ?comment v : t = {statement_desc = Throw v; comment} +let throw_stmt v : t = {statement_desc = Throw v; comment = None} (* avoid nested block *) let rec block (b : J.block) : t = @@ -42,43 +42,34 @@ let rec block (b : J.block) : t = | _ -> {statement_desc = Block b; comment = None} (* It's a statement, we can discard some values *) -let rec exp ?comment (e : E.t) : t = +let rec exp (e : E.t) : t = match e.expression_desc with | Seq ({expression_desc = Number _ | Undefined _}, b) | Seq (b, {expression_desc = Number _ | Undefined _}) -> - exp ?comment b + exp b | Number _ | Undefined _ -> block [] (* TODO: we can do more *) (* | _ when is_pure e -> block [] *) - | _ -> {statement_desc = Exp e; comment} + | _ -> {statement_desc = Exp e; comment = None} -let declare_variable ?comment ?ident_info ~kind (ident : Ident.t) : t = +let declare_variable ~kind (ident : Ident.t) : t = let property : J.property = kind in - let ident_info : J.ident_info = - match ident_info with - | None -> {used_stats = NA} - | Some x -> x - in { - statement_desc = Variable {ident; value = None; property; ident_info}; - comment; + statement_desc = + Variable {ident; value = None; property; ident_info = {used_stats = NA}}; + comment = None; } -let define_variable ?comment ?ident_info ~kind (v : Ident.t) - (exp : J.expression) : t = +let define_variable ~kind (v : Ident.t) (exp : J.expression) : t = match exp.expression_desc with - | Undefined _ -> declare_variable ?comment ?ident_info ~kind v + | Undefined _ -> declare_variable ~kind v | _ -> let property : J.property = kind in - let ident_info : J.ident_info = - match ident_info with - | None -> {used_stats = NA} - | Some x -> x - in { statement_desc = - Variable {ident = v; value = Some exp; property; ident_info}; - comment; + Variable + {ident = v; value = Some exp; property; ident_info = {used_stats = NA}}; + comment = None; } (* let alias_variable ?comment ~exp (v:Ident.t) : t= @@ -88,8 +79,8 @@ let define_variable ?comment ?ident_info ~kind (v : Ident.t) ident_info = {used_stats = NA } }; comment} *) -let int_switch ?(comment : string option) - ?(declaration : (J.property * Ident.t) option) ?(default : J.block option) +let int_switch ?(declaration : (J.property * Ident.t) option) + ?(default : J.block option) (e : J.expression) (clauses : (int * J.case_clause) list) : t = match e.expression_desc with | Number (Int {i; _}) -> ( @@ -119,22 +110,26 @@ let int_switch ?(comment : string option) }; ] ) when Ident.same did id -> - define_variable ?comment ~kind id e0 + define_variable ~kind id e0 | Some (kind, did), _ -> - block (declare_variable ?comment ~kind did :: continuation) + block (declare_variable ~kind did :: continuation) | None, _ -> block continuation) | _ -> ( match declaration with | Some (kind, did) -> block [ - declare_variable ?comment ~kind did; - {statement_desc = J.Int_switch (e, clauses, default); comment}; + declare_variable ~kind did; + { + statement_desc = J.Int_switch (e, clauses, default); + comment = None; + }; ] - | None -> {statement_desc = J.Int_switch (e, clauses, default); comment}) + | None -> + {statement_desc = J.Int_switch (e, clauses, default); comment = None}) -let string_switch ?(comment : string option) - ?(declaration : (J.property * Ident.t) option) ?(default : J.block option) +let string_switch ?(declaration : (J.property * Ident.t) option) + ?(default : J.block option) (e : J.expression) (clauses : (Ast_untagged_variants.tag_type * J.case_clause) list) : t = match e.expression_desc with @@ -169,19 +164,23 @@ let string_switch ?(comment : string option) }; ] ) when Ident.same did id -> - define_variable ?comment ~kind id e0 + define_variable ~kind id e0 | Some (kind, did), _ -> - block @@ (declare_variable ?comment ~kind did :: continuation) + block @@ (declare_variable ~kind did :: continuation) | None, _ -> block continuation) | _ -> ( match declaration with | Some (kind, did) -> block [ - declare_variable ?comment ~kind did; - {statement_desc = String_switch (e, clauses, default); comment}; + declare_variable ~kind did; + { + statement_desc = String_switch (e, clauses, default); + comment = None; + }; ] - | None -> {statement_desc = String_switch (e, clauses, default); comment}) + | None -> + {statement_desc = String_switch (e, clauses, default); comment = None}) let rec block_last_is_return_throw_or_continue (x : J.block) = match x with @@ -230,24 +229,24 @@ let rec block_last_is_return_throw_or_continue (x : J.block) = ]} Not clear the benefit *) -let if_ ?comment ?declaration ?else_ (e : J.expression) (then_ : J.block) : t = +let if_ ?declaration ?else_ (e : J.expression) (then_ : J.block) : t = let declared = ref false in - let rec aux ?comment (e : J.expression) (ifso : J.block) (ifnot : J.block) : t - = + let rec aux (e : J.expression) (ifso : J.block) (ifnot : J.block) : t = match (e.expression_desc, ifnot) with | Bool boolean, _ -> block (if boolean then ifso else ifnot) - | Js_not pred_not, _ :: _ -> aux ?comment pred_not ifnot ifso + | Js_not pred_not, _ :: _ -> aux pred_not ifnot ifso | _ -> ( match (ifso, ifnot) with | [], [] -> exp e - | [], _ -> aux ?comment (E.not e) ifnot [] (*Make sure no infinite loop*) + | [], _ -> aux (E.not e) ifnot [] (*Make sure no infinite loop*) | ( [{statement_desc = Return ret_ifso; _}], [{statement_desc = Return ret_ifnot; _}] ) -> return_stmt (E.econd e ret_ifso ret_ifnot) | _, [{statement_desc = Return _}] -> - block ({statement_desc = If (E.not e, ifnot, []); comment} :: ifso) + block + ({statement_desc = If (E.not e, ifnot, []); comment = None} :: ifso) | _, _ when block_last_is_return_throw_or_continue ifso -> - block ({statement_desc = If (e, ifso, []); comment} :: ifnot) + block ({statement_desc = If (e, ifso, []); comment = None} :: ifnot) | ( [ { statement_desc = @@ -289,20 +288,20 @@ let if_ ?comment ?declaration ?else_ (e : J.expression) (then_ : J.block) : t = exp (E.econd e exp_ifso exp_ifnot) | [{statement_desc = If (pred1, ifso1, ifnot1)}], _ when Js_analyzer.eq_block ifnot1 ifnot -> - aux ?comment (E.and_ e pred1) ifso1 ifnot1 + aux (E.and_ e pred1) ifso1 ifnot1 | [{statement_desc = If (pred1, ifso1, ifnot1)}], _ when Js_analyzer.eq_block ifso1 ifnot -> - aux ?comment (E.and_ e (E.not pred1)) ifnot1 ifso1 + aux (E.and_ e (E.not pred1)) ifnot1 ifso1 | _, [{statement_desc = If (pred1, ifso1, else_)}] when Js_analyzer.eq_block ifso ifso1 -> - aux ?comment (E.or_ e pred1) ifso else_ + aux (E.or_ e pred1) ifso else_ | _, [{statement_desc = If (pred1, ifso1, ifnot1)}] when Js_analyzer.eq_block ifso ifnot1 -> - aux ?comment (E.or_ e (E.not pred1)) ifso ifso1 - | _ -> {statement_desc = If (e, ifso, ifnot); comment}) + aux (E.or_ e (E.not pred1)) ifso ifso1 + | _ -> {statement_desc = If (e, ifso, ifnot); comment = None}) in let if_block = - aux ?comment e then_ + aux e then_ (match else_ with | None -> [] | Some v -> v) @@ -311,29 +310,32 @@ let if_ ?comment ?declaration ?else_ (e : J.expression) (then_ : J.block) : t = | true, _ | _, None -> if_block | false, Some (kind, id) -> block (declare_variable ~kind id :: [if_block]) -let assign ?comment id e : t = - {statement_desc = J.Exp (E.assign (E.var id) e); comment} +let assign id e : t = + {statement_desc = J.Exp (E.assign (E.var id) e); comment = None} -let while_ ?comment ?label (e : E.t) (st : J.block) : t = - {statement_desc = While (label, e, st); comment} +let while_ ?label (e : E.t) (st : J.block) : t = + {statement_desc = While (label, e, st); comment = None} -let for_ ?comment ?label for_ident_expression finish_ident_expression id - direction (b : J.block) : t = +let for_ ?label for_ident_expression finish_ident_expression id direction + (b : J.block) : t = { statement_desc = ForRange (label, for_ident_expression, finish_ident_expression, id, direction, b); - comment; + comment = None; } -let for_of ?comment ?label iterable_expression id (b : J.block) : t = - {statement_desc = ForOf (label, id, iterable_expression, b); comment} +let for_of ?label iterable_expression id (b : J.block) : t = + {statement_desc = ForOf (label, id, iterable_expression, b); comment = None} -let for_await_of ?comment ?label iterable_expression id (b : J.block) : t = - {statement_desc = ForAwaitOf (label, id, iterable_expression, b); comment} +let for_await_of ?label iterable_expression id (b : J.block) : t = + { + statement_desc = ForAwaitOf (label, id, iterable_expression, b); + comment = None; + } -let try_ ?comment ?with_ ?finally body : t = - {statement_desc = Try (body, with_, finally); comment} +let try_ ?with_ body : t = + {statement_desc = Try (body, with_, None); comment = None} let break_ ?label () : t = {statement_desc = Break label; comment = None} diff --git a/compiler/core/js_stmt_make.mli b/compiler/core/js_stmt_make.mli index 86afe2109cf..2139e36f578 100644 --- a/compiler/core/js_stmt_make.mli +++ b/compiler/core/js_stmt_make.mli @@ -30,10 +30,9 @@ type t = J.statement (* val empty_stmt : t *) -val throw_stmt : ?comment:string -> J.expression -> t +val throw_stmt : J.expression -> t val if_ : - ?comment:string -> ?declaration:Lam_compat.let_kind * Ident.t -> (* when it's not None, we also need make a variable declaration in the begininnig, however, we can optmize such case @@ -50,7 +49,6 @@ val block : J.block -> t *) val int_switch : - ?comment:string -> ?declaration:Lam_compat.let_kind * Ident.t -> ?default:J.block -> J.expression -> @@ -73,25 +71,17 @@ val int_switch : *) val string_switch : - ?comment:string -> ?declaration:Lam_compat.let_kind * Ident.t -> ?default:J.block -> J.expression -> (Ast_untagged_variants.tag_type * J.case_clause) list -> t -val declare_variable : - ?comment:string -> - ?ident_info:J.ident_info -> - kind:Lam_compat.let_kind -> - Ident.t -> - t +val declare_variable : kind:Lam_compat.let_kind -> Ident.t -> t (** Just declaration without initialization *) (*** Declaration with initialization *) val define_variable : - ?comment:string -> - ?ident_info:J.ident_info -> kind:Lam_compat.let_kind -> Ident.t -> J.expression -> @@ -104,7 +94,7 @@ val define_variable : Ident.t -> t *) -val assign : ?comment:string -> J.ident -> J.expression -> t +val assign : J.ident -> J.expression -> t (** Used in cases like {[ @@ -130,10 +120,9 @@ val assign : ?comment:string -> J.ident -> J.expression -> t J.ident -> t *) -val while_ : ?comment:string -> ?label:J.label -> J.expression -> J.block -> t +val while_ : ?label:J.label -> J.expression -> J.block -> t val for_ : - ?comment:string -> ?label:J.label -> J.for_ident_expression option -> J.finish_ident_expression -> @@ -142,22 +131,16 @@ val for_ : J.block -> t -val for_of : - ?comment:string -> ?label:J.label -> J.expression -> J.ident -> J.block -> t +val for_of : ?label:J.label -> J.expression -> J.ident -> J.block -> t val for_await_of : - ?comment:string -> ?label:J.label -> J.expression -> J.ident -> J.block -> t + ?label:J.label -> J.expression -> J.ident -> J.block -> t -val try_ : - ?comment:string -> - ?with_:J.ident * J.block -> - ?finally:J.block -> - J.block -> - t +val try_ : ?with_:J.ident * J.block -> J.block -> t -val exp : ?comment:string -> J.expression -> t +val exp : J.expression -> t -val return_stmt : ?comment:string -> J.expression -> t +val return_stmt : J.expression -> t (* val return_unit : t list *) (** for ocaml function which returns unit From 5499095fbe68a99db4c8e630f6d949d425b8360a Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 16:20:34 +0000 Subject: [PATCH 192/214] dce: trim js exp optionals --- _dce/report.txt | 278 ++++++++-------------------------- compiler/core/js_exp_make.ml | 105 ++++++------- compiler/core/js_exp_make.mli | 34 ++--- 3 files changed, 128 insertions(+), 289 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index 6c900cc65a5..4be99421d94 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -796,392 +796,236 @@ optional argument from_type of function Label.+unbound_name_error is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 338, characters 0-49 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 332, characters 0-49 optional argument comment of function +is_null_undefined is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 334, characters 0-39 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 328, characters 0-39 optional argument comment of function +is_null is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 330, characters 0-73 - optional argument comment of function +raw_js_code is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 327, characters 0-74 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 321, characters 0-74 optional argument comment of function +of_block is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 324, characters 0-54 - optional argument comment of function +dummy_obj is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 318, characters 0-40 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 312, characters 0-40 optional argument comment of function +or_ is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 316, characters 0-41 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 310, characters 0-41 optional argument comment of function +and_ is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 314, characters 0-53 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 308, characters 0-53 optional argument comment of function +obj_length is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 307, characters 0-62 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 301, characters 0-62 optional argument comment of function +tag is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 294, characters 0-69 - optional argument comment of function +obj is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 280, characters 0-147 - optional argument comment of function +make_block is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 270, characters 0-67 - optional argument comment of function +tagged_template is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 264, characters 0-69 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 259, characters 0-69 optional argument comment of function +js_comp is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 262, characters 0-63 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 257, characters 0-63 optional argument comment of function +bigint_mod is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 260, characters 0-63 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 255, characters 0-63 optional argument comment of function +bigint_div is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 258, characters 0-73 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 253, characters 0-73 optional argument comment of function +bigint_comp is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 252, characters 0-71 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 247, characters 0-71 optional argument comment of function +bool_comp is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 246, characters 0-46 - optional argument comment of function +float_mod is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 234, characters 0-47 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 229, characters 0-47 optional argument comment of function +int32_band is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 232, characters 0-47 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 227, characters 0-47 optional argument comment of function +int32_bxor is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 230, characters 0-46 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 225, characters 0-46 optional argument comment of function +int32_asr is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 226, characters 0-46 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 221, characters 0-46 optional argument comment of function +int32_lsl is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 224, characters 0-46 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 219, characters 0-46 optional argument comment of function +int32_pow is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 222, characters 0-62 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 217, characters 0-62 optional argument comment of function +int32_mod is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 220, characters 0-62 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 215, characters 0-62 optional argument comment of function +int32_div is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 218, characters 0-46 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 213, characters 0-46 optional argument comment of function +int32_mul is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 216, characters 0-48 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 211, characters 0-48 optional argument comment of function +int32_minus is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 212, characters 0-46 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 207, characters 0-46 optional argument comment of function +int32_add is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 210, characters 0-40 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 205, characters 0-40 optional argument comment of function +to_int32 is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 207, characters 0-38 - optional argument comment of function +typeof is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 195, characters 0-46 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 190, characters 0-46 optional argument comment of function +is_type_number is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 193, characters 0-63 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 188, characters 0-63 optional argument comment of function +neq_null_undefined_boolean is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 191, characters 0-62 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 186, characters 0-62 optional argument comment of function +eq_null_undefined_boolean is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 187, characters 0-40 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 182, characters 0-40 optional argument comment of function +int_bnot is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 185, characters 0-46 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 180, characters 0-46 optional argument comment of function +int_equal is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 176, characters 0-43 - optional argument comment of function +assign is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 154, characters 0-48 - optional argument comment of function +array_index is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 139, characters 0-47 - optional argument comment of function +function_length is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 137, characters 0-45 - optional argument comment of function +string_length is never used + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 83, characters 0-58 + optional argument comment of function +str is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 135, characters 0-44 - optional argument comment of function +array_length is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 131, characters 0-45 - optional argument comment of function +dot is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 98, characters 0-139 - optional argument comment of function +method_ is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 98, characters 0-139 - optional argument immutable_mask of function +method_ is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 87, characters 0-187 - optional argument comment of function +ocaml_fun is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 74, characters 0-78 - optional argument comment of function +ml_module_as_var is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 67, characters 0-143 - optional argument comment of function +external_var is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 55, characters 0-185 - optional argument comment of function +external_var_field is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 50, characters 0-84 - optional argument comment of function +ml_var_dot is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1706, characters 0-605 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1707, characters 0-605 optional argument comment of function +neq_null_undefined_boolean is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1691, characters 0-605 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1692, characters 0-605 optional argument comment of function +eq_null_undefined_boolean is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1685, characters 0-216 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1686, characters 0-216 optional argument comment of function +is_null_undefined is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1679, characters 0-58 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1680, characters 0-58 optional argument comment of function +is_null is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1655, characters 0-596 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1656, characters 0-596 optional argument comment of function +of_block is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1648, characters 0-160 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1649, characters 0-160 optional argument comment of function +bigint_mod is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1644, characters 0-159 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1645, characters 0-159 optional argument comment of function +bigint_div is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1617, characters 0-992 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1618, characters 0-992 optional argument comment of function +bigint_comp is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1601, characters 0-384 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1602, characters 0-384 optional argument comment of function +int32_band is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1591, characters 0-445 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1592, characters 0-445 optional argument comment of function +int32_bxor is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1585, characters 0-251 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1586, characters 0-251 optional argument comment of function +int32_pow is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1580, characters 0-179 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1581, characters 0-179 optional argument comment of function +int_bnot is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1564, characters 0-702 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1565, characters 0-702 optional argument comment of function +int32_mul is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1547, characters 0-316 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1548, characters 0-316 optional argument comment of function +int32_lsl is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1537, characters 0-316 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1538, characters 0-316 optional argument comment of function +int32_mod is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1526, characters 0-482 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1527, characters 0-482 optional argument comment of function +int32_div is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1522, characters 0-94 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1523, characters 0-94 optional argument comment of function +int32_asr is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1516, characters 0-87 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1517, characters 0-87 optional argument comment of function +int32_minus is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1511, characters 0-66 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1512, characters 0-66 optional argument comment of function +int32_add is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1402, characters 0-89 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1403, characters 0-89 optional argument comment of function +js_comp is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1375, characters 0-901 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1376, characters 0-901 optional argument comment of function +bool_comp is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1335, characters 0-94 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1336, characters 0-94 optional argument comment of function +obj_length is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1330, characters 0-91 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1331, characters 0-91 optional argument comment of function +is_type_number is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1315, characters 0-97 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1316, characters 0-97 optional argument comment of function +to_int32 is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1281, characters 0-106 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1282, characters 0-106 optional argument comment of function +tag is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1217, characters 0-27 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1218, characters 0-27 optional argument comment of function +int_equal is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1092, characters 0-516 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1093, characters 0-516 optional argument comment of function +or_ is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1072, characters 0-751 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1073, characters 0-751 optional argument comment of function +and_ is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 553, characters 0-94 - optional argument comment of function +obj is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 519, characters 0-304 - optional argument comment of function +function_length is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 513, characters 0-242 - optional argument comment of function +string_length is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 506, characters 0-277 - optional argument comment of function +array_length is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 466, characters 0-77 - optional argument comment of function +assign is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 373, characters 0-422 - optional argument comment of function +array_index is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 370, characters 0-94 - optional argument comment of function +float_mod is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 267, characters 0-465 - optional argument comment of function +dummy_obj is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 249, characters 0-365 - optional argument comment of function +method_ is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 249, characters 0-365 - optional argument immutable_mask of function +method_ is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 230, characters 0-444 - optional argument comment of function +ocaml_fun is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 200, characters 0-103 - optional argument comment of function +instanceof is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 192, characters 0-301 - optional argument comment of function +typeof is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 185, characters 0-189 - optional argument comment of function +make_block is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 172, characters 0-104 - optional argument comment of function +dot is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 154, characters 0-134 - optional argument comment of function +raw_js_code is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 134, characters 0-176 - optional argument comment of function +ml_module_as_var is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 118, characters 0-390 - optional argument comment of function +external_var is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 103, characters 0-367 - optional argument comment of function +external_var_field is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 90, characters 0-189 - optional argument comment of function +ml_var_dot is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 70, characters 0-164 - optional argument comment of function +tagged_template is never used + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 150, characters 0-93 + optional argument comment of function +str is never used Warning Unused Argument File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typetexp.mli", line 102, characters 0-91 @@ -2471,4 +2315,4 @@ <-- line 99 type f = May_pos | May_neg | May_weak [@dead "Variance.f.May_weak"] | Inj | Pos | Neg | Inv - Analysis reported 520 issues (Warning Dead Module:4, Warning Dead Type:84, Warning Dead Value:112, Warning Dead Value With Side Effects:2, Warning Redundant Optional Argument:195, Warning Unused Argument:123) + Analysis reported 481 issues (Warning Dead Module:4, Warning Dead Type:84, Warning Dead Value:112, Warning Dead Value With Side Effects:2, Warning Redundant Optional Argument:195, Warning Unused Argument:84) diff --git a/compiler/core/js_exp_make.ml b/compiler/core/js_exp_make.ml index 9fd3df2f16e..3feac368adc 100644 --- a/compiler/core/js_exp_make.ml +++ b/compiler/core/js_exp_make.ml @@ -67,10 +67,10 @@ let nil : t = {expression_desc = Null; comment = None} let call ?comment ~info e0 args : t = {expression_desc = Call (e0, args, info); comment} -let tagged_template ?comment call_expr string_args value_args : t = +let tagged_template call_expr string_args value_args : t = { expression_desc = Tagged_template (call_expr, string_args, value_args); - comment; + comment = None; } let runtime_var_dot (x : string) (e1 : string) : J.expression = @@ -87,11 +87,10 @@ let runtime_var_dot (x : string) (e1 : string) : J.expression = comment = None; } -let ml_var_dot ?comment ?(dynamic_import = false) (id : Ident.t) e : - J.expression = +let ml_var_dot ?(dynamic_import = false) (id : Ident.t) e : J.expression = { expression_desc = Var (Qualified ({id; kind = Ml; dynamic_import}, Some e)); - comment; + comment = None; } (** @@ -100,8 +99,8 @@ let ml_var_dot ?comment ?(dynamic_import = false) (id : Ident.t) e : var http = require("http") ]} *) -let external_var_field ?import_attributes ?comment ~external_name:name - (id : Ident.t) ~field ~default : t = +let external_var_field ?import_attributes ~external_name:name (id : Ident.t) + ~field ~default : t = { expression_desc = Var @@ -112,10 +111,10 @@ let external_var_field ?import_attributes ?comment ~external_name:name dynamic_import = false; }, Some field )); - comment; + comment = None; } -let external_var ?import_attributes ?comment ~external_name (id : Ident.t) : t = +let external_var ?import_attributes ~external_name (id : Ident.t) : t = { expression_desc = Var @@ -128,13 +127,13 @@ let external_var ?import_attributes ?comment ~external_name (id : Ident.t) : t = dynamic_import = false; }, None )); - comment; + comment = None; } -let ml_module_as_var ?comment ?(dynamic_import = false) (id : Ident.t) : t = +let ml_module_as_var ?(dynamic_import = false) (id : Ident.t) : t = { expression_desc = Var (Qualified ({id; kind = Ml; dynamic_import}, None)); - comment; + comment = None; } (* Static_index .....................**) @@ -151,10 +150,10 @@ let pure_runtime_call module_name fn_name args = let str ?(delim = J.DNone) ?comment txt : t = {expression_desc = Str {txt; delim}; comment} -let raw_js_code ?comment info s : t = +let raw_js_code info s : t = { expression_desc = Raw_js_code {code = String.trim s; code_info = info}; - comment; + comment = None; } let array mt es : t = {expression_desc = Array (es, mt); comment = None} @@ -169,8 +168,8 @@ let optional_not_nest_block e : J.expression = (** used in normal property like [e.length], no dependency introduced *) -let dot ?comment (e0 : t) (e1 : string) : t = - {expression_desc = Static_index (e0, e1, None); comment} +let dot (e0 : t) (e1 : string) : t = + {expression_desc = Static_index (e0, e1, None); comment = None} let module_access (e : t) (name : string) (pos : int32) = let name = Ext_ident.convert name in @@ -182,23 +181,26 @@ let module_access (e : t) (name : string) (pos : int32) = {expression_desc = Static_index (e, name, Some pos); comment = None}) | _ -> {expression_desc = Static_index (e, name, Some pos); comment = None} -let make_block ?comment (tag : t) (tag_info : J.tag_info) (es : t list) +let make_block (tag : t) (tag_info : J.tag_info) (es : t list) (mutable_flag : J.mutable_flag) : t = - {expression_desc = Caml_block (es, mutable_flag, tag, tag_info); comment} + { + expression_desc = Caml_block (es, mutable_flag, tag, tag_info); + comment = None; + } module L = Literals (* ATTENTION: this is relevant to how we encode string, boolean *) -let typeof ?comment (e : t) : t = +let typeof (e : t) : t = match e.expression_desc with - | Number _ | Length _ -> str ?comment L.js_type_number - | Str _ -> str ?comment L.js_type_string - | Array _ -> str ?comment L.js_type_object - | Bool _ -> str ?comment L.js_type_boolean - | _ -> {expression_desc = Typeof e; comment} + | Number _ | Length _ -> str L.js_type_number + | Str _ -> str L.js_type_string + | Array _ -> str L.js_type_object + | Bool _ -> str L.js_type_boolean + | _ -> {expression_desc = Typeof e; comment = None} -let instanceof ?comment (e0 : t) (e1 : t) : t = - {expression_desc = Bin (InstanceOf, e0, e1); comment} +let instanceof (e0 : t) (e1 : t) : t = + {expression_desc = Bin (InstanceOf, e0, e1); comment = None} let is_array (e0 : t) : t = let f = str "Array.isArray" ~delim:DNoQuotes in @@ -227,7 +229,7 @@ let unit : t = {expression_desc = Undefined {is_unit = true}; comment = None} [Js_fun_env.empty] is a mutable state .. *) -let ocaml_fun ?comment ?immutable_mask ?directive ~return_unit ~async +let ocaml_fun ?immutable_mask ?directive ~return_unit ~async ~one_unit_arg params body : t = let params = if one_unit_arg then [] else params in let len = List.length params in @@ -243,10 +245,10 @@ let ocaml_fun ?comment ?immutable_mask ?directive ~return_unit ~async async; directive; }; - comment; + comment = None; } -let method_ ?comment ?immutable_mask ~async ~return_unit params body : t = +let method_ ~async ~return_unit params body : t = let len = List.length params in { expression_desc = @@ -255,16 +257,16 @@ let method_ ?comment ?immutable_mask ~async ~return_unit params body : t = is_method = true; params; body; - env = Js_fun_env.make ?immutable_mask len; + env = Js_fun_env.make len; return_unit; async; directive = None; }; - comment; + comment = None; } (** ATTENTION: This is coupuled with {!Caml_obj.caml_update_dummy} *) -let dummy_obj ?comment (info : Lam_tag_info.t) : t = +let dummy_obj (info : Lam_tag_info.t) : t = (* TODO: for record it is [{}] for other it is [[]] @@ -272,9 +274,9 @@ let dummy_obj ?comment (info : Lam_tag_info.t) : t = match info with | Blk_record _ | Blk_module _ | Blk_constructor _ | Blk_record_inlined _ | Blk_poly_var _ | Blk_extension | Blk_record_ext _ -> - {comment; expression_desc = Object (None, [])} + {comment = None; expression_desc = Object (None, [])} | Blk_tuple | Blk_module_export _ -> - {comment; expression_desc = Array ([], Mutable)} + {comment = None; expression_desc = Array ([], Mutable)} | Blk_some | Blk_some_not_nested -> assert false (* TODO: complete @@ -367,18 +369,18 @@ let float f : t = {expression_desc = Number (Float {f}); comment = None} let zero_float_lit : t = {expression_desc = Number (Float {f = "0."}); comment = None} -let float_mod ?comment e1 e2 : J.expression = - {comment; expression_desc = Bin (Mod, e1, e2)} +let float_mod e1 e2 : J.expression = + {comment = None; expression_desc = Bin (Mod, e1, e2)} -let array_index ?comment (e0 : t) (e1 : t) : t = +let array_index (e0 : t) (e1 : t) : t = match (e0.expression_desc, e1.expression_desc) with | Array (l, _), Number (Int {i; _}) (* Float i -- should not appear here *) when no_side_effect e0 -> ( match Ext_list.nth_opt l (Int32.to_int i) with - | None -> {expression_desc = Array_index (e0, e1); comment} + | None -> {expression_desc = Array_index (e0, e1); comment = None} | Some x -> x (* FIX #3084*)) - | _ -> {expression_desc = Array_index (e0, e1); comment} + | _ -> {expression_desc = Array_index (e0, e1); comment = None} let array_index_by_int ?comment (e : t) (pos : int32) : t = match e.expression_desc with @@ -463,7 +465,7 @@ let extension_access (e : t) name (pos : int32) : t = in {expression_desc = Static_index (e, name, Some pos); comment = None} -let assign ?comment e0 e1 : t = {expression_desc = Bin (Eq, e0, e1); comment} +let assign e0 e1 : t = {expression_desc = Bin (Eq, e0, e1); comment = None} let record_assign (e : t) (pos : int32) (name : string) (value : t) = match e.expression_desc with @@ -503,26 +505,25 @@ let extension_assign (e : t) (pos : int32) name (value : t) = (* This is a property access not external module *) -let array_length ?comment (e : t) : t = +let array_length (e : t) : t = match e.expression_desc with (* TODO: use array instead? *) | (Array (l, _) | Caml_block (l, _, _, _)) when no_side_effect e -> - int ?comment (Int32.of_int (List.length l)) - | _ -> {expression_desc = Length (e, Array); comment} + int (Int32.of_int (List.length l)) + | _ -> {expression_desc = Length (e, Array); comment = None} -let string_length ?comment (e : t) : t = +let string_length (e : t) : t = match e.expression_desc with - | Str {txt; delim = DNone} -> int ?comment (Int32.of_int (String.length txt)) + | Str {txt; delim = DNone} -> int (Int32.of_int (String.length txt)) (* No optimization for {j||j}*) - | _ -> {expression_desc = Length (e, String); comment} + | _ -> {expression_desc = Length (e, String); comment = None} -let function_length ?comment (e : t) : t = +let function_length (e : t) : t = match e.expression_desc with | Fun {is_method; params} -> let params_length = List.length params in - int ?comment - (Int32.of_int (if is_method then params_length - 1 else params_length)) - | _ -> {expression_desc = Length (e, Function); comment} + int (Int32.of_int (if is_method then params_length - 1 else params_length)) + | _ -> {expression_desc = Length (e, Function); comment = None} (** no dependency introduced *) (* let js_global_dot ?comment (x : string) (e1 : string) : t = @@ -550,8 +551,8 @@ let rec string_append ?comment (e : t) (el : t) : t = {(concat a b ~delim) with comment} | _, _ -> {comment; expression_desc = String_append (e, el)} -let obj ?comment ?dup properties : t = - {expression_desc = Object (dup, properties); comment} +let obj ?dup properties : t = + {expression_desc = Object (dup, properties); comment = None} let str_equal (txt0 : string) (delim0 : External_arg_spec.delim) txt1 delim1 = if delim0 = delim1 then diff --git a/compiler/core/js_exp_make.mli b/compiler/core/js_exp_make.mli index d21f0f4297f..18476baefbc 100644 --- a/compiler/core/js_exp_make.mli +++ b/compiler/core/js_exp_make.mli @@ -48,13 +48,12 @@ val js_global : string -> t (* val runtime_var_vid : string -> string -> J.vident *) val ml_var_dot : - ?comment:string -> ?dynamic_import:bool -> Ident.t -> string -> t + ?dynamic_import:bool -> Ident.t -> string -> t (** [ml_var_dot ocaml_module name] *) val external_var_field : ?import_attributes:External_ffi_types.import_attributes -> - ?comment:string -> external_name:string -> Ident.t -> field:string -> @@ -66,12 +65,11 @@ val external_var_field : val external_var : ?import_attributes:External_ffi_types.import_attributes -> - ?comment:string -> external_name:string -> Ident.t -> t -val ml_module_as_var : ?comment:string -> ?dynamic_import:bool -> Ident.t -> t +val ml_module_as_var : ?dynamic_import:bool -> Ident.t -> t val runtime_call : string -> @@ -85,7 +83,6 @@ val runtime_call : val str : ?delim:J.delim -> ?comment:string -> string -> t val ocaml_fun : - ?comment:string -> ?immutable_mask:bool array -> ?directive:string -> return_unit:bool -> @@ -96,8 +93,6 @@ val ocaml_fun : t val method_ : - ?comment:string -> - ?immutable_mask:bool array -> async:bool -> return_unit:bool -> J.ident list -> @@ -128,15 +123,15 @@ val is_out : ?comment:string -> t -> t -> t *) -val dot : ?comment:string -> t -> string -> t +val dot : t -> string -> t val module_access : t -> string -> int32 -> t -val array_length : ?comment:string -> t -> t +val array_length : t -> t -val string_length : ?comment:string -> t -> t +val string_length : t -> t -val function_length : ?comment:string -> t -> t +val function_length : t -> t val string_append : ?comment:string -> t -> t -> t (** @@ -151,7 +146,7 @@ val string_append : ?comment:string -> t -> t -> t (* val bind_call : ?comment:string -> J.expression -> string -> J.expression list -> t *) (* val js_global_dot : ?comment:string -> string -> string -> t *) -val array_index : ?comment:string -> t -> t -> t +val array_index : t -> t -> t val array_index_by_int : ?comment:string -> t -> Int32.t -> t @@ -173,7 +168,7 @@ val poly_var_value_access : t -> t val extension_assign : t -> int32 -> string -> t -> t -val assign : ?comment:string -> t -> t -> t +val assign : t -> t -> t val tag_type : Ast_untagged_variants.tag_type -> t @@ -204,7 +199,7 @@ val is_a_literal_case : val is_type_object : t -> t -val typeof : ?comment:string -> t -> t +val typeof : t -> t val is_array : t -> t val to_int32 : ?comment:string -> t -> t @@ -243,7 +238,7 @@ val float_mul : ?comment:string -> t -> t -> t val float_div : ?comment:string -> t -> t -> t -val float_mod : ?comment:string -> t -> t -> t +val float_mod : t -> t -> t val float_pow : ?comment:string -> t -> t -> t @@ -267,7 +262,7 @@ val not : t -> t val call : ?comment:string -> info:Js_call_info.t -> t -> t list -> t -val tagged_template : ?comment:string -> t -> t list -> t list -> t +val tagged_template : t -> t list -> t list -> t val new_ : J.expression -> J.expression list -> t @@ -278,7 +273,6 @@ val optional_block : J.expression -> J.expression val optional_not_nest_block : J.expression -> J.expression val make_block : - ?comment:string -> J.expression -> (* tag *) J.tag_info -> @@ -291,7 +285,7 @@ val seq : ?comment:string -> t -> t -> t val fuse_to_seq : t -> t list -> t -val obj : ?comment:string -> ?dup:J.expression -> J.property_map -> t +val obj : ?dup:J.expression -> J.property_map -> t val true_ : t @@ -321,13 +315,13 @@ val in_ : t -> t -> t (** we don't expose a general interface, since a general interface is generally not safe *) -val dummy_obj : ?comment:string -> Lam_tag_info.t -> t +val dummy_obj : Lam_tag_info.t -> t (** used combined with [caml_update_dummy]*) val of_block : ?comment:string -> ?e:J.expression -> J.statement list -> t (** convert a block to expresion by using IIFE *) -val raw_js_code : ?comment:string -> Js_raw_info.code_info -> string -> t +val raw_js_code : Js_raw_info.code_info -> string -> t val nil : t From 7f4df5b9c4866b8ad781ab2141994092d8850eec Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 16:25:03 +0000 Subject: [PATCH 193/214] dce: trim js numeric optionals --- _dce/report.txt | 234 +++++----------------------------- compiler/core/js_exp_make.ml | 131 ++++++++++--------- compiler/core/js_exp_make.mli | 58 ++++----- 3 files changed, 122 insertions(+), 301 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index 4be99421d94..5344dbc6da7 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -796,236 +796,60 @@ optional argument from_type of function Label.+unbound_name_error is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 332, characters 0-49 - optional argument comment of function +is_null_undefined is never used + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 251, characters 0-61 + optional argument comment of function +bigint_op is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 328, characters 0-39 - optional argument comment of function +is_null is never used + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 243, characters 0-46 + optional argument comment of function +float_pow is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 321, characters 0-74 - optional argument comment of function +of_block is never used + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 239, characters 0-46 + optional argument comment of function +float_div is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 312, characters 0-40 - optional argument comment of function +or_ is never used + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 237, characters 0-46 + optional argument comment of function +float_mul is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 310, characters 0-41 - optional argument comment of function +and_ is never used + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 233, characters 0-46 + optional argument comment of function +float_add is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 308, characters 0-53 - optional argument comment of function +obj_length is never used + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 231, characters 0-46 + optional argument comment of function +int32_bor is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 301, characters 0-62 - optional argument comment of function +tag is never used + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 184, characters 0-49 + optional argument comment of function +string_equal is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 259, characters 0-69 - optional argument comment of function +js_comp is never used + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1612, characters 0-67 + optional argument comment of function +bigint_op is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 257, characters 0-63 - optional argument comment of function +bigint_mod is never used + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1543, characters 0-53 + optional argument comment of function +float_mul is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 255, characters 0-63 - optional argument comment of function +bigint_div is never used + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1518, characters 0-53 + optional argument comment of function +float_pow is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 253, characters 0-73 - optional argument comment of function +bigint_comp is never used + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1517, characters 0-53 + optional argument comment of function +float_div is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 247, characters 0-71 - optional argument comment of function +bool_comp is never used + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1474, characters 0-1244 + optional argument comment of function +float_add is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 229, characters 0-47 - optional argument comment of function +int32_band is never used + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1329, characters 0-80 + optional argument comment of function +string_equal is never used Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 227, characters 0-47 - optional argument comment of function +int32_bxor is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 225, characters 0-46 - optional argument comment of function +int32_asr is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 221, characters 0-46 - optional argument comment of function +int32_lsl is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 219, characters 0-46 - optional argument comment of function +int32_pow is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 217, characters 0-62 - optional argument comment of function +int32_mod is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 215, characters 0-62 - optional argument comment of function +int32_div is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 213, characters 0-46 - optional argument comment of function +int32_mul is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 211, characters 0-48 - optional argument comment of function +int32_minus is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 207, characters 0-46 - optional argument comment of function +int32_add is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 205, characters 0-40 - optional argument comment of function +to_int32 is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 190, characters 0-46 - optional argument comment of function +is_type_number is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 188, characters 0-63 - optional argument comment of function +neq_null_undefined_boolean is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 186, characters 0-62 - optional argument comment of function +eq_null_undefined_boolean is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 182, characters 0-40 - optional argument comment of function +int_bnot is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 180, characters 0-46 - optional argument comment of function +int_equal is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 83, characters 0-58 - optional argument comment of function +str is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1707, characters 0-605 - optional argument comment of function +neq_null_undefined_boolean is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1692, characters 0-605 - optional argument comment of function +eq_null_undefined_boolean is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1686, characters 0-216 - optional argument comment of function +is_null_undefined is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1680, characters 0-58 - optional argument comment of function +is_null is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1656, characters 0-596 - optional argument comment of function +of_block is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1649, characters 0-160 - optional argument comment of function +bigint_mod is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1645, characters 0-159 - optional argument comment of function +bigint_div is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1618, characters 0-992 - optional argument comment of function +bigint_comp is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1602, characters 0-384 - optional argument comment of function +int32_band is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1592, characters 0-445 - optional argument comment of function +int32_bxor is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1586, characters 0-251 - optional argument comment of function +int32_pow is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1581, characters 0-179 - optional argument comment of function +int_bnot is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1565, characters 0-702 - optional argument comment of function +int32_mul is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1548, characters 0-316 - optional argument comment of function +int32_lsl is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1538, characters 0-316 - optional argument comment of function +int32_mod is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1527, characters 0-482 - optional argument comment of function +int32_div is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1523, characters 0-94 - optional argument comment of function +int32_asr is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1517, characters 0-87 - optional argument comment of function +int32_minus is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1512, characters 0-66 - optional argument comment of function +int32_add is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1403, characters 0-89 - optional argument comment of function +js_comp is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1376, characters 0-901 - optional argument comment of function +bool_comp is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1336, characters 0-94 - optional argument comment of function +obj_length is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1331, characters 0-91 - optional argument comment of function +is_type_number is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1316, characters 0-97 - optional argument comment of function +to_int32 is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1282, characters 0-106 - optional argument comment of function +tag is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1218, characters 0-27 - optional argument comment of function +int_equal is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1093, characters 0-516 - optional argument comment of function +or_ is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1073, characters 0-751 - optional argument comment of function +and_ is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 150, characters 0-93 - optional argument comment of function +str is never used + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1298, characters 0-726 + optional argument comment of function +int32_bor is never used Warning Unused Argument File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typetexp.mli", line 102, characters 0-91 @@ -2315,4 +2139,4 @@ <-- line 99 type f = May_pos | May_neg | May_weak [@dead "Variance.f.May_weak"] | Inj | Pos | Neg | Inv - Analysis reported 481 issues (Warning Dead Module:4, Warning Dead Type:84, Warning Dead Value:112, Warning Dead Value With Side Effects:2, Warning Redundant Optional Argument:195, Warning Unused Argument:84) + Analysis reported 437 issues (Warning Dead Module:4, Warning Dead Type:84, Warning Dead Value:112, Warning Dead Value With Side Effects:2, Warning Redundant Optional Argument:195, Warning Unused Argument:40) diff --git a/compiler/core/js_exp_make.ml b/compiler/core/js_exp_make.ml index 3feac368adc..4f3be3865b9 100644 --- a/compiler/core/js_exp_make.ml +++ b/compiler/core/js_exp_make.ml @@ -147,8 +147,8 @@ let pure_runtime_call module_name fn_name args = (runtime_var_dot module_name fn_name) args -let str ?(delim = J.DNone) ?comment txt : t = - {expression_desc = Str {txt; delim}; comment} +let str ?(delim = J.DNone) txt : t = + {expression_desc = Str {txt; delim}; comment = None} let raw_js_code info s : t = { @@ -605,7 +605,7 @@ let bin ?comment (op : J.binop) (e0 : t) (e1 : t) : t = is not used: benefit is not clear | Int_of_boolean e10, Bin(And, {expression_desc = Int_of_boolean e20 }, e3) -> - and_ ?comment + and_ { e1 with expression_desc = J.Int_of_boolean { expression_desc = Bin (And, e10,e20); comment = None} @@ -1070,7 +1070,7 @@ let simplify_or (e1 : t) (e2 : t) : t option = if no_side_effect e1 && no_side_effect e2 then simplify_or_ ~n:0 e1 e2 else None -let and_ ?comment (e1 : t) (e2 : t) : t = +let and_ (e1 : t) (e2 : t) : t = match (e1.expression_desc, e2.expression_desc) with | Var i, Var j when Js_op_util.same_vident i j -> e1 | Var i, Bin (And, {expression_desc = Var j; _}, _) @@ -1088,9 +1088,9 @@ let and_ ?comment (e1 : t) (e2 : t) : t = | _, _ -> ( match simplify_and e1 e2 with | Some e -> e - | None -> {expression_desc = Bin (And, e1, e2); comment}) + | None -> {expression_desc = Bin (And, e1, e2); comment = None}) -let or_ ?comment (e1 : t) (e2 : t) = +let or_ (e1 : t) (e2 : t) = match (e1.expression_desc, e2.expression_desc) with | Var i, Var j when Js_op_util.same_vident i j -> e1 | Var i, Bin (Or, {expression_desc = Var j; _}, _) @@ -1102,7 +1102,7 @@ let or_ ?comment (e1 : t) (e2 : t) = | _, _ -> ( match simplify_or e1 e2 with | Some e -> e - | None -> {expression_desc = Bin (Or, e1, e2); comment}) + | None -> {expression_desc = Bin (Or, e1, e2); comment = None}) let in_ (prop : t) (obj : t) : t = {expression_desc = In (prop, obj); comment = None} @@ -1215,7 +1215,7 @@ let rec float_equal ?comment (e0 : t) (e1 : t) : t = | Number (Float {f = f0; _}), Number (Float {f = f1}) when f0 = f1 -> true_ | _ -> {expression_desc = Bin (EqEqEq, e0, e1); comment} -let int_equal = float_equal +let int_equal e0 e1 = float_equal e0 e1 let tag_type = function | Ast_untagged_variants.String s -> str s ~delim:DStarJ @@ -1279,8 +1279,8 @@ let is_int_tag ?has_null_undefined_other e = call plain [dot] *) -let tag ?comment ?(name = Js_dump_lit.tag) e : t = - {expression_desc = Caml_block_tag (e, name); comment} +let tag ?(name = Js_dump_lit.tag) e : t = + {expression_desc = Caml_block_tag (e, name); comment = None} (* according to the compiler, [Btype.hash_variant], it's reduced to 31 bits for hash @@ -1313,8 +1313,8 @@ let rec int32_bor ?comment (e1 : J.expression) (e2 : J.expression) : int32_bor e1 e2 | _ -> {comment; expression_desc = Bin (Bor, e1, e2)} -let to_int32 ?comment (e : J.expression) : J.expression = - int32_bor ?comment e zero_int_literal +let to_int32 (e : J.expression) : J.expression = + int32_bor e zero_int_literal (* TODO: if we already know the input is int32, [x|0] can be reduced into [x] *) let string_comp (cmp : Lam_compat.comparison) ?comment (e0 : t) (e1 : t) = @@ -1328,13 +1328,12 @@ let string_comp (cmp : Lam_compat.comparison) ?comment (e0 : t) (e1 : t) = let string_equal ?comment (e0 : t) (e1 : t) : t = string_comp Ceq ?comment e0 e1 -let is_type_number ?comment (e : t) : t = - string_equal ?comment (typeof e) (str "number") +let is_type_number (e : t) : t = string_equal (typeof e) (str "number") let is_type_object (e : t) : t = string_equal (typeof e) (str "object") -let obj_length ?comment e : t = - to_int32 {expression_desc = Length (e, Caml_block); comment} +let obj_length e : t = + to_int32 {expression_desc = Length (e, Caml_block); comment = None} let compare_int_aux (cmp : Lam_compat.comparison) (l : int) r = match cmp with @@ -1373,7 +1372,7 @@ let rec int_comp (cmp : Lam_compat.comparison) ?comment (e0 : t) (e1 : t) = true_ | _ -> bin ?comment (Lam_compile_util.jsop_of_comp cmp) e0 e1 -let bool_comp (cmp : Lam_compat.comparison) ?comment (e0 : t) (e1 : t) = +let bool_comp (cmp : Lam_compat.comparison) (e0 : t) (e1 : t) = match (e0, e1) with | {expression_desc = Bool l}, {expression_desc = Bool r} -> bool @@ -1390,18 +1389,17 @@ let bool_comp (cmp : Lam_compat.comparison) ?comment (e0 : t) (e1 : t) = | Clt -> seq rest false_ | Cge -> seq rest true_ | Cle | Cgt | Ceq | Cneq -> - bin ?comment (Lam_compile_util.jsop_of_comp cmp) e0 e1) + bin (Lam_compile_util.jsop_of_comp cmp) e0 e1) | rest, {expression_desc = Bool true} | {expression_desc = Bool false}, rest -> ( match cmp with | Cle -> seq rest true_ | Cgt -> seq rest false_ | Clt | Cge | Ceq | Cneq -> - bin ?comment (Lam_compile_util.jsop_of_comp cmp) e0 e1) - | _, _ -> bin ?comment (Lam_compile_util.jsop_of_comp cmp) e0 e1 + bin (Lam_compile_util.jsop_of_comp cmp) e0 e1) + | _, _ -> bin (Lam_compile_util.jsop_of_comp cmp) e0 e1 -let js_comp cmp ?comment e0 e1 = - bin ?comment (Lam_compile_util.jsop_of_comp cmp) e0 e1 +let js_comp cmp e0 e1 = bin (Lam_compile_util.jsop_of_comp cmp) e0 e1 let rec int32_lsr ?comment (e1 : J.expression) (e2 : J.expression) : J.expression = @@ -1509,48 +1507,47 @@ and float_minus ?comment (e1 : t) (e2 : t) : t = | _ -> {comment; expression_desc = Bin (Minus, e1, e2)} (* bin ?comment Minus e1 e2 *) -let int32_add ?comment e1 e2 = to_int32 (float_add ?comment e1 e2) +let int32_add e1 e2 = to_int32 (float_add e1 e2) let offset e1 (offset : int) = if offset = 0 then e1 else int32_add e1 (small_int offset) -let int32_minus ?comment e1 e2 : J.expression = - to_int32 (float_minus ?comment e1 e2) +let int32_minus e1 e2 : J.expression = to_int32 (float_minus e1 e2) let float_div ?comment e1 e2 = bin ?comment Div e1 e2 let float_pow ?comment e1 e2 = bin ?comment Pow e1 e2 -let int32_asr ?comment e1 e2 : J.expression = - {comment; expression_desc = Bin (Asr, e1, e2)} +let int32_asr e1 e2 : J.expression = + {comment = None; expression_desc = Bin (Asr, e1, e2)} (** Division by zero is undefined behavior*) -let int32_div ~checked ?comment (e1 : t) (e2 : t) : t = +let int32_div ~checked (e1 : t) (e2 : t) : t = match (e1.expression_desc, e2.expression_desc) with | Length _, Number (Int {i = 2l}) -> int32_asr e1 one_int_literal | e1_desc, Number (Int {i = i1}) when i1 <> 0l -> ( match e1_desc with | Number (Int {i = i0}) -> int (Int32.div i0 i1) - | _ -> to_int32 (float_div ?comment e1 e2)) + | _ -> to_int32 (float_div e1 e2)) | _, _ -> if checked then runtime_call Primitive_modules.int "div" [e1; e2] - else to_int32 (float_div ?comment e1 e2) + else to_int32 (float_div e1 e2) -let int32_mod ~checked ?comment e1 (e2 : t) : J.expression = +let int32_mod ~checked e1 (e2 : t) : J.expression = match e2.expression_desc with | Number (Int {i}) when i <> 0l -> - {comment; expression_desc = Bin (Mod, e1, e2)} + {comment = None; expression_desc = Bin (Mod, e1, e2)} | _ -> if checked then runtime_call Primitive_modules.int "mod_" [e1; e2] - else {comment; expression_desc = Bin (Mod, e1, e2)} + else {comment = None; expression_desc = Bin (Mod, e1, e2)} let float_mul ?comment e1 e2 = bin ?comment Mul e1 e2 -let int32_lsl ?comment (e1 : J.expression) (e2 : J.expression) : J.expression = +let int32_lsl (e1 : J.expression) (e2 : J.expression) : J.expression = match (e1, e2) with | ( {expression_desc = Number (Int {i = i0})}, {expression_desc = Number (Int {i = i1})} ) -> - int ?comment (Int32.shift_left i0 (Int32.to_int i1)) - | _ -> {comment; expression_desc = Bin (Lsl, e1, e2)} + int (Int32.shift_left i0 (Int32.to_int i1)) + | _ -> {comment = None; expression_desc = Bin (Lsl, e1, e2)} let is_pos_pow n = let exception E in @@ -1562,7 +1559,7 @@ let is_pos_pow n = in try aux 0 n with E -> -1 -let int32_mul ?comment (e1 : J.expression) (e2 : J.expression) : J.expression = +let int32_mul (e1 : J.expression) (e2 : J.expression) : J.expression = match (e1, e2) with | {expression_desc = Number (Int {i = 0l}); _}, x when no_side_effect x -> zero_int_literal @@ -1575,32 +1572,31 @@ let int32_mul ?comment (e1 : J.expression) (e2 : J.expression) : J.expression = | {expression_desc = Number (Int {i = i0}); _}, e -> let i = is_pos_pow i0 in if i >= 0 then int32_lsl e (small_int i) - else to_int32 (float_mul ?comment e1 e2) - | _ -> to_int32 (float_mul ?comment e1 e2) + else to_int32 (float_mul e1 e2) + | _ -> to_int32 (float_mul e1 e2) -let int_bnot ?comment (e : t) : J.expression = +let int_bnot (e : t) : J.expression = match e.expression_desc with - | Number (Int {i}) -> int ?comment (Int32.lognot i) - | _ -> {comment; expression_desc = Js_bnot e} + | Number (Int {i}) -> int (Int32.lognot i) + | _ -> {comment = None; expression_desc = Js_bnot e} -let int32_pow ?comment (e1 : t) (e2 : t) : J.expression = +let int32_pow (e1 : t) (e2 : t) : J.expression = match (e1.expression_desc, e2.expression_desc) with | Number (Int {i = i1}), Number (Int {i = i2}) -> - int ?comment (Ext_int.int32_pow i1 i2) - | _ -> to_int32 (float_pow ?comment e1 e2) + int (Ext_int.int32_pow i1 i2) + | _ -> to_int32 (float_pow e1 e2) -let rec int32_bxor ?comment (e1 : t) (e2 : t) : J.expression = +let rec int32_bxor (e1 : t) (e2 : t) : J.expression = match (e1.expression_desc, e2.expression_desc) with | Number (Int {i = i1}), Number (Int {i = i2}) -> - int ?comment (Int32.logxor i1 i2) + int (Int32.logxor i1 i2) | _, Bin (Lsr, e2, {expression_desc = Number (Int {i = 0l}); _}) -> int32_bxor e1 e2 | Bin (Lsr, e1, {expression_desc = Number (Int {i = 0l}); _}), _ -> int32_bxor e1 e2 - | _ -> {comment; expression_desc = Bin (Bxor, e1, e2)} + | _ -> {comment = None; expression_desc = Bin (Bxor, e1, e2)} -let rec int32_band ?comment (e1 : J.expression) (e2 : J.expression) : - J.expression = +let rec int32_band (e1 : J.expression) (e2 : J.expression) : J.expression = match e1.expression_desc with | Bin (Bor, a, {expression_desc = Number (Int {i = 0l})}) -> (* Note that in JS @@ -1608,14 +1604,14 @@ let rec int32_band ?comment (e1 : J.expression) (e2 : J.expression) : {[ (-1 >>> 0 | 0 ) & 0xffffff ]} *) int32_band a e2 - | _ -> {comment; expression_desc = Bin (Band, e1, e2)} + | _ -> {comment = None; expression_desc = Bin (Band, e1, e2)} (* let int32_bin ?comment op e1 e2 : J.expression = *) (* {expression_desc = Int32_bin(op,e1, e2); comment} *) let bigint_op ?comment op (e1 : t) (e2 : t) = bin ?comment op e1 e2 -let bigint_comp (cmp : Lam_compat.comparison) ?comment (e0 : t) (e1 : t) = +let bigint_comp (cmp : Lam_compat.comparison) (e0 : t) (e1 : t) = let normalize s = let len = String.length s in let buf = Buffer.create len in @@ -1640,25 +1636,25 @@ let bigint_comp (cmp : Lam_compat.comparison) ?comment (e0 : t) (e1 : t) = Number (BigInt {positive = p1; value = v1}), Number (BigInt {positive = p2; value = v2}) ) -> not (bool (p1 = p2 && String.equal (normalize v1) (normalize v2))) - | _ -> bin ?comment (Lam_compile_util.jsop_of_comp cmp) e0 e1 + | _ -> bin (Lam_compile_util.jsop_of_comp cmp) e0 e1 -let bigint_div ~checked ?comment (e0 : t) (e1 : t) = +let bigint_div ~checked (e0 : t) (e1 : t) = if checked then runtime_call Primitive_modules.bigint "div" [e0; e1] - else bigint_op ?comment Div e0 e1 + else bigint_op Div e0 e1 -let bigint_mod ~checked ?comment (e0 : t) (e1 : t) = +let bigint_mod ~checked (e0 : t) (e1 : t) = if checked then runtime_call Primitive_modules.bigint "mod_" [e0; e1] - else bigint_op ?comment Mod e0 e1 + else bigint_op Mod e0 e1 (* TODO -- alpha conversion remember to add parens.. *) -let of_block ?comment ?e block : t = +let of_block ?e block : t = let return_unit = false in (* This case is not hit that much*) call ~info:Js_call_info.ml_full_call { - comment; + comment = None; expression_desc = Fun { @@ -1668,7 +1664,8 @@ let of_block ?comment ?e block : t = (match e with | None -> block | Some e -> - Ext_list.append block [{J.statement_desc = Return e; comment}]); + Ext_list.append block + [{J.statement_desc = Return e; comment = None}]); env = Js_fun_env.make 0; return_unit; async = false; @@ -1677,19 +1674,19 @@ let of_block ?comment ?e block : t = } [] -let is_null ?comment (x : t) = triple_equal ?comment x nil +let is_null (x : t) = triple_equal x nil let is_null_undefined_constant (x : t) = match x.expression_desc with | Null | Undefined _ -> true | _ -> false -let is_null_undefined ?comment (x : t) : t = +let is_null_undefined (x : t) : t = match x.expression_desc with | Null | Undefined _ -> true_ | Number _ | Array _ | Caml_block _ -> false_ - | _ -> {comment; expression_desc = Is_null_or_undefined x} + | _ -> {comment = None; expression_desc = Is_null_or_undefined x} -let eq_null_undefined_boolean ?comment (a : t) (b : t) = +let eq_null_undefined_boolean (a : t) (b : t) = (* [a == b] when either a or b is null or undefined *) match (a.expression_desc, b.expression_desc) with | ( (Null | Undefined _), @@ -1702,9 +1699,9 @@ let eq_null_undefined_boolean ?comment (a : t) (b : t) = false_ | Null, Undefined _ | Undefined _, Null -> false_ | Null, Null | Undefined _, Undefined _ -> true_ - | _ -> {expression_desc = Bin (EqEqEq, a, b); comment} + | _ -> {expression_desc = Bin (EqEqEq, a, b); comment = None} -let neq_null_undefined_boolean ?comment (a : t) (b : t) = +let neq_null_undefined_boolean (a : t) (b : t) = (* [a != b] when either a or b is null or undefined *) match (a.expression_desc, b.expression_desc) with | ( (Null | Undefined _), @@ -1717,7 +1714,7 @@ let neq_null_undefined_boolean ?comment (a : t) (b : t) = true_ | Null, Null | Undefined _, Undefined _ -> false_ | Null, Undefined _ | Undefined _, Null -> true_ - | _ -> {expression_desc = Bin (NotEqEq, a, b); comment} + | _ -> {expression_desc = Bin (NotEqEq, a, b); comment = None} let make_exception (s : string) = pure_runtime_call Primitive_modules.exceptions Literals.create [str s] diff --git a/compiler/core/js_exp_make.mli b/compiler/core/js_exp_make.mli index 18476baefbc..145066efbfb 100644 --- a/compiler/core/js_exp_make.mli +++ b/compiler/core/js_exp_make.mli @@ -80,7 +80,7 @@ val runtime_call : (* args *) t -val str : ?delim:J.delim -> ?comment:string -> string -> t +val str : ?delim:J.delim -> string -> t val ocaml_fun : ?immutable_mask:bool array -> @@ -177,17 +177,17 @@ val emit_check : t Ast_untagged_variants.Dynamic_checks.t -> t val triple_equal : ?comment:string -> t -> t -> t (* TODO: reduce [triple_equal] use *) -val int_equal : ?comment:string -> t -> t -> t +val int_equal : t -> t -> t -val int_bnot : ?comment:string -> t -> t +val int_bnot : t -> t val string_equal : ?comment:string -> t -> t -> t -val eq_null_undefined_boolean : ?comment:string -> t -> t -> t +val eq_null_undefined_boolean : t -> t -> t -val neq_null_undefined_boolean : ?comment:string -> t -> t -> t +val neq_null_undefined_boolean : t -> t -> t -val is_type_number : ?comment:string -> t -> t +val is_type_number : t -> t val is_int_tag : ?has_null_undefined_other:bool * bool * bool -> t -> t @@ -202,31 +202,31 @@ val is_type_object : t -> t val typeof : t -> t val is_array : t -> t -val to_int32 : ?comment:string -> t -> t +val to_int32 : t -> t -val int32_add : ?comment:string -> t -> t -> t +val int32_add : t -> t -> t val offset : t -> int -> t -val int32_minus : ?comment:string -> t -> t -> t +val int32_minus : t -> t -> t -val int32_mul : ?comment:string -> t -> t -> t +val int32_mul : t -> t -> t -val int32_div : checked:bool -> ?comment:string -> t -> t -> t +val int32_div : checked:bool -> t -> t -> t -val int32_mod : checked:bool -> ?comment:string -> t -> t -> t +val int32_mod : checked:bool -> t -> t -> t -val int32_pow : ?comment:string -> t -> t -> t +val int32_pow : t -> t -> t -val int32_lsl : ?comment:string -> t -> t -> t +val int32_lsl : t -> t -> t val int32_lsr : ?comment:string -> t -> t -> t -val int32_asr : ?comment:string -> t -> t -> t +val int32_asr : t -> t -> t -val int32_bxor : ?comment:string -> t -> t -> t +val int32_bxor : t -> t -> t -val int32_band : ?comment:string -> t -> t -> t +val int32_band : t -> t -> t val int32_bor : ?comment:string -> t -> t -> t @@ -244,19 +244,19 @@ val float_pow : ?comment:string -> t -> t -> t val int_comp : Lam_compat.comparison -> ?comment:string -> t -> t -> t -val bool_comp : Lam_compat.comparison -> ?comment:string -> t -> t -> t +val bool_comp : Lam_compat.comparison -> t -> t -> t val string_comp : Lam_compat.comparison -> ?comment:string -> t -> t -> t val bigint_op : ?comment:string -> Js_op.binop -> t -> t -> t -val bigint_comp : Lam_compat.comparison -> ?comment:string -> t -> t -> t +val bigint_comp : Lam_compat.comparison -> t -> t -> t -val bigint_div : checked:bool -> ?comment:string -> t -> t -> t +val bigint_div : checked:bool -> t -> t -> t -val bigint_mod : checked:bool -> ?comment:string -> t -> t -> t +val bigint_mod : checked:bool -> t -> t -> t -val js_comp : Lam_compat.comparison -> ?comment:string -> t -> t -> t +val js_comp : Lam_compat.comparison -> t -> t -> t val not : t -> t @@ -298,18 +298,18 @@ val unit : t val undefined : t -val tag : ?comment:string -> ?name:string -> J.expression -> t +val tag : ?name:string -> J.expression -> t (** Note that this is coupled with how we encode block, if we use the `Object.defineProperty(..)` since the array already hold the length, this should be a nop *) -val obj_length : ?comment:string -> J.expression -> t +val obj_length : J.expression -> t -val and_ : ?comment:string -> t -> t -> t +val and_ : t -> t -> t -val or_ : ?comment:string -> t -> t -> t +val or_ : t -> t -> t val in_ : t -> t -> t @@ -318,18 +318,18 @@ val in_ : t -> t -> t val dummy_obj : Lam_tag_info.t -> t (** used combined with [caml_update_dummy]*) -val of_block : ?comment:string -> ?e:J.expression -> J.statement list -> t +val of_block : ?e:J.expression -> J.statement list -> t (** convert a block to expresion by using IIFE *) val raw_js_code : Js_raw_info.code_info -> string -> t val nil : t -val is_null : ?comment:string -> t -> t +val is_null : t -> t val is_null_undefined_constant : J.expression -> bool -val is_null_undefined : ?comment:string -> t -> t +val is_null_undefined : t -> t val make_exception : string -> t From 233c4c83f080f399513a1718eb0d2a0f86e1063c Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 16:26:51 +0000 Subject: [PATCH 194/214] dce: trim js arithmetic optionals --- _dce/report.txt | 58 +---------------------------------- compiler/core/js_exp_make.ml | 39 ++++++++++++----------- compiler/core/js_exp_make.mli | 18 +++++------ 3 files changed, 29 insertions(+), 86 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index 5344dbc6da7..06be2b75bb4 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -795,62 +795,6 @@ File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typecore.ml", line 967, characters 2-55 optional argument from_type of function Label.+unbound_name_error is never used - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 251, characters 0-61 - optional argument comment of function +bigint_op is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 243, characters 0-46 - optional argument comment of function +float_pow is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 239, characters 0-46 - optional argument comment of function +float_div is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 237, characters 0-46 - optional argument comment of function +float_mul is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 233, characters 0-46 - optional argument comment of function +float_add is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 231, characters 0-46 - optional argument comment of function +int32_bor is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.mli", line 184, characters 0-49 - optional argument comment of function +string_equal is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1612, characters 0-67 - optional argument comment of function +bigint_op is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1543, characters 0-53 - optional argument comment of function +float_mul is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1518, characters 0-53 - optional argument comment of function +float_pow is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1517, characters 0-53 - optional argument comment of function +float_div is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1474, characters 0-1244 - optional argument comment of function +float_add is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1329, characters 0-80 - optional argument comment of function +string_equal is never used - - Warning Unused Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/js_exp_make.ml", line 1298, characters 0-726 - optional argument comment of function +int32_bor is never used - Warning Unused Argument File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typetexp.mli", line 102, characters 0-91 optional argument from_type of function +unbound_label_error is never used @@ -2139,4 +2083,4 @@ <-- line 99 type f = May_pos | May_neg | May_weak [@dead "Variance.f.May_weak"] | Inj | Pos | Neg | Inv - Analysis reported 437 issues (Warning Dead Module:4, Warning Dead Type:84, Warning Dead Value:112, Warning Dead Value With Side Effects:2, Warning Redundant Optional Argument:195, Warning Unused Argument:40) + Analysis reported 423 issues (Warning Dead Module:4, Warning Dead Type:84, Warning Dead Value:112, Warning Dead Value With Side Effects:2, Warning Redundant Optional Argument:195, Warning Unused Argument:26) diff --git a/compiler/core/js_exp_make.ml b/compiler/core/js_exp_make.ml index 4f3be3865b9..a0c7615c79c 100644 --- a/compiler/core/js_exp_make.ml +++ b/compiler/core/js_exp_make.ml @@ -1295,11 +1295,10 @@ let tag ?(name = Js_dump_lit.tag) e : t = *) (* Note that [lsr] or [bor] are js semantics *) -let rec int32_bor ?comment (e1 : J.expression) (e2 : J.expression) : - J.expression = +let rec int32_bor (e1 : J.expression) (e2 : J.expression) : J.expression = match (e1.expression_desc, e2.expression_desc) with | Number (Int {i = i1}), Number (Int {i = i2}) -> - int ?comment (Int32.logor i1 i2) + int (Int32.logor i1 i2) | _, Bin (Lsr, e2, {expression_desc = Number (Int {i = 0l}); _}) -> int32_bor e1 e2 | Bin (Lsr, e1, {expression_desc = Number (Int {i = 0l}); _}), _ -> @@ -1311,22 +1310,22 @@ let rec int32_bor ?comment (e1 : J.expression) (e2 : J.expression) : | ( Bin (Bor, e1, {expression_desc = Number (Int {i = 0l}); _}), Number (Int {i = 0l}) ) -> int32_bor e1 e2 - | _ -> {comment; expression_desc = Bin (Bor, e1, e2)} + | _ -> {comment = None; expression_desc = Bin (Bor, e1, e2)} let to_int32 (e : J.expression) : J.expression = int32_bor e zero_int_literal (* TODO: if we already know the input is int32, [x|0] can be reduced into [x] *) -let string_comp (cmp : Lam_compat.comparison) ?comment (e0 : t) (e1 : t) = +let string_comp (cmp : Lam_compat.comparison) (e0 : t) (e1 : t) = match (e0.expression_desc, e1.expression_desc) with | Str {txt = a0; delim = d0}, Str {txt = a1; delim = d1} -> ( match (cmp, str_equal a0 d0 a1 d1) with | Ceq, Some b -> bool b | Cneq, Some b -> bool (b = false) - | _ -> bin ?comment (Lam_compile_util.jsop_of_comp cmp) e0 e1) - | _ -> bin ?comment (Lam_compile_util.jsop_of_comp cmp) e0 e1 + | _ -> bin (Lam_compile_util.jsop_of_comp cmp) e0 e1) + | _ -> bin (Lam_compile_util.jsop_of_comp cmp) e0 e1 -let string_equal ?comment (e0 : t) (e1 : t) : t = string_comp Ceq ?comment e0 e1 +let string_equal (e0 : t) (e1 : t) : t = string_comp Ceq e0 e1 let is_type_number (e : t) : t = string_equal (typeof e) (str "number") @@ -1471,15 +1470,15 @@ let rec is_out ?comment (e : t) (range : t) : t = is_out ?comment e range | _, _ -> int_comp ?comment Cgt e range -let rec float_add ?comment (e1 : t) (e2 : t) = +let rec float_add (e1 : t) (e2 : t) = match (e1.expression_desc, e2.expression_desc) with - | Number (Int {i; _}), Number (Int {i = j; _}) -> int ?comment (Int32.add i j) + | Number (Int {i; _}), Number (Int {i = j; _}) -> int (Int32.add i j) | _, Number (Int {i = j; c}) when j < 0l -> - float_minus ?comment e1 + float_minus e1 {e2 with expression_desc = Number (Int {i = Int32.neg j; c})} | ( Bin (Plus, a1, {expression_desc = Number (Int {i = k; _})}), Number (Int {i = j; _}) ) -> - {comment; expression_desc = Bin (Plus, a1, int (Int32.add k j))} + {comment = None; expression_desc = Bin (Plus, a1, int (Int32.add k j))} (* bin ?comment Plus a1 (int (k + j)) *) (* TODO remove commented code ?? *) (* | Bin(Plus, a0 , ({expression_desc = Number (Int a1)} )), *) @@ -1497,14 +1496,14 @@ let rec float_add ?comment (e1 : t) (e2 : t) = (* | Number _, _ *) (* -> *) (* bin ?comment Plus e2 e1 *) - | _ -> {comment; expression_desc = Bin (Plus, e1, e2)} + | _ -> {comment = None; expression_desc = Bin (Plus, e1, e2)} (* bin ?comment Plus e1 e2 *) (* associative is error prone due to overflow *) -and float_minus ?comment (e1 : t) (e2 : t) : t = +and float_minus (e1 : t) (e2 : t) : t = match (e1.expression_desc, e2.expression_desc) with - | Number (Int {i; _}), Number (Int {i = j; _}) -> int ?comment (Int32.sub i j) - | _ -> {comment; expression_desc = Bin (Minus, e1, e2)} + | Number (Int {i; _}), Number (Int {i = j; _}) -> int (Int32.sub i j) + | _ -> {comment = None; expression_desc = Bin (Minus, e1, e2)} (* bin ?comment Minus e1 e2 *) let int32_add e1 e2 = to_int32 (float_add e1 e2) @@ -1514,8 +1513,8 @@ let offset e1 (offset : int) = let int32_minus e1 e2 : J.expression = to_int32 (float_minus e1 e2) -let float_div ?comment e1 e2 = bin ?comment Div e1 e2 -let float_pow ?comment e1 e2 = bin ?comment Pow e1 e2 +let float_div e1 e2 = bin Div e1 e2 +let float_pow e1 e2 = bin Pow e1 e2 let int32_asr e1 e2 : J.expression = {comment = None; expression_desc = Bin (Asr, e1, e2)} @@ -1540,7 +1539,7 @@ let int32_mod ~checked e1 (e2 : t) : J.expression = if checked then runtime_call Primitive_modules.int "mod_" [e1; e2] else {comment = None; expression_desc = Bin (Mod, e1, e2)} -let float_mul ?comment e1 e2 = bin ?comment Mul e1 e2 +let float_mul e1 e2 = bin Mul e1 e2 let int32_lsl (e1 : J.expression) (e2 : J.expression) : J.expression = match (e1, e2) with @@ -1609,7 +1608,7 @@ let rec int32_band (e1 : J.expression) (e2 : J.expression) : J.expression = (* let int32_bin ?comment op e1 e2 : J.expression = *) (* {expression_desc = Int32_bin(op,e1, e2); comment} *) -let bigint_op ?comment op (e1 : t) (e2 : t) = bin ?comment op e1 e2 +let bigint_op op (e1 : t) (e2 : t) = bin op e1 e2 let bigint_comp (cmp : Lam_compat.comparison) (e0 : t) (e1 : t) = let normalize s = diff --git a/compiler/core/js_exp_make.mli b/compiler/core/js_exp_make.mli index 145066efbfb..f5925ee6b98 100644 --- a/compiler/core/js_exp_make.mli +++ b/compiler/core/js_exp_make.mli @@ -181,7 +181,7 @@ val int_equal : t -> t -> t val int_bnot : t -> t -val string_equal : ?comment:string -> t -> t -> t +val string_equal : t -> t -> t val eq_null_undefined_boolean : t -> t -> t @@ -228,27 +228,27 @@ val int32_bxor : t -> t -> t val int32_band : t -> t -> t -val int32_bor : ?comment:string -> t -> t -> t +val int32_bor : t -> t -> t -val float_add : ?comment:string -> t -> t -> t +val float_add : t -> t -> t -val float_minus : ?comment:string -> t -> t -> t +val float_minus : t -> t -> t -val float_mul : ?comment:string -> t -> t -> t +val float_mul : t -> t -> t -val float_div : ?comment:string -> t -> t -> t +val float_div : t -> t -> t val float_mod : t -> t -> t -val float_pow : ?comment:string -> t -> t -> t +val float_pow : t -> t -> t val int_comp : Lam_compat.comparison -> ?comment:string -> t -> t -> t val bool_comp : Lam_compat.comparison -> t -> t -> t -val string_comp : Lam_compat.comparison -> ?comment:string -> t -> t -> t +val string_comp : Lam_compat.comparison -> t -> t -> t -val bigint_op : ?comment:string -> Js_op.binop -> t -> t -> t +val bigint_op : Js_op.binop -> t -> t -> t val bigint_comp : Lam_compat.comparison -> t -> t -> t From 551753ca9ad2f355e9b765318a276b3b69768c7d Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 16:27:44 +0000 Subject: [PATCH 195/214] dce: note untagged switch liveness --- scripts/dce/live-findings.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/scripts/dce/live-findings.md b/scripts/dce/live-findings.md index 65e976d2ba6..2915904de22 100644 --- a/scripts/dce/live-findings.md +++ b/scripts/dce/live-findings.md @@ -452,6 +452,22 @@ live after manual validation. `block_is_object` were removed. The remaining warnings are a cross-module pipeline edge from ML variant analysis into JS lowering. +### Untagged switch defaults and declarations + +- Report: `Warning Unused Argument`, `compiler/core/lam_compile.ml`, optional + arguments `default` and `declaration` on the local `switch` helper inside + `compile_untagged_cases`. +- Verdict: live; false positive. +- Validation: `compile_general_cases` calls its switch callback as + `switch ?default ?declaration switch_exp body`. The untagged-variant callback + partitions `instanceof` clauses away from `typeof` clauses, then forwards + `?default` and `?declaration` to `S.string_switch (E.typeof e)` from its + `typeof_switch` closure. The `default` body is also read directly when the + helper inserts null/array guards before the typeof switch. +- Context: reanalyze appears to lose the optional-label flow through the local + callback and nested closure. Removing these labels would drop default handling + or declaration threading for generated untagged-variant switch code. + ### GenType map/set helpers - Report: `Warning Dead Module` / `Warning Dead Value`, From 69efd3c1a935c20cbf2cb3f95755c8c5076ab299 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 16:28:47 +0000 Subject: [PATCH 196/214] dce: note namespace helpers --- scripts/dce/live-findings.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/scripts/dce/live-findings.md b/scripts/dce/live-findings.md index 2915904de22..d6e632cfa80 100644 --- a/scripts/dce/live-findings.md +++ b/scripts/dce/live-findings.md @@ -565,6 +565,20 @@ live after manual validation. caller. Dead pretty-printer scope/debug helpers and extra `Ext_ref` protect variants were removed. +### `Ext_namespace` package-name helpers + +- Report: `Warning Dead Value`, `compiler/ext/ext_namespace.ml` / `.mli`, for + `is_valid_npm_package_name` and `namespace_of_package_name`. +- Verdict: intentionally retained unit-test-covered utility surface for now. +- Validation: grep finds only OUnit callers in + `tests/ounit_tests/ounit_string_tests.ml` and documentation references in + `ext_namespace_encode.mli`; there are no production callers in the current + compiler pipeline. +- Context: these helpers validate and encode npm package names for namespace + derivation. Since unit tests are excluded from DCE roots and this pass is + avoiding unit-test edits, they are documented rather than removed in this + batch. + ### `Ext_pervasives` unit-test number parsers - Report: `Warning Dead Value`, `compiler/ext/ext_pervasives.ml` / `.mli`, for From 87ab438fccd643635960c413d8a7676e261f7534 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 16:30:23 +0000 Subject: [PATCH 197/214] dce: remove unused ext sys helper --- _dce/report.txt | 8 +------- compiler/ext/ext_basic_hash_stubs.c | 31 ----------------------------- compiler/ext/ext_sys.cppo.ml | 10 ---------- compiler/ext/ext_sys.mli | 2 -- 4 files changed, 1 insertion(+), 50 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index 06be2b75bb4..fa6df669b61 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -1261,12 +1261,6 @@ <-- line 53 val parse_nat_of_string : string -> int ref -> int [@@dead "+parse_nat_of_string"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_sys.mli", line 25, characters 0-40 - +is_directory_no_exn is never used - <-- line 25 - val is_directory_no_exn : string -> bool [@@dead "+is_directory_no_exn"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_set_poly.mli", line 29, characters 0-24 +clear is never used @@ -2083,4 +2077,4 @@ <-- line 99 type f = May_pos | May_neg | May_weak [@dead "Variance.f.May_weak"] | Inj | Pos | Neg | Inv - Analysis reported 423 issues (Warning Dead Module:4, Warning Dead Type:84, Warning Dead Value:112, Warning Dead Value With Side Effects:2, Warning Redundant Optional Argument:195, Warning Unused Argument:26) + Analysis reported 422 issues (Warning Dead Module:4, Warning Dead Type:84, Warning Dead Value:111, Warning Dead Value With Side Effects:2, Warning Redundant Optional Argument:195, Warning Unused Argument:26) diff --git a/compiler/ext/ext_basic_hash_stubs.c b/compiler/ext/ext_basic_hash_stubs.c index 4937997fecd..80f1f58d7e1 100644 --- a/compiler/ext/ext_basic_hash_stubs.c +++ b/compiler/ext/ext_basic_hash_stubs.c @@ -179,38 +179,7 @@ CAMLprim value caml_stale_file(value path) } #endif - -CAMLprim value caml_sys_is_directory_no_exn(value name) -{ - CAMLparam1(name); -#ifdef _WIN32 - struct _stati64 st; -#else - struct stat st; -#endif - char_os * p; - int ret; - - - if(!caml_string_is_c_safe(name)){ - CAMLreturn(Val_false); - } - - p = caml_stat_strdup_to_os(String_val(name)); - caml_enter_blocking_section(); - ret = stat_os(p, &st); - caml_leave_blocking_section(); - caml_stat_free(p); - - if (ret == -1) CAMLreturn(Val_false); -#ifdef S_ISDIR - CAMLreturn(Val_bool(S_ISDIR(st.st_mode))); -#else - CAMLreturn(Val_bool(st.st_mode & S_IFDIR)); -#endif -} /* local variables: */ /* compile-command: "ocamlopt.opt -c ext_basic_hash_stubs.c" */ /* end: */ - diff --git a/compiler/ext/ext_sys.cppo.ml b/compiler/ext/ext_sys.cppo.ml index 917d397550e..021a93fc6a5 100644 --- a/compiler/ext/ext_sys.cppo.ml +++ b/compiler/ext/ext_sys.cppo.ml @@ -22,15 +22,5 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *) -(** TODO: not exported yet, wait for Windows Fix*) -#ifdef BROWSER -let is_directory_no_exn f = - try Sys.is_directory f with _ -> false -#else -external is_directory_no_exn : string -> bool = "caml_sys_is_directory_no_exn" -#endif - - let is_windows_or_cygwin = Sys.win32 || Sys.cygwin - diff --git a/compiler/ext/ext_sys.mli b/compiler/ext/ext_sys.mli index f884380ae84..9959f6a34cd 100644 --- a/compiler/ext/ext_sys.mli +++ b/compiler/ext/ext_sys.mli @@ -22,6 +22,4 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *) -val is_directory_no_exn : string -> bool - val is_windows_or_cygwin : bool From dd8833eeb4d0bf7a9e5e63cc0966e7ab03c25ee6 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 16:30:53 +0000 Subject: [PATCH 198/214] dce: note location hooks --- scripts/dce/live-findings.md | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/scripts/dce/live-findings.md b/scripts/dce/live-findings.md index d6e632cfa80..6abb28287d8 100644 --- a/scripts/dce/live-findings.md +++ b/scripts/dce/live-findings.md @@ -149,19 +149,24 @@ live after manual validation. callback is consumed by `Set.Make`, and removing the reset hook would let experimental feature flags leak between playground compilations. -### `Location.report_error ?custom_intro ?src` +### `Location` diagnostic hooks - Report: `Warning Redundant Optional Argument`, `compiler/ml/location.ml` and `compiler/ml/location.mli`, optional arguments `custom_intro` and `src` on - `report_error`. + `report_error`; and `Warning Dead Value`, `compiler/ml/location.mli`, for + warning-printer hook exports such as `warning_printer`, + `formatter_for_warnings`, and `default_warning_printer`. - Verdict: live; false positive. - Validation: `compiler/syntax/src/res_diagnostics.ml` calls `Location.report_error ~custom_intro ~src:(Some src)` when rendering syntax diagnostics, and `compiler/jsoo/jsoo_playground_main.ml` uses the default wrapper form. The local exception reporter also passes explicit `None` values. + The playground entry point installs a custom `formatter_for_warnings` and + `warning_printer`, and calls `default_warning_printer` from its custom hook. - Context: these labels select syntax-error intro text and source rendering for - diagnostics. Reanalyze only counts the local wrapper call, so it misses the - cross-module diagnostic call that supplies real values. + diagnostics. The warning hooks are public so the playground can intercept + compiler warnings. Reanalyze only counts the local wrapper call and misses the + jsoo cross-module diagnostic hooks. ### Reactive combinator internals From 8c8294f3687b5327b53b250ff3e7b6567b962820 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 16:32:11 +0000 Subject: [PATCH 199/214] dce: remove js file kind record --- _dce/report.txt | 14 +------------- compiler/ext/ext_js_file_kind.ml | 2 -- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index fa6df669b61..699308dbf8e 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -1195,18 +1195,6 @@ <-- line 38 val make_unused : unit -> Ident.t [@@dead "+make_unused"] - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_js_file_kind.ml", line 26, characters 10-21 - t.case is a record label never used to read a value - <-- line 26 - type t = {case: case; [@dead "t.case"] suffix: string} [@@warning "-69"] - - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_js_file_kind.ml", line 26, characters 22-36 - t.suffix is a record label never used to read a value - <-- line 26 - type t = {case: case; [@dead "t.case"] suffix: string [@dead "t.suffix"] } [@@warning "-69"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_namespace.ml", line 59, characters 0-352 +is_valid_npm_package_name is never used @@ -2077,4 +2065,4 @@ <-- line 99 type f = May_pos | May_neg | May_weak [@dead "Variance.f.May_weak"] | Inj | Pos | Neg | Inv - Analysis reported 422 issues (Warning Dead Module:4, Warning Dead Type:84, Warning Dead Value:111, Warning Dead Value With Side Effects:2, Warning Redundant Optional Argument:195, Warning Unused Argument:26) + Analysis reported 420 issues (Warning Dead Module:4, Warning Dead Type:82, Warning Dead Value:111, Warning Dead Value With Side Effects:2, Warning Redundant Optional Argument:195, Warning Unused Argument:26) diff --git a/compiler/ext/ext_js_file_kind.ml b/compiler/ext/ext_js_file_kind.ml index 2efce680a8c..225047474c7 100644 --- a/compiler/ext/ext_js_file_kind.ml +++ b/compiler/ext/ext_js_file_kind.ml @@ -22,5 +22,3 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *) type case = Upper | Little - -type t = {case: case; suffix: string} [@@warning "-69"] From a24fe296844386c75baddc2e22b64aeb793f2906 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 16:33:47 +0000 Subject: [PATCH 200/214] dce: remove lam function helper --- _dce/report.txt | 8 +------- compiler/core/lam_util.cppo.ml | 4 ---- compiler/core/lam_util.mli | 2 -- 3 files changed, 1 insertion(+), 13 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index 699308dbf8e..cdde3964234 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -1177,12 +1177,6 @@ <-- line 31 val lambda_to_string : Lam.t -> string [@@dead "+lambda_to_string"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_util.mli", line 62, characters 0-31 - +is_function is never used - <-- line 62 - val is_function : Lam.t -> bool [@@dead "+is_function"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ext_ident.ml", line 166, characters 0-31 +make_unused is never used @@ -2065,4 +2059,4 @@ <-- line 99 type f = May_pos | May_neg | May_weak [@dead "Variance.f.May_weak"] | Inj | Pos | Neg | Inv - Analysis reported 420 issues (Warning Dead Module:4, Warning Dead Type:82, Warning Dead Value:111, Warning Dead Value With Side Effects:2, Warning Redundant Optional Argument:195, Warning Unused Argument:26) + Analysis reported 419 issues (Warning Dead Module:4, Warning Dead Type:82, Warning Dead Value:110, Warning Dead Value With Side Effects:2, Warning Redundant Optional Argument:195, Warning Unused Argument:26) diff --git a/compiler/core/lam_util.cppo.ml b/compiler/core/lam_util.cppo.ml index 9d7334930c9..cdd045aca4c 100644 --- a/compiler/core/lam_util.cppo.ml +++ b/compiler/core/lam_util.cppo.ml @@ -255,10 +255,6 @@ let dump ext lam = -let is_function (lam : Lam.t) = - match lam with - | Lfunction _ -> true | _ -> false - let not_function (lam : Lam.t) = match lam with | Lfunction _ -> false | _ -> true diff --git a/compiler/core/lam_util.mli b/compiler/core/lam_util.mli index 25e257665b5..6c6f6a0429b 100644 --- a/compiler/core/lam_util.mli +++ b/compiler/core/lam_util.mli @@ -58,5 +58,3 @@ val dump : string -> Lam.t -> unit (** [dump] when {!Js_config.is_same_file}*) val not_function : Lam.t -> bool - -val is_function : Lam.t -> bool From df879b41baed245ead8d4663e0826aeb317b07f8 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 16:35:27 +0000 Subject: [PATCH 201/214] dce: remove unused debugger literal --- _dce/report.txt | 8 +------- compiler/ext/literals.ml | 2 -- scripts/dce/live-findings.md | 13 ++++++------- 3 files changed, 7 insertions(+), 16 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index cdde3964234..51a2b26ff08 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -1313,12 +1313,6 @@ <-- line 98 module Make (T : Thing) : S with type t := T.t [@@dead "Make.Tbl.+map"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/literals.ml", line 45, characters 0-25 - +debugger is never used - <-- line 45 - let debugger = "debugger" [@@dead "+debugger"] - Warning Dead Type File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.ml", line 72, characters 2-9 t.Empty is a variant case which is never constructed @@ -2059,4 +2053,4 @@ <-- line 99 type f = May_pos | May_neg | May_weak [@dead "Variance.f.May_weak"] | Inj | Pos | Neg | Inv - Analysis reported 419 issues (Warning Dead Module:4, Warning Dead Type:82, Warning Dead Value:110, Warning Dead Value With Side Effects:2, Warning Redundant Optional Argument:195, Warning Unused Argument:26) + Analysis reported 418 issues (Warning Dead Module:4, Warning Dead Type:82, Warning Dead Value:109, Warning Dead Value With Side Effects:2, Warning Redundant Optional Argument:195, Warning Unused Argument:26) diff --git a/compiler/ext/literals.ml b/compiler/ext/literals.ml index c7008e8772b..6e5ada10725 100644 --- a/compiler/ext/literals.ml +++ b/compiler/ext/literals.ml @@ -42,8 +42,6 @@ let setter_suffix = "#=" let setter_suffix_len = String.length setter_suffix -let debugger = "debugger" - let suffix_cmj = ".cmj" let suffix_cmi = ".cmi" diff --git a/scripts/dce/live-findings.md b/scripts/dce/live-findings.md index 6abb28287d8..739608b1566 100644 --- a/scripts/dce/live-findings.md +++ b/scripts/dce/live-findings.md @@ -377,15 +377,14 @@ live after manual validation. - Report: remaining `Warning Dead Value` entries in `compiler/ext/literals.ml`, including `js_type_*`, `param`, `partial_arg`, - `tmp`, `create`, `setter_suffix_len`, `debugger`, node path constants, and - `pure`. + `tmp`, `create`, `setter_suffix_len`, node path constants, and `pure`. - Verdict: live; false positive for the remaining reported constants. - Validation: `compiler/core/js_exp_make.ml` imports - `module L = Literals` and reads the `js_type_*` constants; `js_dump.ml` - imports the same alias for `debugger`. `Lam_eta_conversion` uses `param` and - `partial_arg`, `Ext_ident.create_tmp` uses `tmp`, `Js_exp_make` uses `create` - and `pure`, `Lam_convert` uses `setter_suffix_len`, and `Ext_path` uses - `node_sep`, `node_parent`, and `node_current`. + `module L = Literals` and reads the `js_type_*` constants. + `Lam_eta_conversion` uses `param` and `partial_arg`, + `Ext_ident.create_tmp` uses `tmp`, `Js_exp_make` uses `create` and `pure`, + `Lam_convert` uses `setter_suffix_len`, and `Ext_path` uses `node_sep`, + `node_parent`, and `node_current`. - Context: unused constants with no `Literals.*` or alias callers were removed. The survivors are cross-module or alias-qualified uses that DCE reports as unrooted. From c8ae11efa3654acb820051a5c9be863d6b77b421 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 16:37:11 +0000 Subject: [PATCH 202/214] dce: remove unused dynamic check helper --- _dce/report.txt | 8 +------- compiler/ml/ast_untagged_variants.ml | 1 - 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index 51a2b26ff08..a4172df4624 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -1765,12 +1765,6 @@ <-- line 188 val get_cookie : string -> Parsetree.expression option [@@dead "+get_cookie"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/ast_untagged_variants.ml", line 541, characters 2-34 - Dynamic_checks.+str is never used - <-- line 541 - let str s = String s |> tag_type [@@dead "Dynamic_checks.+str"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/cmt_format.mli", line 73, characters 0-67 +read is never used @@ -2053,4 +2047,4 @@ <-- line 99 type f = May_pos | May_neg | May_weak [@dead "Variance.f.May_weak"] | Inj | Pos | Neg | Inv - Analysis reported 418 issues (Warning Dead Module:4, Warning Dead Type:82, Warning Dead Value:109, Warning Dead Value With Side Effects:2, Warning Redundant Optional Argument:195, Warning Unused Argument:26) + Analysis reported 417 issues (Warning Dead Module:4, Warning Dead Type:82, Warning Dead Value:108, Warning Dead Value With Side Effects:2, Warning Redundant Optional Argument:195, Warning Unused Argument:26) diff --git a/compiler/ml/ast_untagged_variants.ml b/compiler/ml/ast_untagged_variants.ml index 5709c6a17d7..c847bc5e6db 100644 --- a/compiler/ml/ast_untagged_variants.ml +++ b/compiler/ml/ast_untagged_variants.ml @@ -538,7 +538,6 @@ module Dynamic_checks = struct let bin op x y = BinOp (op, x, y) let tag_type t = TagType t let typeof x = TypeOf x - let str s = String s |> tag_type let is_instance i x = IsInstanceOf (i, x) let not x = Not x let nil = Null |> tag_type From 9cc6b61ca1f477ba0b594f2977942da9db29f478 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 16:39:17 +0000 Subject: [PATCH 203/214] dce: remove unused misc output helper --- _dce/report.txt | 26 +++++++------------------- compiler/ext/misc.ml | 30 ------------------------------ compiler/ext/misc.mli | 9 --------- scripts/dce/live-findings.md | 15 +++++++-------- 4 files changed, 14 insertions(+), 66 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index a4172df4624..ef18455f8d5 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -1385,36 +1385,24 @@ <-- line 53 val concat_or_join : ('a, 'b) t -> 'a -> 'b option -> ('a, 'b) t -> ('a, 'b) t [@@dead "+concat_or_join"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 117, characters 0-1080 - +output_to_file_via_temporary is never used - <-- line 117 - raise exn [@@dead "+output_to_file_via_temporary"] - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 343, characters 17-21 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 313, characters 17-21 Color.setting.Auto is a variant case which is never constructed - <-- line 343 + <-- line 313 type setting = Auto [@dead "Color.setting.Auto"] | Always | Never Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 343, characters 22-30 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 313, characters 22-30 Color.setting.Always is a variant case which is never constructed - <-- line 343 + <-- line 313 type setting = Auto [@dead "Color.setting.Auto"] | Always [@dead "Color.setting.Always"] | Never Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 343, characters 31-38 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 313, characters 31-38 Color.setting.Never is a variant case which is never constructed - <-- line 343 + <-- line 313 type setting = Auto [@dead "Color.setting.Auto"] | Always [@dead "Color.setting.Always"] | Never [@dead "Color.setting.Never"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.mli", line 61, characters 0-106 - +output_to_file_via_temporary is never used - <-- line 61 - ?mode:open_flag list -> string -> (string -> out_channel -> 'a) -> 'a [@@dead "+output_to_file_via_temporary"] - Warning Dead Type File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.ml", line 48, characters 2-9 t.Empty is a variant case which is never constructed @@ -2047,4 +2035,4 @@ <-- line 99 type f = May_pos | May_neg | May_weak [@dead "Variance.f.May_weak"] | Inj | Pos | Neg | Inv - Analysis reported 417 issues (Warning Dead Module:4, Warning Dead Type:82, Warning Dead Value:108, Warning Dead Value With Side Effects:2, Warning Redundant Optional Argument:195, Warning Unused Argument:26) + Analysis reported 415 issues (Warning Dead Module:4, Warning Dead Type:82, Warning Dead Value:106, Warning Dead Value With Side Effects:2, Warning Redundant Optional Argument:195, Warning Unused Argument:26) diff --git a/compiler/ext/misc.ml b/compiler/ext/misc.ml index a2e99486f93..e9ed2fe68aa 100644 --- a/compiler/ext/misc.ml +++ b/compiler/ext/misc.ml @@ -114,36 +114,6 @@ let output_to_bin_file_directly filename fn = close_out oc; raise e -let output_to_file_via_temporary ?(mode = [Open_text]) filename fn = - let temp_filename, oc = - Filename.open_temp_file ~mode ~perms:0o666 - ~temp_dir:(Filename.dirname filename) - (Filename.basename filename) - ".tmp" - in - (* The 0o666 permissions will be modified by the umask. It's just - like what [open_out] and [open_out_bin] do. - With temp_dir = dirname filename, we ensure that the returned - temp file is in the same directory as filename itself, making - it safe to rename temp_filename to filename later. - With prefix = basename filename, we are almost certain that - the first generated name will be unique. A fixed prefix - would work too but might generate more collisions if many - files are being produced simultaneously in the same directory. *) - match fn temp_filename oc with - | res -> ( - close_out oc; - try - Sys.rename temp_filename filename; - res - with exn -> - remove_file temp_filename; - raise exn) - | exception exn -> - close_out oc; - remove_file temp_filename; - raise exn - module Int_literal_converter = struct (* To convert integer literals, allowing max_int + 1 (PR#4210) *) let cvt_int_aux str neg of_string = diff --git a/compiler/ext/misc.mli b/compiler/ext/misc.mli index 9f4425b8244..f890e42cc76 100644 --- a/compiler/ext/misc.mli +++ b/compiler/ext/misc.mli @@ -58,15 +58,6 @@ val create_hashtable : ('a * 'b) array -> ('a, 'b) Hashtbl.t val output_to_bin_file_directly : string -> (string -> out_channel -> 'a) -> 'a -val output_to_file_via_temporary : - ?mode:open_flag list -> string -> (string -> out_channel -> 'a) -> 'a -(* Produce output in temporary file, then rename it - (as atomically as possible) to the desired output file name. - [output_to_file_via_temporary filename fn] opens a temporary file - which is passed to [fn] (name + output channel). When [fn] returns, - the channel is closed and the temporary file is renamed to - [filename]. *) - module Int_literal_converter : sig val int : string -> int end diff --git a/scripts/dce/live-findings.md b/scripts/dce/live-findings.md index 739608b1566..a9d868d24f9 100644 --- a/scripts/dce/live-findings.md +++ b/scripts/dce/live-findings.md @@ -359,16 +359,15 @@ live after manual validation. - Report: remaining `Warning Dead Value`, `Warning Dead Module`, and constructor warnings in `compiler/ext/misc.ml` / `.mli`, including - `output_to_bin_file_directly`, `output_to_file_via_temporary`, `String_map`, - `String_set`, and `Color.setting`. + `output_to_bin_file_directly`, `String_map`, `String_set`, and + `Color.setting`. - Verdict: live; false positive for the remaining reported entries. - Validation: `compiler/ml/cmt_format.cppo.ml` calls - `Misc.output_to_bin_file_directly`, and `compiler/ml/stypes.ml` calls - `Misc.output_to_file_via_temporary`. `Misc.String_map` is used by the - analysis package metadata and completion paths; `Misc.String_set` is used - through `open Misc` in `compiler/ml/printtyp.ml`. `Color.Auto`, `Always`, and - `Never` are constructed by `compiler/ml/clflags.ml`, while `Color.setup` is - used by `compiler/ml/location.ml` and `analysis/reanalyze/src/log_.ml`. + `Misc.output_to_bin_file_directly`. `Misc.String_map` is used by the analysis + package metadata and completion paths; `Misc.String_set` is used through + `open Misc` in `compiler/ml/printtyp.ml`. `Color.Auto`, `Always`, and `Never` + are constructed by `compiler/ml/clflags.ml`, while `Color.setup` is used by + `compiler/ml/location.ml` and `analysis/reanalyze/src/log_.ml`. - Context: the truly unused inherited helpers were removed. The survivors are `.cppo.ml`, open-module, functor-callback, or cross-module edges that the DCE report does not root correctly. From 5d9c3d3bed090cabe96191516f8579d09f059fe5 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 16:48:13 +0000 Subject: [PATCH 204/214] dce: remove identifiable helper --- _dce/report.txt | 36 +----- compiler/ext/ident.ml | 16 --- compiler/ext/ident.mli | 4 +- compiler/ext/identifiable.ml | 221 ---------------------------------- compiler/ext/identifiable.mli | 98 --------------- scripts/dce/README.md | 3 +- scripts/dce/live-findings.md | 21 ++-- 7 files changed, 14 insertions(+), 385 deletions(-) delete mode 100644 compiler/ext/identifiable.ml delete mode 100644 compiler/ext/identifiable.mli diff --git a/_dce/report.txt b/_dce/report.txt index ef18455f8d5..938ca3923b6 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -1279,40 +1279,6 @@ <-- line 45 val length : 'a t -> int [@@dead "+length"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ident.ml", line 50, characters 0-35 - +equal is never used - <-- line 50 - let equal i1 i2 = i1.name = i2.name [@@dead "+equal"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ident.ml", line 229, characters 0-26 - +original_equal is never used - <-- line 229 - let original_equal = equal [@@dead "+original_equal"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ident.ml", line 238, characters 0-26 - +equal is never used - <-- line 238 - let equal = original_equal [@@dead "+equal"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/ident.mli", line 32, characters 0-29 - +unique_name is never used - <-- line 32 - val unique_name : t -> string [@@dead "+unique_name"] - - Warning Dead Module - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/identifiable.mli", line 98, characters 26-46 - identifiable.Make.Tbl is a dead module as all its items are dead. - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/identifiable.mli", line 98, characters 26-46 - Make.Tbl.+map is never used - <-- line 98 - module Make (T : Thing) : S with type t := T.t [@@dead "Make.Tbl.+map"] - Warning Dead Type File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.ml", line 72, characters 2-9 t.Empty is a variant case which is never constructed @@ -2035,4 +2001,4 @@ <-- line 99 type f = May_pos | May_neg | May_weak [@dead "Variance.f.May_weak"] | Inj | Pos | Neg | Inv - Analysis reported 415 issues (Warning Dead Module:4, Warning Dead Type:82, Warning Dead Value:106, Warning Dead Value With Side Effects:2, Warning Redundant Optional Argument:195, Warning Unused Argument:26) + Analysis reported 409 issues (Warning Dead Module:3, Warning Dead Type:82, Warning Dead Value:101, Warning Dead Value With Side Effects:2, Warning Redundant Optional Argument:195, Warning Unused Argument:26) diff --git a/compiler/ext/ident.ml b/compiler/ext/ident.ml index a5ca80e840f..91c193af48d 100644 --- a/compiler/ext/ident.ml +++ b/compiler/ext/ident.ml @@ -41,8 +41,6 @@ let rename i = let name i = i.name -let unique_name i = i.name ^ "_" ^ string_of_int i.stamp - let unique_toplevel_name i = i.name ^ "/" ^ string_of_int i.stamp let persistent i = i.stamp = 0 @@ -222,17 +220,3 @@ let compare x y = else let c = compare x.name y.name in if c <> 0 then c else compare x.flags y.flags - -let output oc id = output_string oc (unique_name id) -let hash i = Char.code i.name.[0] lxor i.stamp - -let original_equal = equal -include Identifiable.Make (struct - type nonrec t = t - let compare = compare - let output = output - let print = print - let hash = hash - let equal = same -end) -let equal = original_equal diff --git a/compiler/ext/ident.mli b/compiler/ext/ident.mli index d73cff6f6eb..269e2bd30b6 100644 --- a/compiler/ext/ident.mli +++ b/compiler/ext/ident.mli @@ -17,7 +17,8 @@ type t = {stamp: int; name: string; mutable flags: int} -include Identifiable.S with type t := t +val print : Format.formatter -> t -> unit +val equal : t -> t -> bool (* Notes: - [equal] compares identifiers by name - [compare x y] is 0 if [same x y] is true. @@ -29,7 +30,6 @@ val create_persistent : string -> t val create_predef_exn : string -> t val rename : t -> t val name : t -> string -val unique_name : t -> string val unique_toplevel_name : t -> string val persistent : t -> bool val same : t -> t -> bool diff --git a/compiler/ext/identifiable.ml b/compiler/ext/identifiable.ml deleted file mode 100644 index 91cb451ef31..00000000000 --- a/compiler/ext/identifiable.ml +++ /dev/null @@ -1,221 +0,0 @@ -(**************************************************************************) -(* *) -(* OCaml *) -(* *) -(* Pierre Chambart, OCamlPro *) -(* Mark Shinwell and Leo White, Jane Street Europe *) -(* *) -(* Copyright 2013--2016 OCamlPro SAS *) -(* Copyright 2014--2016 Jane Street Group LLC *) -(* *) -(* All rights reserved. This file is distributed under the terms of *) -(* the GNU Lesser General Public License version 2.1, with the *) -(* special exception on linking described in the file LICENSE. *) -(* *) -(**************************************************************************) - -module type Thing = sig - type t - - include Hashtbl.HashedType with type t := t - include Map.OrderedType with type t := t - - val output : out_channel -> t -> unit - val print : Format.formatter -> t -> unit -end - -module type Set = sig - module T : Set.OrderedType - include Set.S with type elt = T.t and type t = Set.Make(T).t - - val output : out_channel -> t -> unit - val print : Format.formatter -> t -> unit - val to_string : t -> string - val of_list : elt list -> t - val map : (elt -> elt) -> t -> t -end - -module type Map = sig - module T : Map.OrderedType - include Map.S with type key = T.t and type 'a t = 'a Map.Make(T).t - - val filter_map : (key -> 'a -> 'b option) -> 'a t -> 'b t - val of_list : (key * 'a) list -> 'a t - - val disjoint_union : - 'a t -> - 'a t -> - 'a t - - val union_right : 'a t -> 'a t -> 'a t - - val union_left : 'a t -> 'a t -> 'a t - - val union_merge : ('a -> 'a -> 'a) -> 'a t -> 'a t -> 'a t - val rename : key t -> key -> key - val map_keys : (key -> key) -> 'a t -> 'a t - val keys : 'a t -> Set.Make(T).t - val data : 'a t -> 'a list - val of_set : (key -> 'a) -> Set.Make(T).t -> 'a t - val transpose_keys_and_data : key t -> key t - val transpose_keys_and_data_set : key t -> Set.Make(T).t t - val print : - (Format.formatter -> 'a -> unit) -> Format.formatter -> 'a t -> unit -end - -module type Tbl = sig - module T : sig - type t - include Map.OrderedType with type t := t - include Hashtbl.HashedType with type t := t - end - include Hashtbl.S with type key = T.t and type 'a t = 'a Hashtbl.Make(T).t - - val to_list : 'a t -> (T.t * 'a) list - val of_list : (T.t * 'a) list -> 'a t - - val to_map : 'a t -> 'a Map.Make(T).t - val of_map : 'a Map.Make(T).t -> 'a t - val memoize : 'a t -> (key -> 'a) -> key -> 'a - val map : 'a t -> ('a -> 'b) -> 'b t -end - -module Make_map (T : Thing) = struct - include Map.Make (T) - - let filter_map f t = - fold - (fun id v map -> - match f id v with - | None -> map - | Some r -> add id r map) - t empty - - let of_list l = List.fold_left (fun map (id, v) -> add id v map) empty l - - let disjoint_union m1 m2 = - union - (fun id _ _ -> - Misc.fatal_error (Format.asprintf "Map.disjoint_union %a" T.print id)) - m1 m2 - - let union_right m1 m2 = - merge - (fun _id x y -> - match (x, y) with - | None, None -> None - | None, Some v | Some v, None | Some _, Some v -> Some v) - m1 m2 - - let union_left m1 m2 = union_right m2 m1 - - let union_merge f m1 m2 = - let aux _ m1 m2 = - match (m1, m2) with - | None, m | m, None -> m - | Some m1, Some m2 -> Some (f m1 m2) - in - merge aux m1 m2 - - let rename m v = try find v m with Not_found -> v - - let map_keys f m = of_list (List.map (fun (k, v) -> (f k, v)) (bindings m)) - - let print f ppf s = - let elts ppf s = - iter (fun id v -> Format.fprintf ppf "@ (@[%a@ %a@])" T.print id f v) s - in - Format.fprintf ppf "@[<1>{@[%a@ @]}@]" elts s - - module T_set = Set.Make (T) - - let keys map = fold (fun k _ set -> T_set.add k set) map T_set.empty - - let data t = List.map snd (bindings t) - - let of_set f set = T_set.fold (fun e map -> add e (f e) map) set empty - - let transpose_keys_and_data map = fold (fun k v m -> add v k m) map empty - let transpose_keys_and_data_set map = - fold - (fun k v m -> - let set = - match find v m with - | exception Not_found -> T_set.singleton k - | set -> T_set.add k set - in - add v set m) - map empty -end - -module Make_set (T : Thing) = struct - include Set.Make (T) - - let output oc s = - Printf.fprintf oc " ( "; - iter (fun v -> Printf.fprintf oc "%a " T.output v) s; - Printf.fprintf oc ")" - - let print ppf s = - let elts ppf s = iter (fun e -> Format.fprintf ppf "@ %a" T.print e) s in - Format.fprintf ppf "@[<1>{@[%a@ @]}@]" elts s - - let to_string s = Format.asprintf "%a" print s - - let of_list l = - match l with - | [] -> empty - | [t] -> singleton t - | t :: q -> List.fold_left (fun acc e -> add e acc) (singleton t) q - - let map f s = of_list (List.map f (elements s)) -end - -module Make_tbl (T : Thing) = struct - include Hashtbl.Make (T) - - module T_map = Make_map (T) - - let to_list t = fold (fun key datum elts -> (key, datum) :: elts) t [] - - let of_list elts = - let t = create 42 in - List.iter (fun (key, datum) -> add t key datum) elts; - t - - let to_map v = fold T_map.add v T_map.empty - - let of_map m = - let t = create (T_map.cardinal m) in - T_map.iter (fun k v -> add t k v) m; - t - - let memoize t f key = - try find t key - with Not_found -> - let r = f key in - add t key r; - r - - let map t f = of_map (T_map.map f (to_map t)) -end - -module type S = sig - type t - - module T : Thing with type t = t - include Thing with type t := T.t - - module Set : Set with module T := T - module Map : Map with module T := T - module Tbl : Tbl with module T := T -end - -module Make (T : Thing) = struct - module T = T - include T - - module Set = Make_set (T) - module Map = Make_map (T) - module Tbl = Make_tbl (T) -end diff --git a/compiler/ext/identifiable.mli b/compiler/ext/identifiable.mli deleted file mode 100644 index 6310e4dcc2b..00000000000 --- a/compiler/ext/identifiable.mli +++ /dev/null @@ -1,98 +0,0 @@ -(**************************************************************************) -(* *) -(* OCaml *) -(* *) -(* Pierre Chambart, OCamlPro *) -(* Mark Shinwell and Leo White, Jane Street Europe *) -(* *) -(* Copyright 2013--2016 OCamlPro SAS *) -(* Copyright 2014--2016 Jane Street Group LLC *) -(* *) -(* All rights reserved. This file is distributed under the terms of *) -(* the GNU Lesser General Public License version 2.1, with the *) -(* special exception on linking described in the file LICENSE. *) -(* *) -(**************************************************************************) - -(** Uniform interface for common data structures over various things. *) - -module type Thing = sig - type t - - include Hashtbl.HashedType with type t := t - include Map.OrderedType with type t := t - - val output : out_channel -> t -> unit - val print : Format.formatter -> t -> unit -end - -module type Set = sig - module T : Set.OrderedType - include Set.S with type elt = T.t and type t = Set.Make(T).t - - val output : out_channel -> t -> unit - val print : Format.formatter -> t -> unit - val to_string : t -> string - val of_list : elt list -> t - val map : (elt -> elt) -> t -> t -end - -module type Map = sig - module T : Map.OrderedType - include Map.S with type key = T.t and type 'a t = 'a Map.Make(T).t - - val filter_map : (key -> 'a -> 'b option) -> 'a t -> 'b t - val of_list : (key * 'a) list -> 'a t - - val disjoint_union : 'a t -> 'a t -> 'a t - (** [disjoint_union m1 m2] contains all bindings from [m1] and - [m2]. If some binding is present in both, a Fatal_error is raised. *) - - val union_right : 'a t -> 'a t -> 'a t - (** [union_right m1 m2] contains all bindings from [m1] and [m2]. If - some binding is present in both, the one from [m2] is taken *) - - val union_left : 'a t -> 'a t -> 'a t - (** [union_left m1 m2 = union_right m2 m1] *) - - val union_merge : ('a -> 'a -> 'a) -> 'a t -> 'a t -> 'a t - val rename : key t -> key -> key - val map_keys : (key -> key) -> 'a t -> 'a t - val keys : 'a t -> Set.Make(T).t - val data : 'a t -> 'a list - val of_set : (key -> 'a) -> Set.Make(T).t -> 'a t - val transpose_keys_and_data : key t -> key t - val transpose_keys_and_data_set : key t -> Set.Make(T).t t - val print : - (Format.formatter -> 'a -> unit) -> Format.formatter -> 'a t -> unit -end - -module type Tbl = sig - module T : sig - type t - include Map.OrderedType with type t := t - include Hashtbl.HashedType with type t := t - end - include Hashtbl.S with type key = T.t and type 'a t = 'a Hashtbl.Make(T).t - - val to_list : 'a t -> (T.t * 'a) list - val of_list : (T.t * 'a) list -> 'a t - - val to_map : 'a t -> 'a Map.Make(T).t - val of_map : 'a Map.Make(T).t -> 'a t - val memoize : 'a t -> (key -> 'a) -> key -> 'a - val map : 'a t -> ('a -> 'b) -> 'b t -end - -module type S = sig - type t - - module T : Thing with type t = t - include Thing with type t := T.t - - module Set : Set with module T := T - module Map : Map with module T := T - module Tbl : Tbl with module T := T -end - -module Make (T : Thing) : S with type t := T.t diff --git a/scripts/dce/README.md b/scripts/dce/README.md index 7e59c2560a7..28065c9ff37 100644 --- a/scripts/dce/README.md +++ b/scripts/dce/README.md @@ -70,8 +70,7 @@ sensitive to the missing-roots problem and are the best first targets: e.g. `transl_apply`'s `~inlined`/`~transformed_jsx` (`compiler/ml/translcore.ml`), `Typ.poly`'s `~loc` (`compiler/ml/ast_helper`). Can be made mandatory. - **Unused Argument** — optional arg *never used* in the body, e.g. - `type_open_`'s `~used_slot` (`compiler/ml/typemod.ml`), - `disjoint_union`'s `~eq`/`~print` (`compiler/ext/identifiable.ml`). + `type_open_`'s `~used_slot` (`compiler/ml/typemod.ml`). ## Relationship to the manual "unreachable OCaml variant" survey diff --git a/scripts/dce/live-findings.md b/scripts/dce/live-findings.md index a9d868d24f9..f5468eb721a 100644 --- a/scripts/dce/live-findings.md +++ b/scripts/dce/live-findings.md @@ -606,20 +606,19 @@ live after manual validation. - Context: unused `Ext_obj` debug helpers (`dump_endline`, `pp_any`, `bt`) were removed. `Ext_scc.graph` remains production-live through `lam_scc.ml`. -### `Ident`, `Identifiable`, and SCC vector helpers +### `Ident` and SCC vector helpers - Report: `Warning Dead Value` / `Warning Dead Module`, - `compiler/ext/ident.ml` / `.mli`, `identifiable.ml` / `.mli`, - `int_vec_util.ml` / `.mli`, and `int_vec_vec.ml` / `.mli`. + `compiler/ext/ident.ml` / `.mli`, `int_vec_util.ml` / `.mli`, and + `int_vec_vec.ml` / `.mli`. - Verdict: live; false positive for the remaining reported identifiers. -- Validation: `Ident.unique_name` is used in module-inclusion diagnostics, - `Ident.is_predef_exn` is used by lambda conversion, `Ident.print` is used by - lambda and typed-tree printers, and `Ident.compare` / `equal` are used by path - comparison, type checking, maps, and hash tables. `Identifiable.Make` builds - the `Ident` set/map/table helpers. `Int_vec_util.mem` and `Int_vec_vec` are - used by `lam_scc.ml` and `ext_scc.ml`. -- Context: the unused `Identifiable.Pair` functor was removed. The remaining - warnings are cross-module/functor-signature edges missed by DCE. +- Validation: `Ident.is_predef_exn` is used by lambda conversion, + `Ident.print` is used by lambda and typed-tree printers, and + `Ident.compare` / `equal` are used by path comparison, type checking, maps, + and hash tables. `Int_vec_util.mem` and `Int_vec_vec` are used by + `lam_scc.ml` and `ext_scc.ml`. +- Context: the unused `Identifiable` helper module was removed. The remaining + warnings are cross-module edges missed by DCE. ### Runtime package, warnings, and hash collections From a14bf9f38b8356d4cc0684caee4b98bd3913c06e Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 16:52:36 +0000 Subject: [PATCH 205/214] dce: note ext pervasives tests --- scripts/dce/live-findings.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/scripts/dce/live-findings.md b/scripts/dce/live-findings.md index f5468eb721a..b56d29e0c05 100644 --- a/scripts/dce/live-findings.md +++ b/scripts/dce/live-findings.md @@ -588,9 +588,8 @@ live after manual validation. `nat_of_string_exn`, `parse_nat_of_string`, and their local helper. - Verdict: intentionally retained unit-test-covered utility surface for now. - Validation: the number parsers are exercised only by - `ounit_util_tests.ml`. Since unit tests are excluded from the DCE roots and - this pass is avoiding unit-test edits, they are documented rather than - removed in this batch. + `ounit_util_tests.ml`. Removing them breaks `dune build @check` while those + unit tests remain in the build, so they are documented rather than removed. - Context: `with_file_as_chan` from the same module is production-live through `.cppo.ml` callers. From cbc517954764bb9704b989041bc55d234a08f761 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 16:53:53 +0000 Subject: [PATCH 206/214] dce: trim hash set poly exports --- _dce/report.txt | 32 +++++++------------------------- compiler/ext/hash_set_poly.mli | 6 ------ scripts/dce/live-findings.md | 5 +++-- 3 files changed, 10 insertions(+), 33 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index 938ca3923b6..2ccaba710f5 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -1244,39 +1244,21 @@ val parse_nat_of_string : string -> int ref -> int [@@dead "+parse_nat_of_string"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_set_poly.mli", line 29, characters 0-24 - +clear is never used - <-- line 29 - val clear : 'a t -> unit [@@dead "+clear"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_set_poly.mli", line 31, characters 0-24 - +reset is never used - <-- line 31 - val reset : 'a t -> unit [@@dead "+reset"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_set_poly.mli", line 37, characters 0-31 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_set_poly.mli", line 33, characters 0-31 +remove is never used - <-- line 37 + <-- line 33 val remove : 'a t -> 'a -> unit [@@dead "+remove"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_set_poly.mli", line 41, characters 0-39 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_set_poly.mli", line 37, characters 0-39 +iter is never used - <-- line 41 + <-- line 37 val iter : 'a t -> ('a -> unit) -> unit [@@dead "+iter"] Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_set_poly.mli", line 43, characters 0-29 - +to_list is never used - <-- line 43 - val to_list : 'a t -> 'a list [@@dead "+to_list"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_set_poly.mli", line 45, characters 0-24 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/hash_set_poly.mli", line 39, characters 0-24 +length is never used - <-- line 45 + <-- line 39 val length : 'a t -> int [@@dead "+length"] Warning Dead Type @@ -2001,4 +1983,4 @@ <-- line 99 type f = May_pos | May_neg | May_weak [@dead "Variance.f.May_weak"] | Inj | Pos | Neg | Inv - Analysis reported 409 issues (Warning Dead Module:3, Warning Dead Type:82, Warning Dead Value:101, Warning Dead Value With Side Effects:2, Warning Redundant Optional Argument:195, Warning Unused Argument:26) + Analysis reported 406 issues (Warning Dead Module:3, Warning Dead Type:82, Warning Dead Value:98, Warning Dead Value With Side Effects:2, Warning Redundant Optional Argument:195, Warning Unused Argument:26) diff --git a/compiler/ext/hash_set_poly.mli b/compiler/ext/hash_set_poly.mli index 1539d3f7bf5..7bee1e76a20 100644 --- a/compiler/ext/hash_set_poly.mli +++ b/compiler/ext/hash_set_poly.mli @@ -26,10 +26,6 @@ type 'a t val create : int -> 'a t -val clear : 'a t -> unit - -val reset : 'a t -> unit - (* val copy : 'a t -> 'a t *) val add : 'a t -> 'a -> unit @@ -40,8 +36,6 @@ val mem : 'a t -> 'a -> bool val iter : 'a t -> ('a -> unit) -> unit -val to_list : 'a t -> 'a list - val length : 'a t -> int (* val stats: 'a t -> Hashtbl.statistics *) diff --git a/scripts/dce/live-findings.md b/scripts/dce/live-findings.md index b56d29e0c05..a669bfcfa3b 100644 --- a/scripts/dce/live-findings.md +++ b/scripts/dce/live-findings.md @@ -635,8 +635,9 @@ live after manual validation. `hash.cppo.ml` and `hash_set.cppo.ml`; `Hash_set_ident_mask` is used by `lam_scc.ml`; `Hash_set_poly` is used by `used_attributes.ml` and covered by unit tests for the extra collection operations. -- Context: unused `Warnings.Bad_module_name`, `mk_lazy`, and unused interface - exports were removed. +- Context: unused `Warnings.Bad_module_name`, `mk_lazy`, unused interface + exports, and unused `Hash_set_poly` exports (`clear`, `reset`, `to_list`) + were removed. ### `Ext_list` production helpers From ec30a419b787ced19e277b7fcb0568301f9a112f Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 16:54:58 +0000 Subject: [PATCH 207/214] dce: trim lam print export --- _dce/report.txt | 12 +++--------- compiler/core/lam_print.mli | 2 -- scripts/dce/live-findings.md | 5 +++-- 3 files changed, 6 insertions(+), 13 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index 2ccaba710f5..7e168a6ef35 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -1166,15 +1166,9 @@ +lambda_to_string is never used and could have side effects Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_print.mli", line 27, characters 0-59 - +primitive is never used - <-- line 27 - val primitive : Format.formatter -> Lam_primitive.t -> unit [@@dead "+primitive"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_print.mli", line 31, characters 0-38 + File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/core/lam_print.mli", line 29, characters 0-38 +lambda_to_string is never used - <-- line 31 + <-- line 29 val lambda_to_string : Lam.t -> string [@@dead "+lambda_to_string"] Warning Dead Value @@ -1983,4 +1977,4 @@ <-- line 99 type f = May_pos | May_neg | May_weak [@dead "Variance.f.May_weak"] | Inj | Pos | Neg | Inv - Analysis reported 406 issues (Warning Dead Module:3, Warning Dead Type:82, Warning Dead Value:98, Warning Dead Value With Side Effects:2, Warning Redundant Optional Argument:195, Warning Unused Argument:26) + Analysis reported 405 issues (Warning Dead Module:3, Warning Dead Type:82, Warning Dead Value:97, Warning Dead Value With Side Effects:2, Warning Redundant Optional Argument:195, Warning Unused Argument:26) diff --git a/compiler/core/lam_print.mli b/compiler/core/lam_print.mli index f8b6fda4975..d62dd6f6832 100644 --- a/compiler/core/lam_print.mli +++ b/compiler/core/lam_print.mli @@ -24,8 +24,6 @@ val lambda : Format.formatter -> Lam.t -> unit -val primitive : Format.formatter -> Lam_primitive.t -> unit - val serialize : string -> Lam.t -> unit val lambda_to_string : Lam.t -> string diff --git a/scripts/dce/live-findings.md b/scripts/dce/live-findings.md index a669bfcfa3b..9ff059a2c81 100644 --- a/scripts/dce/live-findings.md +++ b/scripts/dce/live-findings.md @@ -895,7 +895,7 @@ live after manual validation. ### `Lam_print` lambda printers - Report: `Warning Dead Value` entries in `compiler/core/lam_print.ml` / `.mli`, - including `lambda`, `primitive`, `serialize`, and `lambda_to_string`. + including `lambda`, `serialize`, and `lambda_to_string`. - Verdict: live false positives, except `primitive_to_string`, which had no callers and was removed. - Validation: `Lam_group.pp` calls `Lam_print.lambda`, @@ -906,7 +906,8 @@ live after manual validation. - Context: these are debug/inspection printers reached through cross-module and `.cppo.ml` paths that the DCE report does not root correctly. The playground call site is not covered by `dune build @check`, so this warning must stay - documented rather than removed. + documented rather than removed. The unused public `primitive` signature export + was removed; the implementation remains live through `lambda`. ### Lambda-to-JS compilation pipeline From 9dab4fa16dd153c126ebe2966de0ae53faffc203 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 16:56:03 +0000 Subject: [PATCH 208/214] dce: require parse error flag --- _dce/report.txt | 10 +--------- compiler/syntax/src/res_driver.ml | 4 ++-- compiler/syntax/src/res_driver.mli | 4 ++-- scripts/dce/live-findings.md | 15 --------------- 4 files changed, 5 insertions(+), 28 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index 7e168a6ef35..5cda9357c13 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -779,14 +779,6 @@ File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/type_utils.ml", line 179, characters 0-2146 optional argument type_arg_context of function +instantiate_type2 is never used - Warning Redundant Optional Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/syntax/src/res_driver.ml", line 192, characters 0-399 - optional argument ignore_parse_errors of function +parse_interface is always supplied (1 calls) - - Warning Redundant Optional Argument - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/syntax/src/res_driver.ml", line 181, characters 0-409 - optional argument ignore_parse_errors of function +parse_implementation is always supplied (1 calls) - Warning Unused Argument File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/typecore.ml", line 1145, characters 2-61 optional argument from_type of function Constructor.+unbound_name_error is never used @@ -1977,4 +1969,4 @@ <-- line 99 type f = May_pos | May_neg | May_weak [@dead "Variance.f.May_weak"] | Inj | Pos | Neg | Inv - Analysis reported 405 issues (Warning Dead Module:3, Warning Dead Type:82, Warning Dead Value:97, Warning Dead Value With Side Effects:2, Warning Redundant Optional Argument:195, Warning Unused Argument:26) + Analysis reported 403 issues (Warning Dead Module:3, Warning Dead Type:82, Warning Dead Value:97, Warning Dead Value With Side Effects:2, Warning Redundant Optional Argument:193, Warning Unused Argument:26) diff --git a/compiler/syntax/src/res_driver.ml b/compiler/syntax/src/res_driver.ml index b9d38dd9e69..20dd41956ed 100644 --- a/compiler/syntax/src/res_driver.ml +++ b/compiler/syntax/src/res_driver.ml @@ -178,7 +178,7 @@ let print_engine = print_string (Res_printer.print_interface ~width signature ~comments)); } -let parse_implementation ?(ignore_parse_errors = false) sourcefile = +let parse_implementation ~ignore_parse_errors sourcefile = Location.input_name := sourcefile; let parse_result = parsing_engine.parse_implementation ~for_printer:false ~filename:sourcefile @@ -189,7 +189,7 @@ let parse_implementation ?(ignore_parse_errors = false) sourcefile = parse_result.parsetree [@@raises exit] -let parse_interface ?(ignore_parse_errors = false) sourcefile = +let parse_interface ~ignore_parse_errors sourcefile = Location.input_name := sourcefile; let parse_result = parsing_engine.parse_interface ~for_printer:false ~filename:sourcefile diff --git a/compiler/syntax/src/res_driver.mli b/compiler/syntax/src/res_driver.mli index 1b24bef757e..acd67f26c3e 100644 --- a/compiler/syntax/src/res_driver.mli +++ b/compiler/syntax/src/res_driver.mli @@ -63,9 +63,9 @@ val print_engine : print_engine (* ReScript implementation parsing compatible with ocaml pparse driver. Used by the compiler. *) val parse_implementation : - ?ignore_parse_errors:bool -> string -> Parsetree.structure + ignore_parse_errors:bool -> string -> Parsetree.structure [@@live] [@@raises Location.Error] (* ReScript interface parsing compatible with ocaml pparse driver. Used by the compiler *) -val parse_interface : ?ignore_parse_errors:bool -> string -> Parsetree.signature +val parse_interface : ignore_parse_errors:bool -> string -> Parsetree.signature [@@live] [@@raises Location.Error] diff --git a/scripts/dce/live-findings.md b/scripts/dce/live-findings.md index 9ff059a2c81..d29f66104f1 100644 --- a/scripts/dce/live-findings.md +++ b/scripts/dce/live-findings.md @@ -68,21 +68,6 @@ live after manual validation. aliasing in the recursive type-extraction helpers. Removing these labels would break generic type instantiation and manifest traversal. -### `Res_driver.parse_* ?ignore_parse_errors` - -- Report: `Warning Redundant Optional Argument`, `compiler/syntax/src/res_driver.ml`, - optional argument `ignore_parse_errors` on `parse_implementation` and - `parse_interface`. -- Verdict: live parser option; do not remove as part of this DCE pass. -- Validation: `compiler/bsc/rescript_compiler_main.ml` passes - `~ignore_parse_errors:!Clflags.ignore_parse_errors` into both parser functions - so the `-ignore-parse-errors` CLI flag controls whether syntax diagnostics - exit compilation. The declarations in `res_driver.mli` are also marked - `[@@live]`. -- Context: the warning only says all known callers supply the option. The option - itself is behaviorally live and part of the syntax driver surface used by the - compiler entry point. - ### `from_type` in unbound name errors - Report: `Warning Unused Argument`, `compiler/ml/typecore.ml` and From 4746f43c58e1027da89a3475f897de8e7c0ef0b3 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 16:58:13 +0000 Subject: [PATCH 209/214] dce: remove analysis version state --- _dce/report.txt | 8 +------- analysis/src/cli.ml | 13 ------------- analysis/src/packages.ml | 23 ----------------------- analysis/src/shared_types.ml | 1 - scripts/dce/live-findings.md | 12 ------------ 5 files changed, 1 insertion(+), 56 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index 5cda9357c13..bf2f83d2754 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -875,12 +875,6 @@ File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/location.ml", line 253, characters 0-108 optional argument src of function +report_error is always supplied (1 calls) - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/analysis/src/shared_types.ml", line 523, characters 2-30 - package.rescript_version is a record label never used to read a value - <-- line 523 - rescript_version: int * int; [@dead "package.rescript_version"] - Warning Dead Module File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/common/bs_loc.ml", line 1, characters 0-0 +bs_loc is a dead module as all its items are dead. @@ -1969,4 +1963,4 @@ <-- line 99 type f = May_pos | May_neg | May_weak [@dead "Variance.f.May_weak"] | Inj | Pos | Neg | Inv - Analysis reported 403 issues (Warning Dead Module:3, Warning Dead Type:82, Warning Dead Value:97, Warning Dead Value With Side Effects:2, Warning Redundant Optional Argument:193, Warning Unused Argument:26) + Analysis reported 402 issues (Warning Dead Module:3, Warning Dead Type:81, Warning Dead Value:97, Warning Dead Value With Side Effects:2, Warning Redundant Optional Argument:193, Warning Unused Argument:26) diff --git a/analysis/src/cli.ml b/analysis/src/cli.ml index a30e36530a7..1fa75508d42 100644 --- a/analysis/src/cli.ml +++ b/analysis/src/cli.ml @@ -230,19 +230,6 @@ let test ~state ~path = | "dv-" -> Debug.debug_level := Off | "in+" -> Cfg.in_incremental_typechecking_mode := true | "in-" -> Cfg.in_incremental_typechecking_mode := false - | "ve+" -> ( - let version = String.sub rest 3 (String.length rest - 3) in - let version = String.trim version in - if Debug.verbose () then - Printf.printf "Setting version: %s\n" version; - match String.split_on_char '.' version with - | [major_raw; minor_raw] -> - let version = - (int_of_string major_raw, int_of_string minor_raw) - in - Packages.override_rescript_version := Some version - | _ -> ()) - | "ve-" -> Packages.override_rescript_version := None | "def" -> print_endline ("Definition " ^ path ^ " " ^ string_of_int line ^ ":" diff --git a/analysis/src/packages.ml b/analysis/src/packages.ml index 3c6d6d530d2..584b8e119c9 100644 --- a/analysis/src/packages.ml +++ b/analysis/src/packages.ml @@ -12,27 +12,6 @@ let make_paths_for_module ~project_files_and_paths ~dependencies_files_and_paths Hashtbl.replace paths_for_module mod_name paths); paths_for_module -let override_rescript_version = ref None - -let get_rescript_version () = - match !override_rescript_version with - | Some override_rescript_version -> override_rescript_version - | None -> ( - (* TODO: Include patch stuff when needed *) - let default_version = (11, 0) in - try - let value = Sys.getenv "RESCRIPT_VERSION" in - let version = - match value |> String.split_on_char '.' with - | major :: minor :: _rest -> ( - match (int_of_string_opt major, int_of_string_opt minor) with - | Some major, Some minor -> (major, minor) - | _ -> default_version) - | _ -> default_version - in - version - with Not_found -> default_version) - let new_bs_package ~root_path = let rescript_json = Filename.concat root_path "rescript.json" in @@ -45,7 +24,6 @@ let new_bs_package ~root_path = match Yojson_helpers.from_string_opt raw with | Some config -> ( let namespace = Find_files.get_namespace config in - let rescript_version = get_rescript_version () in let suffix = match config |> Yojson_helpers.get "suffix" with | Some (`String suffix) -> suffix @@ -175,7 +153,6 @@ let new_bs_package ~root_path = { generic_jsx_module; suffix; - rescript_version; root_path; project_files; dependencies_files; diff --git a/analysis/src/shared_types.ml b/analysis/src/shared_types.ml index eae298d726e..b4337792ee4 100644 --- a/analysis/src/shared_types.ml +++ b/analysis/src/shared_types.ml @@ -520,7 +520,6 @@ and package = { paths_for_module: (file, paths) Hashtbl.t; namespace: string option; opens: path list; - rescript_version: int * int; autocomplete: file list Misc.String_map.t; } diff --git a/scripts/dce/live-findings.md b/scripts/dce/live-findings.md index d29f66104f1..70932a4bb80 100644 --- a/scripts/dce/live-findings.md +++ b/scripts/dce/live-findings.md @@ -266,18 +266,6 @@ live after manual validation. analysis, environment consistency, variance checks, match compilation, or exhaustiveness analysis. -### `Shared_types.package.rescript_version` - -- Report: `Warning Dead Type`, `analysis/src/shared_types.ml`, - `package.rescript_version`. -- Verdict: live compatibility state; leave in place for now. -- Validation: `analysis/src/packages.ml` populates this from - `Packages.get_rescript_version`, which honors `RESCRIPT_VERSION` and the - analysis-test `// ^ve+` / `// ^ve-` commands parsed in `analysis/src/cli.ml`. -- Context: no current reader was found, but removing the field cascades into the - version override test-command surface. Keep this documented until the version - override path is intentionally retired or reconnected to feature gating. - ### Compiler-common cross-module hooks - Report: `Warning Dead Value` / `Warning Dead Module`, From 9d9b4b291ba60f178560a83e10b284e8b06ee978 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 17:00:07 +0000 Subject: [PATCH 210/214] dce: trim cmt format exports --- _dce/report.txt | 20 +------------------- compiler/ml/cmt_format.mli | 22 ---------------------- scripts/dce/live-findings.md | 3 ++- 3 files changed, 3 insertions(+), 42 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index bf2f83d2754..3c114a6197d 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -1681,24 +1681,6 @@ <-- line 188 val get_cookie : string -> Parsetree.expression option [@@dead "+get_cookie"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/cmt_format.mli", line 73, characters 0-67 - +read is never used - <-- line 73 - val read : string -> Cmi_format.cmi_infos option * cmt_infos option [@@dead "+read"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/cmt_format.mli", line 104, characters 0-44 - +read_magic_number is never used - <-- line 104 - val read_magic_number : in_channel -> string [@@dead "+read_magic_number"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/cmt_format.mli", line 115, characters 0-228 - +record_deprecated_used is never used - <-- line 115 - unit [@@dead "+record_deprecated_used"] - Warning Dead Type File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/cmt_utils.ml", line 5, characters 2-26 deprecated_used.deprecated_text is a record label never used to read a value @@ -1963,4 +1945,4 @@ <-- line 99 type f = May_pos | May_neg | May_weak [@dead "Variance.f.May_weak"] | Inj | Pos | Neg | Inv - Analysis reported 402 issues (Warning Dead Module:3, Warning Dead Type:81, Warning Dead Value:97, Warning Dead Value With Side Effects:2, Warning Redundant Optional Argument:193, Warning Unused Argument:26) + Analysis reported 399 issues (Warning Dead Module:3, Warning Dead Type:81, Warning Dead Value:94, Warning Dead Value With Side Effects:2, Warning Redundant Optional Argument:193, Warning Unused Argument:26) diff --git a/compiler/ml/cmt_format.mli b/compiler/ml/cmt_format.mli index 66589f088de..ded15fd0e17 100644 --- a/compiler/ml/cmt_format.mli +++ b/compiler/ml/cmt_format.mli @@ -70,16 +70,6 @@ type error = Not_a_typedtree of string exception Error of error -val read : string -> Cmi_format.cmi_infos option * cmt_infos option -(** [read filename] opens filename, and extract both the cmi_infos, if - it exists, and the cmt_infos, if it exists. Thus, it can be used - with .cmi, .cmt and .cmti files. - - .cmti files always contain a cmi_infos at the beginning. .cmt files - only contain a cmi_infos at the beginning if there is no associated - .cmti file. -*) - val read_cmt : string -> cmt_infos val read_cmi : string -> Cmi_format.cmi_infos @@ -99,10 +89,6 @@ val save_cmt : (** [save_cmt filename modname binary_annots sourcefile initial_env cmi] writes a cmt(i) file. *) -(* Miscellaneous functions *) - -val read_magic_number : in_channel -> string - val clear : unit -> unit val add_saved_type : binary_part -> unit @@ -112,14 +98,6 @@ val set_saved_types : binary_part list -> unit val record_value_dependency : Types.value_description -> Types.value_description -> unit -val record_deprecated_used : - ?deprecated_context:Cmt_utils.deprecated_used_context -> - ?migration_template:Parsetree.expression -> - ?migration_in_pipe_chain_template:Parsetree.expression -> - Location.t -> - string -> - unit - (* val is_magic_number : string -> bool diff --git a/scripts/dce/live-findings.md b/scripts/dce/live-findings.md index 70932a4bb80..83133a5dc12 100644 --- a/scripts/dce/live-findings.md +++ b/scripts/dce/live-findings.md @@ -310,7 +310,8 @@ live after manual validation. deprecation hook is installed from `cmt_format.cppo.ml` into `Cmt_utils.record_deprecated_used` and invoked through `compiler/ml/builtin_attributes.ml`, with `deprecated_text` carried in the - recorded payload. + recorded payload. Unused public `Cmt_format` signature exports for internal + reader helpers and the hook installer were removed. ### Typedtree iterators From 4d25b06c42a84750f9fb4e0afa879b31013310ce Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 17:01:18 +0000 Subject: [PATCH 211/214] dce: remove cmt deprecated text --- _dce/report.txt | 8 +------- compiler/ml/cmt_format.cppo.ml | 4 ++-- compiler/ml/cmt_utils.ml | 1 - scripts/dce/live-findings.md | 6 +++--- 4 files changed, 6 insertions(+), 13 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index 3c114a6197d..294c775a5d9 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -1681,12 +1681,6 @@ <-- line 188 val get_cookie : string -> Parsetree.expression option [@@dead "+get_cookie"] - Warning Dead Type - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/cmt_utils.ml", line 5, characters 2-26 - deprecated_used.deprecated_text is a record label never used to read a value - <-- line 5 - deprecated_text: string; [@dead "deprecated_used.deprecated_text"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ml/env.ml", line 718, characters 0-434 +reset_cache_toplevel is never used @@ -1945,4 +1939,4 @@ <-- line 99 type f = May_pos | May_neg | May_weak [@dead "Variance.f.May_weak"] | Inj | Pos | Neg | Inv - Analysis reported 399 issues (Warning Dead Module:3, Warning Dead Type:81, Warning Dead Value:94, Warning Dead Value With Side Effects:2, Warning Redundant Optional Argument:193, Warning Unused Argument:26) + Analysis reported 398 issues (Warning Dead Module:3, Warning Dead Type:80, Warning Dead Value:94, Warning Dead Value With Side Effects:2, Warning Redundant Optional Argument:193, Warning Unused Argument:26) diff --git a/compiler/ml/cmt_format.cppo.ml b/compiler/ml/cmt_format.cppo.ml index ff30fc00435..4b70c81d899 100644 --- a/compiler/ml/cmt_format.cppo.ml +++ b/compiler/ml/cmt_format.cppo.ml @@ -166,11 +166,11 @@ let add_saved_type b = saved_types := b :: !saved_types let get_saved_types () = !saved_types let set_saved_types l = saved_types := l -let record_deprecated_used ?deprecated_context ?migration_template ?migration_in_pipe_chain_template source_loc deprecated_text = +let record_deprecated_used ?deprecated_context ?migration_template + ?migration_in_pipe_chain_template source_loc _deprecated_text = deprecated_used := { Cmt_utils.source_loc; - deprecated_text; migration_template; migration_in_pipe_chain_template; context = deprecated_context; diff --git a/compiler/ml/cmt_utils.ml b/compiler/ml/cmt_utils.ml index 3e08cd93b47..219503f1807 100644 --- a/compiler/ml/cmt_utils.ml +++ b/compiler/ml/cmt_utils.ml @@ -2,7 +2,6 @@ type deprecated_used_context = FunctionCall | Reference type deprecated_used = { source_loc: Location.t; - deprecated_text: string; migration_template: Parsetree.expression option; migration_in_pipe_chain_template: Parsetree.expression option; context: deprecated_used_context option; diff --git a/scripts/dce/live-findings.md b/scripts/dce/live-findings.md index 83133a5dc12..333956f9eeb 100644 --- a/scripts/dce/live-findings.md +++ b/scripts/dce/live-findings.md @@ -309,9 +309,9 @@ live after manual validation. when a specific field is not read back by current in-repo code. The deprecation hook is installed from `cmt_format.cppo.ml` into `Cmt_utils.record_deprecated_used` and invoked through - `compiler/ml/builtin_attributes.ml`, with `deprecated_text` carried in the - recorded payload. Unused public `Cmt_format` signature exports for internal - reader helpers and the hook installer were removed. + `compiler/ml/builtin_attributes.ml`. Unused public `Cmt_format` signature + exports for internal reader helpers, the hook installer, and the write-only + `deprecated_text` CMT payload field were removed. ### Typedtree iterators From 8ee82575b03e304acf13fb7b0fc5f160c1afb571 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 17:03:23 +0000 Subject: [PATCH 212/214] dce: trim map set core helpers --- _dce/report.txt | 68 +----------------------------------- compiler/ext/map_gen.ml | 17 --------- compiler/ext/map_gen.mli | 8 ----- compiler/ext/set_gen.ml | 18 ---------- compiler/ext/set_gen.mli | 6 ---- scripts/dce/live-findings.md | 4 ++- 6 files changed, 4 insertions(+), 117 deletions(-) diff --git a/_dce/report.txt b/_dce/report.txt index 294c775a5d9..e7d7e3978ba 100644 --- a/_dce/report.txt +++ b/_dce/report.txt @@ -1259,18 +1259,6 @@ <-- line 74 | Node of {l: ('key, 'a) t; k: 'key; v: 'a; r: ('key, 'a) t; h: int} [@dead "t.Node"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.ml", line 276, characters 0-165 - +concat is never used - <-- line 276 - join t1 x d (remove_min_binding t2) [@@dead "+concat"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.ml", line 284, characters 0-99 - +concat_or_join is never used - <-- line 284 - | None -> concat t1 t2 [@@dead "+concat_or_join"] - Warning Dead Type File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.mli", line 2, characters 2-9 t.Empty is a variant case which is never constructed @@ -1289,30 +1277,6 @@ <-- line 4 | Node of {l: ('key, 'a) t; k: 'key; v: 'a; r: ('key, 'a) t; h: int} [@dead "t.Node"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.mli", line 10, characters 0-80 - +fill_array_with_f is never used - <-- line 10 - val fill_array_with_f : ('a, 'b) t -> int -> 'c array -> ('a -> 'b -> 'c) -> int [@@dead "+fill_array_with_f"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.mli", line 12, characters 0-64 - +fill_array_aux is never used - <-- line 12 - val fill_array_aux : ('a, 'b) t -> int -> ('a * 'b) array -> int [@@dead "+fill_array_aux"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.mli", line 51, characters 0-51 - +concat is never used - <-- line 51 - val concat : ('a, 'b) t -> ('a, 'b) t -> ('a, 'b) t [@@dead "+concat"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/map_gen.mli", line 53, characters 0-78 - +concat_or_join is never used - <-- line 53 - val concat_or_join : ('a, 'b) t -> 'a -> 'b option -> ('a, 'b) t -> ('a, 'b) t [@@dead "+concat_or_join"] - Warning Dead Type File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/misc.ml", line 313, characters 17-21 Color.setting.Auto is a variant case which is never constructed @@ -1349,18 +1313,6 @@ <-- line 50 | Node of {l: 'a t0; v: 'a; r: 'a t0; h: int} [@dead "t.Node"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.ml", line 253, characters 0-425 - +partition is never used - <-- line 253 - else (internal_concat lt rt, internal_join lf v rf) [@@dead "+partition"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.ml", line 314, characters 0-53 - +invariant is never used - <-- line 314 - is_ordered ~cmp t [@@dead "+invariant"] - Warning Dead Type File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.mli", line 2, characters 2-9 t.Empty is a variant case which is never constructed @@ -1379,24 +1331,6 @@ <-- line 4 | Node of {l: 'a t; v: 'a; r: 'a t; h: int} [@dead "t.Node"] - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.mli", line 30, characters 0-33 - +remove_min_elt is never used - <-- line 30 - val remove_min_elt : 'a t -> 'a t [@@dead "+remove_min_elt"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.mli", line 40, characters 0-51 - +partition is never used - <-- line 40 - val partition : 'a t -> ('a -> bool) -> 'a t * 'a t [@@dead "+partition"] - - Warning Dead Value - File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/set_gen.mli", line 46, characters 0-53 - +invariant is never used - <-- line 46 - val invariant : cmp:('a -> 'a -> int) -> 'a t -> bool [@@dead "+invariant"] - Warning Dead Value File "/home/jono/.codex/worktrees/2166/rescript-compiler/compiler/ext/warnings.ml", line 468, characters 0-33 +reset_fatal is never used @@ -1939,4 +1873,4 @@ <-- line 99 type f = May_pos | May_neg | May_weak [@dead "Variance.f.May_weak"] | Inj | Pos | Neg | Inv - Analysis reported 398 issues (Warning Dead Module:3, Warning Dead Type:80, Warning Dead Value:94, Warning Dead Value With Side Effects:2, Warning Redundant Optional Argument:193, Warning Unused Argument:26) + Analysis reported 387 issues (Warning Dead Module:3, Warning Dead Type:80, Warning Dead Value:83, Warning Dead Value With Side Effects:2, Warning Redundant Optional Argument:193, Warning Unused Argument:26) diff --git a/compiler/ext/map_gen.ml b/compiler/ext/map_gen.ml index 7c8af834dd3..2881b5255d7 100644 --- a/compiler/ext/map_gen.ml +++ b/compiler/ext/map_gen.ml @@ -269,23 +269,6 @@ let rec join l v d r = else if rh > lh + 2 then bal (join l v d xr.l) xr.k xr.v xr.r else unsafe_node v d l r (calc_height lh rh)) -(* Merge two trees l and r into one. - All elements of l must precede the elements of r. - No assumption on the heights of l and r. *) - -let concat t1 t2 = - match (t1, t2) with - | Empty, t -> t - | t, Empty -> t - | _, _ -> - let x, d = min_binding_exn t2 in - join t1 x d (remove_min_binding t2) - -let concat_or_join t1 v d t2 = - match d with - | Some d -> join t1 v d t2 - | None -> concat t1 t2 - module type S = sig type key diff --git a/compiler/ext/map_gen.mli b/compiler/ext/map_gen.mli index c5038ffc42f..d2f3fd237a6 100644 --- a/compiler/ext/map_gen.mli +++ b/compiler/ext/map_gen.mli @@ -7,10 +7,6 @@ val cardinal : ('a, 'b) t -> int val bindings : ('a, 'b) t -> ('a * 'b) list -val fill_array_with_f : ('a, 'b) t -> int -> 'c array -> ('a -> 'b -> 'c) -> int - -val fill_array_aux : ('a, 'b) t -> int -> ('a * 'b) array -> int - val to_sorted_array : ('key, 'a) t -> ('key * 'a) array val to_sorted_array_with_f : ('a, 'b) t -> ('a -> 'b -> 'c) -> 'c array @@ -48,10 +44,6 @@ val exists : ('a, 'b) t -> ('a -> 'b -> bool) -> bool val join : ('a, 'b) t -> 'a -> 'b -> ('a, 'b) t -> ('a, 'b) t -val concat : ('a, 'b) t -> ('a, 'b) t -> ('a, 'b) t - -val concat_or_join : ('a, 'b) t -> 'a -> 'b option -> ('a, 'b) t -> ('a, 'b) t - module type S = sig type key diff --git a/compiler/ext/set_gen.ml b/compiler/ext/set_gen.ml index 0fd5e66f41f..9f5f2b3ba42 100644 --- a/compiler/ext/set_gen.ml +++ b/compiler/ext/set_gen.ml @@ -250,20 +250,6 @@ let internal_concat t1 t2 = | t, Empty -> t | _, _ -> internal_join t1 (min_exn t2) (remove_min_elt t2) -let rec partition x p = - match x with - | Empty -> (empty, empty) - | Leaf v -> - let pv = p v in - if pv then (x, empty) else (empty, x) - | Node {l; v; r} -> - (* call [p] in the expected left-to-right order *) - let lt, lf = partition l p in - let pv = p v in - let rt, rf = partition r p in - if pv then (internal_join lt v rt, internal_concat lf rf) - else (internal_concat lt rt, internal_join lf v rf) - let of_sorted_array l = let rec sub start n l = if n = 0 then empty @@ -311,10 +297,6 @@ let is_ordered ~cmp tree = in is_ordered_min_max tree <> `No -let invariant ~cmp t = - check t; - is_ordered ~cmp t - module type S = sig type elt diff --git a/compiler/ext/set_gen.mli b/compiler/ext/set_gen.mli index f3f39f01910..8e294fbbd2d 100644 --- a/compiler/ext/set_gen.mli +++ b/compiler/ext/set_gen.mli @@ -27,8 +27,6 @@ val check : 'a t -> unit val bal : 'a t -> 'a -> 'a t -> 'a t -val remove_min_elt : 'a t -> 'a t - val singleton : 'a -> 'a t val internal_merge : 'a t -> 'a t -> 'a t @@ -37,14 +35,10 @@ val internal_join : 'a t -> 'a -> 'a t -> 'a t val internal_concat : 'a t -> 'a t -> 'a t -val partition : 'a t -> ('a -> bool) -> 'a t * 'a t - val of_sorted_array : 'a array -> 'a t val is_ordered : cmp:('a -> 'a -> int) -> 'a t -> bool -val invariant : cmp:('a -> 'a -> int) -> 'a t -> bool - module type S = sig type elt diff --git a/scripts/dce/live-findings.md b/scripts/dce/live-findings.md index 333956f9eeb..c7ef78c3488 100644 --- a/scripts/dce/live-findings.md +++ b/scripts/dce/live-findings.md @@ -649,7 +649,9 @@ live after manual validation. expose those generated concrete modules. - Context: this is a `.cppo.ml` rooting issue. The report sees the generic tree implementation as dead, but those functions are the shared implementation of - the compiler's generated map and set modules. + the compiler's generated map and set modules. Unused top-level map/set core + helpers and internal-only signature exports were removed where they were not + part of the generated concrete modules. ### `Ext_array` production helpers From bcd1f667edf1af2fbda991d060d6ebcac03ee68f Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 12 Jun 2026 17:06:33 +0000 Subject: [PATCH 213/214] dce: clarify map set findings --- scripts/dce/live-findings.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/dce/live-findings.md b/scripts/dce/live-findings.md index c7ef78c3488..4b92f4d2385 100644 --- a/scripts/dce/live-findings.md +++ b/scripts/dce/live-findings.md @@ -635,8 +635,9 @@ live after manual validation. ### `Map_gen` and `Set_gen` collection cores - Report: `Warning Dead Module`, `Warning Dead Value`, and constructor warnings - across `compiler/ext/map_gen.ml` / `.mli` and - `compiler/ext/set_gen.ml` / `.mli`. + across `compiler/ext/map_gen.ml`, `compiler/ext/map_gen.mli`, + `compiler/ext/set_gen.ml`, and `compiler/ext/set_gen.mli`, including the + `t.Empty`, `t.Leaf`, and `t.Node` constructor mirrors. - Verdict: live; false positive. - Validation: `compiler/ext/map.cppo.ml` defines concrete map modules by wrapping `Map_gen.empty`, `is_empty`, `iter`, `fold`, `for_all`, `exists`, From 1b1e3f6079b4bd03e6c0c4d57054c28b23e039c2 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Mon, 15 Jun 2026 11:28:09 +0000 Subject: [PATCH 214/214] dce: track reanalyze branch --- scripts/dce/README.md | 14 ++++++++------ scripts/dce/run-dce.sh | 28 ++++++++++++++++++++++------ 2 files changed, 30 insertions(+), 12 deletions(-) diff --git a/scripts/dce/README.md b/scripts/dce/README.md index 28065c9ff37..3cb22e0ce6b 100644 --- a/scripts/dce/README.md +++ b/scripts/dce/README.md @@ -11,8 +11,10 @@ scripts/dce/run-dce.sh # writes _dce/report.txt ``` Requires the host OCaml switch (5.3) with `dune` available (`eval $(opam env)`). -The script fetches + builds a pinned standalone reanalyze on first run (cached in -`~/.cache/rescript-dce/reanalyze-cmt-sourcefile-fallback`). +The script fetches + builds standalone reanalyze from +`jono/cmt-sourcefile-fallback` by default (cached in +`~/.cache/rescript-dce/reanalyze-cmt-sourcefile-fallback`) and rebuilds the cache +when that branch advances. The runner excludes `tests/ounit_tests` from DCE by default. Unit tests should not keep compiler implementation details live, and test-only helpers are intentionally @@ -31,12 +33,12 @@ So we use the **standalone** reanalyze (`rescript-lang/reanalyze`), built agains the host `compiler-libs.common`. OCaml 5.3 support started in [reanalyze#203](https://github.com/rescript-lang/reanalyze/pull/203), with follow-up source-file/dependency fixes on JonoPrest's -`jono/cmt-sourcefile-fallback` branch. The runner pins that branch commit. +`jono/cmt-sourcefile-fallback` branch. The runner tracks that branch by default. ## Status: actionable, still manually validated The tooling runs end-to-end and produces a full report over all dune-built cmts. -The pinned `jono/cmt-sourcefile-fallback` build fixes the large cross-module +The `jono/cmt-sourcefile-fallback` build fixes the large cross-module false-positive class seen with the earlier `ocaml-5-3` branch. Treat the report as an actionable worklist, but still manually validate each warning with source searches and `dune build @check` before committing removals. @@ -88,5 +90,5 @@ Complementary, with a subtle boundary: Once the backlog is cleaned up, gate CI on **new** dead code: run `run-dce.sh`, diff against the checked-in baseline, and fail on additions. Open question: how to -depend on the external unmerged analyzer fix long-term (pin a commit, vendor it, -or wait for merge). +depend on the analyzer fix long-term (track the branch, pin a commit, or use an +upstream release once available). diff --git a/scripts/dce/run-dce.sh b/scripts/dce/run-dce.sh index d4e4f77f389..bdcc160982e 100755 --- a/scripts/dce/run-dce.sh +++ b/scripts/dce/run-dce.sh @@ -8,7 +8,7 @@ # cmts (fails with Cmi_format.Error). We therefore use the STANDALONE reanalyze # built against the host compiler-libs. OCaml 5.3 support comes from # rescript-lang/reanalyze#203 plus follow-up fixes from JonoPrest's -# `jono/cmt-sourcefile-fallback` branch, so we pin that branch commit here. +# `jono/cmt-sourcefile-fallback` branch, so we track that branch by default. # # Usage: scripts/dce/run-dce.sh [output-file] # Output defaults to _dce/report.txt @@ -17,9 +17,9 @@ set -euo pipefail REPO_ROOT="$(cd "$(dirname "$0")/../.." && pwd)" cd "$REPO_ROOT" -# Pinned standalone reanalyze with OCaml 5.3 support and cmt source-file fixes. +# Standalone reanalyze with OCaml 5.3 support and cmt source-file fixes. REANALYZE_REPO="${REANALYZE_REPO:-https://github.com/JonoPrest/reanalyze.git}" -REANALYZE_REF="${REANALYZE_REF:-c7ee038f772e5175253527236c5eac44c02f6136}" # jono/cmt-sourcefile-fallback +REANALYZE_REF="${REANALYZE_REF:-jono/cmt-sourcefile-fallback}" REANALYZE_SRC="${REANALYZE_SRC:-$HOME/.cache/rescript-dce/reanalyze-cmt-sourcefile-fallback}" OUT="${1:-_dce/report.txt}" @@ -30,15 +30,31 @@ mkdir -p "$(dirname "$OUT")" EXCLUDE_PATHS="${DCE_EXCLUDE_PATHS:-$REPO_ROOT/tests/ounit_tests,tests/ounit_tests,./tests/ounit_tests,$REPO_ROOT/_build/default/tests/ounit_tests,_build/default/tests/ounit_tests}" # 1. Fetch + build the standalone reanalyze (cached). -if [ ! -x "$REANALYZE_SRC/_build/default/src/Reanalyze.exe" ]; then - echo "==> Fetching standalone reanalyze ($REANALYZE_REF)" +if [ ! -d "$REANALYZE_SRC/.git" ]; then + echo "==> Fetching standalone reanalyze" rm -rf "$REANALYZE_SRC" git clone --quiet "$REANALYZE_REPO" "$REANALYZE_SRC" +else + echo "==> Updating standalone reanalyze" + git -C "$REANALYZE_SRC" fetch --quiet origin +fi + +if git -C "$REANALYZE_SRC" rev-parse --verify --quiet "refs/remotes/origin/$REANALYZE_REF" >/dev/null; then + git -C "$REANALYZE_SRC" checkout --quiet --detach "origin/$REANALYZE_REF" +else git -C "$REANALYZE_SRC" checkout --quiet "$REANALYZE_REF" +fi + +BIN="$REANALYZE_SRC/_build/default/src/Reanalyze.exe" +STAMP="$REANALYZE_SRC/_build/.rescript-dce-reanalyze-sha" +REANALYZE_SHA="$(git -C "$REANALYZE_SRC" rev-parse HEAD)" +if [ ! -x "$BIN" ] || [ ! -f "$STAMP" ] || [ "$(cat "$STAMP")" != "$REANALYZE_SHA" ]; then echo "==> Building reanalyze against $(ocaml -version)" (cd "$REANALYZE_SRC" && dune build 2>&1 | tail -5) + mkdir -p "$(dirname "$STAMP")" + echo "$REANALYZE_SHA" > "$STAMP" fi -BIN="$REANALYZE_SRC/_build/default/src/Reanalyze.exe" +echo "==> Using reanalyze $REANALYZE_SHA" # 2. Typecheck-build so dune emits fresh .cmt for EVERY module, including the # executable mains (bsc, res_cli). A plain `dune build` does native compilation