Skip to content

Commit ffd9ad4

Browse files
committed
added param-tags section to interop ref
1 parent 47b79a8 commit ffd9ad4

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

content/reference/java_interop.adoc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,15 @@ For example, byte arrays (byte-array []) have a type of "[B".
336336
* chars - A character array
337337
* objects - An object array
338338

339+
[[paramtags]]
340+
== param-tags
341+
342+
When used as values, qualified methods supply only the class and method name, and thus cannot resolve overloaded methods.
343+
344+
Since Clojure 1.12, developers can supply `:param-tags` metadata on qualified methods to specify the signature of a single desired method, 'resolving' it. The `:param-tags` metadata is a vector of zero or more tags: `[... tag ...]`. A tag is any existing valid `:tag` metadata value as described above. Each tag corresponds to a parameter in the desired signature (arity should match the number of tags). Parameters with non-overloaded types can use the placeholder `_` in lieu of the tag. When you supply :param-tags metadata on a qualified method, the metadata must allow the compiler to resolve it to a single method at compile time.
345+
346+
A new metadata reader syntax `^[ ... ]` attaches `:param-tags` metadata to member symbols, just as `^tag` attaches `:tag` metadata to a symbol.
347+
339348
[[primitives]]
340349
== Support for Java Primitives
341350

0 commit comments

Comments
 (0)