-
Notifications
You must be signed in to change notification settings - Fork 464
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
Extend statement with & selector causes crash #1519
Comments
I can confirm that this segfaults. Fix seems simple as we just need to error when we extend '&'
@bassplayer7 thanks for the report! I just don't understand why quite a few people actually like to post pictures of code instead of just pasting the code (it keeps us from transcribing the test case) 😕 foo {
@extend &;
} |
@mgreter, I'm sorry about that. I absolutely should have included the code: I'm not sure why it didn't cross my mind. Here's where it happened to me, in case it affects your error message:
That was perhaps what made me miss the error of my way originally is that it was not extending a parent selector. I was trying to extend Thanks for working on this! I appreciate libsass very much. |
Not sure if you expect this to compile, but ruby sass gives this error (and libsass segfaults):
So we need add this check to libsass, but the given code is not valid sass ... |
Ok. Great. Right, I didn't expect the SCSS to compile, I was just commenting on the error message. And, |
Ah, I guess I got you now. The error seems to repeat what you tried to extend. Ie. |
Fix was merged and will be in 3.3 |
Spec added and activated in sass/sass-spec#689 |
Why not allow extending of parent selectors? |
@brookjordan LibSass just implements the Sass language. Questions and suggestions about the language should be raised with Sass - https://github.com/sass/sass |
Oops, sorry. Thanks @xzyfer ! |
I have this situation in one of my SCSS stylesheets which I'm compiling with libsass (with CodeKit 2):
At the time of writing, I didn't put it together that
@extend &
will always extend the current selector and as such doesn't make sense. However, CodeKit crashed with that and I'm guessing that it threw an unrecoverable exception. I suppose it is conceivable that others would make the same mistake that I did, and it would be nice to have an error saying that the "current select cannot be extended". Obviously, had it compiled or told me, I would have immediately realized the error of my thought at that moment.The text was updated successfully, but these errors were encountered: