diff --git a/collects/typed-scheme/typecheck/tc-expr-unit.ss b/collects/typed-scheme/typecheck/tc-expr-unit.ss index c61bbd3d..b9c97d48 100644 --- a/collects/typed-scheme/typecheck/tc-expr-unit.ss +++ b/collects/typed-scheme/typecheck/tc-expr-unit.ss @@ -46,6 +46,7 @@ [else Univ])) +;; do-inst : syntax type -> type (define (do-inst stx ty) (define inst (syntax-property stx 'type-inst)) (define (split-last l) @@ -53,16 +54,16 @@ (values all-but (car last-list)))) (cond [(not inst) ty] [(not (or (Poly? ty) (PolyDots? ty))) - (tc-error/expr #:return (ret (Un)) "Cannot instantiate non-polymorphic type ~a" ty)] + (tc-error/expr #:return (Un) "Cannot instantiate non-polymorphic type ~a" ty)] [(and (Poly? ty) (not (= (length (syntax->list inst)) (Poly-n ty)))) - (tc-error/expr #:return (ret (Un)) + (tc-error/expr #:return (Un) "Wrong number of type arguments to polymorphic type ~a:~nexpected: ~a~ngot: ~a" ty (Poly-n ty) (length (syntax->list inst)))] [(and (PolyDots? ty) (not (>= (length (syntax->list inst)) (sub1 (PolyDots-n ty))))) ;; we can provide 0 arguments for the ... var - (tc-error/expr #:return (ret (Un)) + (tc-error/expr #:return (Un) "Wrong number of type arguments to polymorphic type ~a:~nexpected at least: ~a~ngot: ~a" ty (sub1 (PolyDots-n ty)) (length (syntax->list inst)))] [(PolyDots? ty)