diff options
Diffstat (limited to 'src/hir/hir.cpp')
-rw-r--r-- | src/hir/hir.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/hir/hir.cpp b/src/hir/hir.cpp index 8f35ba0c..c2ad4d00 100644 --- a/src/hir/hir.cpp +++ b/src/hir/hir.cpp @@ -73,14 +73,21 @@ namespace { } throw ""; } - if( right.m_data.is_Generic() ) { - return left.m_data.is_Generic(); - } + // A local generic could match anything, leave that up to the caller if( left.m_data.is_Generic() ) { - // True? (TODO: Check bounds?) return true; } + // A local UfcsKnown can only be becuase it couldn't be expanded earlier, assume it could match + if( left.m_data.is_Path() && left.m_data.as_Path().path.m_data.is_UfcsKnown() ) { + // True? + return true; + } + + // If the RHS (provided) is generic, it can only match if it binds to a local type parameter + if( right.m_data.is_Generic() ) { + return left.m_data.is_Generic(); + } if( left.m_data.tag() != right.m_data.tag() ) { return false; |