From fd9b01b2d8b1efb4f7f95a72af4eeff2fae2a576 Mon Sep 17 00:00:00 2001 From: John Hodge Date: Sun, 29 May 2016 18:20:15 +0800 Subject: Resolve - Fix glob imports of enums yeilding bad paths --- src/resolve/index.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/resolve/index.cpp') diff --git a/src/resolve/index.cpp b/src/resolve/index.cpp index d3fdf57d..eeae3f5b 100644 --- a/src/resolve/index.cpp +++ b/src/resolve/index.cpp @@ -224,6 +224,7 @@ void Resolve_Index_Module_Wildcard(AST::Module& mod, bool handle_pub) ), (Module, + DEBUG("Glob mod " << i.data.path); if( e.module_ == &mod ) { ERROR(sp, E0000, "Glob import of self"); } @@ -246,9 +247,10 @@ void Resolve_Index_Module_Wildcard(AST::Module& mod, bool handle_pub) } ), (Enum, + DEBUG("Glob enum " << i.data.path); unsigned int idx = 0; for( const auto& ev : e.enum_->variants() ) { - ::AST::Path p = mod.path() + ev.m_name; + ::AST::Path p = i.data.path + ev.m_name; p.bind( ::AST::PathBinding::make_EnumVar({e.enum_, idx}) ); if( ev.m_data.is_Struct() ) { _add_item_type ( sp, mod, ev.m_name, i.is_pub, mv$(p), false ); -- cgit v1.2.3