From b439fff0adca76dbe1f9b3d3218d8f710f282fc2 Mon Sep 17 00:00:00 2001 From: John Hodge Date: Wed, 6 Jul 2016 00:05:39 +0800 Subject: HIR Typecheck CS - Type possibility from src->dst of borrow --- src/hir_typeck/expr_cs.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/hir_typeck/expr_cs.cpp b/src/hir_typeck/expr_cs.cpp index c304654b..7bbfb847 100644 --- a/src/hir_typeck/expr_cs.cpp +++ b/src/hir_typeck/expr_cs.cpp @@ -2030,6 +2030,14 @@ namespace { return false; ) + TU_IFLET(::HIR::TypeRef::Data, ty_dst.m_data, Infer, l_e, + if( l_e.ty_class == ::HIR::InferClass::None ) { + context.possible_equate_type(l_e.index, ty_src); + return false; + } + // - Otherwise, it could be a deref? + ) + // Deref coercions { ::HIR::TypeRef tmp_ty; @@ -2064,7 +2072,7 @@ namespace { } // Either ran out of deref, or hit a _ } - + // - If `right`: ::core::marker::Unsize<`left`> // - If left can be dereferenced to right // - If left is a slice, right can unsize/deref (Defunct?) -- cgit v1.2.3