Skip to content

Java interop: type hinting an array #695

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

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Java interop: type hinting an array
The section on type hints does not make it clear how to do this for arrays (unless you know to look at "Aliases" for the primitive ones), especially for non-primitive ones.
  • Loading branch information
holyjak authored Jun 29, 2024
commit a782b208765c267517505b60f6d580c26757cf58
8 changes: 8 additions & 0 deletions content/reference/java_interop.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,14 @@ For function return values, the type hint can be placed before the parameter vec
-> #user/hinted
----

For type hints on arrays, see <<TypeAliases>> below for primitive arrays. For non-primitive arrays you can use
the Java array class name (`"[L" + class name + ";"`):

[source,clojure]
----
(defn foo [^"[Ljava.lang.String;" strs])
----

[[TypeAliases]]
== Aliases

Expand Down