Enable inference for ((lambda with rest args when no annotation on rest arg

svn: r14794

original commit: 8ca532220a402daace37d5b539d5c95c85e83544
This commit is contained in:
Sam Tobin-Hochstadt 2009-05-13 14:34:44 +00:00
parent 67420e1988
commit b9ec9f145e

View File

@ -456,13 +456,13 @@
(tc/let-values #'((x) ...) #'(args ...) #'body
#'(let-values ([(x) args] ...) . body)
expected)]
;; FIXME - make this work - doesn't work because the annotation
;; on rst is not a normal annotation, may have * or ...
;; inference for ((lambda with dotted rest
#;
;; inference for ((lambda with dotted rest
[(#%plain-app (#%plain-lambda (x ... . rst:id) . body) args ...)
#:when (<= (length (syntax->list #'(x ...)))
(length (syntax->list #'(args ...))))
;; FIXME - remove this restriction - doesn't work because the annotation
;; on rst is not a normal annotation, may have * or ...
#:when (not (type-annotation #'rst))
(let-values ([(fixed-args varargs) (split-at (syntax->list #'(args ...)) (length (syntax->list #'(x ...))))])
(with-syntax ([(fixed-args ...) fixed-args]
[varg #`(#%plain-app list #,@varargs)])