diff options
author | John Hodge <tpg@mutabah.net> | 2016-07-10 16:42:51 +1000 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2016-07-10 16:42:51 +1000 |
commit | 87e8becbb724486004b5b4d2711a80eb3a1b199e (patch) | |
tree | 50f14b812b74b88f9648cef4f0bfaf4a8b46bc8f | |
parent | 61e61e0a557c399ed6f62a645e25063557b8f569 (diff) | |
download | mrust-87e8becbb724486004b5b4d2711a80eb3a1b199e.tar.gz |
HIR Typecheck CS - Mark change when a new rule is added
-rw-r--r-- | src/hir_typeck/expr_cs.cpp | 3 | ||||
-rw-r--r-- | src/hir_typeck/helpers.cpp | 2 | ||||
-rw-r--r-- | src/hir_typeck/helpers.hpp | 6 |
3 files changed, 8 insertions, 3 deletions
diff --git a/src/hir_typeck/expr_cs.cpp b/src/hir_typeck/expr_cs.cpp index 6fbf8907..8fa36cfa 100644 --- a/src/hir_typeck/expr_cs.cpp +++ b/src/hir_typeck/expr_cs.cpp @@ -2330,6 +2330,7 @@ void Context::equate_types_coerce(const Span& sp, const ::HIR::TypeRef& l, ::HIR l.clone(), &node_ptr }); DEBUG("equate_types_coerce(" << this->link_coerce.back() << ")"); + this->m_ivars.mark_change(); } void Context::equate_types_assoc(const Span& sp, const ::HIR::TypeRef& l, const ::HIR::SimplePath& trait, ::std::vector< ::HIR::TypeRef> ty_args, const ::HIR::TypeRef& impl_ty, const char *name, bool is_op) { @@ -2346,6 +2347,7 @@ void Context::equate_types_assoc(const Span& sp, const ::HIR::TypeRef& l, const is_op }); DEBUG("equate_types_assoc(" << this->link_assoc.back() << ")"); + this->m_ivars.mark_change(); } void Context::add_revisit(::HIR::ExprNode& node) { this->to_visit.push_back( &node ); @@ -3093,7 +3095,6 @@ void Typecheck_Code_CS(const typeck::ModuleState& ms, t_args& args, const ::HIR: } count ++; - context.m_ivars.dump(); context.m_resolve.compact_ivars(context.m_ivars); } diff --git a/src/hir_typeck/helpers.cpp b/src/hir_typeck/helpers.cpp index 04984054..69998bca 100644 --- a/src/hir_typeck/helpers.cpp +++ b/src/hir_typeck/helpers.cpp @@ -307,10 +307,12 @@ bool HMTypeInferrence::apply_defaults() break; case ::HIR::InferClass::Integer: rv = true; + DEBUG("- " << *v.type << " -> i32"); *v.type = ::HIR::TypeRef( ::HIR::CoreType::I32 ); break; case ::HIR::InferClass::Float: rv = true; + DEBUG("- " << *v.type << " -> f64"); *v.type = ::HIR::TypeRef( ::HIR::CoreType::F64 ); break; } diff --git a/src/hir_typeck/helpers.hpp b/src/hir_typeck/helpers.hpp index 94fcef6b..cdcbc12c 100644 --- a/src/hir_typeck/helpers.hpp +++ b/src/hir_typeck/helpers.hpp @@ -78,8 +78,10 @@ public: return rv; } void mark_change() { - DEBUG("- CHANGE"); - m_has_changed = true; + if( !m_has_changed ) { + DEBUG("- CHANGE"); + m_has_changed = true; + } } void compact_ivars(); |