Skip to content

Conversation

@EdwinEngelen
Copy link
Contributor

This falsely triggers SA1500 and SA1513 on the closing brace.
Although this is a stupid example, usually there will be some expression in the getter and/or setter.

public bool Property1
{
    get { return field; }
    set { field = value; }
} = default;

This problem has also been mentioned #4028 (comment).
Depends on PR #4040.

@EdwinEngelenCGM EdwinEngelenCGM force-pushed the csharp14-property-initializer branch 2 times, most recently from 240b507 to a8debc2 Compare December 12, 2025 10:58
@codecov
Copy link

codecov bot commented Dec 12, 2025

Codecov Report

❌ Patch coverage is 97.14286% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 97.48%. Comparing base (673de60) to head (9b946ab).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4077      +/-   ##
==========================================
+ Coverage   94.60%   97.48%   +2.88%     
==========================================
  Files        1026     1029       +3     
  Lines      119110   119172      +62     
  Branches     3475     3476       +1     
==========================================
+ Hits       112684   116176    +3492     
+ Misses       5366     1984    -3382     
+ Partials     1060     1012      -48     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@EdwinEngelenCGM EdwinEngelenCGM force-pushed the csharp14-property-initializer branch 2 times, most recently from 12ea8e8 to a8debc2 Compare December 15, 2025 19:54
@EdwinEngelenCGM EdwinEngelenCGM force-pushed the csharp14-property-initializer branch 3 times, most recently from 14cbf9b to 9b946ab Compare December 17, 2025 08:20
@sharwell
Copy link
Member

Note that I probably won't be able to get to this until after the C# 14 audit is complete. So far I (recently) completed the C# 8 and 9 audits and am currently working on C# 10.

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.

3 participants