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

Nullness issue - support direct <Nullable>enable</Nullable> flag instead of <OtherOptions> #17403

Closed
1 of 7 tasks
T-Gro opened this issue Jul 10, 2024 · 1 comment · Fixed by #17486
Closed
1 of 7 tasks
Assignees
Labels
Area-Nullness Issues related to handling of Nullable Reference Types Area-ProjectsAndBuild MSBuild tasks, project files, framework resolution
Milestone

Comments

@T-Gro
Copy link
Member

T-Gro commented Jul 10, 2024

Issue description

The <Nullable>enable</Nullable> msbuild property is used in C# already.
Since this feature is targeted at interop scenarios, it would be handy to support the exact same property, since people can have it in their Directory.* files for the whole solution.

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.
  • 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

<Nullable>enable</Nullable>

Possible workarounds

<OtherFlags>--checknulls+</OtherFlags>

@T-Gro T-Gro added Bug Needs-Triage Area-Nullness Issues related to handling of Nullable Reference Types labels Jul 10, 2024
@T-Gro T-Gro self-assigned this Jul 10, 2024
@github-actions github-actions bot added this to the Backlog milestone Jul 10, 2024
@T-Gro T-Gro removed their assignment Jul 12, 2024
@T-Gro T-Gro self-assigned this Jul 30, 2024
@T-Gro T-Gro added Area-ProjectsAndBuild MSBuild tasks, project files, framework resolution and removed Bug Needs-Triage labels Jul 31, 2024
@T-Gro T-Gro modified the milestones: Backlog, August-2024 Jul 31, 2024
@T-Gro
Copy link
Member Author

T-Gro commented Jul 31, 2024

TODO: Consider the other C# values: "annotations" , "warnings" as opposed to just "disabled" / "enabled".
TODO Tomas: Scan GH C# repo to see how common the options are.

@T-Gro T-Gro linked a pull request Aug 2, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Nullness Issues related to handling of Nullable Reference Types Area-ProjectsAndBuild MSBuild tasks, project files, framework resolution
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant