-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Warn at compile time on arity mismatch for function invocation (#842)
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 #671 Fixes #847
- Loading branch information
1 parent
b4d9c2d
commit 8b3a2da
Showing
12 changed files
with
298 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.