Python: test closure instance cross-talk - #22395
Draft
yoff wants to merge 1 commit into
Draft
Conversation
Add an inline type-tracking regression for two closures created from the same wrapper AST with different captured callables. Keep positive controls for the sensitive callable and ordinary captured data while marking the safe closure result as the current spurious flow. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
SPURIOUSso this tests-only draft remains greenMotivation
This is an experimental dependent follow-up to #21925. The improved shared-CFG/SSA routing exposes cross-talk in generic decorator factories such as Django
keep_lazyand Airflowprovide_session/action_cli: separate wrapper instances can capture different callables, but callable type tracking currently merges their returns.Current finding
TypeTrackingImpl::capturedJumpSteptransfers the merged outer value into the wrapper scope through a shared type-trackingJumpStep, which intentionally discards call context. Removing that jump eliminates the false positive but also drops legitimate captured callable and data flow. A sound implementation therefore appears to require call-site-specific closure/function-object identity in shared type tracking or dataflow; this draft intentionally does not include a workaround or framework-specific suppression.Testing
All four targeted tests pass with the inline
SPURIOUSexpectations.