Make kw/opt lambda special checks work with other expected values.

Closes PR13544.

original commit: d59a600be69da8a487950c2bfbc663a516fc90d4
This commit is contained in:
Eric Dobson 2013-02-23 09:28:04 -08:00
parent 8377169790
commit 1194117dba
2 changed files with 6 additions and 1 deletions

View File

@ -0,0 +1,4 @@
#lang typed/racket/base
(opt-lambda: ((p : Symbol) (log? : Any #f) (1-p? : Any #f)) (ann p Symbol))

View File

@ -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)