Static method invocation + type hint not working

Open
#823 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
clojure, java
Domain
compilers

Research direction

Start by reading the linked babashka issue and tracing how clojure.lang.Reflector handles static method invocation when an argument is nil. The proposed :classes configuration is the entry point to investigate; done would mean a documented, tested way to intercept such invocations and support the type-hint case.

Written by the indexing model from the issue text.

Description

See https://github.com/babashka/babashka/issues/1409

The issue here is that clojure.lang.Reflector looks at the runtime values of arguments but if such a value is nil it qualifies as basically anything.

It might be better if we starter supporting intercepting method invocations so users can handle these, also for performance.

:classes {java.nio.file.FileSystems {:static-methods {newFileSystem (fn ...)}}}

or so

Dominant language
Clojure
Stars
1.4k
Forks
109
Avg merge
1m
Merged PRs (30d)
26

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from babashka/sci

All issues in babashka/sci

Similar issues

More Clojure issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.