summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/hir_typeck/outer.cpp12
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];