Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[uba] Fix new false negative from #10034 #10069

Closed
jacobtylerwalls opened this issue Nov 4, 2024 · 0 comments · Fixed by #10075
Closed

[uba] Fix new false negative from #10034 #10069

jacobtylerwalls opened this issue Nov 4, 2024 · 0 comments · Fixed by #10075
Assignees
Labels
Blocker 🙅 Blocks the next release C: used-before-assignment Issues related to 'used-before-assignment' check False Negative 🦋 No message is emitted but something is wrong with the code Needs PR This issue is accepted, sufficiently specified and now needs an implementation Unreleased
Milestone

Comments

@jacobtylerwalls
Copy link
Member

def nonlocal_in_outer_frame_ok(callback, condition_a, condition_b):
    def outer():
        nonlocal callback
        def inner():
            if condition_a:
                def inner2():
                    callback()  # possibly-used-before-assignment?
                inner2()
            else:
                if condition_b:
                    def callback():
                        pass
        inner()
    outer()

we should probably raise a message here?

Originally posted by @zenlyj in #10034 (comment)

@jacobtylerwalls jacobtylerwalls added False Positive 🦟 A message is emitted but nothing is wrong with the code Unreleased labels Nov 4, 2024
@jacobtylerwalls jacobtylerwalls changed the title Fix new FP from #10034 [uba] Fix new false negative from #10034 Nov 4, 2024
@jacobtylerwalls jacobtylerwalls added False Negative 🦋 No message is emitted but something is wrong with the code C: used-before-assignment Issues related to 'used-before-assignment' check Needs PR This issue is accepted, sufficiently specified and now needs an implementation and removed False Positive 🦟 A message is emitted but nothing is wrong with the code labels Nov 4, 2024
@jacobtylerwalls jacobtylerwalls added this to the 4.0.0 milestone Nov 4, 2024
@Pierre-Sassoulas Pierre-Sassoulas added the Blocker 🙅 Blocks the next release label Nov 5, 2024
@zenlyj zenlyj self-assigned this Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Blocker 🙅 Blocks the next release C: used-before-assignment Issues related to 'used-before-assignment' check False Negative 🦋 No message is emitted but something is wrong with the code Needs PR This issue is accepted, sufficiently specified and now needs an implementation Unreleased
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants