Branch: * main
commit bab23b9cdb47e8f853731a619eea0cbfe15cb3a2
Author: Dhairya Patel <124895699+HABER7789@users.noreply.github.com>
Date: Mon Jul 20 09:15:08 2026 -0700
fix deprecated assign update expression for nested expressions (#3482)
## Fix deprecated assign-update quick fix for nested expressions
The `DeprecatedAssignUpdateExpr` quick fix flattens nested `w/=` updates
by matching index source text. That's unsafe for impure indices: the
flattened form evaluates the index fewer times than the original,
changing behavior.
Now it only merges levels where the shared indices are pure, otherwise
falling back to the safe single-level rewrite. The assigned value is
never required to be pure (it's evaluated once either way).
Example (`NextIndex()` returns a different value each call):
```text
a w/= NextIndex() <- (a[NextIndex()] w/ 1 <- 7)
before → a[NextIndex()][1] = 7 // runs NextIndex() once, wrong
after → a[NextIndex()] = a[NextIndex()] w/ 1 <- 7 // both calls preserved
```
Pure cases still flatten fully, e.g. `a w/= 0 <- (a[0] w/ 1 <- 7)` →
`a[0][1] = 7`.
---------
Co-authored-by: HABER7789 <dhaipatel@microsoft.com>
The fuzz-testing workflow has detected a bug.
Auto-Minimized Fuzzing Input That Triggers the Bug: Click this line.
Note: If the input is multi-line then the end-of-line characters ' ' (0x0A) and ' ' (0x0D) may affect the reproducibility of the bug. If you fail to repro the bug with the input shown below then you may want to go to the workflow that reported this GitHub bug, download the artifact, and extract the file with the exact minimized input.The branch/commit the bug has been found in: Click.
If the developers fail to repro the bug in the latestmainthen the branch/commit info below can help them to make sure that they are using the correct way to repro. If the bug is reproducible in the branch/commit below, but not in latestmain, then the bug is likely fixed already or is not in themainbranch.Other Info
ubuntu-latest: Linux runnervm3jd5f 6.17.0-1020-azure #20~24.04.1-Ubuntu SMP Fri Jun 19 20:09:14 UTC 2026 x86_64 x86_64 x86_64 GNU/Linux.