Skip to content

Extension method fix - #1309

Merged
GrahamTheCoder merged 2 commits into
icsharpcode:masterfrom
GrahamTheCoder:claude/dreamy-meitner-iekdwa
Nov 10, 2026
Merged

GrahamTheCoder merged 2 commits into
icsharpcode:masterfrom
GrahamTheCoder:claude/dreamy-meitner-iekdwa

Conversation

@GrahamTheCoder

Copy link
Copy Markdown
Member

Summary

An extension call on an implicit Me dropped the receiver: in a class inheriting List(Of Integer), Distinct().ToList() became Enumerable.Distinct().ToList() (CS1501).

Two causes in VbNameExpander:

  1. IsTypePromotion treated the outer reduced-extension access (.ToList) as type promotion, so the whole access was replaced by its receiver and the inner Distinct was never expanded. Reduced extensions are now excluded.
  2. The enclosing-type check used a class-only InheritsFromOrEquals, so interface receivers (IEnumerable<T>) never matched. It now includes interfaces.

…ion access

A reduced extension method access such as Distinct().ToList() was treated as
type promotion, so the whole access was replaced by its receiver and the
implicit Me of the inner Distinct() was never expanded, giving
Enumerable.Distinct().

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019FEr8Ewvos6pJ4xv426Vsc
The enclosing-type check for a reduced extension used a base-class-only
InheritsFromOrEquals, so extensions on interfaces such as
IEnumerable(Of T).Distinct() inside a class deriving List(Of T) were not
given Me.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019FEr8Ewvos6pJ4xv426Vsc
@GrahamTheCoder GrahamTheCoder changed the title Claude/dreamy meitner iekdwa Extension method fix Nov 10, 2026
@GrahamTheCoder
GrahamTheCoder merged commit 5c083f9 into icsharpcode:master Nov 10, 2026
3 checks passed
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.

2 participants