Skip to content

Comments

Fix false LocalShadow warning triggered by type function references#2240

Open
adityuhkapoor wants to merge 1 commit intoluau-lang:masterfrom
adityuhkapoor:fix/local-shadow-type-function
Open

Fix false LocalShadow warning triggered by type function references#2240
adityuhkapoor wants to merge 1 commit intoluau-lang:masterfrom
adityuhkapoor:fix/local-shadow-type-function

Conversation

@adityuhkapoor
Copy link

Fixes #2087

The LocalShadow lint walker traverses into AstStatTypeFunction bodies, where type references like num appear as AstExprGlobal nodes. When a local variable with the same name is declared later, the linter incorrectly reports a shadow warning.

This skips traversal into AstStatTypeFunction nodes in LintLocalHygiene, matching how the compiler's FunctionVisitor already handles them.

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.

LocalShadow lint can be triggered by type functions referencing a defined type

1 participant