<< Back to previous view

[CTYP-122] annotation fails on recur Created: 16/Mar/14  Updated: 23/Mar/14  Resolved: 16/Mar/14

Status: Closed
Project: core.typed
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Minor
Reporter: Christian S Assignee: Ambrose Bonnaire-Sergeant
Resolution: Completed Votes: 0
Labels: bug

Mac OS X, clojure 1.5.1, Oracle JDK 1.7.0_45


The following test case fails on check-ns. The issue seems to be the use of recur. The test case is modelled after clojure.core/<

(ns huhu (:require [clojure.core.typed :refer :all]))
  (ann testcase [Number Number * -> boolean])
  (defn testcase
    ([x] true)
    ([x y] false)
    ([x y & more]
     (if (testcase x y)
       (if (next more)
         (recur y (first more) (next more))
         (testcase y (first more)))

This is the result of check-ns:

Start collecting huhu
Finished collecting huhu
Collected 1 namespaces in 26.58 msecs
Start checking huhu
AssertionError Assert failed: (AnyType? t)  clojure.core.typed.type-rep/ret (type_rep.clj:825)

If a recursive call instead of recur would be used it works. This is not a workaround to be applicable in every case.

Comment by Christian S [ 16/Mar/14 8:01 AM ]

clojure.core.typed version is [org.clojure/core.typed "0.2.37"]

Comment by Ambrose Bonnaire-Sergeant [ 16/Mar/14 8:38 AM ]

Fixed in 0.2.38-20140316.133526-3

Generated at Fri Jan 19 19:56:06 CST 2018 using JIRA 4.4#649-r158309.