Skip to content

Commit bc6f93e

Browse files
mfikesdnolen
authored and
dnolen
committed
CLJS-1538: Type hint some cljs.core predicates
Add type hints to predicates that directly delegate to instance? or satisfies?
1 parent e807ebf commit bc6f93e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/main/cljs/cljs/core.cljs

+5-5
Original file line numberDiff line numberDiff line change
@@ -1043,7 +1043,7 @@
10431043
(-invoke [_ a b c d e f g h i j k l m n o p q r s t rest]
10441044
(apply (val) a b c d e f g h i j k l m n o p q r s t rest)))
10451045

1046-
(defn var?
1046+
(defn ^boolean var?
10471047
"Returns true if v is of type cljs.core.Var"
10481048
[v]
10491049
(instance? cljs.core.Var v))
@@ -1052,7 +1052,7 @@
10521052

10531053
(declare array-seq prim-seq IndexedSeq)
10541054

1055-
(defn iterable?
1055+
(defn ^boolean iterable?
10561056
"Return true if x implements IIterable protocol."
10571057
[x]
10581058
(satisfies? IIterable x))
@@ -1062,7 +1062,7 @@
10621062
[value]
10631063
(-clone value))
10641064

1065-
(defn cloneable?
1065+
(defn ^boolean cloneable?
10661066
"Return true if x implements ICloneable protocol."
10671067
[value]
10681068
(satisfies? ICloneable value))
@@ -4070,7 +4070,7 @@ reduces them without incurring seq initialization"
40704070
[val]
40714071
(Volatile. val))
40724072

4073-
(defn volatile?
4073+
(defn ^boolean volatile?
40744074
"Returns true if x is a volatile."
40754075
[x] (instance? Volatile x))
40764076

@@ -9999,7 +9999,7 @@ Maps become Objects. Arbitrary keys are encoded to by key->js."
99999999
(-write writer (str "#" tag " "))
1000010000
(pr-writer form writer opts)))
1000110001

10002-
(defn tagged-literal?
10002+
(defn ^boolean tagged-literal?
1000310003
"Return true if the value is the data representation of a tagged literal"
1000410004
[value]
1000510005
(instance? TaggedLiteral value))

0 commit comments

Comments
 (0)