Skip to content
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

Recognize ^super #2229

Closed
valerauko opened this issue Dec 4, 2023 · 4 comments · Fixed by Tensegritics/ClojureDart#295
Closed

Recognize ^super #2229

valerauko opened this issue Dec 4, 2023 · 4 comments · Fixed by Tensegritics/ClojureDart#295

Comments

@valerauko
Copy link

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.

In ClojureDart if you want to call a superclass method, you need to use ^super. The following is valid:

;; (:require ["package:flutter/material.dart" :as m])
(reify :extends m/State
 :no-meta true
 (initState [this]
   (.initState ^super this)
   ,,,
   nil)
 
 (dispose [this]
   ,,,
   (.dispose ^super this)))

Describe the solution you'd like

Teach clj-kondo to recognize this syntax.

I don't know if there are scenarios where this shouldn't (can't) be used that warrants a linter warning.

Describe alternatives you've considered

Currently we ignore the unresolved symbol warnings where ^super is used

Additional context

I'd love to help implementing this, but I have no idea where to start

@borkdude
Copy link
Member

borkdude commented Dec 4, 2023

ClojureDart could have supported ^:super which would not require any changes to clj-kondo. Are they open to that?

@valerauko
Copy link
Author

Turns out it's a bit more complicated than that. In such a context super is actually a type so tagging it as a keyword is not right.

cljd also has support for Dart generic type parameters, which complicates things quite a lot. Example: (the E)
https://github.com/Tensegritics/ClojureDart/blob/fca6e1da6b538a7cb76e08c78856c8741ccb39af/clj/src/cljd/core.cljd#L3159-L3174

@borkdude
Copy link
Member

borkdude commented Dec 4, 2023

ok, let's just support ^super, it's not super hard to add it if clj-kondo understands that it's processing cljd.

@valerauko
Copy link
Author

Confirmed that the above PR resolves the warning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants