fsharp icon indicating copy to clipboard operation
fsharp copied to clipboard

[Visual studio] Nullness - GUI in property pages for a project to turn nullness checking on/off

Open T-Gro opened this issue 1 year ago • 1 comments

Issue description

Nullable reference type checking is controlled via project settings in .fsproj file. This suggestion is to create an alternative control mechanism via project property pages setting in VS.

Choose one or more from the following categories of impact

  • [ ] Unexpected nullness warning (false positive in nullness checking, code uses --checknulls and langversion:preview).
  • [ ] Missing nullness warning in a case which can produce nulls (false negative, code uses --checknulls and langversion:preview).
  • [ ] Breaking change related to older null constructs in code not using the checknulls switch.
  • [ ] Breaking change related to generic code and explicit type constraints (null, not null).
  • [ ] Type inference issue (i.e. code worked without type annotations before, and applying the --checknulls enforces type annotations).
  • [ ] C#/F# interop issue related to nullness metadata.
  • [X] Other (none of the categories above apply).

Operating System

Windows (Default)

What .NET runtime/SDK kind are you seeing the issue on

.NET SDK (.NET Core, .NET 5+)

.NET Runtime/SDK version

No response

Reproducible code snippet and actual behavior

No response

Possible workarounds

No response

T-Gro avatar Jul 19 '24 15:07 T-Gro

This is what VS offers for C#:

image

It maps to .csproj property, e.g.: <Nullable>annotations</Nullable>

The annotations value means that it loads the nullable types, propagates them etc., but never emits a warning. I guess it is similar to having checknulls+, but disabling all related warnings.

T-Gro avatar Jul 19 '24 16:07 T-Gro