Skip to content

Commit e5a77a1

Browse files
Indexers most commonly have 1 arg
1 parent 88b5fed commit e5a77a1

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

CodeConverter/CSharp/ExpressionNodeVisitor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1464,7 +1464,7 @@ private static CSharpSyntaxNode ReplaceRightmostIdentifierText(CSharpSyntaxNode
14641464
/// </summary>
14651465
private static bool ProbablyNotAMethodCall(VBasic.Syntax.InvocationExpressionSyntax node, ISymbol symbol, ITypeSymbol symbolReturnType)
14661466
{
1467-
return !node.IsParentKind(VBasic.SyntaxKind.CallStatement) && !(symbol is IMethodSymbol) && symbolReturnType.IsErrorType() && node.Expression is VBasic.Syntax.IdentifierNameSyntax && node.ArgumentList?.Arguments.Any() == true;
1467+
return !node.IsParentKind(VBasic.SyntaxKind.CallStatement) && !(symbol is IMethodSymbol) && symbolReturnType.IsErrorType() && node.Expression is VBasic.Syntax.IdentifierNameSyntax && node.ArgumentList?.Arguments.Count() == 1;
14681468
}
14691469

14701470
private async Task<ArgumentListSyntax> ConvertArgumentListOrEmptyAsync(SyntaxNode node, VBSyntax.ArgumentListSyntax argumentList)

Tests/CSharp/MissingSemanticModelInfo/ExpressionTests.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ internal partial class TestClass
311311
312312
private void TestMethod()
313313
{
314-
var a = DefaultDate[1, 2, 3].Blawer(1, 2, 3);
314+
var a = DefaultDate.Blawer(1, 2, 3);
315315
}
316316
}
317317
2 source compilation errors:
@@ -338,14 +338,13 @@ internal partial class TestClass
338338
private void TestMethod()
339339
{
340340
if (MyEvent is object)
341-
MyEvent[this, EventArgs.Empty];
341+
MyEvent(this, EventArgs.Empty);
342342
}
343343
}
344344
1 source compilation errors:
345345
BC30451: 'MyEvent' is not declared. It may be inaccessible due to its protection level.
346-
2 target compilation errors:
347-
CS0103: The name 'MyEvent' does not exist in the current context
348-
CS0201: Only assignment, call, increment, decrement, await, and new object expressions can be used as a statement");
346+
1 target compilation errors:
347+
CS0103: The name 'MyEvent' does not exist in the current context");
349348
}
350349

351350
[Fact]

0 commit comments

Comments
 (0)