diff --git a/pkgs/racket-pkgs/racket-test/tests/racket/contract/blame.rkt b/pkgs/racket-pkgs/racket-test/tests/racket/contract/blame.rkt index 7c894aa6d7..5840354c41 100644 --- a/pkgs/racket-pkgs/racket-test/tests/racket/contract/blame.rkt +++ b/pkgs/racket-pkgs/racket-test/tests/racket/contract/blame.rkt @@ -48,6 +48,9 @@ [rename five chaperone-five chaperone-blame-ok/c] [rename five flat-five flat-blame-ok/c])))) + (test/no-error + '(contract string? "string" #f 'neg)) + (begin (test/no-error '(dynamic-require ''blame-ok-dynamic 'impersonator-five)) diff --git a/racket/collects/racket/contract/private/base.rkt b/racket/collects/racket/contract/private/base.rkt index c6aa35bf76..eec1b49b63 100644 --- a/racket/collects/racket/contract/private/base.rkt +++ b/racket/collects/racket/contract/private/base.rkt @@ -53,7 +53,15 @@ (make-blame (build-source-location loc) name (λ () (contract-name c)) - pos + + ;; hack! We need to allow pos = #f for backwards + ;; compatibility, but we cannot put #f into the + ;; blame struct now because #f means that the + ;; name is not known. Since #f is not a very good + ;; name, we'll just put something stupid here + ;; instead of changing the library around. + (or pos "false") + (if cvfp #f neg) #t)) (define new-val