From f54b532f00e183dc0250435acdff3beec5d7ae51 Mon Sep 17 00:00:00 2001 From: John Hodge Date: Sun, 11 Dec 2016 22:32:12 +0800 Subject: HIR Const Eval - Split into two passes to have correct types in literals --- src/mir/cleanup.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/mir/cleanup.cpp') diff --git a/src/mir/cleanup.cpp b/src/mir/cleanup.cpp index c5a8c5b9..4268b288 100644 --- a/src/mir/cleanup.cpp +++ b/src/mir/cleanup.cpp @@ -74,6 +74,8 @@ const ::HIR::Literal* MIR_Cleanup_GetConstant(const Span& sp, const StaticTraitR if( pe.m_params.m_types.size() != 0 ) TODO(sp, "Generic constants - " << path); out_ty = constant.m_type.clone(); + if( constant.m_value_res.is_Invalid() ) + return nullptr; return &constant.m_value_res; ), (UfcsUnknown, -- cgit v1.2.3