From 6654865a76dcbe84d1fbdb3b78d9c6624c1c9741 Mon Sep 17 00:00:00 2001 From: xc42 <2042292281@qq.com> Date: Wed, 24 Aug 2022 11:42:27 +0800 Subject: [PATCH] fix type-check-Lfun for `Apply` type-check --- type-check-Lfun.rkt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/type-check-Lfun.rkt b/type-check-Lfun.rkt index d1f4cc1..dfb3286 100644 --- a/type-check-Lfun.rkt +++ b/type-check-Lfun.rkt @@ -37,9 +37,9 @@ ((type-check-exp env) e))) (match ty [`(,ty^* ... -> ,rt) - (for ([arg-ty ty*] [param-ty ty^*]) - (check-type-equal? arg-ty param-ty (Apply e es))) - (values e^ e* rt)] + (let ([expr (Apply e es)]) + (for-each (lambda (at pt) (check-type-equal? at pt expr)) ty* ty^*)) + (values e^ e* rt)] [else (error 'type-check "expected a function, not ~a" ty)])) (define/override (type-check-exp env)