Skip to content

fix: resolve properties backed by default interface members - #658

Merged
rexm merged 1 commit into
masterfrom
fix/issue-601-default-interface-members
Aug 6, 2026
Merged

fix: resolve properties backed by default interface members#658
rexm merged 1 commit into
masterfrom
fix/issue-601-default-interface-members

Conversation

@rexm

@rexm rexm commented Aug 6, 2026

Copy link
Copy Markdown
Member

Summary

  • Type.GetProperties() on a concrete class doesn't surface properties whose only implementation is a C# 8+ default interface member (declared and bodied on an interface, not overridden by the class). Both {{PropertyName}} lookup (ReflectionMemberAccessor) and property enumeration (ObjectDescriptorProvider, used by {{#each this}}) now also scan the instance type's implemented interfaces as a fallback.
  • Verified experimentally that PropertyInfo.GetValue/CreateDelegate on an interface-declared property correctly dispatches to the default implementation for a concrete instance, so no change was needed to the existing delegate-binding code.

Fixes #601.

Test plan

  • Added Issue601_DefaultInterfaceMemberPropertyIsResolved and Issue601_DefaultInterfaceMemberPropertyIsEnumerated in IssueTests.cs, reproducing the exact interface/class shape from the issue.
  • Full test suite passes: 1906/1906, no regressions.

🤖 Generated with Claude Code

Type.GetProperties() on a concrete class doesn't surface properties whose
only implementation is a C# 8+ default interface member, so {{PropertyName}}
and {{#each this}} silently skipped them. Both reflection lookups now also
scan the instance type's implemented interfaces.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@rexm
rexm enabled auto-merge August 6, 2026 02:41
@sonarqubecloud

sonarqubecloud Bot commented Aug 6, 2026

Copy link
Copy Markdown

@rexm
rexm merged commit 39ad350 into master Aug 6, 2026
7 checks passed
@rexm
rexm deleted the fix/issue-601-default-interface-members branch August 6, 2026 02:51
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.

default interface methods

1 participant