add more racket/contract non late-neg projection warnings
This commit is contained in:
parent
4a29792934
commit
557b039f3c
|
@ -49,7 +49,8 @@
|
|||
(except-out (all-from-out "private/misc.rkt")
|
||||
check-between/c
|
||||
check-unary-between/c
|
||||
random-any/c)
|
||||
random-any/c
|
||||
maybe-warn-about-val-first)
|
||||
symbols or/c first-or/c one-of/c
|
||||
flat-rec-contract
|
||||
provide/contract
|
||||
|
|
|
@ -193,6 +193,7 @@
|
|||
#:val-first-projection
|
||||
(λ (ctc)
|
||||
(define blame-accepting-proj (arr->i-late-neg-proj ctc c-or-i-procedure))
|
||||
(maybe-warn-about-val-first ctc)
|
||||
(λ (blame)
|
||||
(define val+neg-party-accepting-proj (blame-accepting-proj blame))
|
||||
(λ (val)
|
||||
|
|
|
@ -1152,6 +1152,7 @@
|
|||
(define (make-property build-X-property chaperone-or-impersonate-procedure)
|
||||
(define val-first-proj
|
||||
(λ (->stct)
|
||||
(maybe-warn-about-val-first ->stct)
|
||||
(->-proj chaperone-or-impersonate-procedure ->stct
|
||||
(base->-min-arity ->stct)
|
||||
(base->-doms ->stct)
|
||||
|
|
|
@ -68,7 +68,9 @@
|
|||
random-any/c
|
||||
|
||||
rename-contract
|
||||
if/c)
|
||||
if/c
|
||||
|
||||
maybe-warn-about-val-first)
|
||||
|
||||
(define-syntax (flat-murec-contract stx)
|
||||
(syntax-case stx ()
|
||||
|
@ -2108,15 +2110,18 @@
|
|||
x)))))
|
||||
|
||||
(define warn-about-val-first? (make-parameter #t))
|
||||
(define (maybe-warn-about-val-first ctc)
|
||||
(when (warn-about-val-first?)
|
||||
(log-racket/contract-warning
|
||||
"building val-first-projection of contract ~s for~a"
|
||||
ctc
|
||||
(build-context))))
|
||||
|
||||
(define (get/build-val-first-projection ctc)
|
||||
(cond
|
||||
[(contract-struct-val-first-projection ctc) => values]
|
||||
[else
|
||||
(when (warn-about-val-first?)
|
||||
(log-racket/contract-warning
|
||||
"building val-first-projection of contract ~s for~a"
|
||||
ctc
|
||||
(build-context)))
|
||||
(maybe-warn-about-val-first ctc)
|
||||
(late-neg-projection->val-first-projection
|
||||
(get/build-late-neg-projection ctc))]))
|
||||
(define (late-neg-projection->val-first-projection lnp)
|
||||
|
|
Loading…
Reference in New Issue
Block a user