diff options
author | John Hodge <tpg@mutabah.net> | 2016-07-07 19:10:10 +1000 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2016-07-07 19:10:10 +1000 |
commit | 01855eb0d44ca9b30f8a4a9604dadfa9eb55e218 (patch) | |
tree | 3f821cec7f2228abfb43129e553bd70dbbd23350 | |
parent | 15af300790fab5663f480aca06887062e7517604 (diff) | |
download | mrust-01855eb0d44ca9b30f8a4a9604dadfa9eb55e218.tar.gz |
HIR Type - Mark the same ivar as being the Equal
-rw-r--r-- | src/hir/type.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
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) |