Fix: Convert VB.Net 'Operator Xor' to C# 'operator ^'#1183
Merged
GrahamTheCoder merged 4 commits intoicsharpcode:masterfrom Jun 14, 2025
Merged
Conversation
This commit implements the conversion for VB.Net `Operator Xor` overload declarations to their C# `operator ^` equivalent. The change involves modifying the `ConvertToken` method in `CodeConverter/CSharp/SyntaxKindExtensions.cs` to correctly map `VBasic.SyntaxKind.XorKeyword` (when used in an operator declaration context) to `CSSyntaxKind.CaretToken`. This addresses the issue where such declarations were previously causing a cast error due to being misinterpreted. I made extensive attempts to add or correct a unit test for this specific scenario in `Tests/CSharp/MemberTests/OperatorMemberTests.cs`. However, I encountered difficulties in reliably modifying the test file (`OperatorMemberTests.cs`) to bring it to a correct, compilable state to include the new test. It is therefore likely broken or does not contain the intended test for this fix. The core `CodeConverter.csproj` containing this fix compiles successfully. The `Vsix.csproj` has an unrelated, persistent build issue (missing VSSDK targets).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1182
Implements the conversion for VB.Net
Operator Xoroverload declarations to their C#operator ^equivalent.The change involves modifying the
ConvertTokenmethod inCodeConverter/CSharp/SyntaxKindExtensions.csto correctly mapVBasic.SyntaxKind.XorKeyword(when used in an operator declaration context) toCSSyntaxKind.CaretToken. This addresses the issue where such declarations were previously causing a cast error due to being misinterpreted.This was a test of Jules. I gave it the issue description for the simplest possible issue on this codebase. It:
Given that Jules doesn't officially support C#, this is still shows promise, but obviously is much slower than manually fixing right now.