Impossible to annotate protocol in other namespace

Description

If I try to annotate external protocol, I get exception (CTYP-277).

Example to reproduce problem:

(ns my.tst-typed (:require [clojure.core.typed :as t] [com.stuartsierra.component :as component])) (t/ann-protocol ^:no-check component/Lifecycle start [component/Lifecycle -> component/Lifecycle] stop [component/Lifecycle -> component/Lifecycle]) (t/defprotocol My (all-records [this :- My] :- (t/Seq String))) (t/ann-record TestConnection [hosts :- (t/Seq String) db :- String connection :- String]) (defrecord TestConnection [hosts db connection] component/Lifecycle (start [component] (let [connection (str hosts db)] (assoc component :connection connection))) (stop [component] (when connection (assoc component :connection nil))) My (all-records [this] "Returns all records from database" (list "1" "2")))

Looks like type annotation doesn't apply to target protocol.

Environment

Clojure 1.7.0

Activity

Show:

Ambrose Bonnaire-SergeantDecember 4, 2017 at 12:17 AM

ann-protocol takes a fully qualified protocol name, aliases not supported.

Declined

Details

Assignee

Reporter

Components

Fix versions

Affects versions

Priority

Created September 17, 2015 at 11:25 PM
Updated December 4, 2017 at 12:17 AM
Resolved December 4, 2017 at 12:17 AM