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

No matching method for class error when using Clojure 1.12 qualified method syntax #734

Open
Oddsor opened this issue Dec 2, 2024 · 5 comments · May be fixed by #737
Open

No matching method for class error when using Clojure 1.12 qualified method syntax #734

Oddsor opened this issue Dec 2, 2024 · 5 comments · May be fixed by #737

Comments

@Oddsor
Copy link

Oddsor commented Dec 2, 2024

Since clojure 1.12 hit I figured I'd use some qualified methods, such as String/.split.
Sadly this seems to fail with the following error message:

Execution error (ExceptionInfo) at clojure.tools.analyzer.passes.jvm.validate/validate-call (validate.clj:127).
No matching method: .split for class: class java.lang.String and arity: 2

Usage example:

^{:nextjournal.clerk/visibility {:result :hide}}
(defn to-matrix [input]
  (for [line (String/.split input "\\n")
        :let [numbers (String/.split line "\\s+")]]
    (map parse-long numbers)))

Clerk-version:

io.github.nextjournal/clerk {:git/sha "d9cab25aae62029557cff3346e7bd06e878999cd"
                                             :git/url "https://github.com/nextjournal/clerk"}
@mk
Copy link
Member

mk commented Dec 2, 2024

Hi @Oddsor,

Suport for the new Clojure syntax depends on tools.analyzer.jvm support for it, see https://clojure.atlassian.net/browse/TANAL-138. It was merged a while back and I've asked for a release to be cut so we can use it.

@mk mk changed the title No matching method for class No matching method for class error when using Clojure 1.12 qualified method syntax Dec 3, 2024
@mk
Copy link
Member

mk commented Dec 3, 2024

tools.analyzer.jvm has been released and I updated it in 73c6a50 but found out that method values aren't supported yet, this is tracked as https://clojure.atlassian.net/browse/TANAL-141.

borkdude added a commit that referenced this issue Dec 10, 2024
@borkdude
Copy link
Collaborator

I've implemented a workaround in:

org.clojure/tools.analyzer.jvm {:git/url "https://github.com/borkdude/tools.analyzer.jvm"
                                        :git/sha "86e7d1f6f1aa048b468d42ed9a596b6104012416"}

Note that this is merely a workaround, probably not something that should be merged in tools.analyzer proper.

@borkdude borkdude linked a pull request Dec 10, 2024 that will close this issue
@borkdude
Copy link
Collaborator

org.clojure/tools.analyzer.jvm {:git/url "https://github.com/borkdude/tools.analyzer.jvm"
                                        :git/sha "318dc38f0a903fabb22a7e2caafea5a5b4c37df8"}

has some more fixes

@borkdude
Copy link
Collaborator

Screenshot 2024-12-10 at 22 16 27

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

Successfully merging a pull request may close this issue.

3 participants