[Bug]: An array literal that starts with a spilled range changes that range's stored values
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 67/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- node.js, typescript
Direzione di ricerca
Start with the array evaluation path in Interpreter.ts at the reported ARRAY branch and ArrayValue.ts where raw() exposes row arrays. Reproduce the example from the issue and trace how a range matching a spilled result is used while building the literal. Done means the literal copies the rows it builds from, the spill result stays unchanged on recalculation, and the reported formulas return the expected values.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Description
When the first element in a row of an array literal is a range that exactly matches another formula's spilled result, the literal appends the row's other elements to that formula's stored result. The cells still show the right values, but formulas that read the range as an array get wrong results:
const hf = HyperFormula.buildFromArray([
['=SEQUENCE(2)', 10, '=SUM({A1:A2,B1:B2})', '=SUMPRODUCT(A1:A2,A1:A2)'],
[null, 20],
], {licenseKey: 'gpl-v3'})
hf.getCellValue({sheet: 0, col: 3, row: 0}) // 505, expected 5
hf.getCellValue({sheet: 0, col: 2, row: 0}) // 33, correct
// A1:A2 still show 1 and 2
With plain values 1 and 2 in A1:A2, D1 returns 5. In Microsoft Excel Online, =SUMPRODUCT(A1:A2,A1:A2) over =SEQUENCE(2) returns 5. (Excel doesn't accept references inside array constants, so the literal itself can't be compared.)
If the literal's formula is recalculated, for example because it also contains RAND(), the stored result gains another column every time.
Cause: a range that matches a spilled result is evaluated through ArrayValue.raw(), which returns the result's own row arrays (Interpreter.ts:213 and :222, ArrayValue.ts:132-134). The ARRAY branch of Interpreter.evaluateAst then pushes the next elements into those rows (Interpreter.ts:266 and :269).
Expected: the array literal copies the rows it builds from, and the other formula's result stays unchanged.
Video or screenshots
N/A
Demo
Code snippet in the description.
HyperFormula version
3.5.0 (also develop at ec7512d21)
Your framework
None (Node.js)
Your environment
Node.js 22.23.4 on Linux
- Lingua principale
- TypeScript
- Stelle
- 2.8k
- Fork
- 175
- Merge medio
- 2g 5h
- PR unite (30g)
- 23
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di handsontable/hyperformula
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
handsontable/hyperformula#1803 ·
I maintainer di solito rispondono entro 1 giorno
-
numberToSimpleDate returns day 0 for 31 December of some years when leapYear1900 is trueForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
handsontable/hyperformula#1793 ·
I maintainer di solito rispondono entro 1 giorno
-
Bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
handsontable/hyperformula#1745 ·
I maintainer di solito rispondono entro 1 giorno
-
Bug Impact: Low
Difficoltà 1/5 1-3 ore Idoneità per principianti 68/100
handsontable/hyperformula#1641 ·
I maintainer di solito rispondono entro 1 giorno
-
Bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 74/100
handsontable/hyperformula#1878 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di handsontable/hyperformula
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
-
pending close triaging
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
anomalyco/opencode#62582 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
feature request
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
callstack/react-native-paper#5189 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
live-codes/livecodes#1079 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Add: ESP 2 ROApertaapproved check:passed streams:add
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
I maintainer di solito rispondono entro 1 giorno