Allow more inference on ... lists.
original commit: 78fbdfec0be3d8173856737f46db6809d75e76ed
This commit is contained in:
parent
ef5b55b293
commit
22eb5e27b8
|
@ -557,8 +557,8 @@
|
|||
(when (memq dbound Y) (fail! S T))
|
||||
(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))
|
||||
(when (memq dbound Y) (fail! S T))
|
||||
(cgen V X Y s-dty t-dty)]
|
||||
[((ListDots: s-dty (? (λ (db) (memq db Y)) s-dbound)) (ListDots: t-dty t-dbound))
|
||||
;; What should we do if both are in Y?
|
||||
|
|
|
@ -67,7 +67,8 @@
|
|||
|
||||
(infer-t (make-ListDots -Symbol '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 (-v a) 'b) (make-ListDots -Symbol 'b) #:vars '(a))
|
||||
(infer-t (make-ListDots -Symbol 'b) (make-ListDots Univ 'b) #:indices '(b))
|
||||
(infer-t (make-ListDots (-v b) 'b) (make-ListDots (-v b) 'b) #:indices '(b))
|
||||
(infer-t (make-ListDots (-v b) 'b) (make-ListDots Univ 'b) #:indices '(b))
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user