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

Weird behaviour with lists as map keys #1187

Closed
KittyGiraudel opened this issue May 9, 2015 · 2 comments · Fixed by #1195
Closed

Weird behaviour with lists as map keys #1187

KittyGiraudel opened this issue May 9, 2015 · 2 comments · Fixed by #1195

Comments

@KittyGiraudel
Copy link

Maybe follow up of #1169?

$a: 'foo';
$b: 'foo';
$map: (
  $a: 1,
  $b: 2
);

.foo {
  content: $a == $b;
  content: inspect($map);
}

Ruby Sass:

Duplicate key "foo" in map ($a: 1, $b: 2).

LibSass:

.foo {
  content: true;
  content: ("foo": 2);
}

The behaviour is really weird because obviously LibSass spots that it is twice the same key since there is only one key in the output. Although, it does not throw a duplicated key error.

Interestingly enough:

$key: 'foo';
$map: (
  $key: 1,
  $key: 2
);

.foo {
  content: $a == $b;
  content: inspect($map);
}

This yields in LibSass:

Duplicate key "$key" in map ($key: 2). on line 4 at column 10
mgreter added a commit to mgreter/libsass that referenced this issue May 10, 2015
Deferred check from parser to evaluation
Fixes sass#1187
@mgreter mgreter self-assigned this May 10, 2015
@mgreter mgreter added this to the 3.2.4 milestone May 10, 2015
mgreter added a commit to mgreter/libsass that referenced this issue May 10, 2015
Deferred check from parser to evaluation
Fixes sass#1187
mgreter added a commit to mgreter/libsass that referenced this issue May 10, 2015
Deferred check from parser to evaluation
Fixes sass#1187
mgreter added a commit to mgreter/sass-spec that referenced this issue May 10, 2015
mgreter added a commit to mgreter/sass-spec that referenced this issue May 10, 2015
mgreter added a commit to mgreter/sass-spec that referenced this issue May 10, 2015
mgreter added a commit to mgreter/sass-spec that referenced this issue May 10, 2015
mgreter added a commit to mgreter/sass-spec that referenced this issue May 10, 2015
@xzyfer
Copy link
Contributor

xzyfer commented May 11, 2015

Spec added sass/sass-spec#373

@KittyGiraudel
Copy link
Author

You guys rock.

mgreter added a commit to mgreter/libsass that referenced this issue May 12, 2015
Deferred check from parser to evaluation
Fixes sass#1187
saper pushed a commit to saper/sass-spec that referenced this issue Sep 20, 2015
saper pushed a commit to saper/sass-spec that referenced this issue Sep 21, 2015
saper pushed a commit to saper/sass-spec that referenced this issue Sep 21, 2015
saper pushed a commit to saper/sass-spec that referenced this issue Sep 21, 2015
xzyfer added a commit to xzyfer/sass-spec that referenced this issue Dec 28, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants