Skip to content

Instantly share code, notes, and snippets.

@mybuddymichael
Last active December 24, 2015 14:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mybuddymichael/f584ab905a4165f273e6 to your computer and use it in GitHub Desktop.
Save mybuddymichael/f584ab905a4165f273e6 to your computer and use it in GitHub Desktop.
(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)]]))
)
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=>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment