Skip to content

[regression] static member can be defined without member keyword, in unexpected way #16342

@smoothdeveloper

Description

@smoothdeveloper
 type Seq =
   static meme average (x: int seq) = x |> Seq.map float |> Seq.average;;

notice I typed meme and not member.

It fails to parse in older fsharp, tried fsharpi, where it fails with:

error FS0010: Unexpected identifier in type definition

With current F#, it defines a static member meme that takes average: obj and x: int seq as input and returns float, which I can then call:

Seq.meme null [1..10];;

5.5

I don't think we want the meaning to change, and it should fail the same way it used to, unless I missed something.

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions