diff options
author | John Hodge <tpg@mutabah.net> | 2016-08-19 22:10:49 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2016-08-19 22:10:49 +0800 |
commit | 1feea41ee0c04bc51497f255a5ebef5a18896241 (patch) | |
tree | 5175d462223176e819805ead3bcc7c32d8e156d6 | |
parent | c805e9e03db7e7b48f04824ccf5e625a20032af9 (diff) | |
download | mrust-1feea41ee0c04bc51497f255a5ebef5a18896241.tar.gz |
HIR Typecheck - Fix bug in recursion checking
-rw-r--r-- | src/hir_typeck/helpers.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/hir_typeck/helpers.cpp b/src/hir_typeck/helpers.cpp index ad4183a9..4a15c29e 100644 --- a/src/hir_typeck/helpers.cpp +++ b/src/hir_typeck/helpers.cpp @@ -331,11 +331,12 @@ void HMTypeInferrence::check_for_loops() for(auto idx : m_indexes) ASSERT_BUG(Span(), e.index != idx, "Recursion in ivar #" << m_indexes.front() << " " << *ivars.m_ivars[m_indexes.front()].type << " - loop with " << idx << " " << *ivars.m_ivars[idx].type); - m_indexes.push_back( e.index ); const auto& ivd = ivars.get_pointed_ivar(e.index); assert( !ivd.is_alias() ); if( !ivd.type->m_data.is_Infer() ) { + m_indexes.push_back( e.index ); this->check_ty(ivars, *ivd.type); + m_indexes.pop_back( ); } ), (Primitive, |