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

21 lines
327 B
Racket

#lang typed/racket #:no-optimize
(define-type T
(case->
(String Symbol -> Symbol)
(Symbol String -> Symbol)))
(define-type S ((U String Symbol) (U String Symbol) -> Symbol))
(: f T)
(define (f x y)
(if (and (string? x) (string? y))
"BROKEN"
'ok))
(: g S)
(define g f)
(g "Hello" "World")