diff options
author | John Hodge <tpg@ucc.asn.au> | 2019-04-20 11:50:34 +0800 |
---|---|---|
committer | John Hodge <tpg@ucc.asn.au> | 2019-04-20 11:50:34 +0800 |
commit | 7dca0b4a6ff1158edf1ab17772e96bab488c1b32 (patch) | |
tree | 107a4bce0e0cb8c4bc81325acfa107e24ffbb1ec /src/hir/type.cpp | |
parent | b82f4f8d88fc533b75cb552dad39f49fad164c49 (diff) | |
download | mrust-7dca0b4a6ff1158edf1ab17772e96bab488c1b32.tar.gz |
HIR Typecheck - Bulk commit of typecheck fixes, less magic
Diffstat (limited to 'src/hir/type.cpp')
-rw-r--r-- | src/hir/type.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/hir/type.cpp b/src/hir/type.cpp index ff4742e6..ccd5cd21 100644 --- a/src/hir/type.cpp +++ b/src/hir/type.cpp @@ -789,6 +789,20 @@ bool ::HIR::TypeRef::match_test_generics(const Span& sp, const ::HIR::TypeRef& x assert(!"Fell off end of clone_binding"); throw ""; } +bool HIR::TypeRef::TypePathBinding::operator==(const HIR::TypeRef::TypePathBinding& x) const +{ + if( this->tag() != x.tag() ) + return false; + TU_MATCH(::HIR::TypeRef::TypePathBinding, (*this, x), (te, xe), + (Unbound, return true;), + (Opaque, return true;), + (ExternType, return te == xe;), + (Struct, return te == xe;), + (Union , return te == xe;), + (Enum , return te == xe;) + ) + throw ""; +} ::HIR::TypeRef HIR::TypeRef::clone() const |