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

15 lines
281 B
Racket

#lang typed/racket
(: unsound-cast (All (a b) (a b -> a)))
(define (unsound-cast w r)
(let: ([x : a w])
(: set-x (All (a)
(a -> Void)))
(define (set-x y)
(set! x y))
(set-x r)
x))
(: wrong Integer)
(define wrong (unsound-cast 42 'oops))