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] [(Un -Number -String -Symbol -Boolean) -Number -Number]
[(-lst -Number) (-pair Univ Univ) (-pair -Number (-lst -Number))] [(-lst -Number) (-pair Univ Univ) (-pair -Number (-lst -Number))]
[(-lst -Number) (-poly (a) (-lst a)) (-lst -Number)]
;; FIXME ;; FIXME
#; #;
[-Listof -Sexp (-lst (Un B N -String Sym))] [-Listof -Sexp (-lst (Un B N -String Sym))]

View File

@ -24,8 +24,7 @@
[(subtype t1 t2) t1] ;; already a subtype [(subtype t1 t2) t1] ;; already a subtype
[(match t2 [(match t2
[(Poly: vars t) [(Poly: vars t)
(let ([subst (infer vars null (list t1) (list t) t1)]) (and (infer vars null (list t1) (list t) #f) t1)]
(and subst (restrict* t1 (subst-all subst t1) f)))]
[_ #f])] [_ #f])]
[(Union? t1) (union-map (lambda (e) (restrict* e t2 f)) t1)] [(Union? t1) (union-map (lambda (e) (restrict* e t2 f)) t1)]
[(Union? t2) (union-map (lambda (e) (restrict* t1 e f)) t2)] [(Union? t2) (union-map (lambda (e) (restrict* t1 e f)) t2)]