diff --git a/collects/typed-scheme/private/base-env.ss b/collects/typed-scheme/private/base-env.ss index 397aacef0c..a671316efd 100644 --- a/collects/typed-scheme/private/base-env.ss +++ b/collects/typed-scheme/private/base-env.ss @@ -123,7 +123,7 @@ [procedure? (make-pred-ty (make-Function (list (make-top-arr))))] [map (-polydots (c a b) ((list ((list a) (b b) . ->... . c) (-lst a)) ((-lst b) b) . ->... .(-lst c)))] - [for-each (-polydots (c a b) ((list ((list a) (b b) . ->... . -Void) (-lst a)) + [for-each (-polydots (c a b) ((list ((list a) (b b) . ->... . Univ) (-lst a)) ((-lst b) b) . ->... . -Void))] [fold-left (-polydots (c a b) ((list ((list c a) (b b) . ->... . c) c (-lst a)) ((-lst b) b) . ->... . c))] diff --git a/collects/typed-scheme/private/tc-app-unit.ss b/collects/typed-scheme/private/tc-app-unit.ss index 9fa15d457b..58372a690c 100644 --- a/collects/typed-scheme/private/tc-app-unit.ss +++ b/collects/typed-scheme/private/tc-app-unit.ss @@ -310,8 +310,8 @@ "no polymorphic function domain matched - domain was: ~a rest type was: ~a arguments were ~a" (stringify dom) rest (stringify argtypes))]))] ;; polymorphic ... type - [(tc-result: (PolyDots: (and vars (list fixed-vars ... dotted-var)) - (Function: (list (arr: dom rng #f (cons dty dbound) thn-eff els-eff))))) + [(tc-result: (and t (PolyDots: (and vars (list fixed-vars ... dotted-var)) + (Function: (list (arr: dom rng #f (cons dty dbound) thn-eff els-eff)))))) (for-each (lambda (x) (unless (not (Poly? x)) (tc-error "Polymorphic argument ~a to polymorphic function not allowed" x))) argtypes) @@ -325,9 +325,15 @@ [(and expected substitution) expected] [substitution (ret (subst-all substitution rng))] - [else (tc-error/expr #:return (ret (Un)) - "no polymorphic function domain matched -~ndomain was: ~a ~ndotted rest type was: ~a ... ~a~narguments were ~a" - (stringify dom) dty dbound (stringify argtypes))]))] + [else + (match t + [(PolyDots-names: vars + (Function: (list (arr: dom rng #f (cons dty dbound) thn-eff els-eff)))) + (tc-error/expr #:return (ret (Un)) + (string-append + "no polymorphic function domain matched -~n" + "domain was: ~a ~ndotted rest type was: ~a ... ~a~narguments were ~a") + (stringify dom) dty dbound (stringify argtypes))])]))] [(tc-result: (Poly: vars (Function: (list (arr: doms rngs rests #f thn-effs els-effs) ...)))) (tc-error/expr #:return (ret (Un)) "polymorphic vararg case-lambda application not yet supported")] [(tc-result: (Poly: vars (Function: (list (arr: doms rngs #f drests thn-effs els-effs) ...))))