diff --git a/pkgs/racket-pkgs/racket-test/tests/racket/contract/or-and.rkt b/pkgs/racket-pkgs/racket-test/tests/racket/contract/or-and.rkt index 0fffe8fc61..3be835edcb 100644 --- a/pkgs/racket-pkgs/racket-test/tests/racket/contract/or-and.rkt +++ b/pkgs/racket-pkgs/racket-test/tests/racket/contract/or-and.rkt @@ -219,4 +219,23 @@ (test/pos-blame 'contract-flat2 - '(contract not #t 'pos 'neg))) + '(contract not #t 'pos 'neg)) + + + (test/neg-blame + 'ho-or/c-val-first1 + '((contract (-> (or/c (-> number?) + (-> number? number?)) + number?) + (λ (x) 1) + 'pos 'neg) + (lambda (x y z) 1))) + + (test/neg-blame + 'ho-or/c-val-first2 + '((contract (-> (or/c (-> number? number?) + (-> number? number?)) + number?) + (λ (x) 1) + 'pos 'neg) + (lambda (x) 1)))) diff --git a/racket/collects/racket/contract/private/misc.rkt b/racket/collects/racket/contract/private/misc.rkt index 9731c4915b..d5be237544 100644 --- a/racket/collects/racket/contract/private/misc.rkt +++ b/racket/collects/racket/contract/private/misc.rkt @@ -295,18 +295,20 @@ [candidate-c-proj ((candidate-c-proj blame-w-context) val)] [else - (raise-blame-error blame val - '("none of the branches of the or/c matched" given: "~e") - val)])] + (λ (neg-party) + (raise-blame-error blame val #:missing-party neg-party + '("none of the branches of the or/c matched" given: "~e") + val))])] [((car checks) val) (if candidate-c-proj - (raise-blame-error blame val - '("two of the clauses in the or/c might both match: ~s and ~s" - given: - "~e") - (contract-name candidate-contract) - (contract-name (car contracts)) - val) + (λ (neg-party) + (raise-blame-error blame val #:missing-party neg-party + '("two of the clauses in the or/c might both match: ~s and ~s" + given: + "~e") + (contract-name candidate-contract) + (contract-name (car contracts)) + val)) (loop (cdr checks) (cdr c-projs) (cdr contracts)