Skip to content

Commit 490b7e3

Browse files
committed
protocols - add primitive type hint note
1 parent 310cac1 commit 490b7e3

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

content/reference/protocols.adoc

+1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ A protocol is a named set of named methods and their signatures, defined using h
5151
** all are namespace-qualified by the namespace enclosing the definition
5252
* The resulting functions dispatch on the type of their first argument, and thus must have at least one argument
5353
* defprotocol is dynamic, and does not require AOT compilation
54+
* Note: primitive type hints are not supported on protocol functions
5455

5556
https://clojure.github.io/clojure/clojure.core-api.html#clojure.core/defprotocol[defprotocol] will automatically generate a corresponding interface, with the same name as the protocol, e.g. given a protocol my.ns/Protocol, an interface my.ns.Protocol. The interface will have methods corresponding to the protocol functions, and the protocol will automatically work with instances of the interface.
5657

0 commit comments

Comments
 (0)