allow 'contract' to use #f for the positive

name, but still disallow #f at the blame record
level

closes PR 14387
This commit is contained in:
Robby Findler 2014-03-08 15:41:05 -06:00
parent 8cbcba8ed2
commit 4d94ef91cf
2 changed files with 12 additions and 1 deletions

View File

@ -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))

View File

@ -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