dotnet / dotnet/fsharp

Building a fsharp project using MSBUILD with in the projectlevel the warninglevel set to 5 will result in a false error

Open
#16,355 0 comments 0 reactions 0 assignees View on GitHub
Area-Diagnostics Bug Impact-Low
Dominant language
F#
Stars
4.3k
Forks
876
Avg merge
4d 11h
Merged PRs (30d)
131

Description

**Repro steps**

So we have a solution with multiple .Net 6 Fsharp projects. In one of the projects the warning level is set to 5:
![image](https://github.com/dotnet/fsharp/assets/33624465/95ff3976-8eb0-4fce-b203-6d1dd91b66ef)

And here we have the following code where an warning is reported:
![image](https://github.com/dotnet/fsharp/assets/33624465/77dfc9cf-2b5a-436e-a1cc-77253ee20565)

When building this project in MSBuild, the following warning is shown:
![image](https://github.com/dotnet/fsharp/assets/33624465/ba5488dd-63f0-4a96-9f13-4f149c30b6bf)

**Expected behavior**

No warning is expected, since it does not make sense to name an unit parameter.

**Actual behavior**

a warning is shown that an unit parameter should also be named.

**Known workarounds**

-

**Related information**

Provide any related information (optional):

* Operating system
* .NET Runtime kind (.NET Core, .NET Framework, Mono)
*
![image](https://github.com/dotnet/fsharp/assets/33624465/ab0fb941-e211-4941-a279-b0a31a198d0e)

* Editing Tools (e.g. Visual Studio Version, Visual Studio)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.