From 993fc7a94a3aa2d8f59b59b0f0e30a282c5fa433 Mon Sep 17 00:00:00 2001 From: John Hodge Date: Fri, 10 Mar 2017 22:47:25 +0800 Subject: MIR Helpers - get_const_type defer TODO --- src/mir/helpers.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/mir/helpers.cpp b/src/mir/helpers.cpp index 9c2107ab..9dac1567 100644 --- a/src/mir/helpers.cpp +++ b/src/mir/helpers.cpp @@ -252,14 +252,17 @@ const ::HIR::TypeRef& ::MIR::TypeResolve::get_lvalue_type(::HIR::TypeRef& tmp, c auto v = m_resolve.get_value(this->sp, e.p, p, /*signature_only=*/true); if( const auto* ve = v.opt_Constant() ) { const auto& ty = (*ve)->m_type; - MIR_TODO(*this, "Monomorphise type " << ty); + if( monomorphise_type_needed(ty) ) + MIR_TODO(*this, "get_const_type - Monomorphise type " << ty); + else + return ty.clone(); } else { - MIR_BUG(*this, ""); + MIR_BUG(*this, "get_const_type - Not a constant"); } ), (ItemAddr, - MIR_TODO(*this, "Get type for constant `" << c << "`"); + MIR_TODO(*this, "get_const_type - Get type for constant `" << c << "`"); ) ) throw ""; -- cgit v1.2.3