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

Changes to Nullable Reference Type Annotations in .NET 6.0 #21202

Closed
29 tasks done
jeffhandley opened this issue Oct 23, 2020 · 3 comments
Closed
29 tasks done

Changes to Nullable Reference Type Annotations in .NET 6.0 #21202

jeffhandley opened this issue Oct 23, 2020 · 3 comments
Assignees
Labels
breaking-change Indicates a .NET Core breaking change 🏁 Release: .NET 6 Issues and PRs for the .NET 6 release DO NOT MERGE doc-idea Indicates issues that are suggestions for new topics [org][type][category] Pri1 High priority, do before Pri2 and Pri3

Comments

@jeffhandley
Copy link
Member

jeffhandley commented Oct 23, 2020

Changes to Nullable Reference Type Annotations in .NET 6.0

This issue represents a work-in-progress. All changes to nullability annotations in the .NET Libraries will be aggregated into this issue throughout the course of .NET 6.0.

Starting in .NET Core 3.0, we have been applying nullability annotations to the .NET Libraries; .NET 5.0 reached 94% coverage across the APIs. From the outset of this effort, we anticipated that mistakes would be made in these annotations and fixes would need to be made. In .NET 6.0, we are updating some annotations that have been previously applied.

Some of these changes are considered breaking changes because they could lead to new build-time warnings--code referencing these APIs will need to be updated when migrating to .NET 6.0. Other changes that are not considered breaking are also documented here as referencing code may benefit from removing operators or pragmas that become unnecessary.

Old behavior

The affected APIs had incorrect nullable reference type annotations and build warnings were either absent or incorrect.

New behavior

New build warnings will be produced and incorrect build warnings will no longer be produced for the affected APIs.

Reason for change

Through feedback and further testing, the nullable annotations for the affected APIs were determined to be inaccurate. The updated annotations now correctly represent the nullability contracts for the APIs.

Recommended action

Update code calling these APIs to reflect the revised nullability contracts.

Category

  • Core .NET libraries

Affected APIs

(Unchecked items in the list have not yet been documented)

Version introduced: .NET 6.0 Preview 1

dotnet/runtime#42918 [Breaking]

dotnet/runtime#43717 [Non-Breaking]

dotnet/runtime#44880 [Non-Breaking]

dotnet/runtime#44844 [Non-Breaking]

dotnet/runtime#44938 [Breaking]

Version introduced: .NET 6.0 Preview 2

dotnet/runtime#47402 [Non-Breaking]

dotnet/runtime#47598 [Breaking]


Issue metadata

  • Issue type: breaking-change
@jeffhandley jeffhandley added in-progress breaking-change Indicates a .NET Core breaking change DO NOT MERGE labels Oct 23, 2020
@dotnet-bot dotnet-bot added ⌚ Not Triaged Not triaged doc-idea Indicates issues that are suggestions for new topics [org][type][category] labels Oct 23, 2020
@gewarren gewarren added 🏁 Release: .NET 6 Issues and PRs for the .NET 6 release and removed ⌚ Not Triaged Not triaged labels Oct 26, 2020
@gewarren gewarren self-assigned this Oct 26, 2020
@PRMerger6 PRMerger6 added the Pri3 label Nov 11, 2020
@gewarren gewarren added Pri1 High priority, do before Pri2 and Pri3 and removed Pri3 labels Mar 29, 2021
@gewarren
Copy link
Contributor

gewarren commented Jun 1, 2021

@buyaa-n @eiriktsarpalis Please don't check the boxes in the issue description when you edit it to add an API. That's how I mark whether I've documented them or not. Thanks!

@gewarren
Copy link
Contributor

I'm going to close this issue now. If there are any more nullable reference type annotation changes for .NET 6, please open a new issue.

@jeffhandley
Copy link
Member Author

#25957 was filed for an annotation change to System.ComponentModel.DataAnnotations.AssociatedMetadataTypeTypeDescriptionProvider. Adding the link here for future reference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change Indicates a .NET Core breaking change 🏁 Release: .NET 6 Issues and PRs for the .NET 6 release DO NOT MERGE doc-idea Indicates issues that are suggestions for new topics [org][type][category] Pri1 High priority, do before Pri2 and Pri3
Projects
None yet
Development

No branches or pull requests

4 participants