proper type for @each when single variable
This commit is contained in:
parent
f1b60019a1
commit
ce833b7c03
@ -39,13 +39,23 @@ impl Each {
|
||||
};
|
||||
|
||||
if self.vars.len() == 1 {
|
||||
scope.insert_var(
|
||||
&self.vars[0],
|
||||
Spanned {
|
||||
node: Value::List(this_iterator, ListSeparator::Space, Brackets::None),
|
||||
span: self.vars[0].span,
|
||||
},
|
||||
)?;
|
||||
if this_iterator.len() == 1 {
|
||||
scope.insert_var(
|
||||
&self.vars[0],
|
||||
Spanned {
|
||||
node: this_iterator[0].clone(),
|
||||
span: self.vars[0].span,
|
||||
},
|
||||
)?;
|
||||
} else {
|
||||
scope.insert_var(
|
||||
&self.vars[0],
|
||||
Spanned {
|
||||
node: Value::List(this_iterator, ListSeparator::Space, Brackets::None),
|
||||
span: self.vars[0].span,
|
||||
},
|
||||
)?;
|
||||
}
|
||||
} else {
|
||||
for (var, val) in self.vars.clone().into_iter().zip(
|
||||
this_iterator
|
||||
|
@ -43,3 +43,8 @@ test!(
|
||||
"a {\n @each $i in (1 2 3) {\n color: $i;\n }\n}\n",
|
||||
"a {\n color: 1;\n color: 2;\n color: 3;\n}\n"
|
||||
);
|
||||
test!(
|
||||
type_of_each_space_separated_single_var,
|
||||
"a {\n @each $i in 1 2 3 {\n color: type-of($i);\n }\n}\n",
|
||||
"a {\n color: number;\n color: number;\n color: number;\n}\n"
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user