Skip to content

Commit d6c559a

Browse files
Copilotdadhi
andauthored
Fix LightExpression LoopExpression.Type to return BreakLabel type, matching System.Linq.Expressions behavior
Agent-Logs-Url: https://github.com/dadhi/FastExpressionCompiler/sessions/a43bd802-b944-48bc-8c8c-c0abc89bc6e6 Co-authored-by: dadhi <39516+dadhi@users.noreply.github.com>
1 parent 45ff92c commit d6c559a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/FastExpressionCompiler.LightExpression/Expression.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5160,7 +5160,7 @@ internal TypedManyVariablesBlockExpression(Type type, IReadOnlyList<ParameterExp
51605160
public sealed class LoopExpression : Expression
51615161
{
51625162
public override ExpressionType NodeType => ExpressionType.Loop;
5163-
public override Type Type => typeof(void);
5163+
public override Type Type => BreakLabel?.Type ?? typeof(void);
51645164
public readonly Expression Body;
51655165
public readonly LabelTarget BreakLabel;
51665166
public readonly LabelTarget ContinueLabel;

0 commit comments

Comments
 (0)