Handle (Instance Foo) where Foo is unbound.
Return correct error behavior. svn: r12410
This commit is contained in:
parent
48c90f1c10
commit
541a47f7fd
|
@ -47,7 +47,7 @@
|
||||||
[(Instance t)
|
[(Instance t)
|
||||||
(eq? (syntax-e #'Instance) 'Instance)
|
(eq? (syntax-e #'Instance) 'Instance)
|
||||||
(let ([v (parse-type #'t)])
|
(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)
|
(begin (tc-error/delayed "Argument to Instance must be a class type, got ~a" v)
|
||||||
(make-Instance (Un)))
|
(make-Instance (Un)))
|
||||||
(make-Instance v)))]
|
(make-Instance v)))]
|
||||||
|
|
|
@ -325,7 +325,7 @@
|
||||||
(begin (check-below ret-ty expected) (ret expected))
|
(begin (check-below ret-ty expected) (ret expected))
|
||||||
ret-ty))]
|
ret-ty))]
|
||||||
[(tc-result: t) (int-err "non-symbol methods not supported by Typed Scheme: ~a" t)])]
|
[(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.
|
;; type-check a list of exprs, producing the type of the last one.
|
||||||
;; if the list is empty, the type is Void.
|
;; if the list is empty, the type is Void.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user