From 7eec279e960c4c7c641b683472c24e4ad96375f5 Mon Sep 17 00:00:00 2001 From: Sam Tobin-Hochstadt Date: Wed, 10 Feb 2010 20:32:53 +0000 Subject: [PATCH] Better error message when definition is missing. Fixes PR 10751. svn: r18042 original commit: 39a8c288ec409cef59ec5a3cfec16b13a0a7c1b5 --- collects/typed-scheme/env/type-env.ss | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/collects/typed-scheme/env/type-env.ss b/collects/typed-scheme/env/type-env.ss index 5070a750..7aaf08ac 100644 --- a/collects/typed-scheme/env/type-env.ss +++ b/collects/typed-scheme/env/type-env.ss @@ -63,7 +63,13 @@ (module-identifier-mapping-for-each the-mapping (lambda (id e) - (when (box? e) (tc-error/stx id "Declaration for ~a provided, but with no definition" (syntax-e id)))))) + (when (box? e) + (let ([bnd (identifier-binding id)]) + (tc-error/stx id "Declaration for ~a provided, but ~a ~a" + (syntax-e id) (syntax-e id) + (cond [(eq? bnd 'lexical) "is a lexical binding"] ;; should never happen + [(not bnd) "has no definition"] + [else "is defined in another module"]))))))) ;; map over the-mapping, producing a list ;; (id type -> T) -> listof[T]