|
295 | 295 | [_ (tc-expr/check form #f)])] |
296 | 296 | ;; opt function def |
297 | 297 | [(~and (let-values ([(f) fun]) . body) opt:opt-lambda^) |
298 | | - #:when expected |
299 | | - (define conv-type |
300 | | - (match expected |
301 | | - [(tc-result1: fun-type) |
302 | | - (match-define (list required-pos optional-pos optional-supplied?) |
303 | | - (attribute opt.value)) |
304 | | - (opt-convert fun-type required-pos optional-pos optional-supplied?)] |
305 | | - [_ #f])) |
306 | | - (if conv-type |
307 | | - (begin (tc-expr/check/type #'fun conv-type) (fix-results expected)) |
308 | | - (tc-expr/check form #f))] |
| 298 | + #:when expected |
| 299 | + (define conv-type |
| 300 | + (match expected |
| 301 | + [(tc-result1: fun-type) |
| 302 | + (match-define (list required-pos optional-pos optional-supplied?) |
| 303 | + (attribute opt.value)) |
| 304 | + (opt-convert fun-type required-pos optional-pos optional-supplied?)] |
| 305 | + [_ #f])) |
| 306 | + (if conv-type |
| 307 | + (begin (tc-expr/check/type #'fun conv-type) (fix-results expected)) |
| 308 | + (tc-expr/check form #f))] |
309 | 309 | [(~and _:kw-lambda^ |
310 | | - (let-values ([(f) fun]) |
311 | | - (let-values _ |
312 | | - (#%plain-app |
313 | | - maker |
314 | | - lambda-for-kws |
315 | | - (case-lambda ; wrapper function |
316 | | - (formals . cl-body) ...) |
317 | | - (~or (quote (mand-kw:keyword ...)) |
318 | | - (~and _ (~bind [(mand-kw 1) '()]))) |
319 | | - (quote (all-kw:keyword ...)) |
320 | | - . rst)))) |
321 | | - (define p (plambda-property form)) |
322 | | - (ret (kw-unconvert (tc-expr/t (plambda-property #'fun p)) |
323 | | - (syntax->list #'(formals ...)) |
324 | | - (syntax->datum #'(mand-kw ...)) |
325 | | - (syntax->datum #'(all-kw ...))))] |
| 310 | + (let-values ([(f) fun]) |
| 311 | + (let-values _ |
| 312 | + (#%plain-app |
| 313 | + maker |
| 314 | + lambda-for-kws |
| 315 | + (case-lambda ; wrapper function |
| 316 | + (formals . cl-body) ...) |
| 317 | + (~or (quote (mand-kw:keyword ...)) |
| 318 | + (~and _ (~bind [(mand-kw 1) '()]))) |
| 319 | + (quote (all-kw:keyword ...)) |
| 320 | + . rst)))) |
| 321 | + (define p (plambda-property form)) |
| 322 | + (ret (kw-unconvert (tc-expr/t (plambda-property #'fun p)) |
| 323 | + (syntax->list #'(formals ...)) |
| 324 | + (syntax->datum #'(mand-kw ...)) |
| 325 | + (syntax->datum #'(all-kw ...))))] |
326 | 326 | [(~and opt:opt-lambda^ |
327 | 327 | (let-values ([(f) fun]) |
328 | 328 | (case-lambda (formals . cl-body) ...))) |
|
0 commit comments