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)