diff options
author | John Hodge <tpg@mutabah.net> | 2016-12-10 16:17:02 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2016-12-10 16:17:02 +0800 |
commit | 23af1651d3ac05597da74c38dead7dfb8422080f (patch) | |
tree | dafc9beca7c498a7f266ed0aa040f2682461402e /src/hir/dump.cpp | |
parent | 8ac4ecece4d545ab3cd01c6ab156d375abe46247 (diff) | |
download | mrust-23af1651d3ac05597da74c38dead7dfb8422080f.tar.gz |
HIR ConstEval - Do basic type inferrence so created statics have correct types
Diffstat (limited to 'src/hir/dump.cpp')
-rw-r--r-- | src/hir/dump.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/hir/dump.cpp b/src/hir/dump.cpp index 853d62f1..e8d5c04a 100644 --- a/src/hir/dump.cpp +++ b/src/hir/dump.cpp @@ -242,6 +242,10 @@ namespace { { m_os << indent() << "static " << p.get_name() << ": " << item.m_type << " = " << item.m_value_res << ";\n"; } + else if( !item.m_value_res.is_Invalid() ) + { + m_os << indent() << "static " << p.get_name() << ": " << item.m_type << " = /*magic*/ " << item.m_value_res << ";\n"; + } else { m_os << indent() << "extern static " << p.get_name() << ": " << item.m_type << ";\n"; |