From b9e600dc1a7c6e0ff1ddb1190c2c58abef1960a1 Mon Sep 17 00:00:00 2001 From: Alexis King Date: Fri, 16 Jan 2015 02:20:44 -0800 Subject: [PATCH] Add contract generation support for Async-Channelof --- typed-racket-lib/typed-racket/private/type-contract.rkt | 1 + .../static-contracts/combinators/structural.rkt | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/typed-racket-lib/typed-racket/private/type-contract.rkt b/typed-racket-lib/typed-racket/private/type-contract.rkt index 4b5290b8..3000193d 100644 --- a/typed-racket-lib/typed-racket/private/type-contract.rkt +++ b/typed-racket-lib/typed-racket/private/type-contract.rkt @@ -351,6 +351,7 @@ [(Box: t) (box/sc (t->sc/both t))] [(Pair: t1 t2) (cons/sc (t->sc t1) (t->sc t2))] + [(Async-Channel: t) (async-channel/sc (t->sc t))] [(Promise: t) (promise/sc (t->sc t))] [(Opaque: p?) diff --git a/typed-racket-lib/typed-racket/static-contracts/combinators/structural.rkt b/typed-racket-lib/typed-racket/static-contracts/combinators/structural.rkt index 44fc9e66..bcb6379a 100644 --- a/typed-racket-lib/typed-racket/static-contracts/combinators/structural.rkt +++ b/typed-racket-lib/typed-racket/static-contracts/combinators/structural.rkt @@ -12,9 +12,11 @@ (for-template racket/base racket/contract/base racket/set + racket/async-channel unstable/contract "../../utils/evt-contract.rkt") - racket/contract) + racket/contract + racket/async-channel) (begin-for-syntax @@ -158,4 +160,5 @@ ((sequence/sc . (#:covariant)) sequence/c #:impersonator) ((channel/sc . (#:invariant)) channel/c #:chaperone) ((continuation-mark-key/sc (#:invariant)) continuation-mark-key/c #:chaperone) - ((evt/sc (#:covariant)) tr:evt/c #:chaperone)) + ((evt/sc (#:covariant)) tr:evt/c #:chaperone) + ((async-channel/sc (#:invariant)) async-channel/c #:chaperone))