From 977b9e16a24459fde4e68a07fd3487c3fb30bb26 Mon Sep 17 00:00:00 2001 From: Sam Tobin-Hochstadt Date: Fri, 8 Jul 2016 11:02:57 -0400 Subject: [PATCH] Allow cpointer predicates as struct predicates. Fixes the math library failure here: http://drdr.racket-lang.org/35897/racket/share/pkgs/math-lib/math/private/bigfloat/bigfloat-hurwitz-zeta.rkt Relies on racket/racket#1368. Relevant to #385. --- typed-racket-lib/typed-racket/utils/any-wrap.rkt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/typed-racket-lib/typed-racket/utils/any-wrap.rkt b/typed-racket-lib/typed-racket/utils/any-wrap.rkt index 1899771b..9bf1f343 100644 --- a/typed-racket-lib/typed-racket/utils/any-wrap.rkt +++ b/typed-racket-lib/typed-racket/utils/any-wrap.rkt @@ -6,6 +6,7 @@ racket/set racket/undefined (only-in racket/async-channel async-channel?) + (only-in ffi/unsafe cpointer-predicate-procedure?) (only-in racket/future future? fsemaphore?) (only-in racket/pretty pretty-print-style-table?) (only-in racket/udp udp?) @@ -209,7 +210,8 @@ ;; Contract for "safe" struct predicate procedures. ;; We can trust that these obey the type (-> Any Boolean). (define (struct-predicate-procedure?/c x) - (and (struct-predicate-procedure? x) + (and (or (struct-predicate-procedure? x) + (cpointer-predicate-procedure? x)) (not (impersonator? x)))) (provide any-wrap/c struct-predicate-procedure?/c)