Skip to content

Commit 9c484ea

Browse files
committed
implement unions of box types
1 parent 53c2ea7 commit 9c484ea

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

typed-racket-lib/typed-racket/types/union.rkt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@
3737
[(_ _) #:when (currently-subtyping?) (cons a b)]
3838
[((? (λ _ (subtype a b*))) _) b]
3939
[((? (λ _ (subtype b* a))) _) (list a)]
40+
[((Box: a-w a-r) (list-no-order (Box: b-w b-r) bs ...))
41+
(define w
42+
(cond [(subtype a-w b-w) a-w]
43+
[(subtype b-w a-w) b-w]
44+
[else -Bottom]))
45+
(cons (make-Box w (Un a-r b-r)) bs)]
4046
[(_ _) (cons a (filter-not (λ (b-elem) (subtype b-elem a)) b))]))
4147

4248
;; Type -> List[Type]

0 commit comments

Comments
 (0)