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

GeneratorDriverState and GeneratorState should be records #59199

Open
chsienki opened this issue Feb 1, 2022 · 3 comments
Open

GeneratorDriverState and GeneratorState should be records #59199

chsienki opened this issue Feb 1, 2022 · 3 comments

Comments

@chsienki
Copy link
Member

chsienki commented Feb 1, 2022

It would be nice if GeneratorDriverState and GeneratorState were records. I don't think we've had many opportunities to dogfood records.

Originally posted by @RikkiGibson in #58800 (comment)

Would also be a big code simplification win.

@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged Issues and PRs which have not yet been triaged by a lead label Feb 1, 2022
@jcouv
Copy link
Member

jcouv commented Feb 11, 2022

The reason we haven't used records much in roslyn is because we don't often rely on structural equality. So we didn't want to add all those methods to types when they aren't necessary to our scenarios.

@jcouv
Copy link
Member

jcouv commented Feb 25, 2022

@RikkiGibson @chsienki I'm pushing back a bit on making those types records. What do you think? If you're convinced, we could close this issue.

@jcouv jcouv removed the untriaged Issues and PRs which have not yet been triaged by a lead label Mar 1, 2022
@jcouv jcouv added this to the Backlog milestone Mar 1, 2022
@RikkiGibson
Copy link
Contributor

I would like for us to at least measure the increase in code size, for example, before completely writing it off.

Basically, it concerns me a little that we so carefully designed records to work for such a variety of use cases, and then we feel that we don't want to use them in new code.

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

No branches or pull requests

3 participants