Skip to content

Handle local-variable hiding in local functions#1187

Merged
meziantou merged 1 commit into
mainfrom
fix-ma0084-local-function-hiding
Jun 13, 2026
Merged

Handle local-variable hiding in local functions#1187
meziantou merged 1 commit into
mainfrom
fix-ma0084-local-function-hiding

Conversation

@meziantou

Copy link
Copy Markdown
Owner

Summary

  • Report MA0084 when a local function declares a variable that hides a local from an enclosing method
  • Skip the diagnostic for static local functions and nested cases that cannot access the outer local
  • Add analyzer coverage for the new local-function scenarios and update the rule docs

Testing

  • Added unit tests for local, static local, and nested local function hiding cases
  • Not run (not requested)

@meziantou meziantou merged commit 4cf5121 into main Jun 13, 2026
13 checks passed
@meziantou meziantou deleted the fix-ma0084-local-function-hiding branch June 13, 2026 19:14
This was referenced Jun 13, 2026
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.

1 participant