From 1ae87178ba3e14d23e0a0617f6b73e7e9a8b63ab Mon Sep 17 00:00:00 2001 From: David Nadlinger Date: Fri, 22 Apr 2011 18:41:16 +0200 Subject: [PATCH] Merged DMD commit fb9df45c499e7e314642fc2de2ae6fd0ba1cfbbd: -m This commit actually adds some more import hints. --- dmd/mtype.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/dmd/mtype.c b/dmd/mtype.c index 2e289bef..cf5f48bf 100644 --- a/dmd/mtype.c +++ b/dmd/mtype.c @@ -3651,9 +3651,22 @@ L1: else *pt = t->merge(); } + if (!s) { - error(loc, "identifier '%s' is not defined", toChars()); + const char *p = toChars(); + const char *n = importHint(p); + if (n) + error(loc, "'%s' is not defined, perhaps you need to import %s; ?", p, n); + else + { + Identifier *id = new Identifier(p, TOKidentifier); + s = sc->search_correct(id); + if (s) + error(loc, "undefined identifier %s, did you mean %s %s?", p, s->kind(), s->toChars()); + else + error(loc, "undefined identifier %s", p); + } } }