Skip to content
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

set-nth and arglists don't play well together #1255

Closed
KittyGiraudel opened this issue Jun 1, 2015 · 2 comments
Closed

set-nth and arglists don't play well together #1255

KittyGiraudel opened this issue Jun 1, 2015 · 2 comments

Comments

@KittyGiraudel
Copy link

Test

@function double($value) {
  @return $value * 2;
}

@mixin dummy-bug($args...) {
  @for $i from 1 through length($args) {
    $args: set-nth($args, $i, double(nth($args, $i)));
  }

  content: $args;
}

.foo {
  @include dummy(1, 2, 3, 4);
}

Expected

.foo {
  content: 2, 4, 6, 8;
}

Result (LibSass 3.2.x)

Compile never ends.

Workaround

@mixin dummy($args...) {
  $list: ();

  @each $arg in $args {
    $list: append($list, double($arg), 'comma');
  }

  content: $list;
}

Observations

As far as I can tell, there is somehow an issue when trying to use set-nth on an arglist. Maybe is it only restricted when using a loop? I must say I don't know.

@xzyfer
Copy link
Contributor

xzyfer commented Jun 1, 2015

This may have the same underlying cause as #1171

@mgreter mgreter added this to the 3.3 milestone Jun 12, 2015
@mgreter mgreter self-assigned this Jun 12, 2015
@xzyfer
Copy link
Contributor

xzyfer commented Jul 8, 2015

Fixed by #1318.

@xzyfer xzyfer closed this as completed Jul 8, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants