From b9ec9f145ebd1edd53fc74d4a61009d358ab381e Mon Sep 17 00:00:00 2001 From: Sam Tobin-Hochstadt Date: Wed, 13 May 2009 14:34:44 +0000 Subject: [PATCH] Enable inference for ((lambda with rest args when no annotation on rest arg svn: r14794 original commit: 8ca532220a402daace37d5b539d5c95c85e83544 --- collects/typed-scheme/typecheck/tc-app.ss | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/collects/typed-scheme/typecheck/tc-app.ss b/collects/typed-scheme/typecheck/tc-app.ss index 5ce41648..1accdc8f 100644 --- a/collects/typed-scheme/typecheck/tc-app.ss +++ b/collects/typed-scheme/typecheck/tc-app.ss @@ -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)])