typed-racket/typed-racket-test/fail/async-channel-contract.rkt
2015-01-20 14:23:38 -05:00

20 lines
496 B
Racket

#;
(exn-pred #rx"expected: Integer.*given: \"not an integer\"")
#lang racket/load
;; Test typed-untyped interaction with channels
(module typed typed/racket
(require typed/racket/async-channel)
(: ch (Async-Channelof (Boxof Integer)))
(define ch (make-async-channel))
(: putter (-> Thread))
(define (putter)
(thread (λ () (async-channel-put ch (box 3)))))
(provide putter ch))
(require 'typed racket/async-channel)
(putter)
(set-box! (async-channel-get ch) "not an integer")