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

guarded recursion fails on exit #635

Open
commonpike opened this issue Nov 18, 2017 · 0 comments
Open

guarded recursion fails on exit #635

commonpike opened this issue Nov 18, 2017 · 0 comments

Comments

@commonpike
Copy link

commonpike commented Nov 18, 2017

This

.recurse(@n, @i:0) when ( @i =< @n ) {
	.foo { border:@i; }
	.recurse( @n , (@i + 1) ); 
}
.recurse (5);

fails without a clear error message. plessc says

'src/less/loops.less on line 7ned: failed at '.recurse( @n , (@i + 1) );

the problem is apparently .recurse( 5,6 ); is not defined. this works fine :

.recurse(@n, @i:0) when ( @i =< @n ) {
	.foo { border:@i; }
	.recurse( @n , (@i + 1) ); 
}
.recurse(@n, @i:0) when ( @i > @n ) {
	// done
}
.recurse (5);

It makes some sense, but it's not documented (I think) and other libs don't do that afaik

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant