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 cd32c86
Browse filesBrowse the repository at this point in the historyBrowse files
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.
Diagnostic modified (completion on an applied functor):
Example:
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.
Before (text): tests/analysis_tests/tests/src/AppliedFunctor.res
"detail": "(t, O.t) => array<O.t>"
After (text): tests/analysis_tests/tests/src/AppliedFunctor.res
"detail": "(t, int) => array<int>"
Diagnostic modified (hover on a type of an applied functor):
Before (text):
type IntSet.t = array<O.t>
After (text):
type IntSet.t = array<int>
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.
Fixes: #9072
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kbf3gLMawVgtmiKy3TMBc3
Signed-off-by: Christoph Knittel <ck@cca.io>
- Hover and completion on a module created by applying a functor show the applied types, such as `array<int>`, instead of the functor body's `array<O.t>`.
0 commit comments