diff options
author | John Hodge <tpg@mutabah.net> | 2016-09-03 12:58:14 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2016-09-03 12:58:14 +0800 |
commit | d97e6ed14e09f3e37d84d5f19a9ae3658bce408b (patch) | |
tree | 63c9613769b449058c28196a78738c4107a9c3d2 /src | |
parent | 1f2fc66be90767877c5a8618ab7609b3d8f6624c (diff) | |
download | mrust-d97e6ed14e09f3e37d84d5f19a9ae3658bce408b.tar.gz |
HIR Typecheck Outer - Support exter crates
Diffstat (limited to 'src')
-rw-r--r-- | src/hir_typeck/outer.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/hir_typeck/outer.cpp b/src/hir_typeck/outer.cpp index d5e8e7e9..c3b96036 100644 --- a/src/hir_typeck/outer.cpp +++ b/src/hir_typeck/outer.cpp @@ -9,10 +9,14 @@ namespace { const ::HIR::GenericParams& get_params_for_item(const Span& sp, const ::HIR::Crate& crate, const ::HIR::SimplePath& path, ::HIR::Visitor::PathContext pc) { - if( path.m_crate_name != "" ) - TODO(sp, "get_params_for_item in crate"); - - const ::HIR::Module* mod = &crate.m_root_module; + const ::HIR::Module* mod; + if( path.m_crate_name != "" ) { + ASSERT_BUG(sp, crate.m_ext_crates.count(path.m_crate_name) != 0, "Referenced crate in " << path << " not loaded"); + mod = &crate.m_ext_crates.at(path.m_crate_name)->m_root_module; + } + else { + mod = &crate.m_root_module; + } for( unsigned int i = 0; i < path.m_components.size() - 1; i ++ ) { const auto& pc = path.m_components[i]; |