File tree Expand file tree Collapse file tree 1 file changed +2
-7
lines changed
typed-racket-lib/typed-racket/types Expand file tree Collapse file tree 1 file changed +2
-7
lines changed Original file line number Diff line number Diff line change 4
4
(rep type-rep rep-utils)
5
5
(prefix-in c: (contract-req))
6
6
(types subtype base-abbrev resolve current-seen)
7
+ (only-in (infer infer) intersect)
7
8
racket/match
8
9
racket/list)
9
10
36
37
[(and (Box? t) (ormap Box? ts))
37
38
(match* (t ts)
38
39
[((Box: a-w a-r) (list-no-order (Box: b-w b-r) bs ... ))
39
- (define w
40
- ;; should this use some sort of intersection, or would that
41
- ;; complicate things too much?
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 (union a-r b-r)) bs)])]
40
+ (cons (make-Box (intersect a-w b-w) (union a-r b-r)) bs)])]
46
41
[else (cons t (filter-not (λ (ts-elem) (subtype ts-elem t)) ts))])))
47
42
48
43
;; Recursively reduce unions so that they do not contain
You can’t perform that action at this time.
0 commit comments