Extra arguments passed to fixed arity function don't cause error
chriseppstein opened this issue · comments
Chris Eppstein commented
This should be an error.
@mixin foo($a, $b) {
.foo { #{$a}: $b; }
}
$args: (color, red, extra-arg, another-extra-arg);
@include foo($args...);
It should behave exactly like this:
@mixin foo($a, $b) {
.foo { #{$a}: $b; }
}
@include foo(color, red, extra-arg, another-extra-arg);
Which raises:
Syntax error: Mixin foo takes 2 arguments but 4 were passed.
on line 4 of standard input, in `foo'
from line 4 of standard input
Use --trace for backtrace.
Chris Eppstein commented
This behavior has existed for as long as the varargs feature. Deprecation will be required.
Natalie Weizenbaum commented
I'm moving this issue to the new Ruby Sass repository because it's specific to Ruby Sass's implementation.