.#6
Open
JonoPrest wants to merge 4 commits into
Open
Conversation
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.
7bd4d4e to
4731ede
Compare
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.
ca2c07a to
11f6a61
Compare
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.