diff options
author | John Hodge <tpg@mutabah.net> | 2016-07-10 14:13:59 +1000 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2016-07-10 14:13:59 +1000 |
commit | 75e0b75cd4bebc08e1a0775a869ab255d26041ad (patch) | |
tree | 7bcb2a374f3eb26f28318171bba0181ae65c15d6 | |
parent | fbd8e9ad07e3ba811bcd60910938546b128b039f (diff) | |
download | mrust-75e0b75cd4bebc08e1a0775a869ab255d26041ad.tar.gz |
HIR Typecheck CS - Expand associated types in associated equality rules
-rw-r--r-- | src/hir_typeck/expr_cs.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/hir_typeck/expr_cs.cpp b/src/hir_typeck/expr_cs.cpp index 859dcf38..c85adf2c 100644 --- a/src/hir_typeck/expr_cs.cpp +++ b/src/hir_typeck/expr_cs.cpp @@ -2991,7 +2991,16 @@ void Typecheck_Code_CS(const typeck::ModuleState& ms, t_args& args, const ::HIR: //for(auto it = context.link_assoc.begin(); it != context.link_assoc.end(); ) { // const auto& rule = *it; for(unsigned int i = 0; i < context.link_assoc.size(); ) { - const auto& rule = context.link_assoc[i]; + auto& rule = context.link_assoc[i]; + + for( auto& ty : rule.params.m_types ) { + ty = context.m_resolve.expand_associated_types(rule.span, mv$(ty)); + } + if( rule.name != "" ) { + rule.left_ty = context.m_resolve.expand_associated_types(rule.span, mv$(rule.left_ty)); + } + rule.impl_ty = context.m_resolve.expand_associated_types(rule.span, mv$(rule.impl_ty)); + if( check_associated(context, rule) ) { DEBUG("- Consumed associated type rule - " << rule); context.link_assoc.erase( context.link_assoc.begin() + i ); |