From 37ec8862587fd2eaf2ab87f5cfbc65fdbb1bfe9f Mon Sep 17 00:00:00 2001 From: Eric Dobson Date: Sat, 14 Dec 2013 14:21:54 -0800 Subject: [PATCH] Make static contracts for channels. original commit: 333a93000ab2593950e123cda67345a6e4e28f66 --- .../typed-racket-lib/typed-racket/private/type-contract.rkt | 5 +---- .../typed-racket/static-contracts/combinators/structural.rkt | 1 + 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/private/type-contract.rkt b/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/private/type-contract.rkt index 0dee21aa..d1135418 100644 --- a/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/private/type-contract.rkt +++ b/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/private/type-contract.rkt @@ -306,11 +306,8 @@ (parameter/sc (t->sc in) (t->sc out))] [(Hashtable: k v) (hash/sc (t->sc k) (t->sc v))] - ;; TODO add channel static contracts - #; [(Channel: t) - (set-chaperone!) - #`(channel/c #,(t->c/both t))] + (channel/sc (t->sc t))] [else (fail)])))) diff --git a/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/static-contracts/combinators/structural.rkt b/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/static-contracts/combinators/structural.rkt index 26a10e80..cbf59016 100644 --- a/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/static-contracts/combinators/structural.rkt +++ b/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/static-contracts/combinators/structural.rkt @@ -126,4 +126,5 @@ ((box/sc (#:invariant)) box/c #:chaperone) ((parameter/sc (#:contravariant) (#:covariant)) parameter/c #:chaperone) ((sequence/sc . (#:covariant)) sequence/c #:impersonator) + ((channel/sc . (#:invariant)) channel/c #:chaperone) ((continuation-mark-key/sc (#:invariant)) continuation-mark-key/c #:chaperone))