first on HVec

21 views
Skip to first unread message

Mark Feeney

unread,
Sep 14, 2015, 12:12:30 AM9/14/15
to core.typed
Hi all,

core.typed 0.3.11

user=> (t/cf (t/let [x :- (t/Option '[t/Num String]) nil] (first x)))
(t/Option (t/U String Number))

I'd expect (t/Option t/Num) here.  Is the String really valid somehow?

Thanks,


Mark


Ambrose Bonnaire-Sergeant

unread,
Sep 15, 2015, 8:13:19 PM9/15/15
to core.typed
This is core.typed being overly conservative. I'd guess the HVec special case
in the implementation of checking `first` does not handle unions very well.

Patch welcome/please submit an issue.

Thanks,
Ambrose

Mark Feeney

unread,
Sep 15, 2015, 11:35:34 PM9/15/15
to core.typed
Created http://dev.clojure.org/jira/browse/CTYP-276

Could you please point me to the code you're thinking of?  I'm not that confident I'll be able to figure out a fix, but you never know.
Reply all
Reply to author
Forward
0 new messages