Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using a keyword as member name in F#

Tags:

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;
}
like image 922
citykid Avatar asked Dec 21 '25 04:12

citykid


1 Answers

Use double-backticks:

type Fruit =
    val ``type`` : string
like image 68
vcsjones Avatar answered Dec 24 '25 07:12

vcsjones



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!