-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
keyword args + default args = type instability #15468
Labels
compiler:lowering
Syntax lowering (compiler front end, 2nd stage)
potential benchmark
Could make a good benchmark in BaseBenchmarks
Comments
JeffBezanson
added
the
compiler:lowering
Syntax lowering (compiler front end, 2nd stage)
label
Mar 12, 2016
I think the lowering can be changed to be more efficient here, and possibly also generate less code while we're at it. |
JeffBezanson
added a commit
that referenced
this issue
Mar 15, 2016
tkelman
added
the
potential benchmark
Could make a good benchmark in BaseBenchmarks
label
Mar 15, 2016
JeffBezanson
added a commit
that referenced
this issue
Mar 15, 2016
fix #15468, inefficient lowering of keyword+optional args
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
compiler:lowering
Syntax lowering (compiler front end, 2nd stage)
potential benchmark
Could make a good benchmark in BaseBenchmarks
I'm not sure if this is a dup of some of the more general keyword argument performance issues, so feel free to insta-close if so.
It seems there's an interaction between positional arguments with default values and keyword arguments. For instance, without a keyword arg, everything's fine with or without giving the optional arg:
If I include a keyword argument though, I get type instability:
Now the 1-argument version returns
Any
. Based on @simonster's comment here, I think the problem is that the 1-argument version basically becomesbar(a; kwarg=42) = bar(a, 1; kwarg=kwarg)
, which triggers the creation of theAny
array for keyword argument parsing.The text was updated successfully, but these errors were encountered: