-
Notifications
You must be signed in to change notification settings - Fork 355
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
Misleading error message for overloaded function arity #520
Comments
Hey, @nex3, has this one been solved yet? I'd like to work on it, if possible. I may need some direction in doing so. Mainly, just where to find the code in the files. I see multiple color.dart files in different directories. Can you help out with this? Thanks! |
This is still up for grabs! I think you actually want to look at |
How do we know which overloaded function to use for argument validity? Currently with 4 args, If we use
but we would also get the undesired
|
That's kind of the core question here, and it may come down to finding a heuristic that best matches the failure cases we know of. I think a good starting point is choosing the overload that's closest to the number of (positional?) arguments that were actually passed. |
@DreamSpinner22 Would you mind if I worked on this? |
@Awjin I do not mind you working on this. I haven't had much spare time to work on this, unfortunately. If you do figure it out before me, please let me know how because I'm still new to Dart and want to learn as much as possible. |
See sass/dart-sass#520 [skip dart-sass]
When overloaded functions receive an incorrect number of positional arguments, determine which overload has the most similar number of arguments, and then correctly display that number in the error. Closes #520 sass/sass-spec#1496
When overloaded functions receive an incorrect number of positional arguments, determine which overload has the most similar number of arguments, and then correctly display that number in the error. Closes #520 sass/sass-spec#1496
See sass/dart-sass#520 [skip dart-sass]
When overloaded functions receive an incorrect number of positional arguments, determine which overload has the most similar number of arguments, and then correctly display that number in the error. Closes #520 sass/sass-spec#1496
@DreamSpinner22 see the solution here: https://github.com/sass/dart-sass/pull/883/files |
When the wrong number of arguments are passed to a function with overloads, Dart Sass's error message sometimes claims that the function accepts fewer arguments than it actually does. For example:
hsla()
allows up to 4 arguments, so this error message is confusing and incorrect.The text was updated successfully, but these errors were encountered: