From 39d245984ae1ab453992d879ad50d5be566b1e1e Mon Sep 17 00:00:00 2001 From: Vincent St-Amour Date: Thu, 1 Jul 2010 18:32:21 -0400 Subject: [PATCH] Calls to vector now return heterogenous vectors, to preserve length information. original commit: f79f617ee80417059c15d9228489ec1cb716448a --- collects/typed-scheme/typecheck/tc-app.rkt | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/collects/typed-scheme/typecheck/tc-app.rkt b/collects/typed-scheme/typecheck/tc-app.rkt index b328aac7..4902b6d4 100644 --- a/collects/typed-scheme/typecheck/tc-app.rkt +++ b/collects/typed-scheme/typecheck/tc-app.rkt @@ -623,11 +623,8 @@ expected))] ;; since vectors are mutable, if there is no expected type, we want to generalize the element type [(or #f (tc-result1: _)) - (let ([arg-tys (map (lambda (x) - (match (single-value x) - [(tc-result1: t) (ret (generalize t))])) - (syntax->list #'(args ...)))]) - (tc/funapp #'op #'(args ...) (single-value #'op) arg-tys expected))] + (ret (make-HeterogenousVector (map (lambda (x) (generalize (tc-expr/t x))) + (syntax->list #'(args ...)))))] [_ (int-err "bad expected: ~a" expected)]))] ;; since vectors are mutable, if there is no expected type, we want to generalize the element type [(#%plain-app (~and op (~literal make-vector)) n elt)