Closed twhoff closed 9 years ago
Nice catch, thank you for bug reports.
Simplified example:
.for(@n) when (isnumber(@n)) {
isnumber: true;
}
.for(@array) when (default()) {
should-not-get-executed: but-did;
//.-each(extract(@array, length(@array))); //un-comment to get error
}
@list: one, two, three;
.we {
@number: 2;
.for(@number);
.-each(@val) {
val: @val;
}
}
It is trying to compile .for(@array)
despite it not being in output.
Description
Again using the for-loop logic as an example, this code should compile and run but doesn't:
Error:
Explanation:
So calling the .for() mixin with a number as the parameter should execute the .for(@n) when (isnumber(@n)) mixin based on pattern matching.
Comment out the following line:
You can see in the pattern matching for the .for() mixin is work (ie, it does not output the "should-not-get-executed: but-did;" line) - however it seems it is still evaluating the .-each() mixin in the same scope, which is causing the error.
This compiles fine under the less compiler, so I believe this is a bug.