From cbb7c1b5c7e3539340a6e4f04d521b2f9564b526 Mon Sep 17 00:00:00 2001 From: John Hodge Date: Fri, 20 May 2016 16:32:54 +0800 Subject: Resolve - Fix bug in type replacement --- src/resolve/absolute.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/resolve/absolute.cpp b/src/resolve/absolute.cpp index a41ef04a..7de8499d 100644 --- a/src/resolve/absolute.cpp +++ b/src/resolve/absolute.cpp @@ -747,7 +747,8 @@ void Resolve_Absolute_Type(Context& context, TypeRef& type) Resolve_Absolute_Path(context, type.span(), Context::LookupMode::Type, e.path); TU_IFLET(::AST::Path::Class, e.path.m_class, UFCS, ufcs, if( ufcs.nodes.size() == 0 && ! ufcs.trait ) { - type = mv$(*ufcs.type); + auto ty = mv$(*ufcs.type); + type = mv$(ty); return ; } assert( ufcs.nodes.size() == 1); @@ -840,9 +841,10 @@ void Resolve_Absolute_Expr(Context& context, ::AST::ExprNode& node) case ::AST::ExprNode_Loop::WHILE: break; case ::AST::ExprNode_Loop::WHILELET: - case ::AST::ExprNode_Loop::FOR: Resolve_Absolute_Pattern(this->context, true, node.m_pattern); break; + case ::AST::ExprNode_Loop::FOR: + BUG(node.get_pos(), "`for` should be desugared"); } node.m_code->visit( *this ); this->context.pop_block(); -- cgit v1.2.3