Skip to content

Conversation

BillWagner
Copy link
Member

Fixes #24077

Beginning in C# 10.0, records may declare a ToString method as sealed. This prevents derived records from creating an override. Effectively, that means the ToString output will not include the runtime type information. (All members and values are displayed, because derived records will still have a PrintMembers method generated.)

Fixes dotnet#24077

Beginning in C# 10.0, records may declare a `ToString` method as `sealed`. This prevents derived records from creating an override. Effectively, that means the `ToString` output will not include the runtime type information. (All members and values are displayed, because derived records will still have a PrintMembers method generated.)
This was introduced in an earlier PR
Copy link
Contributor

@tdykstra tdykstra left a comment

Choose a reason for hiding this comment

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

LGTM, a couple of minor suggestions.

@BillWagner BillWagner merged commit c889d4b into dotnet:main Jul 6, 2021
@BillWagner BillWagner deleted the record-sealed-tostring branch July 6, 2021 18:21
@BillWagner BillWagner added the okr-freshness OKR: Freshness of content label Sep 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Record types can seal ToString

4 participants