From d594f7aaa75f415c36295ebe83d20325bfb847ed Mon Sep 17 00:00:00 2001 From: John Hodge Date: Sun, 4 Dec 2016 23:01:22 +0800 Subject: HIR Expand VTables - (HACK) Ignore associated types that aren't known (for now) --- src/hir_expand/vtable.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/hir_expand/vtable.cpp b/src/hir_expand/vtable.cpp index e92fef92..ea578237 100644 --- a/src/hir_expand/vtable.cpp +++ b/src/hir_expand/vtable.cpp @@ -75,10 +75,10 @@ namespace { } i ++; } - // TODO: Iterate supertraits too. for(const auto& st : tr.m_parent_traits) { add_types_from_trait(*st.m_trait_ptr); } + // TODO: Iterate supertraits from bounds too } }; Foo visitor { &tr, {}, static_cast(tr.m_params.m_types.size()) }; @@ -92,7 +92,7 @@ namespace { if(t.m_data.is_Path() && t.m_data.as_Path().path.m_data.is_UfcsKnown()) { const auto& pe = t.m_data.as_Path().path.m_data.as_UfcsKnown(); DEBUG("t=" << t); - if( *pe.type == ::HIR::TypeRef("Self", 0xFFFF) /*&& pe.trait == trait_path*/ ) { + if( *pe.type == ::HIR::TypeRef("Self", 0xFFFF) /*&& pe.trait == trait_path*/ && tr.m_type_indexes.count(pe.item) ) { // Replace with a new type param, need to know the index of it o = ::HIR::TypeRef("a#"+pe.item, tr.m_type_indexes.at(pe.item)); return true; -- cgit v1.2.3