Print types from applied functors in created interfaces
Why
Create interface copied each type declaration 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 interface got the unsubstituted body type or whatever lines of the current file happened to be there. Types declared elsewhere are now printed from the signature.
modifiedDiagnostic create interface
module StrSet = CreateInterfaceFunctor.MakeSet({ type t = string let compare = (a: string, b) => a < b ? -1 : a > b ? 1 : 0})
rescript
Review
- Are types declared in the module itself still copied verbatim? Yes. A type is copied when its location is in the source file and, inside a nested module, within that module's declaration, so attributes on local declarations are kept as before.