Handle (Instance Foo) where Foo is unbound.

Return correct error behavior.

svn: r12410

original commit: 541a47f7fd943f77f82983bd52a837db47b736a8
This commit is contained in:
Sam Tobin-Hochstadt 2008-11-12 15:59:24 +00:00
parent c9e6071981
commit 3f501c1a2f
3 changed files with 2 additions and 18 deletions

View File

@ -1,16 +0,0 @@
#lang scheme/base
(require (for-syntax scheme/base)
framework/framework)
(provide (rename-out [-preferences:get preferences:get])
preferences:get-drscheme:large-letters-font)
(define (preferences:get-drscheme:large-letters-font)
(preferences:get 'drscheme:large-letters-font))
(define-syntax (-preferences:get stx)
(syntax-case stx (quote)
[(_ (quote sym))
(with-syntax ([nm (datum->syntax stx (string->symbol (string-append "preferences:get" "-" (symbol->string (syntax-e #'sym)))))])
(syntax/loc stx (nm)))]))

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.