mirror of
https://github.com/storytold/gridcraft.git
synced 2026-10-29 21:26:48 -06:00
When a dynamic array's anchor gets a new formula, the formula is evaluated while the old array is still laid out, so it can read the old spilled values. The anchor was then never evaluated again: it is left out of its own spill area's dependents, so as not to read its own array. - `A1` was `=SEQUENCE(3)` and becomes `=SUM(A2:A3)+1`: it showed 6 (2 + 3 + 1) with A2:A3 empty; recalculating from scratch gives 1. - `A1` was `=SEQUENCE(3)` and becomes `=SEQUENCE(1,A2+1)`: it read A2 as 2 and spilled over A1:C1 instead of showing 1. The anchor is now evaluated again when its old array is gone or partly freed. It is still left out when its new array covers the old one, where it would read its own array. Regression test in calc (`an_anchor_given_a_formula_that_reads_its_old_spill_area_sees_it_empty`: the new formula stops spilling, spills elsewhere, or spills over part of the old area); it fails without the fix. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>