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
{{ message }}
Repository navigation
Commit 516e650
Browse filesBrowse the repository at this point in the historyBrowse files
Remove the unreachable Longident.Lapply constructor (rescript-lang#8469)
* 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.
0 commit comments