Skip to content

Conversation

@safern
Copy link
Member

@safern safern commented Mar 10, 2021

This reacts to: dotnet/arcade#7058

The build will fail as we need to update API Compat, but before merging the change in arcade I wanted to do a run on dotnet/runtime and see if there was something weird with the rule going on.

@ghost
Copy link

ghost commented Mar 10, 2021

Note regarding the new-api-needs-documentation label:

This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, to please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change.

@ghost
Copy link

ghost commented Mar 10, 2021

I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label.

public bool Expired { get { throw null; } set { } }
public System.DateTime Expires { get { throw null; } set { } }
public bool HttpOnly { get { throw null; } set { } }
[System.Diagnostics.CodeAnalysis.AllowNullAttribute]
Copy link
Member Author

Choose a reason for hiding this comment

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

This is a breaking change against .NET 5.0, however the implementation indeed doesn't allow null in this case:

if (string.IsNullOrEmpty(value) || !InternalSetName(value))
{
throw new CookieException(SR.Format(SR.net_cookie_attribute, "Name", value == null ? "<null>" : value));
}

Copy link
Member

Choose a reason for hiding this comment

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

IIRC we are still permitting corrections to nullable annotations?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think we are. cc: @stephentoub @jeffhandley

Copy link
Member

@stephentoub stephentoub Mar 10, 2021

Choose a reason for hiding this comment

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

Yup. We are tracking all of them for a breaking change issue.
dotnet/docs#21202

@@ -0,0 +1,9 @@
CannotRemoveAttribute : Attribute 'System.Diagnostics.CodeAnalysis.AllowNullAttribute' exists on parameter 'left' on member 'System.Runtime.CompilerServices.Unsafe.AreSame<T>(T, T)' in the contract but not the implementation.
Copy link
Member Author

Choose a reason for hiding this comment

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

I added this to avoid having to add the attributes to the IL as it was verbose because we need to if def depending on the tfm to reference System.Private.CoreLib.

Copy link
Member

@eerhardt eerhardt left a comment

Choose a reason for hiding this comment

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

All the linker annotations (DynamicallyAccessedMembers) LGTM. Thanks for fixing this, @safern! Its great that we are ensuring our ref assembly matches our impl assemblies.

Copy link
Member

@stephentoub stephentoub left a comment

Choose a reason for hiding this comment

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

Thanks for fixing this all up.

@safern safern requested a review from marek-safar as a code owner March 11, 2021 02:19
@safern
Copy link
Member Author

safern commented Mar 11, 2021

I'll follow up on the browser failures tomorrow.

@safern safern merged commit 689bac6 into dotnet:main Mar 11, 2021
@safern safern deleted the ParamAttributes branch March 11, 2021 08:03
@ghost ghost locked as resolved and limited conversation to collaborators Apr 10, 2021
@karelz karelz added this to the 6.0.0 milestone May 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants