Subtyping between (List T ... a) and (Listof T[Any/a])
This commit is contained in:
parent
4c3f279ab9
commit
fd5a662ccc
|
@ -7,3 +7,12 @@
|
||||||
(define (g . x) x)
|
(define (g . x) x)
|
||||||
|
|
||||||
(g 7 7 7)
|
(g 7 7 7)
|
||||||
|
|
||||||
|
(: h (All (a ...) (a ... -> (Listof Any))))
|
||||||
|
(define (h . x) x)
|
||||||
|
|
||||||
|
(: h2 (All (a ...) ((Pair String a) ... -> (Listof (Pair String Any)))))
|
||||||
|
(define (h2 . x) x)
|
||||||
|
|
||||||
|
(: h3 (All (a ...) ((Pair String a) ... -> (Listof Any))))
|
||||||
|
(define (h3 . x) x)
|
||||||
|
|
|
@ -298,6 +298,8 @@
|
||||||
;; recur structurally on dotted lists, assuming same bounds
|
;; recur structurally on dotted lists, assuming same bounds
|
||||||
[((ListDots: s-dty dbound) (ListDots: t-dty dbound))
|
[((ListDots: s-dty dbound) (ListDots: t-dty dbound))
|
||||||
(subtype* A0 s-dty t-dty)]
|
(subtype* A0 s-dty t-dty)]
|
||||||
|
[((ListDots: s-dty dbound) (Listof: t-elem))
|
||||||
|
(subtype* A0 (substitute Univ dbound s-dty) t-elem)]
|
||||||
;; quantification over two types preserves subtyping
|
;; quantification over two types preserves subtyping
|
||||||
[((Poly: ns b1) (Poly: ms b2))
|
[((Poly: ns b1) (Poly: ms b2))
|
||||||
(=> unmatch)
|
(=> unmatch)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user