diff options
author | John Hodge <tpg@mutabah.net> | 2016-06-07 15:20:48 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2016-06-07 15:20:48 +0800 |
commit | 2d7d7d8571a788ca43439a5d75df818eaa8dd5d3 (patch) | |
tree | 7eaf71a1a3a970a7e8e6715e2b754184ea3191b4 /src/hir/expr.hpp | |
parent | d21eaed77240158885c2e22c436bc17053a9cd1d (diff) | |
download | mrust-2d7d7d8571a788ca43439a5d75df818eaa8dd5d3.tar.gz |
HIR - Add literal annotation to TypeRef::Data::Infer
Diffstat (limited to 'src/hir/expr.hpp')
-rw-r--r-- | src/hir/expr.hpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/hir/expr.hpp b/src/hir/expr.hpp index eb1b43a5..bd952348 100644 --- a/src/hir/expr.hpp +++ b/src/hir/expr.hpp @@ -392,11 +392,17 @@ struct ExprNode_Literal: if( e.m_type != ::HIR::CoreType::Str ) { m_res_type = ::HIR::TypeRef::Data::make_Primitive(e.m_type); } + else { + m_res_type.m_data.as_Infer().ty_class = ::HIR::InferClass::Integer; + } ), (Float, if( e.m_type != ::HIR::CoreType::Str ) { m_res_type = ::HIR::TypeRef::Data::make_Primitive(e.m_type); } + else { + m_res_type.m_data.as_Infer().ty_class = ::HIR::InferClass::Float; + } ), (Boolean, m_res_type = ::HIR::TypeRef::Data::make_Primitive( ::HIR::CoreType::Bool ); |