Better error message when definition is missing. Fixes PR 10751.

svn: r18042
This commit is contained in:
Sam Tobin-Hochstadt 2010-02-10 20:32:53 +00:00
parent c224d2ebfc
commit 39a8c288ec

View File

@ -63,7 +63,13 @@
(module-identifier-mapping-for-each (module-identifier-mapping-for-each
the-mapping the-mapping
(lambda (id e) (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 ;; map over the-mapping, producing a list
;; (id type -> T) -> listof[T] ;; (id type -> T) -> listof[T]