summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2016-11-16 13:28:09 +0800
committerJohn Hodge <tpg@mutabah.net>2016-11-16 13:28:09 +0800
commitc3a6cacd573c85bf07471718358bf5e260e389c4 (patch)
tree8cbef163e9d3d3e1ec5a18e99bd038c0a588665b
parent3ba64b2a4adbc6ed8606f77a1a2c5cf7648db313 (diff)
downloadmrust-c3a6cacd573c85bf07471718358bf5e260e389c4.tar.gz
HIR Typecheck Expr - Don't assert if impl params aren't known (just fill them with new ivars)
-rw-r--r--src/hir_typeck/expr_cs.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/hir_typeck/expr_cs.cpp b/src/hir_typeck/expr_cs.cpp
index 1a32fba6..7c260ddc 100644
--- a/src/hir_typeck/expr_cs.cpp
+++ b/src/hir_typeck/expr_cs.cpp
@@ -420,9 +420,13 @@ namespace {
context.equate_types(sp, impl_ty_mono, *e.type);
}
- // - Check that all entries were populated by the above function
- for(const auto& ty : impl_params.m_types) {
- assert( ty != ::HIR::TypeRef() );
+
+ // Fill unknown parametrs with ivars
+ for(auto& ty : impl_params.m_types) {
+ if( ty == ::HIR::TypeRef() ) {
+ // Allocate a new ivar for the param
+ ty = context.m_ivars.new_ivar_tr();
+ }
}
}