Skip to content

Resolve overloads in TryFindMethod and search inherited interfaces [patch] - #161

Merged
matt-edmondson merged 1 commit into
mainfrom
fix/155-158-try-find-method
Oct 9, 2026
Merged

matt-edmondson merged 1 commit into
mainfrom
fix/155-158-try-find-method

Conversation

@matt-edmondson

Copy link
Copy Markdown
Contributor

Fixes #155
Fixes #158

What changes

The triage on both issues says to fix them together, so this PR does that. TryFindMethod now searches one hierarchy level at a time, using GetMethods(flags | DeclaredOnly) filtered by name, and stops at the first level that declares the name.

Tests

🤖 Generated with Claude Code

https://claude.ai/code/session_01P2fpLkFHYU6nd3JVKufVtK


Generated by Claude Code

…faces

TryFindMethod threw AmbiguousMatchException for any overloaded name, and
returned false for methods an interface inherits from its base interfaces.
It now searches one hierarchy level at a time, takes the overload with the
fewest parameters (non-generic first, then ordinal signature order), and for
an interface also searches its inherited interfaces, most-derived first.

Fixes #155
Fixes #158

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P2fpLkFHYU6nd3JVKufVtK
@sonarqubecloud

sonarqubecloud Bot commented Oct 9, 2026

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants