Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unit returning functions yield warning #936

Open
johannesvp opened this issue Aug 7, 2024 · 5 comments
Open

Unit returning functions yield warning #936

johannesvp opened this issue Aug 7, 2024 · 5 comments

Comments

@johannesvp
Copy link

For functions to be documented that return unit, a warning is returned: a parameter is missing a name.
Using fsdocs 19.1.1

The code:

    /// <summary>
    /// Resets all channels ...
    /// Next to this it also disables ...
    /// </summary>
    /// <exception cref="ErrorHandeling.DriverException">An exception that is thrown when the driver encounters
    /// an exception/error</exception>
    let Disable () =
        disable read write

fsdocs output:

> 
> 2>API docs:
> 2>  generating model for 2 assemblies in API docs...
> 2>  loading 2 assemblies...
> 2>isNetCoreApp = true
> 2>  registering entities for assembly Apollo.Driver...
> 2>  registering entities for assembly Apollo.SwitchPanel.Gui...
> 2>  reading XML doc for C:\Users\Johannes.vanPutten\Documents\Salland\Products\Apollo\src\Apollo\Apollo.Driver\bin\x64\Release\net6\Apollo.Driver.dll...
> 2>  reading assembly data for C:\Users\Johannes.vanPutten\Documents\Salland\Products\Apollo\src\Apollo\Apollo.Driver\bin\x64\Release\net6\Apollo.Driver.dll...
> 2>C:\Users\Johannes.vanPutten\Documents\Salland\Products\Apollo\src\Apollo\Apollo.Driver\Dps.fs(126,8): warning : a parameter was missing a name

Same warning is produced for any public function with XML comments that returns unit.

@nojaf
Copy link
Collaborator

nojaf commented Aug 7, 2024

Can you reproduce this with the latest main?

@johannesvp
Copy link
Author

Same result with v20.0.1

@nojaf
Copy link
Collaborator

nojaf commented Aug 7, 2024

I appreciate your response, but my question was specific to the latest update. The main branch received an update to the F# compiler yesterday, and I'm curious if the issue persists with this new version.

@johannesvp
Copy link
Author

Not yet available at nuget, after a local build it appeared that the result is the same for 21.0.0-beta-003.

@nojaf
Copy link
Collaborator

nojaf commented Aug 7, 2024

I noticed this warning comes from this line.

I'd be happy to accept a PR to check whether the parameter type is unit or not. Would you be interested in submitting a PR for this?

nojaf added a commit that referenced this issue Sep 13, 2024
Fixing issue Unit returning functions yield warning #936
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants