Skip to content

Fix TypeScript return types for sum along a dimension - #3694

Open
WenJing95 wants to merge 1 commit into
josdejong:developfrom
WenJing95:fix/sum-dimension-types-3202
Open

WenJing95 wants to merge 1 commit into
josdejong:developfrom
WenJing95:fix/sum-dimension-types-3202

Conversation

@WenJing95

Copy link
Copy Markdown

Fixes #3202.

Correct the TypeScript overloads for sum(collection, dimension): one-dimensional arrays produce scalars, two-dimensional arrays produce arrays, and Matrix inputs produce Matrix results. Widen number and bigint literals in reductions and add type and runtime regression assertions.

Validation on Windows with Node 22.20.0:

  • TypeScript compilation, focused sum tests (16 passing, 2 pending), new regression runtime assertions, lint, and the default Gulp build passed.
  • Full source suite: 6,648 passing, 22 pending, and four failures in matrixFromRows, matrixFromColumns, acosh, and asech, identical on develop and this branch.
  • npm run test:types: TypeScript compilation passed; the ts-node runtime stage failed on both develop and this branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Matrix sum along a dimension is defined to return a MathScalarType, but might return higher dimension

1 participant