Skip to content

Update signature generation to include Sealed/Class/Interface attribute for OO-style type constructs #14308

Open
@T-Gro

Description

@T-Gro

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:

module Core_access    
type MyClassPropertiyGetters =     
    member      x.AnyKindOfProperty= 12   

This results in the following .fsi file:

module Core_access

type MyClassPropertiyGetters =

  member AnyKindOfProperty: int

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 ?)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-Compiler-SigFileGengeneration of signature files - both compiler and IDEBugImpact-Low(Internal MS Team use only) Describes an issue with limited impact on existing code.

    Type

    Projects

    Status

    New

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions