From f9c65798a26800cb2a24f827bcf8943e4a68775a Mon Sep 17 00:00:00 2001 From: John Hodge Date: Thu, 7 Jul 2016 05:44:51 +1000 Subject: HIR Typecheck CS - Remove coercion if types are equal --- src/hir_typeck/expr_cs.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/hir_typeck/expr_cs.cpp b/src/hir_typeck/expr_cs.cpp index 789f8509..d0f15d10 100644 --- a/src/hir_typeck/expr_cs.cpp +++ b/src/hir_typeck/expr_cs.cpp @@ -2312,6 +2312,10 @@ namespace { const auto& ty_r = context.m_ivars.get_type(node_ptr->m_res_type); TRACE_FUNCTION_F(v << " - " << ty << " := " << ty_r); + if( context.m_ivars.types_equal(ty, ty_r) ) { + return true; + } + // TODO: CoerceUnsized trait // 1. Check that the source type can coerce -- cgit v1.2.3