From 4ca62d84040c9f5adb1ff62f51013f2f0a456f0c Mon Sep 17 00:00:00 2001 From: Sam Tobin-Hochstadt Date: Fri, 19 Aug 2011 11:34:37 -0400 Subject: [PATCH] Useful error message when `with-type' used in a typed module. original commit: 292feaad43d1c1424eb57e3a115714aec7502f4f --- collects/typed-scheme/private/with-types.rkt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/collects/typed-scheme/private/with-types.rkt b/collects/typed-scheme/private/with-types.rkt index 835e01b7..ee35295f 100644 --- a/collects/typed-scheme/private/with-types.rkt +++ b/collects/typed-scheme/private/with-types.rkt @@ -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)