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

Get default value from constructor when type is a record. #2428

Merged
merged 9 commits into from Oct 14, 2020

Conversation

PascalSenn
Copy link
Member

Resolved #2427

@PascalSenn
Copy link
Member Author

@michaelstaib saw this in the backlog

This PR has a little side effect. It would also add default values on class input types if the parameter name is also capital case:

public class FooInput 
{
   public FooInput(string Name = "Default") {
     this.Name = Name; 
   }

   public string Name {get;}  
}

@PascalSenn PascalSenn self-assigned this Oct 13, 2020
@michaelstaib michaelstaib changed the title Get Default Value From Ctor Get default value from constructor when type is a record. Oct 14, 2020
michaelstaib
michaelstaib previously approved these changes Oct 14, 2020
@sonarcloud
Copy link

sonarcloud bot commented Oct 14, 2020

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 4 Code Smells

86.7% 86.7% Coverage
0.0% 0.0% Duplication

@michaelstaib michaelstaib merged commit 1b34d9a into develop Oct 14, 2020
@michaelstaib michaelstaib deleted the pse/default-value-from-ctor branch November 6, 2020 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🎉 enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Records, use default value from the constructor.
2 participants