diff --git a/pkgs/racket-test/tests/racket/contract/stronger.rkt b/pkgs/racket-test/tests/racket/contract/stronger.rkt index 4b9cf9783f..b8b55af941 100644 --- a/pkgs/racket-test/tests/racket/contract/stronger.rkt +++ b/pkgs/racket-test/tests/racket/contract/stronger.rkt @@ -453,6 +453,9 @@ (ctest #t contract-stronger? (object/c (field (f (<=/c 4)))) (object/c (field (f (<=/c 4))))) + (ctest #t contract-stronger? + (object/c (field (f (<=/c 4)))) + (object/c)) (ctest #t contract-stronger? (object/c (m (-> any/c (<=/c 3))) (n (-> any/c any/c))) diff --git a/racket/collects/racket/private/class-c-old.rkt b/racket/collects/racket/private/class-c-old.rkt index 7bc0932f18..94eb41a699 100644 --- a/racket/collects/racket/private/class-c-old.rkt +++ b/racket/collects/racket/private/class-c-old.rkt @@ -1641,16 +1641,17 @@ (names-sel this)) (for/and ([this-name (in-list (names-sel this))] [this-ctc (in-list (ctcs-sel this))]) - (for/or ([that-name (in-list (names-sel that))] - [that-ctc (in-list (ctcs-sel that))]) - (and (equal? this-name that-name) - (contract-equivalent? - (if (just-check-existence? this-ctc) - any/c - this-ctc) - (if (just-check-existence? that-ctc) - any/c - that-ctc))))))) + (or (not (member this-name (names-sel that))) + (for/or ([that-name (in-list (names-sel that))] + [that-ctc (in-list (ctcs-sel that))]) + (and (equal? this-name that-name) + (contract-equivalent? + (if (just-check-existence? this-ctc) + any/c + this-ctc) + (if (just-check-existence? that-ctc) + any/c + that-ctc)))))))) (define-struct base-object/c (methods method-contracts fields field-contracts) #:property prop:custom-write custom-write-property-proc