diff options
Diffstat (limited to 'src/resolve/use.cpp')
-rw-r--r-- | src/resolve/use.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/resolve/use.cpp b/src/resolve/use.cpp index 2d86be13..2ebdc058 100644 --- a/src/resolve/use.cpp +++ b/src/resolve/use.cpp @@ -35,7 +35,17 @@ void Resolve_Use(::AST::Crate& crate) return base_path + path; ), (Self, - return base_path + path; + // EVIL HACK: If the current module is an anon module, refer to the parent + if( base_path.nodes().back().name()[0] == '#' ) { + AST::Path np("", {}); + for( unsigned int i = 0; i < base_path.nodes().size() - 1; i ++ ) + np.nodes().push_back( base_path.nodes()[i] ); + np += path; + return np; + } + else { + return base_path + path; + } ), (Super, assert(e.count >= 1); |