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
Adding a default value to a mixin causes arity match failure #4234
Labels
Comments
I feel like the section on mixins implies that mixins, at the least, must:
|
Note that this appears to only be true in the case of named parameters, which is more related to |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To reproduce:
In the docs, it describes how mixins match on arity (number of arguments).
That is, you can do this:
This will produce:
However, if you add a default value to the first parameter, like so:
... then you get the error:
wrong number of arguments for .mixin (1 for 2)
Expected behavior:
I would expect this to still match the first mixin by arity.
Something else that's unexpected is that you can't match the second mixin by arity by doing this:
However, the Less docs don't sufficiently explain (IMO) what the expected behavior should be in that case. Technically, there is a mixin that matches, but it's not clear from the Less docs if overloading mixins means you can "pass over" mixins with only one named argument. I'm really not sure what the behavior should be because the docs don't say, so I'd welcome opinions.
Environment information:
Latest Less / Node 16
The text was updated successfully, but these errors were encountered: