summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Hodge <tpg@ucc.asn.au>2017-08-20 14:58:49 +0800
committerJohn Hodge <tpg@ucc.asn.au>2017-08-20 14:58:49 +0800
commit10e0d9a2609cc2b4d30c38e7f1f20e11de432fd6 (patch)
tree1eb7198cd76503638e22008ebdc5b9a10af2380c /src
parentedb35ef83c2b2ac6e520751514c369608a6212f5 (diff)
downloadmrust-10e0d9a2609cc2b4d30c38e7f1f20e11de432fd6.tar.gz
Resolve - Lookup glob of external enum
Diffstat (limited to 'src')
-rw-r--r--src/resolve/use.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/resolve/use.cpp b/src/resolve/use.cpp
index 5e1fce6d..be0c2ab8 100644
--- a/src/resolve/use.cpp
+++ b/src/resolve/use.cpp
@@ -443,7 +443,15 @@ void Resolve_Use_Mod(const ::AST::Crate& crate, ::AST::Module& mod, ::AST::Path
}
}
else {
- TODO(span, "Look up '" << des_item_name << "' in wildcard of enum - HIR");
+ const auto& enm = *e.hir;
+ unsigned int i = 0;
+ for(const auto& var : enm.m_variants)
+ {
+ if( var.first == des_item_name ) {
+ return ::AST::PathBinding::make_EnumVar({ nullptr, i, &enm });
+ }
+ i ++;
+ }
}
)
)