File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
test/clojure/test_clojure Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 362362 (try
363363 (finally
364364 (let [z# y#])))))))
365+
366+ ; ; See CLJ-1846
367+ (deftest incorrect-primitive-type-hint-throws
368+ ; ; invalid primitive type hint
369+ (is (thrown-with-msg? Compiler$CompilerException #"Cannot coerce long to int"
370+ (load-string " (defn returns-long ^long [] 1) (Integer/bitCount ^int (returns-long))" )))
371+ ; ; correct casting instead
372+ (is (= 1 (load-string " (defn returns-long ^long [] 1) (Integer/bitCount (int (returns-long)))" ))))
373+
374+ ; ; See CLJ-1825
375+ (def zf (fn rf [x] (lazy-seq (cons x (rf x)))))
376+ (deftest test-anon-recursive-fn
377+ (is (= [0 0 ] (take 2 ((fn rf [x] (lazy-seq (cons x (rf x)))) 0 ))))
378+ (is (= [0 0 ] (take 2 (zf 0 )))))
You can’t perform that action at this time.
0 commit comments