-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed consistent range variable shadowing in loop bodies
When a range loop uses pre-declared variables, ensure their shadowed names are used consistently throughout the loop body. Previously, the loop's range variables would be correctly shadowed but usages within the body would still use the original names. Example fix: for k, _ = range strategies { strategies[k] = stayAtK(k + 1) // k not shadowed in body } Becomes: foreach (var (kΔ1, _) in strategies) { strategies[kΔ1] = stayAtK(kΔ1 + 1) // k correctly shadowed } The fix tracks shadowed range variable names and ensures they're used consistently for all references within the loop scope.
- Loading branch information
1 parent
1ed9bd9
commit 462229d
Showing
4 changed files
with
36 additions
and
8 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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