-
Notifications
You must be signed in to change notification settings - Fork 388
Refactoring records + primary constructor instrumentation #1761
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
base: master
Are you sure you want to change the base?
Conversation
… to one test file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors record tests and primary constructor instrumentation by moving record-related samples into a dedicated file and simplifying auto-property instrumentation logic.
- Migrate record-related test cases from Instrumentation.AutoProps.cs to a new Instrumentation.Records.cs file.
- Simplify auto-property instrumentation logic in CecilSymbolHelper.cs by removing the constructor check and the related default initialization skip.
Reviewed Changes
Copilot reviewed 3 out of 6 changed files in this pull request and generated no comments.
File | Description |
---|---|
test/coverlet.core.coverage.tests/Samples/Instrumentation.Records.cs | Introduces various record types and tests covering records with primary constructors, inheritance, and abstract records. |
test/coverlet.core.coverage.tests/Samples/Instrumentation.AutoProps.cs | Removes duplicate record-related test cases that were relocated. |
src/coverlet.core/Symbols/CecilSymbolHelper.cs | Adjusts the auto-property instrumentation logic by removing the constructor check and skipping default initialization handling. |
Comments suppressed due to low confidence (2)
src/coverlet.core/Symbols/CecilSymbolHelper.cs:1367
- The removal of the constructor check (methodDefinition.IsConstructor) changes when auto-property instrumentation is applied. Please confirm that applying instrumentation to non-constructor methods does not lead to unexpected behavior.
if (!skipAutoProps) return false;
test/coverlet.core.coverage.tests/Samples/Instrumentation.Records.cs:5
- [nitpick] Consider adding brief inline comments to clarify the intent and differences between the various record test types to improve code readability and maintainability.
public record RecordWithPropertyInit
closes #1576