Fix the first order check on async-channel/c

This commit is contained in:
Alexis King 2015-05-21 09:04:32 -07:00 committed by Robby Findler
parent 0bed8e8928
commit 391a672bf6
2 changed files with 11 additions and 6 deletions

View File

@ -23,4 +23,11 @@
'(let ([ac (contract (async-channel/c (cons/c (-> boolean? boolean?) '()))
(make-async-channel) 'pos 'neg)])
(async-channel-put ac (list values))
((car (async-channel-get ac)) 3))))
((car (async-channel-get ac)) 3)))
(test/spec-passed
'async-channel/c-with-higher-order
'(let ([ac (contract (or/c (async-channel/c integer?) (integer? . -> . integer?))
(make-async-channel) 'pos 'neg)])
(async-channel-put ac 1)
(async-channel-get ac))))

View File

@ -209,9 +209,7 @@
val '(expected "an async channel" given: "~e") val))))
(define ((async-channel/c-first-order ctc) val)
(define elem-ctc (base-async-channel/c-content ctc))
(and (async-channel? val)
(contract-first-order-passes? elem-ctc val)))
(async-channel? val))
(define (async-channel/c-stronger? a b)
(contract-stronger? (base-async-channel/c-content a) (base-async-channel/c-content b)))
@ -251,7 +249,7 @@
#:property prop:chaperone-contract
(build-chaperone-contract-property
#:name async-channel/c-name
#:first-order async-channel?
#:first-order async-channel/c-first-order
#:stronger async-channel/c-stronger?
#:val-first-projection (ho-val-first-projection chaperone-async-channel)
#:projection (ho-projection chaperone-async-channel)))
@ -261,7 +259,7 @@
#:property prop:contract
(build-contract-property
#:name async-channel/c-name
#:first-order async-channel?
#:first-order async-channel/c-first-order
#:stronger async-channel/c-stronger?
#:val-first-projection (ho-val-first-projection impersonate-async-channel)
#:projection (ho-projection impersonate-async-channel)))