-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Labels
Description
Found an issue in iteration functions like map and forEach, when a callback function has only one signature only its signature is mapped, but the signature doesn't have the logic to reject and covert types.
const fn = math.typed({number: x => x + 1})
math.map([1, 2], fn) // yields [2, 3]
math.map([1, 'text'], fn) // yields [2, 'text1']
// should be TypeError: Function map cannot apply callback arguments to function : Cannot convert "text" to a numberThe issue was introduced by #3256
It should be possible to still use the signature only for matrices that have a datatype that is not "mixed" or undefined
I'm willing to work on the fix, might have an effect on performance but have more precise results.
Reactions are currently unavailable