From 074f21203a5983d7fbccfe67976e3b389a0a5cc4 Mon Sep 17 00:00:00 2001 From: Robby Findler Date: Fri, 13 Dec 2013 19:18:43 -0600 Subject: [PATCH] another fix to the first-order check I added earlier today (discovered by the test suites run by drdr) --- racket/collects/racket/private/class-internal.rkt | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/racket/collects/racket/private/class-internal.rkt b/racket/collects/racket/private/class-internal.rkt index ef19a98177..76df51e5d1 100644 --- a/racket/collects/racket/private/class-internal.rkt +++ b/racket/collects/racket/private/class-internal.rkt @@ -2817,13 +2817,14 @@ An example [c (in-list (class/c-method-contracts ctc))]) (define mth (hash-ref method-ht m #f)) (unless mth (fail "no public method ~a" m)) - (define meth-proc - (let loop ([m/l (vector-ref methods mth)]) - (cond - [(pair? m/l) (loop (car m/l))] - [else m/l]))) - (unless (contract-first-order-passes? c meth-proc) - (fail "public method ~a doesn't match contract" m))) + (when c + (define meth-proc + (let loop ([m/l (vector-ref methods mth)]) + (cond + [(pair? m/l) (loop (car m/l))] + [else m/l]))) + (unless (contract-first-order-passes? c meth-proc) + (fail "public method ~a doesn't match contract" m)))) (unless (class/c-opaque? ctc) (for ([m (class/c-absents ctc)]) (when (hash-ref method-ht m #f)