Enum (flags) member composed of other members

f#

Solution

According to the F# language reference there is no way to do this. The right hand side of the = sign in a F# enum must be an integer literal

- http://msdn.microsoft.com/en-us/library/dd233216(v=VS.100).aspx

Grammar

type enum-name =
   | value1 = integer-literal1
   | value2 = integer-literal2

Problem

``` [<Flags>] type LikeMatch = | None = 0 | Start = 1 | End = 2 | All = Start ||| End //ERROR: Unexpected identifier in union case ``` I've also tried qualifying the members with the enum type. Is there a way to do this in F#?

Original source