Skip to content
Browse files

Fix subtype check for :map. Fixes CTYP-22

  • Loading branch information...
1 parent a1b0abc commit 8571e0197ea5a2d3534bc8c3bb553ef74cbb1c34 @frenchy64 frenchy64 committed Mar 25, 2013
View
4 src/main/clojure/clojure/core/typed/check.clj
@@ -104,8 +104,8 @@
(-complete-hmap ts)
(RClass-of APersistentMap [(apply Un (keys ts))
(apply Un (vals ts))]))
- _ (assert (when expected
- (subtype? actual expected)) (type-error actual expected))]
+ _ (when (and expected (subtype? actual expected))
+ (type-error actual expected))]
(assoc expr
expr-type (ret actual (-FS -top -bot)))))
View
3 src/test/clojure/clojure/core/typed/test/core.clj
@@ -1220,3 +1220,6 @@
(is (cf (fn [a]
(and (< 1 2) a))
[(U nil Number) -> Any :filters {:then (is Number 0)}])))
+
+(deftest map-literal-test
+ (is (cf {:bar (identity 1)})))

0 comments on commit 8571e01

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