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

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

Closed
chriseppstein opened this Issue Aug 29, 2014 · 2 comments

Comments

Projects
None yet
2 participants
@chriseppstein
Member

chriseppstein commented Aug 29, 2014

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.
@chriseppstein

This comment has been minimized.

Member

chriseppstein commented Aug 29, 2014

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

@nex3 nex3 added Bug labels Sep 5, 2014

nex3 added a commit that referenced this issue Sep 5, 2014

@nex3 nex3 added this to the 4.0 milestone Aug 21, 2015

@nex3

This comment has been minimized.

Contributor

nex3 commented Apr 5, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment