Use the applied signature for modules created by functor application
Why
Editor analysis modelled module M = F(X) by F's own body, so hover and completion on M's items showed the types of the functor's body, with the parameter's types such as O.t, instead of the argument's. M is now modelled by the signature the compiler computed for the application. That signature keeps the identifiers of F's body, whose stamps already name the body's items, so it is renamed first.
modifiedDiagnostic completion on an applied functor
module type Ord = { type t let compare: (t, t) => int}module MakeSet = (O: Ord) => { type t = array<O.t> let add = (s: t, x: O.t) => s->Array.concat([x])}module IntSet = MakeSet({ type t = int let compare = (a: int, b) => a - b})// IntSet.
text
modifiedDiagnostic hover on a type of an applied functor
text
Review
- Why raise the stamp counter before renaming? The renamed identifiers get stamps from the analysis process's own counter, which starts low and would hand out stamps that the typed tree already uses; above 2^40 they cannot meet one.