Skip to content

F# compiler treats FSharpFunc as sealed in latest update to F# 4.1 #3737

Closed
@krauthaufen

Description

@krauthaufen

Hi everyone,

I know it's bad practice to inherit FSharpFunc directly in user code but in certain scenarios i had to do that.
typeof<int -> int>.IsSealed reports false obviously but the new (4.1) compiler complains about FSharpFunc<int, int> being sealed.

I understand the general idea of making all the concrete implementations sealed but why did you decide to treat the base-type as if it was sealed?

Would it be possible to make the base-type non-sealed again, since it just gives the system more flexibility. Couldn't it just be a warning of some sort? (e.g. inheriting FSharpFunc may cause your code to be broken in future versions of F#)

P.S.: the types in OptimiziedClosures (FSharpFunc<,,_>, etc.) are not sealed btw.

cheers

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugImpact-High(Internal MS Team use only) Describes an issue with extreme impact on existing code.ReadyRegression

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions