Create a gist now

Instantly share code, notes, and snippets.

@mybuddymichael /core.clj Secret
Last active Dec 24, 2015

What would you like to do?
(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)
"the annotation for alts!!, according to cf"
(All [x d]
[(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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment