Reduce unnecessarily complicated restrict case.

This commit is contained in:
Eric Dobson 2013-02-16 11:19:06 -08:00
parent d59a600be6
commit ddf0c39e98
2 changed files with 2 additions and 2 deletions

View File

@ -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))]

View File

@ -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)]