File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
ICSharpCode.CodeConverter/CSharp Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -1442,7 +1442,7 @@ public override CSharpSyntaxNode VisitSingleLineLambdaExpression(VBSyntax.Single
14421442 body = node . Body . Accept ( TriviaConvertingVisitor ) ;
14431443 }
14441444 var param = ( ParameterListSyntax ) node . SubOrFunctionHeader . ParameterList . Accept ( TriviaConvertingVisitor ) ;
1445- if ( param . Parameters . Count == 1 )
1445+ if ( param . Parameters . Count == 1 && param . Parameters . Single ( ) . Type == null )
14461446 return SyntaxFactory . SimpleLambdaExpression ( param . Parameters [ 0 ] , body ) ;
14471447 return SyntaxFactory . ParenthesizedLambdaExpression ( param , body ) ;
14481448 }
@@ -1451,7 +1451,7 @@ public override CSharpSyntaxNode VisitMultiLineLambdaExpression(VBSyntax.MultiLi
14511451 {
14521452 var body = SyntaxFactory . Block ( node . Statements . SelectMany ( s => s . Accept ( CreateMethodBodyVisitor ( ) ) ) ) ;
14531453 var param = ( ParameterListSyntax ) node . SubOrFunctionHeader . ParameterList . Accept ( TriviaConvertingVisitor ) ;
1454- if ( param . Parameters . Count == 1 )
1454+ if ( param . Parameters . Count == 1 && param . Parameters . Single ( ) . Type == null )
14551455 return SyntaxFactory . SimpleLambdaExpression ( param . Parameters [ 0 ] , body ) ;
14561456 return SyntaxFactory . ParenthesizedLambdaExpression ( param , body ) ;
14571457 }
Original file line number Diff line number Diff line change @@ -550,7 +550,7 @@ class TestClass
550550{
551551 private void TestMethod()
552552 {
553- Func<int, int> test = int a => a * 2;
553+ Func<int, int> test = ( int a) => a * 2;
554554 test(3);
555555 }
556556}" ) ;
You can’t perform that action at this time.
0 commit comments