sass / sass

Sass makes CSS fun!

Home Page:https://sass-lang.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Extra arguments passed to fixed arity function don't cause error

chriseppstein opened this issue · comments

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.

This behavior has existed for as long as the varargs feature. Deprecation will be required.

I'm moving this issue to the new Ruby Sass repository because it's specific to Ruby Sass's implementation.