Skip to content

Fix conversion of single-statement multiline lambda to block syntax#1254

Open
GrahamTheCoder wants to merge 1 commit intoicsharpcode:masterfrom
GrahamTheCoder:claude/fix-issue-1012-lambda-multiline
Open

Fix conversion of single-statement multiline lambda to block syntax#1254
GrahamTheCoder wants to merge 1 commit intoicsharpcode:masterfrom
GrahamTheCoder:claude/fix-issue-1012-lambda-multiline

Conversation

@GrahamTheCoder
Copy link
Copy Markdown
Member

Fixes #1012 by ensuring that when a VB.NET MultiLineLambdaExpressionSyntax contains a single statement that is not an ExpressionStatementSyntax or ReturnStatementSyntax (such as a local declaration statement with a multiline LINQ query), it is converted to a block-bodied lambda in C# rather than an arrow expression clause.

Also adds a corresponding characterization test.

Fixes icsharpcode#1012 by ensuring that when a VB.NET MultiLineLambdaExpressionSyntax
contains a single statement that is not an ExpressionStatementSyntax or
ReturnStatementSyntax (such as a local declaration statement with a
multiline LINQ query), it is converted to a block-bodied lambda in C#
rather than an arrow expression clause.

Also adds a corresponding characterization test.

Co-authored-by: GrahamTheCoder <2490482+GrahamTheCoder@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

VB -> C#: Conversion of lambda block ends up on single line

1 participant