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

Use new record equality specification #43626

Merged
merged 5 commits into from
May 1, 2020

Conversation

agocke
Copy link
Member

@agocke agocke commented Apr 23, 2020

Per design changes, record equality is now defined using all instance
fields, instead of just record fields.

Spec changes at dotnet/csharplang#3396

@agocke agocke changed the title Change record equality to consider all instance fields Use new record equality specification Apr 25, 2020
Per design changes, record equality is now defined using all instance
fields, instead of just record fields.
@agocke agocke marked this pull request as ready for review April 27, 2020 23:13
@agocke agocke requested a review from a team as a code owner April 27, 2020 23:13
@agocke agocke requested review from gafter and 333fred April 27, 2020 23:13
@agocke
Copy link
Member Author

agocke commented Apr 27, 2020

@gafter @333fred for review

Copy link
Member

@333fred 333fred left a comment

Choose a reason for hiding this comment

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

LGTM (other than the miss-add/move of anonymous type symbol tests).

@agocke
Copy link
Member Author

agocke commented Apr 30, 2020

ping @gafter for review

: F.LogicalAnd(retExpression, nextEquals);
}

RoslynDebug.AssertNotNull(retExpression);
Copy link
Member

Choose a reason for hiding this comment

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

AssertNotNull [](start = 24, length = 13)

This assertion does not appear justified.

Copy link
Member

Choose a reason for hiding this comment

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

Earlier fields is asserted to have more than 1 element, there will always be at least one iteration of the foreach.

Copy link
Member

Choose a reason for hiding this comment

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

How is there always at least one iteration of the foreach? According to the spec a record can have an empty parameter list.


In reply to: 418268985 [](ancestors = 418268985)

@gafter
Copy link
Member

gafter commented Apr 30, 2020

Finished a quick scan of Iteration 2.

TList fields,
SyntheticBoundNodeFactory F) where TList : IReadOnlyList<FieldSymbol>
{
Debug.Assert(fields.Count > 0);
Copy link
Member

@gafter gafter May 1, 2020

Choose a reason for hiding this comment

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

fields.Count > 0 [](start = 25, length = 16)

How is this justified? Please add a PROTOYPE, issue, or bullet in the test plan.

Copy link
Member

@gafter gafter left a comment

Choose a reason for hiding this comment

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

:shipit:

Copy link
Member

@gafter gafter left a comment

Choose a reason for hiding this comment

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

Looks good, except for a possible mismatch with the spec on how to handle a data class declared with an empty parameter list. Please track that somehow.

@agocke agocke merged commit a0534a0 into dotnet:features/records May 1, 2020
@agocke agocke deleted the value-equals branch May 1, 2020 07:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants