File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -781,9 +781,13 @@ and FSharpUnionCase(cenv, v: UnionCaseRef) =
781781 checkIsResolved()
782782 v.Range
783783
784+ member __.HasFields =
785+ if isUnresolved() then false else
786+ v.UnionCase.RecdFieldsArray.Length <> 0
787+
784788 member __.UnionCaseFields =
785789 if isUnresolved() then makeReadOnlyCollection [] else
786- v.UnionCase.RecdFields |> List .mapi ( fun i _ -> FSharpField( cenv, FSharpFieldData.Union ( v, i))) |> makeReadOnlyCollection
790+ v.UnionCase.RecdFieldsArray |> Array .mapi ( fun i _ -> FSharpField( cenv, FSharpFieldData.Union ( v, i))) |> makeReadOnlyCollection
787791
788792 member __.ReturnType =
789793 checkIsResolved()
Original file line number Diff line number Diff line change @@ -382,6 +382,9 @@ and [<Class>] public FSharpUnionCase =
382382 /// Get the range of the name of the case
383383 member DeclarationLocation : range
384384
385+ /// Indicates if the union case has field definitions
386+ member HasFields : bool
387+
385388 /// Get the data carried by the case.
386389 member UnionCaseFields : IList < FSharpField >
387390
You can’t perform that action at this time.
0 commit comments