From 5b9453c63f1bc791e23b92a08017d7b10fb3415b Mon Sep 17 00:00:00 2001 From: John Hodge Date: Tue, 12 Jul 2016 17:48:19 +1000 Subject: HIR Typecheck - Extra defence --- src/hir_typeck/helpers.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/hir_typeck/helpers.cpp b/src/hir_typeck/helpers.cpp index 6f022f68..b7415a8a 100644 --- a/src/hir_typeck/helpers.cpp +++ b/src/hir_typeck/helpers.cpp @@ -1756,6 +1756,7 @@ bool TraitResolution::find_trait_impls_crate(const Span& sp, }; auto monomorph = [&](const auto& gt)->const auto& { const auto& ge = gt.m_data.as_Generic(); + ASSERT_BUG(sp, ge.binding >> 8 != 2, ""); assert( ge.binding < impl_params.size() ); if( !impl_params[ge.binding] ) { //BUG(sp, "Param " << ge.binding << " for `impl" << impl.m_params.fmt_args() << " " << trait << impl.m_trait_args << " for " << impl.m_type << "` wasn't constrained"); @@ -1836,6 +1837,7 @@ bool TraitResolution::find_trait_impls_crate(const Span& sp, { types.insert( ::std::make_pair(aty.first, this->expand_associated_types(sp, monomorphise_type_with(sp, aty.second, monomorph))) ); } + // TODO: Ensure that there are no-longer any magic params DEBUG("[find_trait_impls_crate] callback(args=" << args_mono << ", assoc={" << types << "})"); //if( match == ::HIR::Compare::Fuzzy ) { -- cgit v1.2.3