diff options
author | John Hodge <tpg@mutabah.net> | 2016-04-02 12:06:07 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2016-04-02 12:06:07 +0800 |
commit | c47ac13386ac5a597ec822ea6d73bf62ca009954 (patch) | |
tree | 7fe7dd24850cabf5fafb0a79b1b2531104d35345 /src/resolve/use.cpp | |
parent | d5b39c4fcf80a1e84aee6080351dc990c0aa8963 (diff) | |
download | mrust-c47ac13386ac5a597ec822ea6d73bf62ca009954.tar.gz |
Resolve - Start building an index of names avaliable in each module
Diffstat (limited to 'src/resolve/use.cpp')
-rw-r--r-- | src/resolve/use.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/resolve/use.cpp b/src/resolve/use.cpp index 43bd074f..6eb837e6 100644 --- a/src/resolve/use.cpp +++ b/src/resolve/use.cpp @@ -96,6 +96,22 @@ void Resolve_Use_Mod(const ::AST::Crate& crate, ::AST::Module& mod, ::AST::Path ::AST::PathBinding Resolve_Use_GetBinding_Mod(const Span& span, const ::AST::Crate& crate, const ::AST::Module& mod, const ::std::string& des_item_name) { + // HACK - Catch the possibiliy of a name clash (not sure if this is really an erro) + { + bool found = false; + for( const auto& item : mod.items() ) + { + if( item.data.is_None() ) + continue ; + if( item.name == des_item_name ) { + if( found ) { + TODO(span, "Duplicate name found resolving use statement searching in module " << mod.path()); + } + found = true; + } + } + } + for( const auto& item : mod.items() ) { if( item.data.is_None() ) |