From 606c701bca379038568921aec6f216fa69b7a580 Mon Sep 17 00:00:00 2001 From: John Hodge Date: Wed, 3 Aug 2016 21:14:42 +0800 Subject: Expand Derive - Working extra bounds --- src/expand/derive.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/expand/derive.cpp b/src/expand/derive.cpp index 3ee0772b..3e2bdabd 100644 --- a/src/expand/derive.cpp +++ b/src/expand/derive.cpp @@ -162,13 +162,16 @@ struct Deriver (Local, ), (Relative, - // Check if the first node of a relative is a generic param. - for(const auto& typ : params.ty_params()) + if( pe.nodes.size() > 1 ) { - if( pe.nodes.front().name() == typ.name() ) + // Check if the first node of a relative is a generic param. + for(const auto& typ : params.ty_params()) { - add_field_bound(out_list, ty); - break ; + if( pe.nodes.front().name() == typ.name() ) + { + add_field_bound(out_list, ty); + break ; + } } } H::visit_nodes(*this, params, out_list, pe.nodes); -- cgit v1.2.3