typed-racket/typed-racket-test/fail/control-test-1.rkt
2014-12-16 10:07:25 -05:00

29 lines
632 B
Racket

#;
(exn-pred exn:fail:contract?)
#lang racket/load
;; check typed-untyped interaction with continuations
;; continuations & prompt tags
(module typed typed/racket
(provide call-f)
(: tag (Prompt-Tagof String (Integer -> String)))
(define tag (make-continuation-prompt-tag))
(: call-f (((Prompt-Tagof String (Integer -> String)) -> String) -> String))
(define (call-f f)
(call-with-continuation-prompt
(λ () (f tag))
tag
(λ: ([x : Integer]) (number->string x)))))
(module untyped racket
(require 'typed)
(call-f
(λ (tag)
(abort-current-continuation tag "bad"))))
(require 'untyped)