-
-
Notifications
You must be signed in to change notification settings - Fork 291
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
Support Dart named parameters #2226
Comments
Can you create a Dart example to which this compiles? I'd like to learn more about this. |
Nice tutorial about dart named parameters: https://www.darttutorial.org/dart-tutorial/dart-named-parameters A usecase in cljd is for example a function that can take a .child like flutter widgets: https://clojurians.slack.com/archives/C03A6GE8D32/p1681981648987529?thread_ts=1681981215.249239&cid=C03A6GE8D32 |
I guess the easiest solution would be to just ignore all |
I'm not sure. Named arguments are not ordered which could result in weird warnings with expected types I was wondering if something might be possible with 1.11 keyword arguments, but I don't know if those could be made required (which named arguments are) |
Maybe for CLJD we have to then transform it internally into |
With that approach, I'd want to add an extra check because named arguments are required |
To upvote this issue, give it a thumbs up. See this list for the most upvoted issues.
Is your feature request related to a problem? Please describe.
ClojureDart supports Dart named parameters. The following is valid:
Also apparently at the callsites you can use keywords instead of dotted symbols, but I don't know if this is recommended.
https://github.com/Tensegritics/ClojureDart/blob/fed8bed6e578cb554b3e83f13813b20d58a422f8/doc/differences.md?plain=1#L177-L185
Describe the solution you'd like
Teach clj-kondo to recognize
.
named parameters in cljd filesDescribe alternatives you've considered
Currently we ignore the unresolved symbol warnings in the function body, and the invalid arity warnings at the call sites.
Additional context
I'd love to help implementing this, but I have no idea where to start
The text was updated successfully, but these errors were encountered: