check-ns: Assert failed: (r/Type? t)

Description

The presence of the function

(defn foo [x y] (pos? (rem x y)))

in a namespace causes an assert error when check-ns is called on it.

Attached is the full output of lein typed check, and the full code for a lein project that demonstrates the bug. This only occurs in 0.3.11 and 0.3.10.

Environment

Java 8, Clojure 1.7, OS X 10.10.3

Attachments

3
  • 25 Aug 2015, 06:34 PM
  • 25 Aug 2015, 06:34 PM
  • 25 Aug 2015, 06:34 PM

Activity

Show:

Ambrose Bonnaire-Sergeant December 4, 2017 at 12:09 AM

No longer has assert error.

Ambrose Bonnaire-Sergeant September 14, 2015 at 6:56 PM

I've reduced this down to tools.analyzer.jvm not resolving the reflection in:

(fn [^Number x] (pos? x))

import September 5, 2015 at 1:12 PM

Comment made by: kshramt

Annotating some `clojure.lang.Numbers` methods seems to solve the problem.

(typed/override-method clojure.lang.Numbers/remainder (IFn [Int Int -> Int] [Num Num -> Num])) (typed/override-method clojure.lang.Numbers/isPos [Num -> Boolean]) (ann foo [Num Num -> Boolean]) (defn foo [x y] (pos? (rem x y)))
Completed

Details

Assignee

Reporter

Components

Fix versions

Affects versions

Priority

Created August 25, 2015 at 6:34 PM
Updated December 4, 2017 at 12:10 AM
Resolved December 4, 2017 at 12:10 AM