Open T-Gro opened 1 year ago
Testcase will be prepared at ~\tests\FSharp.Compiler.ComponentTests\Signatures\TestCasesForGenerationRoundTrip\access-minimal-repro.fsx
Without manually specifying the Sealed attribute at impl file, the roundtrip (impfile -> generate -> compile .fs and .fsi together) fails.
Fsc.exe offers a way to generate signature files out of current implementation. For most of the F# constructs, a tooling-powered roundtrip just works: You can generally take an existing imp file, generate .fsi for it, and then compile them together.
One particular are where this does not work are OO-style (so not DUs, not records) constructions like this one:
This results in the following .fsi file:
And a compiler error for the type saying: FS0938
The representation of this type is hidden by the signature. It must be given an attribute such as
[<Sealed>], [<Class>] or [<Interface>]
to indicate the characteristics of the type.Proposal: Enrich signature generation to include one of the three attributes (most likely choosing between and ?)