Index: src/Tuples/TupleAssignment.cc
===================================================================
--- src/Tuples/TupleAssignment.cc	(revision b8baa37eb2d4983aa6519224b93c9a92306453af)
+++ src/Tuples/TupleAssignment.cc	(revision 938dd75cd0a06438ce8f54625e62e2550e7537f0)
@@ -281,12 +281,17 @@
 	}
 
-	// removes environments from subexpressions within statement exprs, which could throw off later passes like those in Box which rely on PolyMutator.
+	// removes environments from subexpressions within statement exprs, which could throw off later passes like those in Box which rely on PolyMutator, and adds the bindings to the compositeEnv
 	// xxx - maybe this should happen in alternative finder for every StmtExpr?
-	// xxx - it's possible that these environments could contain some useful information. Maybe the right thing to do is aggregate the environments and pass the aggregate back to be added into the compositeEnv
 	struct EnvRemover {
 		void previsit( ExprStmt * stmt ) {
-			delete stmt->expr->env;
-			stmt->expr->env = nullptr;
-		}
+			assert( compositeEnv );
+			if ( stmt->expr->env ) {
+				compositeEnv->add( *stmt->expr->env );
+				delete stmt->expr->env;
+				stmt->expr->env = nullptr;
+			}
+		}
+
+		ResolvExpr::TypeEnvironment * compositeEnv = nullptr;
 	};
 
@@ -300,4 +305,5 @@
 			ResolvExpr::resolveCtorInit( ctorInit, spotter.currentFinder.get_indexer() ); // resolve ctor/dtors for the new object
 			PassVisitor<EnvRemover> rm; // remove environments from subexpressions of StmtExprs
+			rm.pass.compositeEnv = &compositeEnv;
 			ctorInit->accept( rm );
 		}
