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

Add primary constructors #612

Merged

Conversation

Head0nF1re
Copy link
Contributor

@Head0nF1re Head0nF1re commented Feb 2, 2024

resolves #611

CS9107: Parameter is captured into the state of the enclosing type and its value is also passed to the base constructor. The value might be captured by the base class as well. This warning indicates that your code may be allocated two copies of a primary constructor parameter. Because the parameter is passed to the base class, the base class likely uses it. Because the derived class accesses it, it may have a second copy of the same parameter. That extra storage may not be intended.
CS9113: Parameter is unread. This warning indicates that your class never references the primary constructor, even to pass it to the base primary constructor. It likely isn't needed.
CS9124: Parameter is captured into the state of the enclosing type and its value is also used to initialize a field, property, or event. This warning indicates that the constructor parameter of a nested type is also captured by the enclosing type. The parameter is likely stored twice.
CS9179: Primary constructor parameter is shadowed by a member from base

Note: There was a need to add a field in Replace and Insert in order to prevent a naming conflict between the index parameter of primary ctor and ElementAt.

Copy link

codecov bot commented Feb 2, 2024

Codecov Report

Attention: 10 lines in your changes are missing coverage. Please review.

Comparison is base (bcecba2) 93.30% compared to head (2607cc4) 93.29%.
Report is 6 commits behind head on master.

Files Patch % Lines
Source/SuperLinq/ValueTupleEqualityComparer.cs 30.00% 6 Missing and 1 partial ⚠️
Source/SuperLinq/ScanRight.cs 87.50% 0 Missing and 1 partial ⚠️
Source/SuperLinq/Sequence.cs 88.88% 0 Missing and 1 partial ⚠️
Source/SuperLinq/ValueTupleComparer.cs 83.33% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #612      +/-   ##
==========================================
- Coverage   93.30%   93.29%   -0.02%     
==========================================
  Files         242      242              
  Lines        7767     7781      +14     
  Branches     1596     1596              
==========================================
+ Hits         7247     7259      +12     
- Misses        329      331       +2     
  Partials      191      191              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@viceroypenguin viceroypenguin merged commit 7691a3f into viceroypenguin:master Feb 2, 2024
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reduce visual noise with primary constructors
2 participants