* Guard for `Sum`/`Product` accumulation over a collection: an already-failed * accumulator propagates, and a non-numeric (string) element is rejected with * an `incompatible-type` error rather than silently poisoning the result * (`Sum([a, b])` used to fold to `NaN`). Returns the error to short-
( acc: Expression, term: Expression )
| 2599 | * types as — since each divides one point by one scalar. |
| 2600 | */ |
| 2601 | function divisorKeepsNumeratorShape( |
| 2602 | den: OperandDescriptor, |
| 2603 | admitMatrix = false |
| 2604 | ): boolean { |
| 2605 | const dt = den.type; |
| 2606 | if (typeCouldBeNumericTuple(dt)) return false; |
| 2607 | if (typeCouldBeNumericTupleCollection(dt)) return false; |
| 2608 | if ( |
| 2609 | typeof dt !== 'string' && |
| 2610 | dt.kind === 'broadcastable' && |
| 2611 | typeCouldBeNumericTuple(dt.elements) |
no test coverage detected