fsharp icon indicating copy to clipboard operation
fsharp copied to clipboard

Valid type alias with anonymous record report error

Open jindraivanek opened this issue 1 year ago • 2 comments

This type alias:

type T =
    {| Id: Guid
    |} []

leads to error: Unexpected symbol '[' in member definition

Replacing [] with another generic type (seq, list, option) leads to similar error: Unexpected identifier in member definition

Expected behavior

Code should be accepted by compiler.

Actual behavior

Compiler error when {| and |} are vertically aligned and there is generic type after |}

Known workarounds

  • Indent closing bracket one space further.
  • Use T<A> generic type syntax.

Related information

dotnet --version 8.0.204

jindraivanek avatar Jul 11 '24 14:07 jindraivanek

@auduchinok Do you think this could be related to your changes re indentation or have an idea what could be the reason?

abonie avatar Aug 19 '24 17:08 abonie

@auduchinok Do you think this could be related to your changes re indentation or have an idea what could be the reason?

There's a chance it could be. We should check if this has been working before.

auduchinok avatar Aug 20 '24 12:08 auduchinok