diff options
author | John Hodge <tpg@ucc.asn.au> | 2017-11-26 11:00:21 +0800 |
---|---|---|
committer | John Hodge <tpg@ucc.asn.au> | 2017-11-26 11:00:21 +0800 |
commit | b9bc72577076c984d901e4c41dc028073b7a44e4 (patch) | |
tree | 7ccec3edb65499ce4fdc870b1744bea5f218fc1f | |
parent | 7ca433200a46434ea785881010c476520d6ea746 (diff) | |
download | mrust-b9bc72577076c984d901e4c41dc028073b7a44e4.tar.gz |
Typecheck Expressions - Handle type being known when possibility added
-rw-r--r-- | src/hir_typeck/expr_cs.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/hir_typeck/expr_cs.cpp b/src/hir_typeck/expr_cs.cpp index f982f928..d3587095 100644 --- a/src/hir_typeck/expr_cs.cpp +++ b/src/hir_typeck/expr_cs.cpp @@ -4150,7 +4150,12 @@ void Context::possible_equate_type(unsigned int ivar_index, const ::HIR::TypeRef { ::HIR::TypeRef ty_l; ty_l.m_data.as_Infer().index = ivar_index; - assert( m_ivars.get_type(ty_l).m_data.is_Infer() ); + const auto& real_ty = m_ivars.get_type(ty_l); + if( real_ty != ty_l ) + { + DEBUG("IVar " << ivar_index << " is actually " << real_ty); + return ; + } } if( ivar_index >= possible_ivar_vals.size() ) { |