Skip to content

Make AreStatic/AreNotStatic agree with BeStatic/NotBeStatic on unknown state - #485

Merged
alexanderlinne merged 1 commit into
mainfrom
fix-static-predicates-unknown-state
Aug 28, 2026
Merged

alexanderlinne merged 1 commit into
mainfrom
fix-static-predicates-unknown-state

Conversation

@alexanderlinne

Copy link
Copy Markdown
Collaborator

IMember.IsStatic is null for stub members, i.e. members built from a MethodReference or FieldReference rather than a definition. The two member predicates were the only two of the 24 HasValue guards under Elements/ written as "HasValue &&" rather than "!HasValue ||", so for such a member BeStatic and NotBeStatic both passed while neither AreStatic nor AreNotStatic matched.

No snapshot changes: every member in every test architecture has a non-null IsStatic, and there is no fluent path to a stub member today, so the fix is not observable from a test.

…nknown state

IMember.IsStatic is null for stub members, i.e. members built from a
MethodReference or FieldReference rather than a definition. The two member
predicates were the only two of the 24 HasValue guards under Elements/ written
as "HasValue &&" rather than "!HasValue ||", so for such a member BeStatic and
NotBeStatic both passed while neither AreStatic nor AreNotStatic matched.

No snapshot changes: every member in every test architecture has a non-null
IsStatic, and there is no fluent path to a stub member today, so the fix is not
observable from a test.

Signed-off-by: Alexander Linne <alexander.linne@tngtech.com>
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.50%. Comparing base (6d8fd73) to head (a110765).

Files with missing lines Patch % Lines
...tax/Elements/Members/MemberPredicatesDefinition.cs 0.00% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #485   +/-   ##
=======================================
  Coverage   82.50%   82.50%           
=======================================
  Files         259      259           
  Lines       12395    12395           
  Branches     1206     1206           
=======================================
  Hits        10226    10226           
  Misses       1798     1798           
  Partials      371      371           

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@alexanderlinne
alexanderlinne merged commit 7d902ca into main Aug 28, 2026
10 checks passed
@alexanderlinne
alexanderlinne deleted the fix-static-predicates-unknown-state branch August 28, 2026 08:12
This was referenced Oct 26, 2026
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