Make apply work with more initial args than in the type.

original commit: 33a31d28681d3e382f0395e1fb77f0ccdd6db027
This commit is contained in:
Eric Dobson 2014-04-25 23:22:19 -07:00
parent 34575cbb0f
commit e0a792bd78
2 changed files with 11 additions and 4 deletions

View File

@ -183,14 +183,14 @@
;; ... function, (Listof A) or (List A B C etc) arg
[(and drest (not tail-bound)
(eq? (cdr drest) dotted-var)
(= (length domain) (length arg-tys))
(<= (length domain) (length arg-tys))
(match full-tail-ty
[(List: tail-arg-tys #:tail (Listof: tail-arg-ty))
(infer/vararg
fixed-vars (list dotted-var)
(cons tail-arg-ty (append tail-arg-tys arg-tys))
(cons (car drest) (append (map (λ _ (car drest)) tail-arg-tys) domain))
rest
(cons tail-arg-ty (append arg-tys tail-arg-tys))
(cons (car drest) domain)
(car drest)
range)]
[(List: tail-arg-tys)
(infer/dots fixed-vars dotted-var (append arg-tys tail-arg-tys) domain

View File

@ -2859,6 +2859,13 @@
#:ret (ret (->* (list) Univ Univ))
#:expected (ret (->* (list) Univ Univ))]
[tc-e
(let: ([f : (All (b ...) (Any ... b -> Any)) (lambda x 'x)])
(lambda xs (apply f 'y xs)))
#:ret (ret (->* (list) Univ Univ))
#:expected (ret (->* (list) Univ Univ))]
[tc-e
(let ()
(: a Symbol)