You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be helpful if the compiler at least emitted a warning when users call a function with a fixed arity (or fixed arities) with the wrong number of arguments.
The text was updated successfully, but these errors were encountered:
Add a compile-time warning for arity mismatches on function invocations.
The warning is enabled by default (if the dev logger is enabled and
configured for at least `WARNING` level logs).
In order to facilitate this work, we also had to change the computation
of the Basilisp function `arities` attribute set. Previously this
included only fixed arities (the argument count for each non-variadic
function arity) and a `:rest` keyword if the function included a
variadic arity. Now `arities` will include all fixed arities including
the number of fixed (non-variadic) arguments to the varidic arity. This
allows for more sophisticated warnings.
As part of this bill of work, it was also required to update `partial`
to support computing a new set of `arities` for partial applications.
`functools.wraps` copies all values from `__dict__` to wrapped
functions, so partials were appearing to have the same set of arities as
their wrapped function which was never correct.
Fixes#671Fixes#847
It would be helpful if the compiler at least emitted a warning when users call a function with a fixed arity (or fixed arities) with the wrong number of arguments.
The text was updated successfully, but these errors were encountered: