diff options
author | John Hodge <tpg@mutabah.net> | 2016-06-08 14:31:34 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2016-06-08 14:31:34 +0800 |
commit | 9db1983ed557ccc99d33b07cc1be75ee3f5b303d (patch) | |
tree | 632d3436bad2299227cedac755208565a08b4367 /src/hir/from_ast_expr.cpp | |
parent | 5961266133f5e0cbcd57403021086c788d732ec1 (diff) | |
download | mrust-9db1983ed557ccc99d33b07cc1be75ee3f5b303d.tar.gz |
HIR - Move tuple struct/enum construtors to their on HIR node
- This makes typeck of those invocations easier
Diffstat (limited to 'src/hir/from_ast_expr.cpp')
-rw-r--r-- | src/hir/from_ast_expr.cpp | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/src/hir/from_ast_expr.cpp b/src/hir/from_ast_expr.cpp index 40f27d5a..742a4fed 100644 --- a/src/hir/from_ast_expr.cpp +++ b/src/hir/from_ast_expr.cpp @@ -224,10 +224,26 @@ struct LowerHIR_ExprNode_Visitor: ) else { - m_rv.reset( new ::HIR::ExprNode_CallPath( v.span(), - LowerHIR_Path(Span(v.get_pos()), v.m_path), - mv$( args ) - ) ); + TU_MATCH_DEF(::AST::PathBinding, (v.m_path.binding()), (e), + ( + m_rv.reset( new ::HIR::ExprNode_CallPath( v.span(), + LowerHIR_Path(Span(v.get_pos()), v.m_path), + mv$( args ) + ) ); + ), + (EnumVar, + m_rv.reset( new ::HIR::ExprNode_TupleVariant( v.span(), + LowerHIR_GenericPath(v.span(), v.m_path), false, + mv$( args ) + ) ); + ), + (Struct, + m_rv.reset( new ::HIR::ExprNode_TupleVariant( v.span(), + LowerHIR_GenericPath(v.span(), v.m_path), true, + mv$( args ) + ) ); + ) + ) } } virtual void visit(::AST::ExprNode_CallMethod& v) override { |