From 56bb288ca62d4e219b8349e26dbbe531dcc977d2 Mon Sep 17 00:00:00 2001 From: John Hodge Date: Sun, 10 Jul 2016 21:09:02 +1000 Subject: HIR Typecheck - Use Deref impl in autoderef --- src/hir_typeck/helpers.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/hir_typeck/helpers.cpp b/src/hir_typeck/helpers.cpp index 40011a7a..e06aa296 100644 --- a/src/hir_typeck/helpers.cpp +++ b/src/hir_typeck/helpers.cpp @@ -1870,11 +1870,11 @@ const ::HIR::TypeRef* TraitResolution::autoderef(const Span& sp, const ::HIR::Ty else { bool succ = this->find_trait_impls(sp, this->m_crate.get_lang_item_path(sp, "deref"), ::HIR::PathParams {}, ty, [&](const auto&, const auto& args, const auto& types) { assert(args.m_types.size() == 0); - // TODO: Use `types` + tmp_type = types.at("Target").clone(); return true; }); if( succ ) { - TODO(sp, "Found a Deref impl for " << ty << ", use the output of it"); + return &tmp_type; } else { return nullptr; -- cgit v1.2.3