citykid
citykid

Reputation: 11142

Using a keyword as member name in F#

Does F# allow defining a member with the name of a keyword?

type Fruit =
  val type : string

in C# this is possible using @:

class Fruit 
{
    string @type;
}

Upvotes: 3

Views: 132

Answers (1)

vcsjones
vcsjones

Reputation: 141703

Use double-backticks:

type Fruit =
    val ``type`` : string

Upvotes: 5

Related Questions