Commit 0cf1bdf
committed
Fix: Convert VB.Net 'Operator Xor' to C# 'operator ^'
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).1 parent 68299ab commit 0cf1bdf
File tree
3 files changed
+33
-2
lines changed- CodeConverter/CSharp
- Tests
- CSharp/MemberTests
3 files changed
+33
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
243 | 243 | | |
244 | 244 | | |
245 | 245 | | |
| 246 | + | |
| 247 | + | |
246 | 248 | | |
247 | 249 | | |
248 | 250 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
193 | 222 | | |
194 | 223 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
| 45 | + | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| |||
0 commit comments