From 01855eb0d44ca9b30f8a4a9604dadfa9eb55e218 Mon Sep 17 00:00:00 2001 From: John Hodge Date: Thu, 7 Jul 2016 19:10:10 +1000 Subject: HIR Type - Mark the same ivar as being the Equal --- src/hir/type.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/hir/type.cpp b/src/hir/type.cpp index 70ce2599..3bdff34e 100644 --- a/src/hir/type.cpp +++ b/src/hir/type.cpp @@ -515,6 +515,11 @@ bool ::HIR::TypeRef::match_test_generics(const Span& sp, const ::HIR::TypeRef& x //const auto& left = *this; const auto& right = (x.m_data.is_Infer() ? resolve_placeholder(x) : (x.m_data.is_Generic() ? resolve_placeholder(x) : x)); + // If the two types are the same ivar, return equal + if( left.m_data.is_Infer() && left == right ) { + return Compare::Equal; + } + // If left is infer TU_IFLET(::HIR::TypeRef::Data, left.m_data, Infer, e, switch(e.ty_class) -- cgit v1.2.3