Allow invoking thunks on the untyped side of an Any.

original commit: 6fde63007eb0f560b1f86b4c2361d509e4240f41
This commit is contained in:
Sam Tobin-Hochstadt 2012-10-05 16:46:52 -04:00
parent 638b653967
commit ba5fa2d361

View File

@ -60,7 +60,11 @@
(lambda (h k) (t k)))] ;; key
[(? evt?) (chaperone-evt v (lambda (e) (values e t)))]
[(? struct?) (wrap-struct v)]
[(? procedure?) (chaperone-procedure v (lambda _ (fail v)))]
[(? procedure?)
(if (procedure-arity-includes? v 0)
(chaperone-procedure v (case-lambda [() (values)]
[_ (fail v)]))
(chaperone-procedure v (lambda args (fail v))))]
[_ (fail v)]))
t)