File tree Expand file tree Collapse file tree 3 files changed +30
-0
lines changed
Expand file tree Collapse file tree 3 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
1010
1111### VB -> C#
1212
13+ * Xor operator overloads now converted [ #1182 ] ( htts://github.com/icsharpcode/CodeConverter/issues/1182 )
1314
1415### C# -> VB
1516
Original file line number Diff line number Diff line change @@ -243,6 +243,8 @@ public static SyntaxKind ConvertToken(this Microsoft.CodeAnalysis.VisualBasic.Sy
243243 return SyntaxKind . AmpersandToken ;
244244 case Microsoft . CodeAnalysis . VisualBasic . SyntaxKind . OrKeyword :
245245 return SyntaxKind . BarToken ;
246+ case Microsoft . CodeAnalysis . VisualBasic . SyntaxKind . XorKeyword :
247+ return SyntaxKind . CaretToken ;
246248 //
247249 case Microsoft . CodeAnalysis . VisualBasic . SyntaxKind . AssemblyKeyword :
248250 return SyntaxKind . AssemblyKeyword ;
Original file line number Diff line number Diff line change @@ -190,5 +190,32 @@ End Operator
190190 Assert . Contains ( "Public Shared Operator ^(i As Integer," , convertedCode ) ;
191191 Assert . Contains ( "_failedMemberConversionMarker2" , convertedCode ) ;
192192 Assert . Contains ( "Public Shared Operator Like(s As String," , convertedCode ) ;
193+ }
194+
195+ [ Fact ]
196+
197+ public async Task XorOperatorOverloadConversionAsync ( )
198+
199+ {
200+
201+ await TestConversionVisualBasicToCSharpAsync (
202+
203+ @"
204+ Public Class MyType
205+ Public Shared Operator Xor(left As MyType, right As MyType) As MyType
206+ Throw New Global.System.NotSupportedException(""Not supported"")
207+ End Operator
208+ End Class" ,
209+
210+ @"using System;
211+
212+ public partial class MyType
213+ {
214+ public static MyType operator ^(MyType left, MyType right)
215+ {
216+ throw new NotSupportedException(""Not supported"");
217+ }
218+ }" ) ;
219+
193220 }
194221}
You can’t perform that action at this time.
0 commit comments