Ensure Primary Constructor Parameter Member Generation Coverage
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- csharp
- Domain
- testing-qa
Research direction
Start with the linked primary constructors documentation, then locate the repository's existing coverage for primary constructor parameters. Check cases for private-field capture, omitted fields, record properties, and inherited record properties, including the non-record distinction. Done means each stated behavior is covered by tests or examples and the relevant test suite passes.
Written by the indexing model from the issue text.
Description
- When a primary constructor parameter is used, the compiler captures the constructor parameter in a private field with a compiler-generated name.
If a primary constructor parameter isn't used in the body of the type, no private field is captured. (That rule prevents accidentally allocating two copies of a primary constructor parameter that's passed to a base constructor.) - If the type includes the record modifier, the compiler instead synthesizes a public property with the same name as the primary constructor parameter.
- For record class types, if a primary constructor parameter uses the same name as a base primary constructor, that property is a public property of the base record class type. It isn't duplicated in the derived record class type. These properties aren't generated for non-record types.
See https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/instance-constructors#primary-constructors
- Dominant language
- C#
- Stars
- 419
- Forks
- 173
- Avg merge
- 3m
- Merged PRs (30d)
- 3
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from IntelliTect/EssentialCSharp
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
IntelliTect/EssentialCSharp#886 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 78/100
IntelliTect/EssentialCSharp#885 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
IntelliTect/EssentialCSharp#883 · 1 comment ·
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
IntelliTect/EssentialCSharp#880 ·
-
IntelliTect/EssentialCSharp#882 · 1 comment · 1 assignee ·
All issues in IntelliTect/EssentialCSharp
Similar issues
-
[Feat] 조합 영역 구분선 개선 Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
type/automation type/tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
t/bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
ci-failure-cause test-failure
Difficulty 2/5 1-3 hours Newbie friendliness 82/100