diff options
-rw-r--r-- | src/ast/path.cpp | 14 | ||||
-rw-r--r-- | src/convert/ast_iterate.cpp | 7 |
2 files changed, 19 insertions, 2 deletions
diff --git a/src/ast/path.cpp b/src/ast/path.cpp index 4cf74368..fed46d0c 100644 --- a/src/ast/path.cpp +++ b/src/ast/path.cpp @@ -246,7 +246,19 @@ void Path::resolve(const Crate& root_crate) const auto& imp = item.unwrap_Use(); if( imp.name == "" ) { - throw ParseError::Todo("Path::resolve - wildcard import"); + // Replace nodes 0:i-1 with source path, then recurse + AST::Path newpath = imp.data; + for( unsigned int j = i; j < m_nodes.size(); j ++ ) + { + newpath.m_nodes.push_back( m_nodes[j] ); + } + + DEBUG("- newpath = " << newpath); + // TODO: This should check for recursion somehow + newpath.resolve(root_crate); + + *this = newpath; + DEBUG("Alias resolved, *this = " << *this); } else { diff --git a/src/convert/ast_iterate.cpp b/src/convert/ast_iterate.cpp index b474a755..3e92e410 100644 --- a/src/convert/ast_iterate.cpp +++ b/src/convert/ast_iterate.cpp @@ -282,7 +282,12 @@ void CASTIterator::handle_impl(AST::Path modpath, AST::Impl& impl) local_type("Self", impl.type()); - // TODO: Associated types + // Associated types + for( auto& at : impl.types() ) + { + DEBUG("- Type '" << at.name << "'"); + handle_type( at.data ); + } // Functions for( auto& fcn : impl.functions() ) |