summaryrefslogtreecommitdiff
path: root/src/hir/from_ast.cpp
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2016-05-29 21:41:05 +0800
committerJohn Hodge <tpg@mutabah.net>2016-05-29 21:41:05 +0800
commit73bcd2fb0bda8f939a6c1385b419a67ad8eeef2c (patch)
tree5c397d572cd5ddfb0a7d55c35ff430f73e6073a5 /src/hir/from_ast.cpp
parentfd9b01b2d8b1efb4f7f95a72af4eeff2fae2a576 (diff)
downloadmrust-73bcd2fb0bda8f939a6c1385b419a67ad8eeef2c.tar.gz
HIR Typecheck - Expression inference coming along
Diffstat (limited to 'src/hir/from_ast.cpp')
-rw-r--r--src/hir/from_ast.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/hir/from_ast.cpp b/src/hir/from_ast.cpp
index 8f306957..a3584663 100644
--- a/src/hir/from_ast.cpp
+++ b/src/hir/from_ast.cpp
@@ -8,6 +8,7 @@
::HIR::Module LowerHIR_Module(const ::AST::Module& module, ::HIR::SimplePath path);
::HIR::Function LowerHIR_Function(const ::AST::Function& f);
+::HIR::SimplePath LowerHIR_SimplePath(const Span& sp, const ::AST::Path& path, bool allow_final_generic = false);
// --------------------------------------------------------------------
::HIR::GenericParams LowerHIR_GenericParams(const ::AST::GenericParams& gp)
@@ -330,7 +331,7 @@
}
}
-::HIR::SimplePath LowerHIR_SimplePath(const ::AST::Path& path, bool allow_final_generic = false)
+::HIR::SimplePath LowerHIR_SimplePath(const Span& sp, const ::AST::Path& path, bool allow_final_generic)
{
TU_IFLET(::AST::Path::Class, path.m_class, Absolute, e,
::HIR::SimplePath rv( e.crate );
@@ -357,7 +358,7 @@
::HIR::GenericPath LowerHIR_GenericPath(const Span& sp, const ::AST::Path& path)
{
TU_IFLET(::AST::Path::Class, path.m_class, Absolute, e,
- auto sp = LowerHIR_SimplePath(path, true);
+ auto simpepath = LowerHIR_SimplePath(sp, path, true);
::HIR::PathParams params;
const auto& src_params = e.nodes.back().args();
//for(const auto& param : src_params.m_lifetimes) {
@@ -366,7 +367,7 @@
params.m_types.push_back( LowerHIR_Type(param) );
}
// TODO: Lifetime params (not encoded in AST::PathNode as yet)
- auto rv = ::HIR::GenericPath(mv$(sp), mv$(params));
+ auto rv = ::HIR::GenericPath(mv$(simpepath), mv$(params));
DEBUG(path << " => " << rv);
return rv;
)