typed-racket/typed-racket-test/succeed/gh-issue-26.rkt
Asumu Takikawa 5180e601db Adjust the fix in 619d6945c3
For unions of multiple type aliases the new placeholder
would cause union collapsing incorrectly. Put an uninterned
symbol in the placeholder types to avoid this.
2015-02-17 14:00:07 -05:00

22 lines
445 B
Racket

#lang typed/racket
(define-type T1 (Listof (U T2 Symbol)))
(define-type T2 (Setof (U T1 Symbol)))
(: x1 T1)
(define x1 (list (set 'foo)))
(: x2 T2)
(define x2 (set (list 'foo)))
;; Demonstrates a bug in the initial fix
(define-type S2 (U Null (Pairof String S2)))
(define-type S3 (U Null (Pairof Integer S3)))
(define-type S1 (Listof (U S1 S2 S3)))
(: y1 S1)
(define y1 (list (cons "foo" null)))
(: y2 S1)
(define y2 (list (cons 3 null)))