From dd61d2e865c5a7be51ea370fc3eb17557e933449 Mon Sep 17 00:00:00 2001 From: Sam Tobin-Hochstadt Date: Mon, 22 Sep 2008 18:09:49 +0000 Subject: [PATCH] Fix internal errors in error reporting. svn: r11836 original commit: e7a7036a48fd3afa19f5dd5420aae13ed09dbda2 --- collects/typed-scheme/typecheck/tc-expr-unit.ss | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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)