diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/hir_typeck/expr_cs.cpp | 5 | ||||
-rw-r--r-- | src/hir_typeck/helpers.cpp | 18 |
2 files changed, 20 insertions, 3 deletions
diff --git a/src/hir_typeck/expr_cs.cpp b/src/hir_typeck/expr_cs.cpp index 4714fa1f..820fd4ac 100644 --- a/src/hir_typeck/expr_cs.cpp +++ b/src/hir_typeck/expr_cs.cpp @@ -3028,6 +3028,9 @@ namespace { TRACE_FUNCTION_F(i); + // TODO: Some cases lead to two possibilities that compare different (due to inferrence) but are actually the same. + // - The above dedup should probably be aware of the way the types are used. + if( ivar_ent.types_to.size() > 1 ) { H::dedup_type_list(context, ivar_ent.types_to); } @@ -3051,7 +3054,7 @@ namespace { context.equate_types(Span(), ty_l, ty_r); } else { - DEBUG("- IVar " << ty_l << " not concretely known"); + DEBUG("- IVar " << ty_l << " not concretely known {" << ivar_ent.types_from << "} and {" << ivar_ent.types_to << "}" ); } ivar_ent.force_no = false; diff --git a/src/hir_typeck/helpers.cpp b/src/hir_typeck/helpers.cpp index a6ce091b..691b507e 100644 --- a/src/hir_typeck/helpers.cpp +++ b/src/hir_typeck/helpers.cpp @@ -252,10 +252,24 @@ void HMTypeInferrence::dump() const unsigned int i = 0; for(const auto& v : m_ivars) { if(v.is_alias()) { - DEBUG("#" << i << " = " << v.alias); + //DEBUG("#" << i << " = " << v.alias); } else { - DEBUG("#" << i << " = " << *v.type); + DEBUG("#" << i << " = " << *v.type << FMT_CB(os, + bool open = false; + unsigned int i2 = 0; + for(const auto& v2 : m_ivars) { + if( v2.is_alias() && v2.alias == i ) { + if( !open ) + os << " { "; + open = true; + os << "#" << i2 << " "; + } + i2 ++; + } + if(open) + os << "}"; + )); } i ++ ; } |