
* fix cast under multiple cases of case-> * add test * Comments explaining cast-table's lists of types and what they mean
13 lines
233 B
Racket
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))
|
|
|