diff --git a/collects/tests/typed-racket/xfail/opt-lambda.rkt b/collects/tests/typed-racket/xfail/opt-lambda.rkt new file mode 100644 index 00000000..9c794942 --- /dev/null +++ b/collects/tests/typed-racket/xfail/opt-lambda.rkt @@ -0,0 +1,4 @@ +#lang typed/racket/base + + +(opt-lambda: ((p : Symbol) (log? : Any #f) (1-p? : Any #f)) (ann p Symbol)) diff --git a/collects/typed-racket/typecheck/tc-expr-unit.rkt b/collects/typed-racket/typecheck/tc-expr-unit.rkt index 148bcd45..2a93b699 100644 --- a/collects/typed-racket/typecheck/tc-expr-unit.rkt +++ b/collects/typed-racket/typecheck/tc-expr-unit.rkt @@ -385,7 +385,8 @@ [(tc-result1: (and f (or (Function: _) (Poly: _ (Function: _))))) (tc-expr/check/type #'fun (kw-convert f #:split #t))] - [(tc-result1: _) (tc-error/expr "Keyword functions must have function type, given ~a" expected)]) + [(or (tc-results: _) (tc-any-results:)) + (tc-error/expr "Keyword functions must have function type, given ~a" expected)]) expected] ;; let [(let-values ([(name ...) expr] ...) . body)