Skip to content

Add regression test for issue #1091: interface DefaultMember Value access#1250

Merged
GrahamTheCoder merged 1 commit intoicsharpcode:masterfrom
GrahamTheCoder:claude/fix-issue-1091-default-member-strip
Apr 13, 2026
Merged

Add regression test for issue #1091: interface DefaultMember Value access#1250
GrahamTheCoder merged 1 commit intoicsharpcode:masterfrom
GrahamTheCoder:claude/fix-issue-1091-default-member-strip

Conversation

@GrahamTheCoder
Copy link
Copy Markdown
Member

@GrahamTheCoder GrahamTheCoder commented Apr 13, 2026

Fixes #1091 (or actually adds a test for it already having been fixed)

When an interface or type has [DefaultMember("Value")] and VB code explicitly accesses .Value, the converter was incorrectly stripping the member access, producing p instead of p.Value.

The fix (already in commit 924785a) adds && p.Parameters.Any() to the isDefaultProperty check in ConvertMemberAccessExpressionAsync. This ensures only truly indexed (parameterized) default properties are stripped, while parameterless default members like Value retain their explicit access.

This commit adds a regression test covering the exact scenario from issue #1091: an interface with <DefaultMember("Value")> where VB code explicitly reads and writes the .Value property.

https://claude.ai/code/session_01AkwUvu3XuCdj3D4axoX4UX

…er Value access

When an interface or type has [DefaultMember("Value")] and VB code explicitly
accesses .Value, the converter was incorrectly stripping the member access,
producing `p` instead of `p.Value`.

The fix (already in commit 924785a) adds `&& p.Parameters.Any()` to the
`isDefaultProperty` check in ConvertMemberAccessExpressionAsync. This ensures
only truly indexed (parameterized) default properties are stripped, while
parameterless default members like Value retain their explicit access.

This commit adds a regression test covering the exact scenario from issue icsharpcode#1091:
an interface with <DefaultMember("Value")> where VB code explicitly reads and
writes the .Value property.

https://claude.ai/code/session_01AkwUvu3XuCdj3D4axoX4UX
@GrahamTheCoder GrahamTheCoder merged commit 68d3696 into icsharpcode:master Apr 13, 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.

VB -> C#: someInterface.Value becomes someInterface if the interface has the DefaultMember("Value") attribute

2 participants