Skip to content

clone the FunctionDefinition any time a lambda captures values#627

Merged
Jamiras merged 1 commit intomasterfrom
bugfix/lambda_capture_lifetime
Apr 4, 2026
Merged

clone the FunctionDefinition any time a lambda captures values#627
Jamiras merged 1 commit intomasterfrom
bugfix/lambda_capture_lifetime

Conversation

@Jamiras
Copy link
Copy Markdown
Owner

@Jamiras Jamiras commented Apr 2, 2026

fixes #623

Captured lambda values were being stored in the function definition, so when the function definition was stored in a class instance, the captured values were only associated to the last instance.

Solution: when capturing values for a lambda function, clone the definition first, ensuring each instance of a lambda function is unique.

@Jamiras Jamiras added this to the 1.17.0 milestone Apr 2, 2026
@Jamiras Jamiras merged commit d1340bb into master Apr 4, 2026
1 check passed
@Jamiras Jamiras deleted the bugfix/lambda_capture_lifetime branch April 4, 2026 22:32
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.

Value captured by lambda is overwritten by subsequent calls

1 participant