Index: src/Tuples/TupleExpansion.cc
===================================================================
--- src/Tuples/TupleExpansion.cc	(revision bf32bb8a6509388bf221983b0b4c4c8620ff76b9)
+++ src/Tuples/TupleExpansion.cc	(revision f0121d7b1fdcae6c3362d9920d387c2a83a180d7)
@@ -28,4 +28,5 @@
 #include "Common/ScopedMap.h"
 #include "ResolvExpr/typeops.h"
+#include "InitTweak/GenInit.h"
 
 namespace Tuples {
@@ -133,5 +134,7 @@
 			return tupleExpr;
 		} else {
-			return memberExpr;
+			// there may be a tuple expr buried in the aggregate
+			// xxx - this is a memory leak
+			return new UntypedMemberExpr( memberExpr->get_member()->clone(), memberExpr->get_aggregate()->acceptMutator( *this ) );
 		}
 	}
@@ -142,8 +145,27 @@
 		if ( ! decls.count( unqExpr->get_id() ) ) {
 			// xxx - it's possible (likely?) that expressions can appear in the wrong order because of this. Need to ensure they're placed in the correct location.
-			// xxx - is it possible to make the decl's type const?
-			ObjectDecl * decl = new ObjectDecl( tempNamer.newName(), DeclarationNode::NoStorageClass, LinkageSpec::Cforall, nullptr, unqExpr->get_result()->clone(), new SingleInit( unqExpr->get_expr()->clone() ) );
-			decls[unqExpr->get_id()] = decl;
-			addDeclaration( decl );
+
+			// xxx - this doesn't work, because it would need to be placed after fixInit, but fixInit doesn't know (and shouldn't have to know) about the existance of UniqueExprs - i.e. it will visit them twice
+			// need to construct/destruct unique exprs in general - maybe it's not worth it and fixInit should handle UniqueExpr explicitly?
+			// currently, tmp is being destructed before unqExpr is used, which suggests there should be a separate lifetime for unqExpr from the tmp_ret
+
+			// if ( CommaExpr * commaExpr = dynamic_cast< CommaExpr * >( unqExpr->get_expr() ) ) {
+			// 	if ( VariableExpr * varExpr = dynamic_cast< VariableExpr * >( commaExpr->get_arg2() ) ) {
+			// 		// steal existing decl from expr
+			// 		if ( ObjectDecl * decl = dynamic_cast< ObjectDecl * >( varExpr->get_var() ) ) {
+			// 			decls[unqExpr->get_id()] = decl;
+			// 			return unqExpr->get_expr()->clone();
+			// 		}
+			// 	}
+			// }
+
+			// xxx - attach a resolved ConstructorInit node?
+			// xxx - is it possible to make the objDecl's type const?
+			ObjectDecl * objDecl = new ObjectDecl( tempNamer.newName(), DeclarationNode::NoStorageClass, LinkageSpec::Cforall, nullptr, unqExpr->get_result()->clone(), nullptr );
+			// must be done on two lines because genCtorInit accesses objDecl's fields
+			objDecl->set_init( InitTweak::genCtorInit( objDecl ) );
+
+			decls[unqExpr->get_id()] = objDecl;
+			addDeclaration( objDecl );
 		}
 		return new VariableExpr( decls[unqExpr->get_id()] );
