-
Notifications
You must be signed in to change notification settings - Fork 854
Open
Labels
Area-Compiler-SigFileGengeneration of signature files - both compiler and IDEgeneration of signature files - both compiler and IDEBugImpact-Low(Internal MS Team use only) Describes an issue with limited impact on existing code.(Internal MS Team use only) Describes an issue with limited impact on existing code.
Milestone
Description
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.
When using this on a struct with private fields, the private fields get erased from the generated .fsi.
However, this results in the following error:
"The type definitions for type 'C' in the signature and implementation are not compatible because the field 'goo' was present in the implementation but not in the signature. **Struct types** must now reveal their fields in the signature for the type, though the fields may still be labelled '**private**' or 'internal'." }
module StructPrivateField =
[<Struct>]
[<NoComparison;NoEquality>]
type C =
[<DefaultValue>]
val mutable private goo : byte []
member this.P with set(x) = this.goo <- x
Small code sample prepared at ~\tests\FSharp.Compiler.ComponentTests\Signatures\TestCasesForGenerationRoundTrip\struct_private_field_repro.fsx
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Area-Compiler-SigFileGengeneration of signature files - both compiler and IDEgeneration of signature files - both compiler and IDEBugImpact-Low(Internal MS Team use only) Describes an issue with limited impact on existing code.(Internal MS Team use only) Describes an issue with limited impact on existing code.
Type
Projects
Status
New