fsprojects / FSharp.Formatting

F# tools for generating documentation (Markdown processor and F# code formatter)
https://fsprojects.github.io/FSharp.Formatting/
Other
464 stars 155 forks source link

If ApiDocMember correspond to a property with a setter ReturnType is equal to None #734

Open MangelMaxime opened 2 years ago

MangelMaxime commented 2 years ago

Description:

My code:

let returnInfo =
    instanceMember.ReturnInfo.ReturnType
    |> Option.map (fun (fsharpType, _) ->
        Common.renderParameterType true fsharpType
        |> TextNode.ToHtml
    )

See how the member with a setter doesn't have the return type displayed.

image

Expected: ReturnType should be Some...

Code for reproduction:

type User =
    {
        Id : int
        Name : string
        Email : string
    }

    member this.GetterOnly
        with get () =
            "This is a getter only property"

    member this.SetterOnly
        with set (value : string) =
            ()

    member this.GetterAndSetter
        with get () =
            "This is a getter and setter property"
        and set (value : string) =
            ()