Skip to content

Fixes async expression compiler bugs and updates nugets#133

Merged
bfarmer67 merged 6 commits intodevelopfrom
bug-fix-123-126
Feb 27, 2026
Merged

Fixes async expression compiler bugs and updates nugets#133
bfarmer67 merged 6 commits intodevelopfrom
bug-fix-123-126

Conversation

@bfarmer67
Copy link
Contributor

Description

Addresses several issues in the async expression compiler, including a value-type boxing issue, incorrect handling of Return gotos in TryCatch blocks, and ensures final result assignment in non-lowered expressions. Also updates NuGet package versions.

  • Fixes #123
  • Fixes #126

Type of Change

  • Bug fix
  • New feature
  • Documentation

Checklist

  • I have run the existing tests and they pass
  • I have run the existing benchmarks and verified performance has not decreased
  • I have added new tests that prove my change is effective or that my feature works
  • I have added the necessary documentation (if applicable)

… expand ExpressionRuntimeOptions

- Fix #126: Add EnsureConvert helper to Transition base class that wraps
  value-type expressions in Convert() when assigning to reference-type
  variables (boxing). Applied in Transition.SetResult and
  FinalTransition.AddExpressions.

- Add failing test for #123: IfThen with Return(label, value) in
  BlockAsync returns null instead of expected value. Root cause is in the
  lowering phase where Returns inside non-lowered conditionals are not
  converted to _finalResultVariable assignments.

- Expand ExpressionRuntimeOptions with Optimize flag (default true) to
  conditionally skip StateOptimizer, and SourceHandler callback to
  capture the generated state machine expression for debugging.

- Add .claude/ to .gitignore.
Copy link

@avarndell avarndell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review the test warnings.

@bfarmer67 bfarmer67 merged commit 3dc923b into develop Feb 27, 2026
7 checks passed
bfarmer67 added a commit that referenced this pull request Mar 1, 2026
* Fixes async expression compiler bugs and updates nugets (#133)

* Fix value-type boxing in Transition (#126), add failing test for #123, expand ExpressionRuntimeOptions

- Fix #126: Add EnsureConvert helper to Transition base class that wraps
  value-type expressions in Convert() when assigning to reference-type
  variables (boxing). Applied in Transition.SetResult and
  FinalTransition.AddExpressions.

- Add failing test for #123: IfThen with Return(label, value) in
  BlockAsync returns null instead of expected value. Root cause is in the
  lowering phase where Returns inside non-lowered conditionals are not
  converted to _finalResultVariable assignments.

- Expand ExpressionRuntimeOptions with Optimize flag (default true) to
  conditionally skip StateOptimizer, and SourceHandler callback to
  capture the generated state machine expression for debugging.

* Change SourceHandler to Action<string> with UnsafeAccessor for DebugView, add tests

* fix(expressions): Ensure Return gotos inside non-lowered expressions set final result

* test(expressions): Add regression test for Return labels in async TryCatch

* test(compiler): Add FastExpressionCompiler compatibility test for Return gotos with assignments

* Update nugets and cleanup

* chore(nbgv): set version via CI: 1.4.1
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.

2 participants