Skip to content

fix: only list declared members in member collections#202

Merged
vbreuss merged 1 commit into
mainfrom
topic/fix-only-list-declared-members-in-member-collections
May 27, 2026
Merged

fix: only list declared members in member collections#202
vbreuss merged 1 commit into
mainfrom
topic/fix-only-list-declared-members-in-member-collections

Conversation

@vbreuss
Copy link
Copy Markdown
Member

@vbreuss vbreuss commented May 27, 2026

The member collections built their results with inline reflection calls (e.g. type.GetMethods(...)) that returned compiler-generated members: .Methods() included property/event accessors and operators, and .Fields() included compiler-generated backing fields.

Route all member collections (methods, properties, fields, events, constructors) through the existing TypeHelpers.GetDeclared* helpers, which filter out special-name members and backing fields, so the collections only expose the members actually declared in source. A new GetDeclaredEvents helper is added to cover events.

@vbreuss vbreuss self-assigned this May 27, 2026
@vbreuss vbreuss added the bug Something isn't working label May 27, 2026
The member collections built their results with inline reflection calls (e.g. `type.GetMethods(...)`) that returned compiler-generated members: `.Methods()` included property/event accessors and operators, and `.Fields()` included compiler-generated backing fields.

Route all member collections (methods, properties, fields, events, constructors) through the existing `TypeHelpers.GetDeclared*` helpers, which filter out special-name members and backing fields, so the collections only expose the members actually declared in source. A new `GetDeclaredEvents` helper is added to cover events.
@vbreuss vbreuss force-pushed the topic/fix-only-list-declared-members-in-member-collections branch from a152c23 to 7860f2c Compare May 27, 2026 10:47
@vbreuss vbreuss enabled auto-merge (squash) May 27, 2026 10:47
@sonarqubecloud
Copy link
Copy Markdown

@github-actions
Copy link
Copy Markdown

Test Results

    13 files  ± 0      13 suites  ±0   3m 12s ⏱️ -36s
 3 078 tests + 2   3 075 ✅ + 2   3 💤 ±0  0 ❌ ±0 
18 448 runs  +12  18 435 ✅ +12  13 💤 ±0  0 ❌ ±0 

Results for commit 7860f2c. ± Comparison against base commit 4883b4e.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 27, 2026

🚀 Benchmark Results

Details

BenchmarkDotNet v0.15.8, Linux Ubuntu 24.04.4 LTS (Noble Numbat)
AMD EPYC 9V74 2.87GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 10.0.300
[Host] : .NET 10.0.8 (10.0.8, 10.0.826.23019), X64 RyuJIT x86-64-v3
DefaultJob : .NET 10.0.8 (10.0.8, 10.0.826.23019), X64 RyuJIT x86-64-v3

Method Mean Error StdDev Gen0 Allocated
TypeIsNotStatic_aweXpect 207.6 ns 2.49 ns 2.33 ns 0.0386 648 B

@github-actions
Copy link
Copy Markdown

👽 Mutation Results

Mutation testing badge

aweXpect.Reflection

Details
File Score Killed Survived Timeout No Coverage Ignored Compile Errors Total Detected Total Undetected Total Mutants
Collections/Filtered.Constructors.cs 100.00% 5 0 0 0 1 1 5 0 7
Collections/Filtered.Events.cs 93.75% 15 1 0 0 10 1 15 1 27
Collections/Filtered.Fields.cs 93.75% 15 1 0 0 10 1 15 1 27
Collections/Filtered.Methods.cs 93.75% 15 1 0 0 10 1 15 1 27
Collections/Filtered.Properties.cs 93.75% 15 1 0 0 10 1 15 1 27
Helpers/TypeHelpers.cs 98.11% 156 1 0 2 36 2 156 3 197

The final mutation score is 96.93%

Coverage Thresholds: high:80 low:60 break:0

@vbreuss vbreuss merged commit a91c278 into main May 27, 2026
12 checks passed
@vbreuss vbreuss deleted the topic/fix-only-list-declared-members-in-member-collections branch May 27, 2026 10:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant