Reduce unnecessarily complicated restrict case.
This commit is contained in:
parent
d59a600be6
commit
ddf0c39e98
|
@ -33,6 +33,7 @@
|
|||
[(Un -Number -String -Symbol -Boolean) -Number -Number]
|
||||
|
||||
[(-lst -Number) (-pair Univ Univ) (-pair -Number (-lst -Number))]
|
||||
[(-lst -Number) (-poly (a) (-lst a)) (-lst -Number)]
|
||||
;; FIXME
|
||||
#;
|
||||
[-Listof -Sexp (-lst (Un B N -String Sym))]
|
||||
|
|
|
@ -24,8 +24,7 @@
|
|||
[(subtype t1 t2) t1] ;; already a subtype
|
||||
[(match t2
|
||||
[(Poly: vars t)
|
||||
(let ([subst (infer vars null (list t1) (list t) t1)])
|
||||
(and subst (restrict* t1 (subst-all subst t1) f)))]
|
||||
(and (infer vars null (list t1) (list t) #f) t1)]
|
||||
[_ #f])]
|
||||
[(Union? t1) (union-map (lambda (e) (restrict* e t2 f)) t1)]
|
||||
[(Union? t2) (union-map (lambda (e) (restrict* t1 e f)) t2)]
|
||||
|
|
Loading…
Reference in New Issue
Block a user