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

[Discussion] Changes to Nullable Reference Type Annotations in .NET 6.0 #27564

Closed
pranavkm opened this issue Nov 5, 2020 · 4 comments
Closed
Milestone

Comments

@pranavkm
Copy link
Contributor

pranavkm commented Nov 5, 2020

Changes to Nullable Reference Type Annotations in .NET 6.0

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

Starting in .NET 5.0, we have been applying nullability annotations to parts of ASP.NET Core. 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 source breaking changes because it leads to the APIs being incompatible or more restrictive, or could result in build-time warnings when used in projects that have nullable reference types enabled.

Version introduced

.NET 6.0

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

ASP.NET

Affected APIs

@pranavkm pranavkm changed the title Changes to Nullable Reference Type Annotations in .NET 6.0 [Discussion] Changes to Nullable Reference Type Annotations in .NET 6.0 Nov 5, 2020
@pranavkm pranavkm added this to the Discussions milestone Nov 5, 2020
@slang25
Copy link
Contributor

slang25 commented Dec 27, 2020

This is a bit of a tangent, but is there any intention to change the default for the .NET SDK in version 6 or further to enable nullable references for new projects, and have enabled be implicit?

@pranavkm
Copy link
Contributor Author

@slang25 ASP.NET Core is planning to do it as part of 6.0. #27389 has an overview of the planned work here. dotnet/sdk#14272 tracks doing it across other .NET 6 project templates.

@ghost ghost closed this as completed Feb 25, 2021
@pranavkm pranavkm reopened this Feb 25, 2021
@dotnet dotnet deleted a comment Feb 25, 2021
@ghost
Copy link

ghost commented Apr 26, 2021

Thank you for contacting us. Due to a lack of activity on this discussion issue we're closing it in an effort to keep our backlog clean. If you believe there is a concern related to the ASP.NET Core framework, which hasn't been addressed yet, please file a new issue.

This issue will be locked after 30 more days of inactivity. If you still wish to discuss this subject after then, please create a new issue!

@ghost ghost closed this as completed Apr 26, 2021
@pranavkm pranavkm reopened this Apr 26, 2021
@ghost
Copy link

ghost commented Jun 26, 2021

Thank you for contacting us. Due to a lack of activity on this discussion issue we're closing it in an effort to keep our backlog clean. If you believe there is a concern related to the ASP.NET Core framework, which hasn't been addressed yet, please file a new issue.

This issue will be locked after 30 more days of inactivity. If you still wish to discuss this subject after then, please create a new issue!

@ghost ghost closed this as completed Jun 26, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Jul 26, 2021
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants