From 46e659ed150e39386fc2eb1c7caa870b8c1c4458 Mon Sep 17 00:00:00 2001 From: John Hodge Date: Wed, 6 Jul 2016 00:11:26 +0800 Subject: HIR Typecheck CS - Ignore CoerceUnsized for now --- src/hir_typeck/expr_cs.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/hir_typeck/expr_cs.cpp b/src/hir_typeck/expr_cs.cpp index 7bbfb847..0135475a 100644 --- a/src/hir_typeck/expr_cs.cpp +++ b/src/hir_typeck/expr_cs.cpp @@ -2084,6 +2084,8 @@ namespace { const auto& ty = context.m_ivars.get_type(v.left_ty); const auto& ty_r = context.m_ivars.get_type(node_ptr->m_res_type); + // TODO: CoerceUnsized trait + // 1. Check that the source type can coerce TU_MATCH( ::HIR::TypeRef::Data, (ty_r.m_data), (e), (Infer, @@ -2100,10 +2102,14 @@ namespace { return true; ), (Path, - TODO(Span(), "check_coerce - Coercion from " << ty_r); + //TODO(Span(), "check_coerce - Coercion from " << ty_r); + context.equate_types(sp, ty, node_ptr->m_res_type); + return true; ), (Generic, - TODO(Span(), "check_coerce - Coercion from " << ty_r); + //TODO(Span(), "check_coerce - Coercion from " << ty_r); + context.equate_types(sp, ty, node_ptr->m_res_type); + return true; ), (TraitObject, // TODO: Can bare trait objects coerce? -- cgit v1.2.3