core.typed

annotation fails on recur

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
  • Environment:
    Mac OS X, clojure 1.5.1, Oracle JDK 1.7.0_45

Description

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/<

huhu.clj
(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)))
       false)))

This is the result of check-ns:

(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.

Activity

Hide
Christian S added a comment -

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

Show
Christian S added a comment - clojure.core.typed version is [org.clojure/core.typed "0.2.37"]
Hide
Ambrose Bonnaire-Sergeant added a comment -

Fixed in 0.2.38-20140316.133526-3

Show
Ambrose Bonnaire-Sergeant added a comment - Fixed in 0.2.38-20140316.133526-3

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: