Skip to content

Nested loop fails in 1.7.0 #2034

@SimonHarte

Description

@SimonHarte

The following code worked until 1.6.3 but now fails in 1.7.0 with a syntax error Cannot call method 'concat' of undefined:

.test() {
    .loop (@index) when (@index > 0) {
        // create css selector
        .@{index} {
            background: @index;
        }
        // next iteration
        .test > .loop(@index - 1);
    }
}
.test > .loop(12);

It is a simplified test version of this early example but nested in an unlocker mixin.

It seems to have a problem with the when () condition, if you take that and the next iteration away (to prevent infinite loop) it "works" but of course doesn't do a loop anymore.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions