From 59cfce08eb46088f6fd1d4049cc8c7dbce355374 Mon Sep 17 00:00:00 2001 From: John Hodge Date: Sun, 5 Apr 2015 11:33:57 +0800 Subject: Tag params with source, rewrite find_impl to return boolean --- src/types.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/types.cpp') diff --git a/src/types.cpp b/src/types.cpp index 9d2e42d4..1925e579 100644 --- a/src/types.cpp +++ b/src/types.cpp @@ -378,8 +378,16 @@ Ordering TypeRef::ord(const TypeRef& x) const } return OrdEqual; case TypeRef::GENERIC: - DEBUG(*this << " == " << x); - throw ::std::runtime_error("BUGCHECK - Can't compare generic type"); + if( m_tagged_ptr != x.m_tagged_ptr ) + { + DEBUG(*this << " == " << x); + if( m_tagged_ptr ) DEBUG("- (L) " << *type_params_ptr()); + if( x.m_tagged_ptr ) DEBUG("- (R) " << *x.type_params_ptr()); + throw ::std::runtime_error("BUGCHECK - Can't compare mismatched generic types"); + } + else { + } + return m_path.ord( x.m_path ); case TypeRef::PATH: return m_path.ord( x.m_path ); case TypeRef::MULTIDST: -- cgit v1.2.3