Skip to content

Clean up #nullable in source - #72568

Merged
stephentoub merged 1 commit into
dotnet:mainfrom
stephentoub:fixnullablepragmas
Jul 21, 2022
Merged

Clean up #nullable in source#72568
stephentoub merged 1 commit into
dotnet:mainfrom
stephentoub:fixnullablepragmas

Conversation

@stephentoub

Copy link
Copy Markdown
Member

We had dozens of uses of #nullable disable left in source in places we shouldn't have, resulting in lack of annotation in sources we'd declared NRT-enabled. We also had dozens of use of #nullable enable in source it shouldn't have been in, resulting in us actually shipping public annotations in code we didn't fully review for that purpose (e.g. some types in CodeDom). This cleans all of that up, removing unnecessary #nullables in the source.

This also now defaults test projects to <Nullable>annotations</Nullable>. Test projects often include annotated files shared with product source, and while we generally don't require test projects be NRT-enabled, they can be tolerant of the annotations; we don't ship them, so we don't need to be concerned about what annotations show up on public types in test assemblies.

@ghost

ghost commented Jul 21, 2022

Copy link
Copy Markdown

Tagging subscribers to this area: @dotnet/area-meta
See info in area-owners.md if you want to be subscribed.

Issue Details

We had dozens of uses of #nullable disable left in source in places we shouldn't have, resulting in lack of annotation in sources we'd declared NRT-enabled. We also had dozens of use of #nullable enable in source it shouldn't have been in, resulting in us actually shipping public annotations in code we didn't fully review for that purpose (e.g. some types in CodeDom). This cleans all of that up, removing unnecessary #nullables in the source.

This also now defaults test projects to <Nullable>annotations</Nullable>. Test projects often include annotated files shared with product source, and while we generally don't require test projects be NRT-enabled, they can be tolerant of the annotations; we don't ship them, so we don't need to be concerned about what annotations show up on public types in test assemblies.

Author: stephentoub
Assignees: -
Labels:

area-Meta

Milestone: -

We had dozens of uses of `#nullable disable` left in source in places we shouldn't have, resulting in lack of annotation in sources we'd declared NRT-enabled.  We also had dozens of use of `#nullable enable` in source it shouldn't have been in, resulting in us actually shipping public annotations in code we didn't fully review for that purpose (e.g. some types in CodeDom).  This cleans all of that up, removing unnecessary #nullables in the source.

This also now defaults test projects to `<Nullable>annotations</Nullable>`.  Test projects often include annotated files shared with product source, and while we generally don't require test projects be NRT-enabled, they can be tolerant of the annotations; we don't ship them, so we don't need to be concerned about what annotations show up on public types in test assemblies.

@buyaa-n buyaa-n left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks

@DustinCampbell DustinCampbell left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@stephentoub
stephentoub merged commit 40f62b6 into dotnet:main Jul 21, 2022
@stephentoub
stephentoub deleted the fixnullablepragmas branch July 21, 2022 16:19
@ghost ghost locked as resolved and limited conversation to collaborators Aug 20, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants