Welcome! Please see the About page for a little more info on how this works.

0 votes
in core.typed by

Following code (unexpectedly) passes a type check.

`
(ns tst
(:require
[clojure.core.typed :refer [Int Kw ann] :as typed]))

(typed/defprotocol [[a :variance :covariant]] P

               (f [p :- (P a)] :- a))

(typed/ann-record [[a :variance :covariant]] R [_f :- a])
(defrecord R [_f]
P
(f [self] _f))

(ann fr [(R Int) -> Kw])
(defn fr [x] (f x))
`

1 Answer

0 votes
by
Reference: https://clojure.atlassian.net/browse/CTYP-279 (reported by alex+import)
...