Skip to content
Browse files

Add subtype check in :new

  • Loading branch information...
1 parent 71dccd4 commit 59cb1c43e49b8dccb566756d5836a31958beec31 @frenchy64 frenchy64 committed Mar 20, 2013
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/main/clojure/clojure/core/typed/check.clj
4 src/main/clojure/clojure/core/typed/check.clj
@@ -2478,7 +2478,9 @@
(ret ctor-fn))
;_ (prn "Expected constructor" (unparse-type (ret-t ifn)))
cargs (mapv check args)
- res-type (check-funapp expr args ifn (map expr-type cargs) nil)]
+ res-type (check-funapp expr args ifn (map expr-type cargs) nil)
+ _ (when expected
+ (subtype (ret-t res-type) (ret-t expected)))]
(assoc expr
expr-type res-type))))))

0 comments on commit 59cb1c4

Please sign in to comment.
Something went wrong with that request. Please try again.