Fix contract-stronger? to work with late-neg projections.

This commit is contained in:
Vincent St-Amour 2016-02-10 12:42:11 -06:00
parent e6a0caa147
commit 640895645f
2 changed files with 13 additions and 4 deletions

View File

@ -26,6 +26,14 @@
(define (call*2 f1 x0) (f1 x0))
(define (call*3 f2 x1 x0) (f2 x1 x0))))
;; the two are incomparable, but we still want to check, to make sure
;; contract-stronger works on contracts that use different kinds of
;; projections (late-neg for any/c, regular for proj:blame/c)
(test/spec-passed/result
'stronger-with-no-late-neg-projection
'(contract-stronger? proj:blame/c any/c)
#f)
(test/spec-passed/result
'opt/c-blame-0
'((contract

View File

@ -497,9 +497,10 @@
v)))))
(define (as-strong? a b)
(procedure-closure-contents-eq?
(contract-struct-projection a)
(contract-struct-projection b)))
(define late-neg-a (contract-struct-late-neg-projection a))
(define late-neg-b (contract-struct-late-neg-projection b))
(and late-neg-a late-neg-b
(procedure-closure-contents-eq? late-neg-a late-neg-b)))
(define make-contract
(procedure-rename
@ -549,4 +550,4 @@
;; raises a blame error if val doesn't satisfy the first-order checks for the function
;; accepts-arglist : (-> (listof keyword?)[sorted by keyword<?] exact-nonnegative-integer? boolean?)
(struct arrow-contract-info (chaperone-procedure check-first-order accepts-arglist)
#:transparent)
#:transparent)