From 251e49aef76e46af5005978ac25650aab4f94313 Mon Sep 17 00:00:00 2001 From: John Hodge Date: Tue, 22 Aug 2017 21:21:44 +0800 Subject: Resolve Use - (minor) Diagnostics fix when module cannot be found --- src/resolve/use.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/resolve/use.cpp b/src/resolve/use.cpp index 5e1fce6d..9c27711d 100644 --- a/src/resolve/use.cpp +++ b/src/resolve/use.cpp @@ -688,7 +688,10 @@ namespace { auto b = Resolve_Use_GetBinding_Mod(span, crate, *mod, nodes[i].name(), parent_modules, Lookup::Type); TU_MATCH_DEF(::AST::PathBinding, (b), (e), ( - ERROR(span, E0000, "Unexpected item type in import"); + ERROR(span, E0000, "Unexpected item type " << b.tag_str() << " in import of " << path); + ), + (Unbound, + ERROR(span, E0000, "Cannot find component " << i << " of " << path); ), (Crate, // TODO: Mangle the original path (or return a new path somehow) -- cgit v1.2.3