Remove dead Sig_class/Sig_class_type variants - #7
Open
JonoPrest wants to merge 20 commits into
Open
Conversation
* Remove the unreachable Longident.Lapply constructor Longident.Lapply is the parsetree form of OCaml's applicative-functor path syntax (F(X).t), where a functor is applied inline inside an identifier path. ReScript's grammar has no such production: functor application is only a module expression (module M = F(X)), which the type checker resolves to Path.Papply, never a Longident.Lapply. The parser never builds Lapply, so every match on it was dead (assert false / fatal_error / raise Not_found / defensive printer fallbacks). Remove the constructor and all its handling across the type checker, printers, depend, and analysis. The sole construction site was Ctype.lid_of_path (Path.Papply -> Longident.Lapply); since no Papply flows into that type-path conversion, replace it with assert false, matching the existing Papply -> assert false invariants. Removing the Env.lookup_module Lapply arms also left functor_components.fcomp_arg write-only, so drop that field too. Add a super_errors fixture exercising functor application plus a type-path error, confirming the functor machinery and error printing are unchanged. * Update changelog * Format functor fixture and refresh super_errors snapshot * lid_of_path: render Papply paths gracefully instead of asserting Applicative functors are on by default, so Path.Papply paths are produced internally (typemod path_of_module, Mtype.strengthen) even though ReScript source cannot reference such a path directly. Replace the assert false in Ctype.lid_of_path's Papply arm (introduced when removing Longident.Lapply) with a graceful Lident rendering via Path.name, so any diagnostic that ever reaches it degrades to a readable name (e.g. F(Arg)) instead of aborting the compiler. Add an ounit test that calls Ctype.lid_of_path on a synthetic Papply path (unreachable from source, so exercised directly) to lock in the graceful behavior.
Types.signature_item carried Sig_class and Sig_class_type (OCaml class / class-type items, each `of unit` dummy AST nodes). ReScript has no classes, so the parser and type checker never construct them; every match arm was assert false / identity / skip. Remove both variants and all their handling across the type system (btype, subst, env, mtype, includemod, printtyp, translmod, transl_recmodule), gentype, and analysis. Also drop the stale commented-out get_string block in lam_print.ml referencing the old 3-arg Sig_class form, and simplify the now-trivial filter_rem_sig. The frozen parsetree0 Pstr_class/Psig_class dummies are independent and left untouched.
JonoPrest
force-pushed
the
jono/remove-sig-class
branch
from
June 12, 2026 10:45
32d44b5 to
4c4b308
Compare
Keep new for...of typedtree and parsetree constructors at the end of their variants so existing marshalled constructor tags remain stable for v12 artifacts. Allow CMT readers to accept explicitly supported older magic numbers while still writing a new magic for current artifacts.
* Remove unused files * Update CHANGELOG.md
* Omit empty document symbol children DocumentSymbol.children is optional, so only set it when a symbol has nested entries. This avoids serializing leaf symbols with an empty children array. Signed-off-by: Pedro Castro <aspeddro@gmail.com> * add transform_opt for server-side use * analysis: add state_to_yojson * packages: add dependencies * Update CHANGELOG.md * Apply codex review suggestions * Refactor cmt_viewer.dump for serve-side * Analysis cmt dump return a string instead a option --------- Signed-off-by: Pedro Castro <aspeddro@gmail.com> Co-authored-by: Florian Hammerschmidt <florianh89@gmail.com>
…g#8482) * test: show the build panics on non-utf8 compiler output bsc can print a code frame that cuts a multi-byte character in half, so the captured stderr is not always valid utf-8. The Ok branch decodes it with from_utf8().expect(), which panics and takes down the whole build with a byte offset into stdout and no file name. This test feeds a truncated em dash and reproduces the panic. * fix: decode compiler output with from_utf8_lossy The Ok branch used from_utf8().expect() on the captured stderr, which panics when the output is not valid utf-8. The two sibling branches right above it already use from_utf8_lossy. Use it here too so a truncated character turns into a replacement character and the build keeps going instead of crashing. * Add changelog entry for the non-UTF-8 build crash fix
* Update coverage.yml to use OIDC for Codecov Always prefer the tokenless method if available. There are no needs to use permanent token here for public repo. It supports verifying repo via OIDC. * fix & clarify permissions use
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 25.6.0 to 25.9.2. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-version: 25.9.2 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [rollup](https://github.com/rollup/rollup) from 4.60.3 to 4.61.1. - [Release notes](https://github.com/rollup/rollup/releases) - [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md) - [Commits](rollup/rollup@v4.60.3...v4.61.1) --- updated-dependencies: - dependency-name: rollup dependency-version: 4.61.1 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 6 to 7. - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md) - [Commits](codecov/codecov-action@v6...v7) --- updated-dependencies: - dependency-name: codecov/codecov-action dependency-version: '7' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 8.0.14 to 8.0.16. - [Release notes](https://github.com/vitejs/vite/releases) - [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md) - [Commits](https://github.com/vitejs/vite/commits/v8.0.16/packages/vite) --- updated-dependencies: - dependency-name: vite dependency-version: 8.0.16 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [actions/checkout](https://github.com/actions/checkout) from 6 to 7. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](actions/checkout@v6...v7) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '7' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [tar](https://github.com/isaacs/node-tar) from 7.5.11 to 7.5.16. - [Release notes](https://github.com/isaacs/node-tar/releases) - [Changelog](https://github.com/isaacs/node-tar/blob/main/CHANGELOG.md) - [Commits](isaacs/node-tar@v7.5.11...v7.5.16) --- updated-dependencies: - dependency-name: tar dependency-version: 7.5.16 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [js-yaml](https://github.com/nodeca/js-yaml) from 3.14.2 to 3.15.0. - [Changelog](https://github.com/nodeca/js-yaml/blob/master/CHANGELOG.md) - [Commits](nodeca/js-yaml@3.14.2...3.15.0) --- updated-dependencies: - dependency-name: js-yaml dependency-version: 3.15.0 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [actions/cache](https://github.com/actions/cache) from 5 to 6. - [Release notes](https://github.com/actions/cache/releases) - [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md) - [Commits](actions/cache@v5...v6) --- updated-dependencies: - dependency-name: actions/cache dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* destructure record rest elements - fixes rescript-lang#8311 * support type with parameter for record rest * simplify parsing of record rest * update record spread error message * improve error message of superfluous fields in rest * improve error message of non optional rest field already matched * add a warning when rest record would be empty * add fixture tests for error/warning messages * add changelog * address comments (parsetree0 PPX roundtrips, nested rest, etc) * support rest of inline record * check rest field types, fix matching & invalid field identifier * fix rest of private type and analysis * use runtime field names for rest * support record type alias in rest * fix compiler crash when spreading the whole record * disallow rest spreading on packed modules * add tests for record rest with namespaced type * make sure rest is used and move logic to its own files * stop ignoring _rest in a few more places * format Signed-off-by: tsnobip <dontshootthink@gmail.com> * improve output (compile to JS destructuring) * update changelog * remove leading _ of used variable * add more tests * disallow spreading rest to unboxed record * address rescript-lang#8317 (comment) * document type_record_pat_rest function * add comment about Tpat_record rest * forbid destructure to rest of record with mutable fields * do not spread function params to avoid issues with 'use strict' * fix comment table for rest spread * Include record rest binders in rec check Signed-off-by: tsnobip <dontshootthink@gmail.com> * Track record rest types in dead analysis Signed-off-by: tsnobip <dontshootthink@gmail.com> * Rename record rest test config fixture Signed-off-by: tsnobip <dontshootthink@gmail.com> * add a warning for optional field overlap * no longer drop rest when printing pattern * make Parmatch.Conv.conv no longer drop rest * remove unused Object_rest_param * use internal attribute for ast mapper * improve completion support for record rest destructuring * simplify js dump shape * simplify materialize_fields * improve record rest completion Signed-off-by: tsnobip <dontshootthink@gmail.com> * print record rest in typedtree dumps Signed-off-by: tsnobip <dontshootthink@gmail.com> * simplify record rest implementation * restore better JS output for rest destructuring --------- Signed-off-by: tsnobip <dontshootthink@gmail.com>
Bumps [rollup](https://github.com/rollup/rollup) from 4.61.1 to 4.62.2. - [Release notes](https://github.com/rollup/rollup/releases) - [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md) - [Commits](rollup/rollup@v4.61.1...v4.62.2) --- updated-dependencies: - dependency-name: rollup dependency-version: 4.62.2 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.