Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Using ... in an overloaded function causes fatal error #2205

Closed
JohnAlbin opened this issue Oct 13, 2016 · 1 comment
Closed

Using ... in an overloaded function causes fatal error #2205

JohnAlbin opened this issue Oct 13, 2016 · 1 comment

Comments

@JohnAlbin
Copy link

JohnAlbin commented Oct 13, 2016

If you try to use the variable argument indicator, ..., inside an overloaded function, it will work just fine in Ruby Sass, but libSass will throw an error. For example, rgba() can be called with either 4 params ($red, $green, $blue, $alpha) or with 2 params ($hex, $alpha).

input.scss

// Use the 2 parameter form of rgba().
$params: #fff .5;
test {
  color: rgba($params...);
}

libSass 3.3.6

overloaded function `rgba` given wrong number of arguments on line 4 at column 10

ruby sass 3.4.21

test {
  color: rgba(255, 255, 255, 0.5);
}

version info:

$ node-sass --version
node-sass   3.10.1  (Wrapper)   [JavaScript]
libsass     3.3.6   (Sass Compiler) [C/C++]

The error is thrown from this line: https://github.com/sass/libsass/blob/master/src/eval.cpp#L834

@JohnAlbin JohnAlbin changed the title Using an overloaded functions with call() causes fatal error Using ... in an overloaded function causes fatal error Oct 15, 2016
@JohnAlbin
Copy link
Author

I found a simpler test case that didn't require using call(), so I've updated the above test case and the bug description. Both the old and the new test case produce the same error message.

@mgreter mgreter added this to the 3.3.7 milestone Oct 20, 2016
@mgreter mgreter self-assigned this Oct 20, 2016
mgreter added a commit to mgreter/libsass that referenced this issue Oct 20, 2016
mgreter added a commit to mgreter/sass-spec that referenced this issue Oct 20, 2016
mgreter added a commit to mgreter/sass-spec that referenced this issue Oct 20, 2016
mgreter added a commit to mgreter/sass-spec that referenced this issue Oct 20, 2016
@xzyfer xzyfer modified the milestones: 3.3.7, 3.4 Oct 20, 2016
mgreter added a commit to mgreter/sass-spec that referenced this issue Oct 22, 2016
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

3 participants