From c497ec9869694aef67fd9db9f3159d8463d13ff4 Mon Sep 17 00:00:00 2001 From: Matthijs Prent Date: Fri, 13 Sep 2024 09:15:45 +0200 Subject: [PATCH] fixed a bug that reported that a unit parameter should have a name --- src/FSharp.Formatting.ApiDocs/GenerateModel.fs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/FSharp.Formatting.ApiDocs/GenerateModel.fs b/src/FSharp.Formatting.ApiDocs/GenerateModel.fs index 9b406e67..8353f716 100644 --- a/src/FSharp.Formatting.ApiDocs/GenerateModel.fs +++ b/src/FSharp.Formatting.ApiDocs/GenerateModel.fs @@ -23,6 +23,7 @@ open FSharp.Formatting.Templating open FSharp.Patterns open FSharp.Compiler.Syntax + [] module internal Utils = @@ -346,10 +347,14 @@ type ApiDocMember m.StartColumn pn - for (_psym, pnm, _pn, _pty) in paramTypes do + for (psym, pnm, _pn, _pty) in paramTypes do match pnm with | None -> - printfn "%s(%d,%d): warning: a parameter was missing a name" m.FileName m.StartLine m.StartColumn + match psym with + | Choice1Of2 p -> + if isUnitType p.Type |> not then + printfn "%s(%d,%d): warning: a parameter was missing a name" m.FileName m.StartLine m.StartColumn + | Choice2Of2 _ -> () | Some nm -> if not (tdocs.ContainsKey pnm) then printfn