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
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: