Index: src/Tuples/TupleAssignment.cc
===================================================================
--- src/Tuples/TupleAssignment.cc	(revision 490ff5c3cdf33976fd18d953a739387a1031d3c6)
+++ src/Tuples/TupleAssignment.cc	(revision e5d4e5c501242024833e1ed47aa37fccc9f78b23)
@@ -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 );
 		}
