support decayed tuple expression as left value

This commit is contained in:
Lu Guanqun
2016-01-04 16:11:36 +08:00
parent 6b711d0527
commit 568da11369
2 changed files with 10 additions and 2 deletions
+4 -1
View File
@@ -792,7 +792,10 @@ bool TypeChecker::visit(TupleExpression const& _tuple)
}
else
types.push_back(TypePointer());
_tuple.annotation().type = make_shared<TupleType>(types);
if (components.size() == 1)
_tuple.annotation().type = type(*components[0]);
else
_tuple.annotation().type = make_shared<TupleType>(types);
// If some of the components are not LValues, the error is reported above.
_tuple.annotation().isLValue = true;
}