[racket] the typed Values restriction

From: Benjamin Greenman (blg59 at cornell.edu)
Date: Wed Mar 18 16:48:13 EDT 2015

Today I got a surprising type error that I think is worth sharing.

(: my-force (All (A) (-> (-> A) A))
(define (my-force x) (x))

(my-force (lambda () (values (void) (void)))
;; ERROR! 'my-force' cannot be applied to argument.
;; expected "(-> A)", got "(-> (values Void Void))"
;; result type "A", expected result "AnyValues"

(inst my-force (Values Void Void))
;; Parse Error in type: "Values" is unbound

That is all. I see now that Values is only allowed in result positions
but I'd still expected this to work.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20150318/bb7a80e1/attachment.html>

Posted on the users mailing list.