diff options
-rw-r--r-- | src/hir_typeck/expr_check.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/hir_typeck/expr_check.cpp b/src/hir_typeck/expr_check.cpp index 7b6b3705..f8cd8202 100644 --- a/src/hir_typeck/expr_check.cpp +++ b/src/hir_typeck/expr_check.cpp @@ -545,9 +545,16 @@ namespace { } void check_types_equal(const Span& sp, const ::HIR::TypeRef& l, const ::HIR::TypeRef& r) const { - if( l != r ) { + if( l.m_data.is_Diverge() || r.m_data.is_Diverge() ) { + // Diverge, matches everything. + // TODO: Is this always true? + } + else if( l != r ) { ERROR(sp, E0000, "Type mismatch - " << l << " != " << r); } + else { + // All good + } } void check_associated_type(const Span& sp, const ::HIR::TypeRef& res, |