( ce: ComputeEngine, ops: ReadonlyArray<Expression>, count: number )
| 63 | import { |
| 64 | activeRollbackFrame, |
| 65 | repairsForbiddenByRollbackFrame, |
| 66 | } from '../inference-rollback.js'; |
| 67 | import { fuzzyStringMatch } from '../../common/fuzzy-string-match.js'; |
| 68 | import { isOperatorDef, isValueDef } from './utils.js'; |
| 69 | import { isTensorValue } from './tensor-view.js'; |
| 70 | import { _BoxedOperatorDefinition } from './boxed-operator-definition.js'; |
| 71 | import { |
| 72 | isSymbol, |
| 73 | isFunction, |
| 74 | isString, |
| 75 | isContinuationOperand, |
| 76 | containsContinuationOperand, |
| 77 | } from './type-guards.js'; |
| 78 | import { narrowStringLiteralToCharacter } from './boxed-character.js'; |
| 79 | |
| 80 | // Parsed once: the type of an indexed collection whose every element is a |
| 81 | // number. Used in `checkNumericArgs` to accept collections for broadcasting on |
| 82 | // the strength of their static element type. |
| 83 | const INDEXED_COLLECTION_OF_NUMBER = parseType('indexed_collection<number>'); |
| 84 | |
| 85 | // `typeCouldBeNumericCollection` / `typeCouldBeNumericTuple` — the COULD- |
| 86 | // semantics predicates `checkNumericArgs` uses to admit collection/tuple |
| 87 | // operands — are imported from `collection-utils.ts`, where the |
| 88 | // `Add`/`Multiply` type handlers and the invisible-operator gate share the |
| 89 | // SAME predicates. Keeping a private copy here let the two layers diverge: |
| 90 | // an operand admitted by validation but missed by the type handlers |
| 91 | // collapsed to `number` and baked `incompatible-type` (Tycho item 30). |
| 92 | |
| 93 | // `couldBeUnkeyedCollectionOperand` moved to `collection-utils.ts` alongside |
| 94 | // the sibling COULD-semantics predicates, so validation, overload resolution |
| 95 | // and result typing share ONE definition — a private copy here would let the |
| 96 | // resolution used for validation admit different arms from the one used for |
| 97 | // result typing. |
| 98 | |
| 99 | /** |
| 100 | * Exclusion gate for scalar numeric INFERENCE — deliberately WIDER than |
| 101 | * broadcast admission (`couldBeUnkeyedCollectionOperand`). The hazard the |
| 102 | * gate prevents is keyedness-independent: `x._infer('real')` on an operand |
| 103 | * whose inferred result signature is collection-shaped WIDENS the shared |
no test coverage detected