From 5be815dca4df26239a338cc127c9181a4cdf0de7 Mon Sep 17 00:00:00 2001 From: John Hodge Date: Tue, 8 Nov 2016 15:17:09 +0800 Subject: HIR Const Eval - MIR Constant::Const --- src/hir_conv/constant_evaluation.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/hir_conv/constant_evaluation.cpp b/src/hir_conv/constant_evaluation.cpp index 412ae2d3..72c7eb34 100644 --- a/src/hir_conv/constant_evaluation.cpp +++ b/src/hir_conv/constant_evaluation.cpp @@ -619,6 +619,9 @@ namespace { ( ERROR(sp, E0000, "Field access on invalid type - " << m_rv_type); ), + (Path, + TODO(sp, "Field access on path type - " << m_rv_type); + ), (Tuple, unsigned int idx = ::std::atoi( node.m_field.c_str() ); ASSERT_BUG(sp, idx < e.size(), "Index out of range in tuple"); @@ -941,7 +944,9 @@ namespace { val = ::HIR::Literal(e2); ), (Const, - TODO(sp, "Constant::Const - " << e); + auto ent = get_ent_fullpath(sp, crate, e2.p, EntNS::Value); + ASSERT_BUG(sp, ent.is_Constant(), "MIR Constant::Const("<m_value_res ); ), (ItemAddr, val = ::HIR::Literal::make_BorrowOf( e2.clone() ); -- cgit v1.2.3