diff --git a/collects/typed-scheme/private/parse-type.ss b/collects/typed-scheme/private/parse-type.ss index 58560d2d50..be6d275263 100644 --- a/collects/typed-scheme/private/parse-type.ss +++ b/collects/typed-scheme/private/parse-type.ss @@ -47,7 +47,7 @@ [(Instance t) (eq? (syntax-e #'Instance) 'Instance) (let ([v (parse-type #'t)]) - (if (not (or (Mu? v) (Class? v) (Union? v))) + (if (not (or (Mu? v) (Class? v) (Union? v) (Error? v))) (begin (tc-error/delayed "Argument to Instance must be a class type, got ~a" v) (make-Instance (Un))) (make-Instance v)))] diff --git a/collects/typed-scheme/typecheck/tc-expr-unit.ss b/collects/typed-scheme/typecheck/tc-expr-unit.ss index ca2f20171f..9f0831ae0b 100644 --- a/collects/typed-scheme/typecheck/tc-expr-unit.ss +++ b/collects/typed-scheme/typecheck/tc-expr-unit.ss @@ -325,7 +325,7 @@ (begin (check-below ret-ty expected) (ret expected)) ret-ty))] [(tc-result: t) (int-err "non-symbol methods not supported by Typed Scheme: ~a" t)])] - [(tc-result: t) (tc-error/expr #:return (or expected (Un)) "send: expected a class instance, got ~a" t)])) + [(tc-result: t) (tc-error/expr #:return (or expected (ret (Un))) "send: expected a class instance, got ~a" t)])) ;; type-check a list of exprs, producing the type of the last one. ;; if the list is empty, the type is Void.