From dd4a3eca5f6ff81e728c550015a6735f2ff42c99 Mon Sep 17 00:00:00 2001 From: John Hodge Date: Mon, 10 Oct 2016 14:48:30 +0800 Subject: HIR Typecheck Expr - Allow merge over ! ivar --- src/hir_typeck/helpers.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/hir_typeck/helpers.cpp b/src/hir_typeck/helpers.cpp index a7573301..727e41ba 100644 --- a/src/hir_typeck/helpers.cpp +++ b/src/hir_typeck/helpers.cpp @@ -522,7 +522,7 @@ void HMTypeInferrence::set_ivar_to(unsigned int slot, ::HIR::TypeRef type) (Infer, // Check for right having a ty_class if( e.ty_class != ::HIR::InferClass::None && e.ty_class != l_e.ty_class ) { - ERROR(sp, E0000, "Unifying types with mismatching literal classes"); + ERROR(sp, E0000, "Unifying types with mismatching literal classes - " << type << " := " << *root_ivar.type); } ) ) @@ -588,7 +588,7 @@ void HMTypeInferrence::ivar_unify(unsigned int left_slot, unsigned int right_slo auto& root_ivar = this->get_pointed_ivar(right_slot); TU_IFLET(::HIR::TypeRef::Data, root_ivar.type->m_data, Infer, re, - if(re.ty_class != ::HIR::InferClass::None) { + if(re.ty_class != ::HIR::InferClass::None && re.ty_class != ::HIR::InferClass::Diverge) { TU_MATCH_DEF(::HIR::TypeRef::Data, (left_ivar.type->m_data), (le), ( ERROR(sp, E0000, "Type unificiation of literal with invalid type - " << *left_ivar.type); @@ -596,7 +596,7 @@ void HMTypeInferrence::ivar_unify(unsigned int left_slot, unsigned int right_slo (Infer, if( le.ty_class != ::HIR::InferClass::None && le.ty_class != re.ty_class ) { - ERROR(sp, E0000, "Unifying types with mismatching literal classes"); + ERROR(sp, E0000, "Unifying types with mismatching literal classes - " << *left_ivar.type << " := " << *root_ivar.type); } le.ty_class = re.ty_class; ), -- cgit v1.2.3