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
Create interface breaks types of applied functors and include F(...) #9065
Create interface (rescript-editor-analysis createInterface, used by the editor's "Create interface file" command) copies each type declaration verbatim from the source file at the declaration's location. A type of an applied functor or of an included module is located in the functor's body, possibly in another file, so the generated .resi gets either the unsubstituted body type or whatever lines of the current file happen to be at that position.
moduleIntSet: {
typet=array<O.t> // O is not in scope; expected array<int>letadd: (t, int) =>array<int>
}
Functor from another file (AdvancedTypes.MakeSet as above):
moduleStrSet=AdvancedTypes.MakeSet({
typet=stringletcompare= (a: string, b) =>a < b ? -1 : a > b ? 1 : 0
})
includeAdvancedTypes.MakeSet({
typet=floatletcompare= (a: float, b) =>a < b ? -1 : a > b ? 1 : 0
})
type t is replaced by an empty line (the lines of the functor's declaration don't exist in this file), so the interface doesn't compile. The compiler's own signature is correct (type t = array<int> etc.).
Activity
Print types from applied functors in created interfaces
Print types from applied functors in created interfaces (#9077)