diff options
Diffstat (limited to 'src/resolve')
-rw-r--r-- | src/resolve/absolute.cpp | 23 | ||||
-rw-r--r-- | src/resolve/use.cpp | 6 |
2 files changed, 25 insertions, 4 deletions
diff --git a/src/resolve/absolute.cpp b/src/resolve/absolute.cpp index da27261f..5685ae82 100644 --- a/src/resolve/absolute.cpp +++ b/src/resolve/absolute.cpp @@ -218,7 +218,7 @@ struct Context break; case LookupMode::Type: - //if( name == "SizeHint" ) { + //if( name == "IntoIterator" ) { // DEBUG("lookup_in_mod(mod="<<mod.path()<<")"); // for(const auto& v : mod.m_type_items) { // DEBUG("- " << v.first << " = " << (v.second.is_pub ? "pub " : "") << v.second.path); @@ -465,6 +465,7 @@ void Resolve_Absolute_Path(/*const*/ Context& context, const Span& sp, Context:: (Absolute, DEBUG("- Absolute"); // Nothing to do (TODO: Bind?) + Resolve_Absolute_PathNodes(context, Span(), e.nodes); ), (UFCS, DEBUG("- UFCS"); @@ -476,6 +477,26 @@ void Resolve_Absolute_Path(/*const*/ Context& context, const Span& sp, Context:: Resolve_Absolute_PathNodes(context, Span(), e.nodes); ) ) + + #if 0 + TU_MATCH_DEF(::AST::Path::Class, (path.m_class), (e), + ( + BUG(sp, "Path wasn't absolutised correctly"); + ), + (Local, + // TODO: Ensure that local paths are bound to the variable/type index + ), + (Absolute, + if( e.crate != "" ) { + // TODO: Handle items from other crates (back-converting HIR paths) + } + TODO(sp, "Bind absolute paths to relevant items (and expand)"); + ), + (UFCS, + // TODO: Resolve UFCS to item class (if possible) + ) + ) + #endif } void Resolve_Absolute_Type(Context& context, TypeRef& type) diff --git a/src/resolve/use.cpp b/src/resolve/use.cpp index 9931eefa..2d86be13 100644 --- a/src/resolve/use.cpp +++ b/src/resolve/use.cpp @@ -39,7 +39,7 @@ void Resolve_Use(::AST::Crate& crate) ), (Super, assert(e.count >= 1); - AST::Path np(base_path.crate(), {}); + AST::Path np("", {}); if( e.count > base_path.nodes().size() ) { ERROR(span, E0000, "Too many `super` components"); } @@ -67,8 +67,8 @@ void Resolve_Use_Mod(const ::AST::Crate& crate, ::AST::Module& mod, ::AST::Path BUG(span, "Use path is not absolute after absolutisation"); // TODO: Is this a valid assertion? - if( use_stmt.data.path.crate() != "" ) - BUG(span, "Use path crate was set before resolve"); + //if( use_stmt.data.path.crate() != "" ) + // BUG(span, "Use path crate was set before resolve"); use_stmt.data.path.bind( Resolve_Use_GetBinding(span, crate, use_stmt.data.path, parent_modules) ); |