We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7faeb3a commit bbea352Copy full SHA for bbea352
test/clojure/test_clojure/compilation.clj
@@ -362,3 +362,17 @@
362
(try
363
(finally
364
(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)))))
0 commit comments