Handle inference of list dots under regular lists.
This commit is contained in:
parent
b87e6a4496
commit
7af943e41d
|
@ -582,8 +582,9 @@
|
|||
;; ListDots can be below a Listof
|
||||
;; must be above mu unfolding
|
||||
[((ListDots: s-dty dbound) (Listof: t-elem))
|
||||
#:return-when (memq dbound Y) #f
|
||||
(cgen V X Y (substitute Univ dbound s-dty) t-elem)]
|
||||
(if (memq dbound Y)
|
||||
(% move-rest-to-dmap (cgen V (cons dbound X) Y s-dty t-elem) dbound)
|
||||
(cgen V X Y (substitute Univ dbound s-dty) t-elem))]
|
||||
;; two ListDots with the same bound, just check the element type
|
||||
;; This is conservative because we don't try to infer a constraint on dbound.
|
||||
[((ListDots: s-dty dbound) (ListDots: t-dty dbound))
|
||||
|
|
|
@ -100,6 +100,8 @@
|
|||
(infer-t (-v a) (-v b) #:vars '(b))
|
||||
|
||||
(infer-t (make-ListDots -Symbol 'b) (-lst -Symbol) #:indices '(b))
|
||||
(infer-t (make-ListDots (-v a) 'b) (-lst -Symbol) #:vars '(a) #:indices '(b))
|
||||
(infer-t (make-ListDots (-v b) 'b) (-lst -Symbol) #:indices '(b))
|
||||
(infer-t (make-ListDots (-v b) 'b) (-lst Univ) #:indices '(b))
|
||||
(infer-t (make-ListDots (-v a) 'b) (make-ListDots -Symbol 'b) #:vars '(a))
|
||||
(infer-t (make-ListDots -Symbol 'b) (make-ListDots Univ 'b) #:indices '(b))
|
||||
|
@ -128,7 +130,6 @@
|
|||
[infer-t (-lst* -String) (make-ListDots -Symbol 'b) #:indices '(b) #:fail]
|
||||
|
||||
;; Currently Broken
|
||||
;(infer-t (make-ListDots (-v b) 'b) (-lst -Symbol) #:indices '(b))
|
||||
;(infer-t (-lst -Symbol) (make-ListDots -Symbol 'b) #:indices '(b))
|
||||
;(infer-t (make-ListDots (-v b) 'b) (make-ListDots -Symbol 'b) #:indices '(b))
|
||||
;(infer-t (make-ListDots -Symbol 'b) (make-ListDots (-v b) 'b) #:indices '(b))
|
||||
|
|
Loading…
Reference in New Issue
Block a user