Skip to content

Commit 8b8136f

Browse files
committed
Update discriminated-unions.md
1 parent 7a29b05 commit 8b8136f

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

docs/fsharp/language-reference/discriminated-unions.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -113,16 +113,17 @@ type SingleCase = Case of string
113113
114114
[<Struct>]
115115
type Multicase =
116-
| Case1 of Case1 : string
117-
| Case2 of Case2 : int
118-
| Case3 of Case3 : double
116+
| Case1 of string
117+
| Case2 of int
118+
| Case3 of double
119119
```
120120

121121
Because these are value types and not reference types, there are extra considerations compared with reference discriminated unions:
122122

123123
1. They are copied as value types and have value type semantics.
124-
2. You cannot use a recursive type definition with a multicase struct Discriminated Union.
125-
3. You must provide unique case names for a multicase struct Discriminated Union.
124+
2. You cannot use a recursive type definition with a multicase struct discriminated union.
125+
126+
Before F# 9, there was a requirement for each case to specify a unique case name (within the union). Starting with F# 9, the limitation is lifted.
126127

127128
## Using Discriminated Unions Instead of Object Hierarchies
128129

0 commit comments

Comments
 (0)