diff options
author | John Hodge <tpg@mutabah.net> | 2016-07-10 17:28:12 +1000 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2016-07-10 17:28:12 +1000 |
commit | 7444f7b57583412a89f88f82f311dbecba6db5d5 (patch) | |
tree | b2502c41fdf63263126bd8107218158b504c4ced /src | |
parent | 5c3de8c392cc9c0a7a5fc858ad3ff33d0f597a04 (diff) | |
download | mrust-7444f7b57583412a89f88f82f311dbecba6db5d5.tar.gz |
HIR Typecheck CS - (minor) Logging in ivar possibilities
Diffstat (limited to 'src')
-rw-r--r-- | src/hir_typeck/expr_cs.cpp | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/src/hir_typeck/expr_cs.cpp b/src/hir_typeck/expr_cs.cpp index e860b68c..ae81143a 100644 --- a/src/hir_typeck/expr_cs.cpp +++ b/src/hir_typeck/expr_cs.cpp @@ -2972,7 +2972,19 @@ namespace { // No idea! (or unused) return ; } + + ::HIR::TypeRef ty_l_ivar; + ty_l_ivar.m_data.as_Infer().index = i; + const auto& ty_l = context.m_ivars.get_type(ty_l_ivar); + + if( !ty_l.m_data.is_Infer() ) { + DEBUG("- IVar " << ty_l << " had possibilities, but was known"); + ivar_ent = Context::IVarPossible(); + return ; + } + if( ivar_ent.force_no == true ) { + DEBUG("- IVar " << ty_l << " is forced unknown"); ivar_ent = Context::IVarPossible(); return ; } @@ -3009,15 +3021,8 @@ namespace { H::dedup_type_list(context, ivar_ent.types_from); } - ::HIR::TypeRef ty_l_ivar; - ty_l_ivar.m_data.as_Infer().index = i; - const auto& ty_l = context.m_ivars.get_type(ty_l_ivar); - - if( !ty_l.m_data.is_Infer() ) { - DEBUG("- IVar " << ty_l << " had possibilities, but was known"); - } // Prefer cases where this type is being created from a known type - else if( ivar_ent.types_from.size() == 1 ) { + if( ivar_ent.types_from.size() == 1 ) { //const ::HIR::TypeRef& ty_r = *ivar_ent.types_from[0]; const ::HIR::TypeRef& ty_r = ivar_ent.types_from[0]; // Only one possibility @@ -3032,6 +3037,7 @@ namespace { context.equate_types(Span(), ty_l, ty_r); } else { + DEBUG("- IVar " << ty_l << " not concretely known"); } ivar_ent.force_no = false; |