typed-racket/typed-racket-test/succeed/case-arrow-cast-contract.rkt
Alex Knauth ee7207d67d Fix cast under multiple cases of case-> (#589)
* fix cast under multiple cases of case->

* add test

* Comments explaining cast-table's lists of types and what they mean
2017-09-30 19:19:18 -04:00

13 lines
233 B
Racket

#lang typed/racket
(require typed/rackunit)
(: f : (case-> (-> (Boxof String) Any)
(-> (Boxof Integer) Any)))
(define (f x)
(cast x Any))
(check-equal? (f (box "a")) (box "a"))
(check-equal? (f (box 1)) (box 1))