Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typescript signatures for add, multiply are incorrect #3180

Closed
dmyronuk opened this issue Mar 28, 2024 · 2 comments
Closed

Typescript signatures for add, multiply are incorrect #3180

dmyronuk opened this issue Mar 28, 2024 · 2 comments

Comments

@dmyronuk
Copy link

dmyronuk commented Mar 28, 2024

Describe the bug
From the docs

Add two or more values, x + y. For matrices, the function is evaluated element wise... math.add(x, y, z, ...)

But the function takes exactly 2 arguments according to TS definition:

add<T extends MathType>(x: T, y: T): T

Same issue affects multiply

To Reproduce
const x = math.add(1, 2, 3);
Transpiler error: Expected 2 arguments, but got 3.

If you suppress the error with @ts-ignore the function works as expected.

@josdejong
Copy link
Owner

Thanks for reporting, will be fixed via 2e427ec (not yet published).

@josdejong
Copy link
Owner

Fix published now in v12.4.2

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

No branches or pull requests

2 participants