-
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
invalid operands for multiplication - once again #1207
Comments
@DenisMir I'm sorry but without a copy-pastable code sample we cannot begin to investigate this issue. Please take the time to find what part of your code is causing this issue. |
@xzyfer I have some function which is reading a modular scale value from a map. @function ms-get-scale-ratio($pos) {
@if not $modular-scale {
@warn 'Please define a modular scale map in your config.';
} @else {
$key: scale-#{$pos};
@debug 'Trying to get ratio for position #{$pos} with key #{$key}';
$ratio: map-get($modular-scale, $key);
@debug 'Found ratio is #{$ratio}';
@return $ratio;
}
} The modular scale map is something like that: $modular-scale: (
scale-0: 1.2,
scale-1: 1.3,
scale-2: 1.4,
scale-3: 1.5,
scale-4: 1.6
); The part where the function gets called looks like: $bp-index: str_slice($bp-key, 7);
@debug 'Got breakpoint index #{$bp-index} for #{$bp-key}';
$ratio: ms-get-scale-ratio($bp-index); Now when I'm looking at the debug log I'm getting some correct pairs of log which look like:
But I'm also getting something like:
The I hope that I could help you finding the issue. Please adjust the title according to the correct malfunction. At the moment I'm not quite sure what is going on here. If you need more information just drop me a message. |
@xzyfer Do you need more information from me to be able to identify the bug? |
@DenisMir the quickest way for use to address this issue is if you create a http://sassmeister.com gist showing the problem. We simply don't have the time to reconstruct the code to test every bug. |
@xzyfer No problem. I will try to reproduce the bug there. I haven't seen it since using |
Reduced test case: @function test($pos) {
@return test-#{$pos};
}
.foo {
content: test(str-slice('scale-0', 7)); // Nope
content: test-#{str-slice('scale-0', 7)}; // Yep
} Expected.foo {
content: test-0;
content: test-0;
} Actual.foo {
content: test-"0";
content: test-0;
} |
Fix seems to be simple (in bind.cpp): for (size_t i = 0, L = as->length(); i < L; ++i) {
if (auto str = dynamic_cast<String_Quoted*>((*as)[i]->value())) {
// force optional quotes (only if needed)
if (str->quote_mark()) str->quote_mark('*');
}
} @xzyfer: I already have this in my latest (local) refactoring branch which I will updatein a few hours/days! |
We now have a passing spec test since #1249 was merged 🎈 |
At the moment I am using the following setup: [email protected], [email protected] and [email protected] and getting once again the "invalid operands for multiplication". This error was not there with [email protected]. I can't even give you the correct error description since it errors out with
Line 36 Column 13
which is a normal comment block.The text was updated successfully, but these errors were encountered: