Handle (Instance Foo) where Foo is unbound.

Return correct error behavior.

svn: r12410
This commit is contained in:
Sam Tobin-Hochstadt 2008-11-12 15:59:24 +00:00
parent 48c90f1c10
commit 541a47f7fd
2 changed files with 2 additions and 2 deletions

View File

@ -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)))]

View File

@ -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.