Useful error message when `with-type' used in a typed module.

original commit: 292feaad43d1c1424eb57e3a115714aec7502f4f
This commit is contained in:
Sam Tobin-Hochstadt 2011-08-19 11:34:37 -04:00
parent e0b3c29c1c
commit 4ca62d8404

View File

@ -30,6 +30,8 @@
(define (with-type-helper stx body fvids fvtys exids extys resty expr? ctx)
(define old-context (unbox typed-context?))
(unless (not old-context)
(tc-error/stx stx "with-type cannot be used in a typed module."))
(define ((no-contract t [stx stx]))
(tc-error/stx stx "Type ~a could not be converted to a contract." t))
(set-box! typed-context? #t)