You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- The Too_many_arguments error cannot be raised anymore: the expected
type is committed to an arrow of the literal's shape before
destructuring, so every legacy path now surfaces as a regular type
clash or Uncurried_arity_mismatch (which is what the fixture credited
to it in ERROR_VARIANTS.md was already producing). Remove the
variant, its printer, and the ?in_function threading through
type_expect/type_cases that existed only to decorate it.
- Remove the function$-vs-arrow unification bridge in ctype (nothing
produces a function$ type expression anymore), the structural arity
counter Ctype.arity (no callers), the parsetree arity probes
get_uncurry_arity/get_curry_arity (is_arity_one reads the params list
directly), and Ast_async's redundant newtype double-dig.
- Deduplicate the arrow-flattening step shared by the analysis
extract_function_type helpers.
- Delete Ast_compatible outright. Every member was a thin veneer over
an existing Ast_helper constructor (rec_type_str/rec_type_sig had
byte-identical signatures to Str.type_/Sig.type_), hand-rolling the
records the canonical constructors build; the OCaml-version
compatibility it existed for is long gone, and its fun_ silently
hard-coded arity 1. Call sites use Ast_helper directly, with two
let-bound app1/app2 shorthands kept local to ast_derive_js_mapper.
Generated code is unchanged. The Pjs_fn_make no-op elision explored
alongside these cleanups is deliberately left out pending a dedicated
analysis of that primitive.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Cristiano Calcagno <cristianoc@users.noreply.github.com>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -48,6 +48,8 @@
48
48
49
49
- Sync the platform npm package's compiler binaries (`packages/@rescript/<platform>/bin`) via dune promotion on every `dune build`, instead of Makefile/CI copy steps that only ran when make did: a plain `dune build` can no longer leave `cli/*.js` and the test harnesses running a stale compiler. https://github.com/rescript-lang/rescript/pull/8560
50
50
- Remove unused compiler IR definitions, modules, helpers, error variants, and Typedtree fields. https://github.com/rescript-lang/rescript/pull/8551https://github.com/rescript-lang/rescript/pull/8555
51
+
- Cleanups enabled by structural arity: remove the unreachable `Too_many_arguments` error and the `?in_function` threading through the type checker that existed only to decorate it; remove the dead `function$`-vs-arrow unification bridge, `Ctype.arity`, and the unused parsetree arity helpers; deduplicate the analysis arrow-flattening helpers. https://github.com/rescript-lang/rescript/pull/8569
52
+
51
53
- Make the typed layers n-ary as well: `Types.Tarrow` carries a parameter list, `Texp_function` carries typed parameters (label, ident, pattern, per-parameter exhaustiveness) and a body, and `Ttyp_arrow`/`Otyp_arrow` follow. The `arity` annotation and its `int option` phantom state are gone from the compiler entirely; `push_defaults` in translcore and the hand-rolled gather-until-arity walks in gentype, reanalyze, and the outcome printer are deleted. The cmi and cmt magic numbers are bumped (`Caml1999I023`/`Caml1999T023`). Generated JavaScript is byte-identical across the test suite (optional-parameter internals are named `*opt_<label>*` instead of `*opt*`, visible only in the rare unprettified case); reanalyze no longer emits spurious empty optional-argument references, and genType recovers real parameter names after defaulted parameters. https://github.com/rescript-lang/rescript/pull/8568
52
54
- Make functions and arrow types n-ary in the parsetree: `Pexp_fun` carries a parameter list and `Ptyp_arrow` a parameter list, replacing the curried one-parameter-per-node chains with an `arity` annotation on the head. Arity is now structural (`List.length params`) and `ast_uncurried.ml` is deleted. The typed layers, cmt format, printed output, and the external-PPX wire format are unchanged. Generated JavaScript is unchanged with one deliberate exception: `@this this => async arg => ...` now means what it says (a method returning an async function) instead of absorbing the nested parameter into the method; write `@this async (this, arg) => ...` for the old meaning. https://github.com/rescript-lang/rescript/pull/8566
53
55
- Give marshaled current-parsetree streams (`-as-pp`, `res_parser -print binary`) their own magic numbers, distinct from the frozen Parsetree0 wire format used for external PPXes. https://github.com/rescript-lang/rescript/pull/8561
0 commit comments