summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2016-06-05 11:21:06 +0800
committerJohn Hodge <tpg@mutabah.net>2016-06-05 11:21:06 +0800
commita0c00721f5b9d79035e522577b0f127df5849cfb (patch)
treecb84ef4494c932d4843507fe17b56a04ba09c4d2
parent1f614012969b0d9052ee1bb0526afddc7e6187b6 (diff)
downloadmrust-a0c00721f5b9d79035e522577b0f127df5849cfb.tar.gz
HIR Typecheck - Set var type during enum
-rw-r--r--src/hir_typeck/expr.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/hir_typeck/expr.cpp b/src/hir_typeck/expr.cpp
index f0a2cee1..48a7a439 100644
--- a/src/hir_typeck/expr.cpp
+++ b/src/hir_typeck/expr.cpp
@@ -900,6 +900,9 @@ namespace {
(*node_ptr_ptr)->m_res_type = l_t.clone();
return ;
)
+ else TU_IFLET(::HIR::TypeRef::Data, r_e.inner->m_data, Generic, right_arg,
+ TODO(sp, "Search for Unsize bound on generic");
+ )
else
{
// Apply deref coercions
@@ -1106,6 +1109,12 @@ namespace {
::HIR::ExprVisitorDef::visit(node);
}
+ // - Variable: Bind to same ivar
+ void visit(::HIR::ExprNode_Variable& node) override
+ {
+ this->context.del_ivar( node.m_res_type.m_data.as_Infer().index );
+ node.m_res_type = this->context.get_var_type(node.m_slot).clone();
+ }
};
class ExprVisitor_Run:
@@ -1232,6 +1241,7 @@ namespace {
// - Variable: Bind to same ivar
void visit(::HIR::ExprNode_Variable& node) override
{
+ // TODO: How to apply deref coercions here?
this->context.apply_equality(node.span(),
node.m_res_type, this->context.get_var_type(node.m_slot)
);