-
Notifications
You must be signed in to change notification settings - Fork 89
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
Fix errors for overloaded function arguments #1496
Merged
Merged
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
<===> input.scss | ||
five-arg { | ||
x: hsl(0, 100%, 50%, 0.5, 0); | ||
<===> error/too_many_args/input.scss | ||
a { | ||
b: hsl(0, 100%, 50%, 0.5, 0); | ||
} | ||
|
||
<===> error | ||
Error: Only 1 argument allowed, but 5 were passed. | ||
<===> error/too_many_args/error | ||
Error: Only 4 arguments allowed, but 5 were passed. | ||
, | ||
2 | x: hsl(0, 100%, 50%, 0.5, 0); | ||
2 | b: hsl(0, 100%, 50%, 0.5, 0); | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
' | ||
input.scss 2:6 root stylesheet | ||
|
||
<===> error-libsass | ||
<===> error/too_many_args/error-libsass | ||
Error: wrong number of arguments (5 for 3) for `hsl' | ||
on line 2 of input.scss | ||
>> x: hsl(0, 100%, 50%, 0.5, 0); | ||
>> b: hsl(0, 100%, 50%, 0.5, 0); | ||
|
||
-----^ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,66 +1,66 @@ | ||
<===> hue/type/input.scss | ||
hue-type { | ||
x: hsl("foo", 100%, 50%); | ||
<===> error/hue/type/input.scss | ||
a { | ||
b: hsl("foo", 100%, 50%); | ||
} | ||
|
||
<===> hue/type/error | ||
<===> error/hue/type/error | ||
Error: $hue: "foo" is not a number. | ||
, | ||
2 | x: hsl("foo", 100%, 50%); | ||
2 | b: hsl("foo", 100%, 50%); | ||
| ^^^^^^^^^^^^^^^^^^^^^ | ||
' | ||
input.scss 2:6 root stylesheet | ||
|
||
<===> hue/type/error-libsass | ||
<===> error/hue/type/error-libsass | ||
Error: argument `$hue` of `hsl($hue, $saturation, $lightness)` must be a number | ||
on line 2 of /sass/spec/core_functions/color/hsl/error/hue_type/input.scss, in function `hsl` | ||
from line 2 of /sass/spec/core_functions/color/hsl/error/hue_type/input.scss | ||
>> x: hsl("foo", 100%, 50%); | ||
>> b: hsl("foo", 100%, 50%); | ||
|
||
-----^ | ||
|
||
<===> | ||
================================================================================ | ||
<===> saturation/type/input.scss | ||
saturation-type { | ||
x: hsl(0, "foo", 50%); | ||
<===> error/saturation/type/input.scss | ||
a { | ||
b: hsl(0, "foo", 50%); | ||
} | ||
|
||
<===> saturation/type/error | ||
<===> error/saturation/type/error | ||
Error: $saturation: "foo" is not a number. | ||
, | ||
2 | x: hsl(0, "foo", 50%); | ||
2 | b: hsl(0, "foo", 50%); | ||
| ^^^^^^^^^^^^^^^^^^ | ||
' | ||
input.scss 2:6 root stylesheet | ||
|
||
<===> saturation/type/error-libsass | ||
<===> error/saturation/type/error-libsass | ||
Error: argument `$saturation` of `hsl($hue, $saturation, $lightness)` must be a number | ||
on line 2 of /sass/spec/core_functions/color/hsl/error/saturation_type/input.scss, in function `hsl` | ||
from line 2 of /sass/spec/core_functions/color/hsl/error/saturation_type/input.scss | ||
>> x: hsl(0, "foo", 50%); | ||
>> b: hsl(0, "foo", 50%); | ||
|
||
-----^ | ||
|
||
<===> | ||
================================================================================ | ||
<===> lightness/type/input.scss | ||
lightness-type { | ||
x: hsl(0, 100%, "foo"); | ||
<===> error/lightness/type/input.scss | ||
a { | ||
b: hsl(0, 100%, "foo"); | ||
} | ||
|
||
<===> lightness/type/error | ||
<===> error/lightness/type/error | ||
Error: $lightness: "foo" is not a number. | ||
, | ||
2 | x: hsl(0, 100%, "foo"); | ||
2 | b: hsl(0, 100%, "foo"); | ||
| ^^^^^^^^^^^^^^^^^^^ | ||
' | ||
input.scss 2:6 root stylesheet | ||
|
||
<===> lightness/type/error-libsass | ||
<===> error/lightness/type/error-libsass | ||
Error: argument `$lightness` of `hsl($hue, $saturation, $lightness)` must be a number | ||
on line 2 of /sass/spec/core_functions/color/hsl/error/lightness_type/input.scss, in function `hsl` | ||
from line 2 of /sass/spec/core_functions/color/hsl/error/lightness_type/input.scss | ||
>> x: hsl(0, 100%, "foo"); | ||
>> b: hsl(0, 100%, "foo"); | ||
|
||
-----^ |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are already in an error directory (spec/core_functions/color/hsl/error) so they don't need an additional error component here. I think it's fine to also leave off too_many_args, since there's only one meaningful test for passing five arguments anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good points, fixed.