@@ -1316,7 +1316,7 @@ type ResolvedUnion = {
1316
1316
caseUndefined: bool
1317
1317
typeofableTypes: Set < Typeofable >
1318
1318
caseArray: Set < Type > option
1319
- caseEnum: Set < Choice < EnumCase , Literal >>
1319
+ caseEnum: Set < Choice < Enum * EnumCase, Literal >>
1320
1320
discriminatedUnions: Map < string , Map < Literal , Type >>
1321
1321
otherTypes: Set < Type >
1322
1322
}
@@ -1339,8 +1339,8 @@ module ResolvedUnion =
1339
1339
ru.caseEnum
1340
1340
|> Set.toSeq
1341
1341
|> Seq.map ( function
1342
- | Choice1Of2 { name = name; value = Some value } -> sprintf " %s =%s " name ( Literal.toString value)
1343
- | Choice1Of2 { name = name; value = None } -> sprintf " %s =?" name
1342
+ | Choice1Of2 ( { name = ty }, { name = name ; value = Some value }) -> sprintf " %s . %s =%s " ty name ( Literal.toString value)
1343
+ | Choice1Of2 ( { name = ty }, { name = name ; value = None }) -> sprintf " %s . %s =?" ty name
1344
1344
| Choice2Of2 l -> Literal.toString l)
1345
1345
yield sprintf " enum<%s >" ( cases |> String.concat " | " )
1346
1346
for k, m in ru.discriminatedUnions |> Map.toSeq do
@@ -1349,7 +1349,7 @@ module ResolvedUnion =
1349
1349
]
1350
1350
cases |> String.concat " | "
1351
1351
1352
- let rec private getEnumFromUnion ctx ( u : UnionType ) : Set < Choice < EnumCase , Literal >> * UnionType =
1352
+ let rec private getEnumFromUnion ctx ( u : UnionType ) : Set < Choice < Enum * EnumCase, Literal >> * UnionType =
1353
1353
let (| Dummy |) _ = []
1354
1354
1355
1355
let rec go t =
@@ -1365,9 +1365,9 @@ module ResolvedUnion =
1365
1365
let bindings = Type.createBindings i.name loc a.typeParams tyargs
1366
1366
yield ! go ( a.target |> Type.substTypeVar bindings ())
1367
1367
| Definition.Enum e ->
1368
- for c in e.cases do yield Choice1Of2 ( Choice1Of2 c )
1369
- | Definition.EnumCase ( c, _ ) ->
1370
- yield Choice1Of2 ( Choice1Of2 c )
1368
+ for c in e.cases do yield Choice1Of2 ( Choice1Of2 ( e , c ) )
1369
+ | Definition.EnumCase ( c, e ) ->
1370
+ yield Choice1Of2 ( Choice1Of2 ( e , c ) )
1371
1371
| Definition.Class _ -> yield Choice2Of2 t
1372
1372
| _ -> ()
1373
1373
| TypeLiteral l -> yield Choice1Of2 ( Choice2Of2 l)
0 commit comments