summaryrefslogtreecommitdiff
path: root/src/resolve
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2016-10-31 11:58:03 +0800
committerJohn Hodge <tpg@mutabah.net>2016-10-31 11:58:03 +0800
commit542633bbfad33d1b94921d89261bb637ba48ff47 (patch)
tree1ac6ad83f407ba64c92554d843b7ed54cc5593fd /src/resolve
parentfc7239e7271e879102272ea4d7e98f87f027ee84 (diff)
downloadmrust-542633bbfad33d1b94921d89261bb637ba48ff47.tar.gz
AST+HIR - Union support through to HIR
Diffstat (limited to 'src/resolve')
-rw-r--r--src/resolve/absolute.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/resolve/absolute.cpp b/src/resolve/absolute.cpp
index 76da7ed1..0d47eb21 100644
--- a/src/resolve/absolute.cpp
+++ b/src/resolve/absolute.cpp
@@ -1951,6 +1951,17 @@ void Resolve_Absolute_Struct(Context& item_context, ::AST::Struct& e)
item_context.pop( e.params() );
}
+void Resolve_Absolute_Union(Context& item_context, ::AST::Union& e)
+{
+ item_context.push( e.m_params, GenericSlot::Level::Top );
+ Resolve_Absolute_Generic(item_context, e.m_params);
+
+ for(auto& field : e.m_variants) {
+ Resolve_Absolute_Type(item_context, field.m_type);
+ }
+
+ item_context.pop( e.m_params );
+}
void Resolve_Absolute_Trait(Context& item_context, ::AST::Trait& e)
{
item_context.push( e.params(), GenericSlot::Level::Top, true );
@@ -2114,7 +2125,7 @@ void Resolve_Absolute_Mod( Context item_context, ::AST::Module& mod )
),
(Union,
DEBUG("Union - " << i.name);
- TODO(i.data.span, "Union");
+ Resolve_Absolute_Union(item_context, e);
),
(Function,
DEBUG("Function - " << i.name);