Skip to content

Commit 75c638e

Browse files
CopilotPhenX
andcommitted
Address code review feedback
- Rename test to better reflect implicit return pattern - Add clarifying comment about control flow in BlockStatementConverter - All tests still passing Co-authored-by: PhenX <42170+PhenX@users.noreply.github.com>
1 parent 7067bc2 commit 75c638e

3 files changed

Lines changed: 3 additions & 2 deletions

File tree

src/EntityFrameworkCore.Projectables.Generator/BlockStatementConverter.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ nonReturnStatements[0] is IfStatementSyntax ifWithoutElse &&
8282
return SyntaxFactory.ConditionalExpression(condition, ifBody, elseBody);
8383
}
8484

85-
// Process local variable declarations
85+
// If we reach here, the pattern was not detected
86+
// Process local variable declarations before the final return
8687
foreach (var stmt in nonReturnStatements)
8788
{
8889
if (stmt is LocalDeclarationStatementSyntax localDecl)

tests/EntityFrameworkCore.Projectables.Generator.Tests/ProjectionExpressionGeneratorTests.BlockBodiedMethod_IfWithoutElse_ReturnsDefault.verified.txt renamed to tests/EntityFrameworkCore.Projectables.Generator.Tests/ProjectionExpressionGeneratorTests.BlockBodiedMethod_IfWithoutElse_ImplicitReturn.verified.txt

File renamed without changes.

tests/EntityFrameworkCore.Projectables.Generator.Tests/ProjectionExpressionGeneratorTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2224,7 +2224,7 @@ public int Foo()
22242224
}
22252225

22262226
[Fact]
2227-
public Task BlockBodiedMethod_IfWithoutElse_ReturnsDefault()
2227+
public Task BlockBodiedMethod_IfWithoutElse_ImplicitReturn()
22282228
{
22292229
var compilation = CreateCompilation(@"
22302230
using System;

0 commit comments

Comments
 (0)