summaryrefslogtreecommitdiff
path: root/src/hir/expr.hpp
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2016-06-07 15:20:48 +0800
committerJohn Hodge <tpg@mutabah.net>2016-06-07 15:20:48 +0800
commit2d7d7d8571a788ca43439a5d75df818eaa8dd5d3 (patch)
tree7eaf71a1a3a970a7e8e6715e2b754184ea3191b4 /src/hir/expr.hpp
parentd21eaed77240158885c2e22c436bc17053a9cd1d (diff)
downloadmrust-2d7d7d8571a788ca43439a5d75df818eaa8dd5d3.tar.gz
HIR - Add literal annotation to TypeRef::Data::Infer
Diffstat (limited to 'src/hir/expr.hpp')
-rw-r--r--src/hir/expr.hpp6
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 );