We're updating the issue view to help you get more done. 

Confusing error message when using clojure.core/defprotocol instead of clojure.core.typed/defprotocol>

Description

Type checking a namespace using clojure.core/defprotocol instead of clojure.core.typed/defprotocol> results in the following error:

1 2 3 4 5 Exception in thread "main" java.lang.AssertionError: Assert failed: 4: Cannot set! (U nil clojure.lang.MethodImplCache) to Any Form: (set! (. f__5866__auto__ __methodImplCache) cache__5865__auto__) (sub/subtype? (-> cval expr-type ret-t) (-> ctarget expr-type ret-t))

Here's a minimal project demonstrating the problem: https://github.com/noidi/core.typed-record-problem

Although the user guide mentions defprotocol>, it's very easy to run into this error by accident, and the error message does not give the user any hints as to what might be wrong. In the long term it would be best if core.typed could deal with clojure.core/defprotocol. As a stopgap measure, maybe core.typed could detect this error and instruct the user to use clojure.core.typed/defprotocol> instead?

Environment

Clojure 1.5, core.typed 0.2.2

Status

Assignee

Ambrose BS

Reporter

Timo Mihaljov

Labels

None

Approval

None

Patch

None

Priority

Minor