Permalink
Browse files

Fix CTYP-56, 3 argument isa?

  • Loading branch information...
1 parent 149e84a commit f73cdc5df8158ed530e275bd0e5452d8cb604a13 @frenchy64 frenchy64 committed Sep 23, 2013
View
@@ -1,3 +1,5 @@
+0.2.11-SNAPSHOT
+
0.2.10 - Released 24 September 2013
- [CTYP-69](http://dev.clojure.org/jira/browse/CTYP-69)
Good error for unannotated deftype
@@ -1725,15 +1725,16 @@
(ret (c/Un r/-true r/-false) fs obj/-empty))))
-;isa? (2 arity only)
+;isa? (2 arity is special)
(add-invoke-special-method 'clojure.core/isa?
[{:keys [args] :as expr} & [expected]]
- (when-not (= 2 (count args))
- (u/nyi-error "core.typed supports 2 argument invocations of isa?"))
- (let [[cchild-expr cparent-expr :as cargs] (mapv check args)]
- (assoc expr
- expr-type (tc-isa? (expr-type cchild-expr)
- (expr-type cparent-expr)))))
+ (cond
+ (#{2} (count args))
+ (let [[cchild-expr cparent-expr :as cargs] (mapv check args)]
+ (assoc expr
+ expr-type (tc-isa? (expr-type cchild-expr)
+ (expr-type cparent-expr))))
+ :else :default))
;FIXME need to review if any repeated "check"s happen between invoke-apply and specials
;apply
@@ -1136,8 +1136,9 @@
(clojure.lang.IPersistentMap clojure.lang.Keyword ':b)))
(deftest isa-test
- (is-clj (tc-t (isa? 1 1)))
- (is-clj (tc-t #(isa? (class %) Number))))
+ (is-cf (isa? 1 1))
+ (is-cf (isa? {:parents {} :ancestors {} :descendants {}} 1 1))
+ (is-cf #(isa? (class %) Number)))
(deftest array-primitive-hint-test
(is-cf (let [^ints a (clojure.core.typed/into-array> int [(int 1)])]

0 comments on commit f73cdc5

Please sign in to comment.