Skip to content

Commit b7c8f86

Browse files
authored
Merge pull request #940 from MatthijsPrent/main
Fixing issue Unit returning functions yield warning #936
2 parents 31e0a51 + ee74bbc commit b7c8f86

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/FSharp.Formatting.ApiDocs/GenerateModel.fs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,10 +346,19 @@ type ApiDocMember
346346
m.StartColumn
347347
pn
348348

349-
for (_psym, pnm, _pn, _pty) in paramTypes do
349+
for (psym, pnm, _pn, _pty) in paramTypes do
350350
match pnm with
351351
| None ->
352-
printfn "%s(%d,%d): warning: a parameter was missing a name" m.FileName m.StartLine m.StartColumn
352+
match psym with
353+
| Choice1Of2 p ->
354+
if isUnitType p.Type |> not then
355+
printfn
356+
"%s(%d,%d): warning: a parameter was missing a name"
357+
m.FileName
358+
m.StartLine
359+
m.StartColumn
360+
| Choice2Of2 _ ->
361+
printfn "%s(%d,%d): warning: a field was missing a name" m.FileName m.StartLine m.StartColumn
353362
| Some nm ->
354363
if not (tdocs.ContainsKey pnm) then
355364
printfn

0 commit comments

Comments
 (0)