diff options
author | John Hodge <tpg@mutabah.net> | 2016-05-20 16:32:54 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2016-05-20 16:32:54 +0800 |
commit | cbb7c1b5c7e3539340a6e4f04d521b2f9564b526 (patch) | |
tree | 49a548d2dbcb36961c21ba4cce40e9a059021cb8 /src | |
parent | edc9df13c48e6358518f66153cce7e8cfca28a2b (diff) | |
download | mrust-cbb7c1b5c7e3539340a6e4f04d521b2f9564b526.tar.gz |
Resolve - Fix bug in type replacement
Diffstat (limited to 'src')
-rw-r--r-- | src/resolve/absolute.cpp | 6 |
1 files 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(); |