CA1805: Fix FP with parameterless ctor on value types#5813
CA1805: Fix FP with parameterless ctor on value types#5813Evangelink merged 12 commits intodotnet:mainfrom
Conversation
|
@stephentoub for review |
sharwell
left a comment
There was a problem hiding this comment.
Waiting for question to be answered
Codecov Report
@@ Coverage Diff @@
## main #5813 +/- ##
==========================================
+ Coverage 96.03% 96.04% +0.01%
==========================================
Files 1338 1325 -13
Lines 307627 306254 -1373
Branches 9803 9693 -110
==========================================
- Hits 295427 294142 -1285
+ Misses 9817 9775 -42
+ Partials 2383 2337 -46 |
Youssef1313
left a comment
There was a problem hiding this comment.
Can you add few tests for #5887?
public record struct MyRecord()
{
public bool SomeBool { get; set; } = false;
}public record struct MyRecord
{
public MyRecord() { }
public bool SomeBool { get; set; } = false;
}There was a problem hiding this comment.
There is no test for a struct without explicit constructor. This now produces CS8983 error anyway, so we may not care, but it didn't use to produce an error before dotnet/roslyn@3e4cc4c (even before that commit I'm not sure why issue states it being a false positive)
|
@stephentoub @Youssef1313 ready for review. Thanks! |
|
@stephentoub @Youssef1313 PR should be finally ready. |
|
I'm hitting this problem in my PR, so it would be great if we could merge this. @Evangelink is the PR ready to be merged? Has it become stale? |
|
@ManickaP I will merge main to have the CI issues fixed but as far as I remember it was ready to be merged. |
Fixes #5750 and fixes #5887