Skip to content

Commit c0a4e07

Browse files
mfikesdnolen
authored andcommitted
CLJS-1550: Enhance docstring for extend-type wrt type-sym
1 parent 8f7b1d0 commit c0a4e07

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

src/main/clojure/cljs/core.cljc

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1472,8 +1472,22 @@
14721472

14731473
(core/defmacro extend-type
14741474
"Extend a type to a series of protocols. Useful when you are
1475-
supplying the definitions explicitly inline. Propagates the
1476-
type as a type hint on the first argument of all fns.
1475+
supplying the definitions explicitly inline. Propagates the
1476+
type as a type hint on the first argument of all fns.
1477+
1478+
type-sym may be
1479+
1480+
* default, meaning the definitions will apply for any value,
1481+
unless an extend-type exists for one of the more specific
1482+
cases below.
1483+
* nil, meaning the definitions will apply for the nil value.
1484+
* any of object, boolean, number, string, array, or function,
1485+
indicating the definitions will apply for values of the
1486+
associated base JavaScript types. Note that, for example,
1487+
string should be used instead of js/String.
1488+
* a JavaScript type not covered by the previous list, such
1489+
as js/RegExp.
1490+
* a type defined by deftype or defrecord.
14771491
14781492
(extend-type MyType
14791493
ICounted

0 commit comments

Comments
 (0)