diff options
author | John Hodge <tpg@mutabah.net> | 2016-11-17 16:08:53 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2016-11-17 16:08:53 +0800 |
commit | 6f7f5a39f7ebf8d16000ef2538178dea72161a5b (patch) | |
tree | fd8ec2c183c9228c6f646d66fce18cfd3e824cc1 /src/resolve | |
parent | 5b8b5da9ac7ca950cc700e6a27f7897e4b753c18 (diff) | |
download | mrust-6f7f5a39f7ebf8d16000ef2538178dea72161a5b.tar.gz |
Resolve - Fix scoping of `if let` bindings
Diffstat (limited to 'src/resolve')
-rw-r--r-- | src/resolve/absolute.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/resolve/absolute.cpp b/src/resolve/absolute.cpp index 60b6c193..c78554a7 100644 --- a/src/resolve/absolute.cpp +++ b/src/resolve/absolute.cpp @@ -1612,15 +1612,16 @@ void Resolve_Absolute_ExprNode(Context& context, ::AST::ExprNode& node) void visit(AST::ExprNode_IfLet& node) override { DEBUG("ExprNode_IfLet"); node.m_value->visit( *this ); + this->context.push_block(); Resolve_Absolute_Pattern(this->context, true, node.m_pattern); assert( node.m_true ); node.m_true->visit( *this ); + this->context.pop_block(); + if(node.m_false) node.m_false->visit(*this); - - this->context.pop_block(); } void visit(AST::ExprNode_StructLiteral& node) override { DEBUG("ExprNode_StructLiteral"); |