summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/resolve/absolute.cpp6
-rw-r--r--src/resolve/index.cpp6
2 files changed, 10 insertions, 2 deletions
diff --git a/src/resolve/absolute.cpp b/src/resolve/absolute.cpp
index 6918a48e..cf7393ab 100644
--- a/src/resolve/absolute.cpp
+++ b/src/resolve/absolute.cpp
@@ -363,17 +363,20 @@ struct Context
{
TU_MATCH(Ent, (*it), (e),
(Module,
+ DEBUG("- Module");
::AST::Path rv;
if( this->lookup_in_mod(*e.mod, name, mode, rv) ) {
return rv;
}
),
(ConcreteSelf,
+ DEBUG("- ConcreteSelf");
if( ( mode == LookupMode::Type || mode == LookupMode::Namespace ) && name == "Self" ) {
return ::AST::Path( ::AST::Path::TagUfcs(), *e, ::AST::Path(), ::std::vector< ::AST::PathNode>() );
}
),
(VarBlock,
+ DEBUG("- VarBlock");
assert(e.level <= m_block_level);
if( mode != LookupMode::Variable ) {
// ignore
@@ -390,6 +393,7 @@ struct Context
}
),
(Generic,
+ DEBUG("- Generic");
if( mode == LookupMode::Type || mode == LookupMode::Namespace ) {
for( auto it2 = e.types.rbegin(); it2 != e.types.rend(); ++ it2 )
{
@@ -409,11 +413,13 @@ struct Context
}
// Top-level module
+ DEBUG("- Top module");
::AST::Path rv;
if( this->lookup_in_mod(m_mod, name, mode, rv) ) {
return rv;
}
+ DEBUG("- Primitives");
switch(mode)
{
case LookupMode::Namespace:
diff --git a/src/resolve/index.cpp b/src/resolve/index.cpp
index 5ebb2808..a8f92027 100644
--- a/src/resolve/index.cpp
+++ b/src/resolve/index.cpp
@@ -40,13 +40,15 @@ enum class IndexName
void _add_item(const Span& sp, AST::Module& mod, IndexName location, const ::std::string& name, bool is_pub, ::AST::Path ir, bool error_on_collision=true)
{
- DEBUG("Add " << location << " item '" << name << "': " << ir);
auto& list = get_mod_index(mod, location);
bool was_import = (ir != mod.path() + name);
if( was_import ) {
DEBUG("### Import " << name << " = " << ir);
}
+ else {
+ DEBUG("Add " << location << " item '" << name << "': " << ir);
+ }
if( false == list.insert(::std::make_pair(name, ::AST::Module::IndexEnt { is_pub, was_import, mv$(ir) } )).second )
{
if( error_on_collision )
@@ -55,7 +57,7 @@ void _add_item(const Span& sp, AST::Module& mod, IndexName location, const ::std
}
else
{
- DEBUG("Name collision " << mod.path() << ", ignored");
+ DEBUG("Name collision in " << mod.path() << " - '" << name << "', ignored");
}
}
}