secret
Last active

  • Download Gist
core.clj
Clojure
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
(ns core-typed-tests.core
(:require [clojure.core.typed :as t]
[clojure.core.typed.async :as ta]
[clojure.core.async :as a]))
 
(t/typed-deps clojure.core.typed.async)
 
(t/ann foo [-> nil])
(defn foo []
(a/alts!! [(a/chan) (a/chan)] :priority true)
nil)
 
(comment
"the annotation for alts!!, according to cf"
(All [x d]
(Fn
[(t/Seqable (U (ta/Port x) [(ta/Port x) x]))
(t/Seqable (ta/Port x))
& {:priority (U true nil)} :mandatory {:default d}
-> (U [x (ta/Port x)] [d (Value :default)])]
[(t/Seqable (U (ta/Port x) [(ta/Port x) x]))
& {:priority (U true nil)}
-> [x (ta/Port x)]]))
)
repl
1 2 3 4 5 6 7 8 9 10 11 12
core-typed-tests.core=> (t/check-ns)
Start collecting core-typed-tests.core
Start collecting clojure.core.typed.async
Finished collecting clojure.core.typed.async
Finished collecting core-typed-tests.core
Collected 2 namespaces in 225.22 msecs
Start checking clojure.core.typed.async
Checked clojure.core.typed.async in 252.916 msecs
Start checking core-typed-tests.core
 
ExceptionInfo Internal Error (core-typed-tests.core:10:3) Uneven number of keyword arguments provided to polymorphic function with keyword parameters. clojure.core/ex-info (core.clj:4327)
core-typed-tests.core=>

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.