IntelliTect / IntelliTect/EssentialCSharp
Ensure Primary Constructor Parameter Member Generation Coverage
- Lenguaje dominante
- C#
- Estrellas
- 418
- Forks
- 173
- Merge medio
- 3 min
- PR fusionados (30 d)
- 3
Descripción
* 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
Guía de contribución
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- csharp
- Área
- testing-qa
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 45/100