Repository navigation
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 41 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
This branch has not been deployed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3952
Root cause
crates/calc/src/eval.rs,unary(), theUnOp::Spillbranch: when no spill range is registered for a single-cell anchor, it returned#REF!without looking at the anchor's own value. So=SUM(A1#)with A1=1/0gave#REF!instead of#DIV/0!.Fix
When no spill range exists, read the anchor's value. If it is an error, return that error (
#DIV/0!,#N/A, or#SPILL!for a blocked spill). Otherwise keep#REF!(ordinary scalar anchor). Successful spills are unchanged.Tests
New
spill_reference_passes_on_an_anchor_errorincrates/calc/src/tests.rscovers=1/0,=NA(), scalar 7 (still#REF!), blockedSEQUENCE(2)(#SPILL!) and unblocked (3). Two existing assertions that encoded the old#REF!for a blocked spill now expect#SPILL!, as the issue reports for Excel.With the fix reverted,
cargo test -p gridcraft-calc spillgave: 24 passed; 3 failed (spill_reference_passes_on_an_anchor_error: left Error(Ref), right Error(Div0);spill_range_operator;formulas_reading_an_array_that_loses_a_spill_conflict_read_spill_errors). With the fix: all 126 calc tests pass.Checks run
cargo test -p gridcraft-calc -j 4: 126 passed, 0 failedcargo clippy -p gridcraft-calc --all-targets -j 4 -- -D warnings: cleancargo fmt -p gridcraft-calc -- --check: cleanNot run
cargo xtask ci(wasm, layers, full workspace tests), other crates' tests, and a comparison against native Excel.