Skip to content

Commit 804615e

Browse files
Fix syntax tree issue
1 parent 82acb3c commit 804615e

6 files changed

Lines changed: 8 additions & 22 deletions

File tree

CodeConverter/CSharp/VisualBasicEqualityComparison.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ public bool TryConvertToNullOrEmptyCheck(VBSyntax.BinaryExpressionSyntax node, E
154154
var arg = lhsEmpty ? rhs : lhs;
155155
var nullOrEmpty = SyntaxFactory.InvocationExpression(
156156
SyntaxFactory.MemberAccessExpression(SyntaxKind.SimpleMemberAccessExpression,
157-
SyntaxFactory.IdentifierName("string"),
157+
SyntaxFactory.PredefinedType(SyntaxFactory.Token(SyntaxKind.StringKeyword)),
158158
SyntaxFactory.IdentifierName("IsNullOrEmpty")),
159159
SyntaxFactory.ArgumentList(SyntaxFactory.SeparatedList(new[]
160160
{SyntaxFactory.Argument(arg)})));

Tests/CSharp/ExpressionTests/BinaryExpressionTests.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,9 +196,7 @@ private void TestMethod(string str)
196196
{
197197
int result = 5 - (string.IsNullOrEmpty(str) ? 1 : 2);
198198
}
199-
}
200-
1 target compilation errors:
201-
CS0103: The name 'string' does not exist in the current context");
199+
}");
202200
}
203201
}
204202
}

Tests/CSharp/ExpressionTests/ExpressionTests.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -691,9 +691,7 @@ private void TestMethod(string str)
691691
{
692692
bool result = string.IsNullOrEmpty(str) ? true : false;
693693
}
694-
}
695-
1 target compilation errors:
696-
CS0103: The name 'string' does not exist in the current context");
694+
}");
697695
}
698696

699697
[Fact]
@@ -730,9 +728,7 @@ private void TestMethod(string str)
730728
{
731729
bool result = !(string.IsNullOrEmpty(str) ? true : false);
732730
}
733-
}
734-
1 target compilation errors:
735-
CS0103: The name 'string' does not exist in the current context");
731+
}");
736732
}
737733

738734
[Fact]

Tests/CSharp/ExpressionTests/StringExpressionTests.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,7 @@ public void Foo()
146146
//
147147
}
148148
}
149-
}
150-
1 target compilation errors:
151-
CS0103: The name 'string' does not exist in the current context");
149+
}");
152150
}
153151

154152
[Fact]
@@ -209,9 +207,7 @@ public void Foo()
209207
//
210208
}
211209
}
212-
}
213-
1 target compilation errors:
214-
CS0103: The name 'string' does not exist in the current context");
210+
}");
215211
}
216212

217213
[Fact]

Tests/CSharp/MemberTests/PropertyMemberTests.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -487,9 +487,7 @@ public string Y
487487
}
488488
}
489489
}
490-
}
491-
1 target compilation errors:
492-
CS0103: The name 'string' does not exist in the current context");
490+
}");
493491
}
494492

495493
[Fact]

Tests/CSharp/StatementTests/StatementTests.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1368,9 +1368,7 @@ public static int FindTextInCol(string w, int pTitleRow, int startCol, string ne
13681368
13691369
return -1;
13701370
}
1371-
}
1372-
1 target compilation errors:
1373-
CS0103: The name 'string' does not exist in the current context");
1371+
}");
13741372
}
13751373

13761374
[Fact]

0 commit comments

Comments
 (0)