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

svn: r18042

original commit: 39a8c288ec409cef59ec5a3cfec16b13a0a7c1b5
This commit is contained in:
Sam Tobin-Hochstadt 2010-02-10 20:32:53 +00:00
parent e2b4318dfa
commit 7eec279e96

View File

@ -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]