Skip to content

Better codegen for record's Equals member#79966

Open
DoctorKrolic wants to merge 7 commits intodotnet:mainfrom
DoctorKrolic:better-record-members-codegen
Open

Better codegen for record's Equals member#79966
DoctorKrolic wants to merge 7 commits intodotnet:mainfrom
DoctorKrolic:better-record-members-codegen

Conversation

@DoctorKrolic
Copy link
Contributor

Closes #70221

One of comments in the issue also mentions GetHashCode. I tried it locally (by "it" I mean calling GetHashCode directly when overriden in structs) and it turns out that it takes a bit more IL due to ceremony with constrained call, so I didn't include those changes

@DoctorKrolic DoctorKrolic requested a review from a team as a code owner August 19, 2025 20:44
@dotnet-policy-service dotnet-policy-service bot added the Community The pull request was submitted by a contributor who is not a Microsoft employee. label Aug 19, 2025
Copy link
Member

@jaredpar jaredpar left a comment

Choose a reason for hiding this comment

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

Putting a hold on the PR until the underlying issue gets LDM sign off.

@DoctorKrolic
Copy link
Contributor Author

@jaredpar Do you have this question scheduled for an LDM? Correct me if I am wrong, but this is a weekly event, isn't it? I don't think it would take much discussion time to make a decision here

@jaredpar
Copy link
Member

jaredpar commented Sep 2, 2025

Correct me if I am wrong, but this is a weekly event, isn't it?

Usually but not always.

Do you have this question scheduled for an LDM?

No. Don't believe anyone has put this on the agenda.

@RikkiGibson, @CyrusNajmabadi in case they have time to bring this in the next few weeks.

@CyrusNajmabadi
Copy link
Contributor

I'll look into it. I don't find it hugely important. But if we have time, then sure:-)

@jcouv jcouv added the Code Gen Quality Room for improvement in the quality of the compiler's generated code label Oct 10, 2025
@DoctorKrolic
Copy link
Contributor Author

@CyrusNajmabadi for a friendly reminder

@CyrusNajmabadi
Copy link
Contributor

Thanks for the reminder. Will try to bring to LDM soon.

@333fred
Copy link
Member

333fred commented Jan 24, 2026

@CyrusNajmabadi @DoctorKrolic this PR by itself is not enough to bring to LDM. There needs to be an actual proposal checked into csharplang.

@DoctorKrolic
Copy link
Contributor Author

You mean something like this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-Compilers Code Gen Quality Room for improvement in the quality of the compiler's generated code Community The pull request was submitted by a contributor who is not a Microsoft employee.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Compiler could/should be better in how it emits equality for records.

5 participants