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

Synthesize record properties and ctor #41011

Merged
merged 6 commits into from
Jan 24, 2020

Conversation

agocke
Copy link
Member

@agocke agocke commented Jan 16, 2020

The synthesized constructor assigns the properties, if they are
synthesized properties. The properties are synthesized only if no
conflicting member already exists in the class.

Spec work in dotnet/csharplang#3106
Relates to #40726 (test plan for records)

@agocke agocke marked this pull request as ready for review January 16, 2020 23:28
@agocke agocke requested a review from a team as a code owner January 16, 2020 23:28
@agocke
Copy link
Member Author

agocke commented Jan 16, 2020

This PR builds on #40625

@agocke agocke requested review from gafter and 333fred January 16, 2020 23:28
@gafter gafter removed their request for review January 17, 2020 00:51
The synthesized constructor assigns the properties, if they are
synthesized properties. The properties are synthesized only if no
conflicting member already exists in the class.
@cston
Copy link
Member

cston commented Jan 17, 2020

using System;

Include copyright. #Closed


Refers to: src/Compilers/CSharp/Portable/Symbols/Source/SourceOrRecordPropertySymbol.cs:1 in 1906e63. [](commit_id = 1906e63, deletion_comment = False)

@agocke
Copy link
Member Author

agocke commented Jan 22, 2020

@333fred for review

}
}";
CompileAndVerify(src, expectedOutput: @"
3
Copy link
Member

Choose a reason for hiding this comment

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

We should bring this behavior up in LDM. This is certainly not what I was expecting to happen in this class declaration. I'd expect either an error, or the Xs to line up.

@333fred
Copy link
Member

333fred commented Jan 23, 2020

Done review pass (commit 5)

@agocke agocke merged commit e85be97 into dotnet:features/records Jan 24, 2020
@agocke agocke deleted the record-properties branch January 24, 2020 21:01
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.

4 participants