File tree Expand file tree Collapse file tree 1 file changed +39
-0
lines changed
Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Original file line number Diff line number Diff line change @@ -49,6 +49,45 @@ public void S()
4949 y.Caption = ""World"";
5050 }
5151}
52+ " ) ;
53+ }
54+
55+ /// <summary>
56+ /// Regression test for https://github.com/icsharpcode/CodeConverter/issues/1091
57+ /// When an interface has [DefaultMember(""Value"")] and VB code explicitly accesses .Value,
58+ /// the converter must NOT strip the .Value member access in the C# output.
59+ /// </summary>
60+ [ Fact ]
61+ public async Task Issue1091_ExplicitAccessToDefaultMemberPropertyIsPreservedAsync ( )
62+ {
63+ await TestConversionVisualBasicToCSharpAsync (
64+ @"
65+ <System.Reflection.DefaultMember(""Value"")>
66+ Public Interface IWithDefaultValue
67+ Property Value As Object
68+ End Interface
69+
70+ Public Module Module1
71+ Sub Test(p As IWithDefaultValue)
72+ Dim v = p.Value
73+ p.Value = v
74+ End Sub
75+ End Module" , @"using System.Reflection;
76+
77+ [DefaultMember(""Value"")]
78+ public partial interface IWithDefaultValue
79+ {
80+ object Value { get; set; }
81+ }
82+
83+ public static partial class Module1
84+ {
85+ public static void Test(IWithDefaultValue p)
86+ {
87+ var v = p.Value;
88+ p.Value = v;
89+ }
90+ }
5291" ) ;
5392 }
5493}
You can’t perform that action at this time.
0 commit comments