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

Unexpected behavior with math.add and math.multiply with >2 parameters #954

Closed
zwigglers opened this Issue Oct 10, 2017 · 4 comments

Comments

Projects
None yet
3 participants
@zwigglers

zwigglers commented Oct 10, 2017

I'm seeing the following errors when I try to use math.add with more than 2 non-scalar parameters.

math.add(1, 2, 3);	//OK
math.add([1,1], [2,2], [3,3]); //TypeError: Too many arguments in function add (expected: 2, actual: 3)
math.add(0, 0, [1,1], [2,2], [3,3]); //OK
math.multiply(2, 3, 4);	// OK
math.multiply([3,3], [3,3], [4,4]); // TypeError: Too many arguments in function add (expected: 2, actual: 3)
math.multiply(1, 1, [2,2], [3,3], [4,4]); // OK

The problem seems that adding three Arrays triggers the "Array, Array" filter whose handler only accepts two parameters.

By adding scalar values in front, I get around the "Array, Array" filter to the "any, any, ...any" filter which allows for multiple parameters.

@josdejong

This comment has been minimized.

Owner

josdejong commented Oct 10, 2017

Thanks for reporting, this should indeed just work.

@josdejong josdejong added the bug label Oct 10, 2017

@iamnapo

This comment has been minimized.

iamnapo commented Oct 16, 2017

I'd like to work on this 😃

@josdejong

This comment has been minimized.

Owner

josdejong commented Oct 16, 2017

Thanks for your offer @iamnapo, that would be great!

@josdejong

This comment has been minimized.

Owner

josdejong commented Oct 18, 2017

This should be fixed in v3.16.5, thanks again @iamnapo for the help in tracing down the issue

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