From 432b35f0b0494d5aae2db5b0cceb85d493b4d4ab Mon Sep 17 00:00:00 2001 From: Sam Tobin-Hochstadt Date: Fri, 28 Oct 2011 15:42:56 -0400 Subject: [PATCH] Fix curried function type parsing without (). original commit: 3caf08da43398438b5f8767233ceb831361e9e98 --- collects/typed-racket/base-env/colon.rkt | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/collects/typed-racket/base-env/colon.rkt b/collects/typed-racket/base-env/colon.rkt index fb8bdaff..459806aa 100644 --- a/collects/typed-racket/base-env/colon.rkt +++ b/collects/typed-racket/base-env/colon.rkt @@ -1,6 +1,6 @@ #lang scheme/base -(require (for-syntax scheme/base syntax/parse "internal.rkt") +(require (for-syntax scheme/base syntax/parse "internal.rkt" "../utils/tc-utils.rkt") "../typecheck/internal-forms.rkt" (prefix-in t: "base-types-extra.rkt")) @@ -12,12 +12,13 @@ ;; and in that case, a `->' on the RHS does not need to be ;; explicitly parenthesized (syntax-parse stx #:literals (: t:->) - [(: id : x ...) - #:fail-unless (= 1 (length - (for/list ([i (syntax->list #'(x ...))] - #:when (and (identifier? i) - (free-identifier=? i #'t:->))) - i))) #f + [(: id (~and kw :) x ...) + #:fail-unless (for/first ([i (syntax->list #'(x ...))] + #:when (identifier? i) + #:when (free-identifier=? i #'t:->)) + i) + #f + (add-disappeared-use #'kw) (syntax/loc stx (: id (x ...)))] [(: id : . more) (syntax/loc stx (: id . more))]