Index: src/CodeGen/CodeGenerator.cc
===================================================================
--- src/CodeGen/CodeGenerator.cc	(revision bb1cd95b1669c150547e9c6ca1c0ac29ffadf57a)
+++ src/CodeGen/CodeGenerator.cc	(revision 6242335009c5d2ebee1bb50d1d228f5aacb0e5bd)
@@ -292,13 +292,13 @@
 		if ( designators.size() == 0 ) return;
 		for ( Expression * des : designators ) {
-			if ( dynamic_cast< ConstantExpr * >( des ) ) {
-				// if expression is a ConstantExpr, then initializing array element
+			if ( dynamic_cast< NameExpr * >( des ) || dynamic_cast< VariableExpr * >( des ) ) {
+				// if expression is a NameExpr or VariableExpr, then initializing aggregate member
+				output << ".";
+				des->accept( *this );
+			} else {
+				// otherwise, it has to be a ConstantExpr or CastExpr, initializing array eleemnt
 				output << "[";
 				des->accept( *this );
 				output << "]";
-			} else {
-				// if not a ConstantExpr, it has to be a NameExpr or VariableExpr, initializing aggregate member
-				output << ".";
-				des->accept( *this );
 			} // if
 		} // for
Index: src/Common/PassVisitor.h
===================================================================
--- src/Common/PassVisitor.h	(revision bb1cd95b1669c150547e9c6ca1c0ac29ffadf57a)
+++ src/Common/PassVisitor.h	(revision 6242335009c5d2ebee1bb50d1d228f5aacb0e5bd)
@@ -257,15 +257,4 @@
 
 	void set_visit_children( bool& ref ) { bool_ref * ptr = visit_children_impl(pass, 0); if(ptr) ptr->set( ref ); }
-
-	guard_value_impl init_guard() {
-		guard_value_impl guard;
-		auto at_cleanup = at_cleanup_impl(pass, 0);
-		if( at_cleanup ) {
-			*at_cleanup = [&guard]( cleanup_func_t && func, void* val ) {
-				guard.push( std::move( func ), val );
-			};
-		}
-		return guard;
-	}
 };
 
Index: src/Common/PassVisitor.impl.h
===================================================================
--- src/Common/PassVisitor.impl.h	(revision bb1cd95b1669c150547e9c6ca1c0ac29ffadf57a)
+++ src/Common/PassVisitor.impl.h	(revision 6242335009c5d2ebee1bb50d1d228f5aacb0e5bd)
@@ -3,5 +3,5 @@
 #define VISIT_START( node )                     \
 	__attribute__((unused))                   \
-	const auto & guard = init_guard();        \
+	guard_value_impl guard( at_cleanup_impl(pass, 0) );       \
 	bool visit_children = true;               \
 	set_visit_children( visit_children );	\
@@ -15,5 +15,5 @@
 #define MUTATE_START( node )                    \
 	__attribute__((unused))                   \
-	const auto & guard = init_guard();        \
+	guard_value_impl guard( at_cleanup_impl(pass, 0) );       \
 	bool visit_children = true;               \
 	set_visit_children( visit_children );	\
Index: src/Common/PassVisitor.proto.h
===================================================================
--- src/Common/PassVisitor.proto.h	(revision bb1cd95b1669c150547e9c6ca1c0ac29ffadf57a)
+++ src/Common/PassVisitor.proto.h	(revision 6242335009c5d2ebee1bb50d1d228f5aacb0e5bd)
@@ -5,8 +5,15 @@
 
 typedef std::function<void( void * )> cleanup_func_t;
+typedef std::function< void( cleanup_func_t, void * ) > at_cleanup_t;
 
 class guard_value_impl {
 public:
-	guard_value_impl() = default;
+	guard_value_impl( at_cleanup_t * at_cleanup ) {
+		if( at_cleanup ) {
+			*at_cleanup = [this]( cleanup_func_t && func, void* val ) {
+				push( std::move( func ), val );
+			};
+		}
+	}
 
 	~guard_value_impl() {
@@ -33,5 +40,4 @@
 };
 
-typedef std::function< void( cleanup_func_t, void * ) > at_cleanup_t;
 
 class bool_ref {
Index: src/InitTweak/FixInit.cc
===================================================================
--- src/InitTweak/FixInit.cc	(revision bb1cd95b1669c150547e9c6ca1c0ac29ffadf57a)
+++ src/InitTweak/FixInit.cc	(revision 6242335009c5d2ebee1bb50d1d228f5aacb0e5bd)
@@ -104,5 +104,6 @@
 			typedef AddStmtVisitor Parent;
 			using Parent::visit;
-			typedef std::set< ObjectDecl * > ObjectSet;
+			// use ordered data structure to maintain ordering for set_difference and for consistent error messages
+			typedef std::list< ObjectDecl * > ObjectSet;
 			virtual void visit( CompoundStmt *compoundStmt ) override;
 			virtual void visit( DeclStmt *stmt ) override;
@@ -116,10 +117,13 @@
 
 		// debug
-		struct printSet {
-			typedef ObjDeclCollector::ObjectSet ObjectSet;
-			printSet( const ObjectSet & objs ) : objs( objs ) {}
+		template<typename ObjectSet>
+		struct PrintSet {
+			PrintSet( const ObjectSet & objs ) : objs( objs ) {}
 			const ObjectSet & objs;
 		};
-		std::ostream & operator<<( std::ostream & out, const printSet & set) {
+		template<typename ObjectSet>
+		PrintSet<ObjectSet> printSet( const ObjectSet & objs ) { return PrintSet<ObjectSet>( objs ); }
+		template<typename ObjectSet>
+		std::ostream & operator<<( std::ostream & out, const PrintSet<ObjectSet> & set) {
 			out << "{ ";
 			for ( ObjectDecl * obj : set.objs ) {
@@ -745,6 +749,6 @@
 
 						Statement * dtor = ctorInit->get_dtor();
-						objDecl->set_init( NULL );
-						ctorInit->set_ctor( NULL );
+						objDecl->set_init( nullptr );
+						ctorInit->set_ctor( nullptr );
 						ctorInit->set_dtor( nullptr );
 						if ( dtor ) {
@@ -799,14 +803,14 @@
 						} else {
 							stmtsToAddAfter.push_back( ctor );
-							objDecl->set_init( NULL );
-							ctorInit->set_ctor( NULL );
+							objDecl->set_init( nullptr );
+							ctorInit->set_ctor( nullptr );
 						}
 					} // if
 				} else if ( Initializer * init = ctorInit->get_init() ) {
 					objDecl->set_init( init );
-					ctorInit->set_init( NULL );
+					ctorInit->set_init( nullptr );
 				} else {
 					// no constructor and no initializer, which is okay
-					objDecl->set_init( NULL );
+					objDecl->set_init( nullptr );
 				} // if
 				delete ctorInit;
@@ -816,5 +820,5 @@
 
 		void ObjDeclCollector::visit( CompoundStmt * compoundStmt ) {
-			std::set< ObjectDecl * > prevVars = curVars;
+			ObjectSet prevVars = curVars;
 			Parent::visit( compoundStmt );
 			curVars = prevVars;
@@ -824,5 +828,5 @@
 			// keep track of all variables currently in scope
 			if ( ObjectDecl * objDecl = dynamic_cast< ObjectDecl * > ( stmt->get_decl() ) ) {
-				curVars.insert( objDecl );
+				curVars.push_back( objDecl );
 			} // if
 			Parent::visit( stmt );
@@ -939,9 +943,12 @@
 			)
 			if ( ! diff.empty() ) {
+				// create an auxilliary set for fast lookup -- can't make diff a set, because diff ordering should be consistent for error messages.
+				std::unordered_set<ObjectDecl *> needsDestructor( diff.begin(), diff.end() );
+
 				// go through decl ordered list of objectdecl. for each element that occurs in diff, output destructor
 				OrderedDecls ordered;
 				for ( OrderedDecls & rdo : reverseDeclOrder ) {
 					// add elements from reverseDeclOrder into ordered if they occur in diff - it is key that this happens in reverse declaration order.
-					copy_if( rdo.begin(), rdo.end(), back_inserter( ordered ), [&]( ObjectDecl * objDecl ) { return diff.count( objDecl ); } );
+					copy_if( rdo.begin(), rdo.end(), back_inserter( ordered ), [&]( ObjectDecl * objDecl ) { return needsDestructor.count( objDecl ); } );
 				} // for
 				insertDtors( ordered.begin(), ordered.end(), back_inserter( stmtsToAdd ) );
Index: src/Parser/TypeData.cc
===================================================================
--- src/Parser/TypeData.cc	(revision bb1cd95b1669c150547e9c6ca1c0ac29ffadf57a)
+++ src/Parser/TypeData.cc	(revision 6242335009c5d2ebee1bb50d1d228f5aacb0e5bd)
@@ -777,6 +777,7 @@
 TupleType * buildTuple( const TypeData * td ) {
 	assert( td->kind == TypeData::Tuple );
-	TupleType * ret = new TupleType( buildQualifiers( td ) );
-	buildTypeList( td->tuple, ret->get_types() );
+	std::list< Type * > types;
+	buildTypeList( td->tuple, types );
+	TupleType * ret = new TupleType( buildQualifiers( td ), types );
 	buildForall( td->forall, ret->get_forall() );
 	return ret;
Index: src/ResolvExpr/AlternativeFinder.cc
===================================================================
--- src/ResolvExpr/AlternativeFinder.cc	(revision bb1cd95b1669c150547e9c6ca1c0ac29ffadf57a)
+++ src/ResolvExpr/AlternativeFinder.cc	(revision 6242335009c5d2ebee1bb50d1d228f5aacb0e5bd)
@@ -809,4 +809,30 @@
 	}
 
+	Expression * restructureCast( Expression * argExpr, Type * toType ) {
+		if ( argExpr->get_result()->size() > 1 && ! toType->isVoid() ) {
+			// Argument expression is a tuple and the target type is not void. Cast each member of the tuple
+			// to its corresponding target type, producing the tuple of those cast expressions. If there are
+			// more components of the tuple than components in the target type, then excess components do not
+			// come out in the result expression (but UniqueExprs ensure that side effects will still be done).
+			if ( Tuples::maybeImpure( argExpr ) && ! dynamic_cast< UniqueExpr * >( argExpr ) ) {
+				// expressions which may contain side effects require a single unique instance of the expression.
+				argExpr = new UniqueExpr( argExpr );
+			}
+			std::list< Expression * > componentExprs;
+			for ( unsigned int i = 0; i < toType->size(); i++ ) {
+				// cast each component
+				TupleIndexExpr * idx = new TupleIndexExpr( argExpr->clone(), i );
+				componentExprs.push_back( restructureCast( idx, toType->getComponent( i ) ) );
+			}
+			delete argExpr;
+			assert( componentExprs.size() > 0 );
+			// produce the tuple of casts
+			return new TupleExpr( componentExprs );
+		} else {
+			// handle normally
+			return new CastExpr( argExpr, toType->clone() );
+		}
+	}
+
 	void AlternativeFinder::visit( CastExpr *castExpr ) {
 		Type *& toType = castExpr->get_result();
@@ -840,28 +866,5 @@
 				thisCost += Cost( 0, 0, discardedValues );
 
-				Expression * argExpr = i->expr->clone();
-				if ( argExpr->get_result()->size() > 1 && ! castExpr->get_result()->isVoid() ) {
-					// Argument expression is a tuple and the target type is not void. Cast each member of the tuple
-					// to its corresponding target type, producing the tuple of those cast expressions. If there are
-					// more components of the tuple than components in the target type, then excess components do not
-					// come out in the result expression (but UniqueExprs ensure that side effects will still be done).
-					if ( Tuples::maybeImpure( argExpr ) && ! dynamic_cast< UniqueExpr * >( argExpr ) ) {
-						// expressions which may contain side effects require a single unique instance of the expression.
-						argExpr = new UniqueExpr( argExpr );
-					}
-					std::list< Expression * > componentExprs;
-					for ( unsigned int i = 0; i < castExpr->get_result()->size(); i++ ) {
-						// cast each component
-						TupleIndexExpr * idx = new TupleIndexExpr( argExpr->clone(), i );
-						componentExprs.push_back( new CastExpr( idx, castExpr->get_result()->getComponent( i )->clone() ) );
-					}
-					delete argExpr;
-					assert( componentExprs.size() > 0 );
-					// produce the tuple of casts
-					candidates.push_back( Alternative( new TupleExpr( componentExprs ), i->env, i->cost, thisCost ) );
-				} else {
-					// handle normally
-					candidates.push_back( Alternative( new CastExpr( argExpr->clone(), toType->clone() ), i->env, i->cost, thisCost ) );
-				}
+				candidates.push_back( Alternative( restructureCast( i->expr->clone(), toType ), i->env, i->cost, thisCost ) );
 			} // if
 		} // for
@@ -1183,31 +1186,39 @@
 
 	void AlternativeFinder::visit( UntypedInitExpr *initExpr ) {
-		AlternativeFinder finder( indexer, env );
-		finder.findWithAdjustment( initExpr->get_expr() );
-		// handle each option like a cast -- should probably push this info into AltFinder as a kind of expression, both to keep common code close and to have less 'reach-in', but more 'push-in'
+		// handle each option like a cast
 		AltList candidates;
-		std::cerr << "untyped init expr: " << initExpr << std::endl;
+		PRINT( std::cerr << "untyped init expr: " << initExpr << std::endl; )
 		// O(N^2) checks of d-types with e-types
-		for ( Alternative & alt : finder.get_alternatives() ) {
-			for ( InitAlternative & initAlt : initExpr->get_initAlts() ) {
+		for ( InitAlternative & initAlt : initExpr->get_initAlts() ) {
+			Type * toType = resolveTypeof( initAlt.type, indexer );
+			SymTab::validateType( toType, &indexer );
+			adjustExprType( toType, env, indexer );
+			// Ideally the call to findWithAdjustment could be moved out of the loop, but unfortunately it currently has to occur inside or else
+			// polymorphic return types are not properly bound to the initialization type, since return type variables are only open for the duration of resolving
+			// the UntypedExpr. This is only actually an issue in initialization contexts that allow more than one possible initialization type, but it is still suboptimal.
+			AlternativeFinder finder( indexer, env );
+			finder.targetType = toType;
+			finder.findWithAdjustment( initExpr->get_expr() );
+			for ( Alternative & alt : finder.get_alternatives() ) {
+				TypeEnvironment newEnv( alt.env );
 				AssertionSet needAssertions, haveAssertions;
-				OpenVarSet openVars;
-				std::cerr << "  " << initAlt.type << " " << initAlt.designation << std::endl;
+				OpenVarSet openVars;  // find things in env that don't have a "representative type" and claim those are open vars?
+				PRINT( std::cerr << "  @ " << toType << " " << initAlt.designation << std::endl; )
 				// It's possible that a cast can throw away some values in a multiply-valued expression.  (An example is a
 				// cast-to-void, which casts from one value to zero.)  Figure out the prefix of the subexpression results
 				// that are cast directly.  The candidate is invalid if it has fewer results than there are types to cast
 				// to.
-				int discardedValues = alt.expr->get_result()->size() - initAlt.type->size();
+				int discardedValues = alt.expr->get_result()->size() - toType->size();
 				if ( discardedValues < 0 ) continue;
 				// xxx - may need to go into tuple types and extract relevant types and use unifyList. Note that currently, this does not
 				// allow casting a tuple to an atomic type (e.g. (int)([1, 2, 3]))
 				// unification run for side-effects
-				unify( initAlt.type, alt.expr->get_result(), alt.env, needAssertions, haveAssertions, openVars, indexer );
-
-				Cost thisCost = castCost( alt.expr->get_result(), initAlt.type, indexer, alt.env );
+				unify( toType, alt.expr->get_result(), newEnv, needAssertions, haveAssertions, openVars, indexer ); // xxx - do some inspecting on this line... why isn't result bound to initAlt.type??
+
+				Cost thisCost = castCost( alt.expr->get_result(), toType, indexer, newEnv );
 				if ( thisCost != Cost::infinity ) {
 					// count one safe conversion for each value that is thrown away
 					thisCost += Cost( 0, 0, discardedValues );
-					candidates.push_back( Alternative( new InitExpr( alt.expr->clone(), initAlt.type->clone(), initAlt.designation->clone() ), alt.env, alt.cost, thisCost ) );
+					candidates.push_back( Alternative( new InitExpr( restructureCast( alt.expr->clone(), toType ), initAlt.designation->clone() ), newEnv, alt.cost, thisCost ) );
 				}
 			}
Index: src/ResolvExpr/CurrentObject.cc
===================================================================
--- src/ResolvExpr/CurrentObject.cc	(revision bb1cd95b1669c150547e9c6ca1c0ac29ffadf57a)
+++ src/ResolvExpr/CurrentObject.cc	(revision 6242335009c5d2ebee1bb50d1d228f5aacb0e5bd)
@@ -22,4 +22,5 @@
 #include "SynTree/Initializer.h"
 #include "SynTree/Type.h"
+#include "SynTree/TypeSubstitution.h"
 
 #if 0
@@ -32,12 +33,15 @@
 	long long int getConstValue( ConstantExpr * constExpr ) {
 		if ( BasicType * basicType = dynamic_cast< BasicType * >( constExpr->get_result() ) ) {
-			if ( basicType->get_kind() == BasicType::Char || basicType->get_kind() == BasicType::SignedChar || basicType->get_kind() == BasicType::UnsignedChar ) {
-				assertf( constExpr->get_constant()->get_value().size() == 3, "constant value with unusual length: %s", constExpr->get_constant()->get_value().c_str() );
-				return constExpr->get_constant()->get_value()[1];
+			if ( basicType->isInteger() ) {
+				return constExpr->get_constant()->get_ival();
 			} else {
-				return stoll( constExpr->get_constant()->get_value() );
-			}
+				assertf( false, "Non-integer constant expression in getConstValue", toString( constExpr ).c_str() ); // xxx - might be semantic error
+			}
+		} else if ( dynamic_cast< OneType * >( constExpr->get_result() ) ) {
+			return 1;
+		} else if ( dynamic_cast< ZeroType * >( constExpr->get_result() ) ) {
+			return 0;
 		} else {
-			assertf( false, "unhandled type on getConstValue %s", constExpr->get_result() );
+			assertf( false, "unhandled type on getConstValue %s", toString( constExpr->get_result() ).c_str() ); // xxx - might be semantic error
 		}
 	}
@@ -56,4 +60,24 @@
 	std::ostream & operator<<( std::ostream & out, Indenter & indent ) {
 		return out << std::string(indent.indent, ' ');
+	}
+
+	template< typename AggrInst >
+	TypeSubstitution makeGenericSubstitution( AggrInst * inst ) {
+		assert( inst );
+		assert( inst->get_baseParameters() );
+		std::list< TypeDecl * > baseParams = *inst->get_baseParameters();
+		std::list< Expression * > typeSubs = inst->get_parameters();
+		TypeSubstitution subs( baseParams.begin(), baseParams.end(), typeSubs.begin() );
+		return subs;
+	}
+
+	TypeSubstitution makeGenericSubstitution( Type * type ) {
+		if ( StructInstType * inst = dynamic_cast< StructInstType * >( type ) ) {
+			return makeGenericSubstitution( inst );
+		} else if ( UnionInstType * inst = dynamic_cast< UnionInstType * >( type ) ) {
+			return makeGenericSubstitution( inst );
+		} else {
+			return TypeSubstitution();
+		}
 	}
 
@@ -135,10 +159,10 @@
 		void setSize( Expression * expr ) {
 			if ( ConstantExpr * constExpr = dynamic_cast< ConstantExpr * >( expr ) ) {
-				size = getConstValue( constExpr ); // xxx - if not a constant expression, it's not simple to determine how long the array actually is, which is necessary for initialization to be done correctly -- fix this
+				size = getConstValue( constExpr );
 				PRINT( std::cerr << "array type with size: " << size << std::endl; )
 			}	else if ( CastExpr * castExpr = dynamic_cast< CastExpr * >( expr ) ) {
-				setSize( castExpr->get_arg() );
+				setSize( castExpr->get_arg() ); // xxx - need to perform the conversion specified by the cast
 			} else {
-				assertf( false, "unhandled expression in setSize: %s", toString( expr ).c_str() );
+				assertf( false, "unhandled expression in setSize: %s", toString( expr ).c_str() ); // xxx - if not a constant expression, it's not simple to determine how long the array actually is, which is necessary for initialization to be done correctly -- fix this
 			}
 		}
@@ -231,14 +255,17 @@
 	class AggregateIterator : public MemberIterator {
 	public:
-		typedef std::list<Declaration *>::iterator iterator;
-		const char * kind = ""; // for debug
-		ReferenceToType * inst = nullptr;
-		AggregateDecl * decl = nullptr;
+		typedef std::list<Declaration *> MemberList;
+		typedef MemberList::const_iterator iterator;
+		std::string kind = ""; // for debug
+		std::string name;
+		Type * inst = nullptr;
+		const MemberList & members;
 		iterator curMember;
-		bool atbegin = true; // false at first {small,big}Step -- this struct type is only added to the possibilities at the beginning
+		bool atbegin = true; // false at first {small,big}Step -- this aggr type is only added to the possibilities at the beginning
 		Type * curType = nullptr;
 		MemberIterator * memberIter = nullptr;
-
-		AggregateIterator( const char * kind, ReferenceToType * inst, AggregateDecl * decl ) : kind( kind ), inst( inst ), decl( decl ), curMember( decl->get_members().begin() ) {
+		mutable TypeSubstitution sub;
+
+		AggregateIterator( const std::string & kind, const std::string & name, Type * inst, const MemberList & members ) : kind( kind ), name( name ), inst( inst ), members( members ), curMember( members.begin() ), sub( makeGenericSubstitution( inst ) ) {
 			init();
 		}
@@ -249,6 +276,6 @@
 
 		bool init() {
-			PRINT( std::cerr << "--init()--" << std::endl; )
-			if ( curMember != decl->get_members().end() ) {
+			PRINT( std::cerr << "--init()--" << members.size() << std::endl; )
+			if ( curMember != members.end() ) {
 				if ( ObjectDecl * field = dynamic_cast< ObjectDecl * >( *curMember ) ) {
 					PRINT( std::cerr << "incremented to field: " << field << std::endl; )
@@ -264,7 +291,12 @@
 			if (memberIter && *memberIter) {
 				std::list<InitAlternative> ret = memberIter->first();
+				PRINT( std::cerr << "sub: " << sub << std::endl; )
 				for ( InitAlternative & alt : ret ) {
 					PRINT( std::cerr << "iterating and adding designators" << std::endl; )
 					alt.designation->get_designators().push_front( new VariableExpr( safe_dynamic_cast< ObjectDecl * >( *curMember ) ) );
+					// need to substitute for generic types, so that casts are to concrete types
+					PRINT( std::cerr << "  type is: " << alt.type; )
+					sub.apply( alt.type ); // also apply to designation??
+					PRINT( std::cerr << " ==> " << alt.type << std::endl; )
 				}
 				return ret;
@@ -276,5 +308,5 @@
 			if ( ! designators.empty() ) {
 				if ( VariableExpr * varExpr = dynamic_cast< VariableExpr * >( designators.front() ) ) {
-					for ( curMember = decl->get_members().begin(); curMember != decl->get_members().end(); ++curMember ) {
+					for ( curMember = members.begin(); curMember != members.end(); ++curMember ) {
 						if ( *curMember == varExpr->get_var() ) {
 							designators.pop_front();
@@ -282,12 +314,12 @@
 							memberIter = createMemberIterator( varExpr->get_result() );
 							curType = varExpr->get_result();
-							atbegin = curMember == decl->get_members().begin() && designators.empty(); // xxx - is this right??
+							atbegin = curMember == members.begin() && designators.empty(); // xxx - is this the right condition for atbegin??
 							memberIter->setPosition( designators );
 							return;
 						} // if
 					} // for
-					assertf( false, "could not find member in %s: %s", kind, toString( varExpr ).c_str() );
+					assertf( false, "could not find member in %s: %s", kind.c_str(), toString( varExpr ).c_str() );
 				} else {
-					assertf( false, "bad designator given to %s: %s", kind, toString( designators.front() ).c_str() );
+					assertf( false, "bad designator given to %s: %s", kind.c_str(), toString( designators.front() ).c_str() );
 				} // if
 			} // if
@@ -336,5 +368,5 @@
 
 		virtual void print( std::ostream & out, Indenter indent ) const {
-			out << kind << "(" << decl->get_name() << ")";
+			out << kind << "(" << name << ")";
 			if ( memberIter ) {
 				Indenter childIndent = indent+1;
@@ -347,5 +379,5 @@
 	class UnionIterator : public AggregateIterator {
 	public:
-		UnionIterator( UnionInstType * inst ) : AggregateIterator( "UnionIterator", inst, inst->get_baseUnion() ) {}
+		UnionIterator( UnionInstType * inst ) : AggregateIterator( "UnionIterator", inst->get_name(), inst, inst->get_baseUnion()->get_members() ) {}
 
 		virtual operator bool() const { return (memberIter && *memberIter); }
@@ -357,5 +389,5 @@
 			memberIter = nullptr;
 			curType = nullptr;
-			curMember = decl->get_members().end();
+			curMember = members.end();
 			return *this;
 		}
@@ -365,7 +397,7 @@
 	class StructIterator : public AggregateIterator {
 	public:
-		StructIterator( StructInstType * inst ) : AggregateIterator( "StructIterator", inst, inst->get_baseStruct() ) {}
-
-		virtual operator bool() const { return curMember != decl->get_members().end() || (memberIter && *memberIter); }
+		StructIterator( StructInstType * inst ) : AggregateIterator( "StructIterator", inst->get_name(), inst, inst->get_baseStruct()->get_members() ) {}
+
+		virtual operator bool() const { return curMember != members.end() || (memberIter && *memberIter); }
 
 		virtual MemberIterator & bigStep() {
@@ -375,5 +407,27 @@
 			memberIter = nullptr;
 			curType = nullptr;
-			for ( ; curMember != decl->get_members().end(); ) {
+			for ( ; curMember != members.end(); ) {
+				++curMember;
+				if ( init() ) {
+					return *this;
+				}
+			}
+			return *this;
+		}
+	};
+
+	class TupleIterator : public AggregateIterator {
+	public:
+		TupleIterator( TupleType * inst ) : AggregateIterator( "TupleIterator", toString("Tuple", inst->size()), inst, inst->get_members() ) {}
+
+		virtual operator bool() const { return curMember != members.end() || (memberIter && *memberIter); }
+
+		virtual MemberIterator & bigStep() {
+			PRINT( std::cerr << "bigStep in " << kind << std::endl; )
+			atbegin = false;
+			delete memberIter;
+			memberIter = nullptr;
+			curType = nullptr;
+			for ( ; curMember != members.end(); ) {
 				++curMember;
 				if ( init() ) {
@@ -392,8 +446,11 @@
 				return new UnionIterator( uit );
 			} else {
-				assertf( false, "some other reftotype" );
+				assertf( dynamic_cast< TypeInstType * >( type ), "some other reftotype" );
+				return new SimpleIterator( type );
 			}
 		} else if ( ArrayType * at = dynamic_cast< ArrayType * >( type ) ) {
 			return new ArrayIterator( at );
+		} else if ( TupleType * tt = dynamic_cast< TupleType * >( type ) ) {
+			return new TupleIterator( tt );
 		} else {
 			return new SimpleIterator( type );
@@ -494,5 +551,4 @@
 		Type * type = objStack.top()->getNext();
 		if ( type ) {
-			// xxx - record types.front()?
 			objStack.push( createMemberIterator( type ) );
 		} else {
@@ -517,4 +573,10 @@
 		return **objStack.top();
 	}
+
+	Type * CurrentObject::getCurrentType() {
+		PRINT( std::cerr << "____getting current type" << std::endl; )
+		assertf( ! objStack.empty(), "objstack empty in getCurrentType" );
+		return objStack.top()->getNext();
+	}
 } // namespace ResolvExpr
 
Index: src/ResolvExpr/CurrentObject.h
===================================================================
--- src/ResolvExpr/CurrentObject.h	(revision bb1cd95b1669c150547e9c6ca1c0ac29ffadf57a)
+++ src/ResolvExpr/CurrentObject.h	(revision 6242335009c5d2ebee1bb50d1d228f5aacb0e5bd)
@@ -42,4 +42,6 @@
 		/// produces a list of alternatives (Type *, Designation *) for the current sub-object's initializer
 		std::list< InitAlternative > getOptions();
+		/// produces the type of the current object but no subobjects
+		Type * getCurrentType();
 
 	private:
Index: src/ResolvExpr/Resolver.cc
===================================================================
--- src/ResolvExpr/Resolver.cc	(revision bb1cd95b1669c150547e9c6ca1c0ac29ffadf57a)
+++ src/ResolvExpr/Resolver.cc	(revision 6242335009c5d2ebee1bb50d1d228f5aacb0e5bd)
@@ -375,103 +375,54 @@
 	}
 
-	template< typename Aggr >
-	void lookupDesignation( Aggr * aggr, const std::list< Expression > & designators ) {
-
-	}
-
 	void Resolver::visit( SingleInit *singleInit ) {
+		// resolve initialization using the possibilities as determined by the currentObject cursor
 		UntypedInitExpr * untyped = new UntypedInitExpr( singleInit->get_value(), currentObject.getOptions() );
 		Expression * newExpr = findSingleExpression( untyped, *this );
 		InitExpr * initExpr = safe_dynamic_cast< InitExpr * >( newExpr );
-		singleInit->set_value( new CastExpr( initExpr->get_expr()->clone(), initExpr->get_result()->clone() ) );
+
+		// move cursor to the object that is actually initialized
 		currentObject.setNext( initExpr->get_designation() );
+
+		// discard InitExpr wrapper and retain relevant pieces
+		newExpr = initExpr->get_expr();
+		singleInit->get_value()->set_env( initExpr->get_env() );
+		initExpr->set_expr( nullptr );
+		initExpr->set_env( nullptr );
+		delete initExpr;
+
+		// get the actual object's type (may not exactly match what comes back from the resolver due to conversions)
+		Type * initContext = currentObject.getCurrentType();
+
+		// check if actual object's type is char[]
+		if ( ArrayType * at = dynamic_cast< ArrayType * >( initContext ) ) {
+			if ( isCharType( at->get_base() ) ) {
+				// check if the resolved type is char *
+				if ( PointerType * pt = dynamic_cast< PointerType *>( newExpr->get_result() ) ) {
+					if ( isCharType( pt->get_base() ) ) {
+						// strip cast if we're initializing a char[] with a char *, e.g.  char x[] = "hello";
+						CastExpr *ce = safe_dynamic_cast< CastExpr * >( newExpr );
+						newExpr = ce->get_arg();
+						ce->set_arg( nullptr );
+						delete ce;
+					}
+				}
+			}
+		}
+
+		// set initializer expr to resolved express
+		singleInit->set_value( newExpr );
+
+		// move cursor to next object in preparation for next initializer
 		currentObject.increment();
-		delete initExpr;
-
-		// // check if initializing type is char[]
-		// if ( ArrayType * at = dynamic_cast< ArrayType * >( initContext ) ) {
-		// 	if ( isCharType( at->get_base() ) ) {
-		// 		// check if the resolved type is char *
-		// 		if ( PointerType * pt = dynamic_cast< PointerType *>( newExpr->get_result() ) ) {
-		// 			if ( isCharType( pt->get_base() ) ) {
-		// 				// strip cast if we're initializing a char[] with a char *, e.g.  char x[] = "hello";
-		// 				CastExpr *ce = dynamic_cast< CastExpr * >( newExpr );
-		// 				singleInit->set_value( ce->get_arg() );
-		// 				ce->set_arg( NULL );
-		// 				delete ce;
-		// 			}
-		// 		}
-		// 	}
-		// }
-	}
-
-	// template< typename AggrInst >
-	// TypeSubstitution makeGenericSubstitution( AggrInst * inst ) {
-	// 	assert( inst );
-	// 	assert( inst->get_baseParameters() );
-	// 	std::list< TypeDecl * > baseParams = *inst->get_baseParameters();
-	// 	std::list< Expression * > typeSubs = inst->get_parameters();
-	// 	TypeSubstitution subs( baseParams.begin(), baseParams.end(), typeSubs.begin() );
-	// 	return subs;
-	// }
-
-	// ReferenceToType * isStructOrUnion( Type * type ) {
-	// 	if ( StructInstType * sit = dynamic_cast< StructInstType * >( type ) ) {
-	// 		return sit;
-	// 	} else if ( UnionInstType * uit = dynamic_cast< UnionInstType * >( type ) ) {
-	// 		return uit;
-	// 	}
-	// 	return nullptr;
-	// }
-
-	// void Resolver::resolveSingleAggrInit( Declaration * dcl, InitIterator & init, InitIterator & initEnd, TypeSubstitution sub ) {
-	// 	ObjectDecl * obj = dynamic_cast< ObjectDecl * >( dcl );
-	// 	assert( obj );
-	// 	// need to substitute for generic types, so that casts are to concrete types
-	// 	currentObject = obj->clone();  // xxx - delete this
-	// 	sub.apply( currentObject );
-
-	// 	try {
-	// 		if ( init == initEnd ) return; // stop when there are no more initializers
-	// 		(*init)->accept( *this );
-	// 		++init; // made it past an initializer
-	// 	} catch( SemanticError & ) {
-	// 		// need to delve deeper, if you can
-	// 		if ( ReferenceToType * type = isStructOrUnion( currentObject->get_type() ) ) {
-	// 			resolveAggrInit( type, init, initEnd );
-	// 		} else {
-	// 			// member is not an aggregate type, so can't go any deeper
-
-	// 			// might need to rethink what is being thrown
-	// 			throw;
-	// 		} // if
-	// 	}
-	// }
-
-	// void Resolver::resolveAggrInit( ReferenceToType * inst, InitIterator & init, InitIterator & initEnd ) {
-	// 	if ( StructInstType * sit = dynamic_cast< StructInstType * >( inst ) ) {
-	// 		TypeSubstitution sub = makeGenericSubstitution( sit );
-	// 		StructDecl * st = sit->get_baseStruct();
-	// 		if(st->get_members().empty()) return;
-	// 		// want to resolve each initializer to the members of the struct,
-	// 		// but if there are more initializers than members we should stop
-	// 		list< Declaration * >::iterator it = st->get_members().begin();
-	// 		for ( ; it != st->get_members().end(); ++it) {
-	// 			resolveSingleAggrInit( *it, init, initEnd, sub );
-	// 		}
-	// 	} else if ( UnionInstType * uit = dynamic_cast< UnionInstType * >( inst ) ) {
-	// 		TypeSubstitution sub = makeGenericSubstitution( uit );
-	// 		UnionDecl * un = uit->get_baseUnion();
-	// 		if(un->get_members().empty()) return;
-	// 		// only resolve to the first member of a union
-	// 		resolveSingleAggrInit( *un->get_members().begin(), init, initEnd, sub );
-	// 	} // if
-	// }
+	}
 
 	void Resolver::visit( ListInit * listInit ) {
+		// move cursor into brace-enclosed initializer-list
 		currentObject.enterListInit();
 		// xxx - fix this so that the list isn't copied, iterator should be used to change current element
 		std::list<Designation *> newDesignations;
 		for ( auto p : group_iterate(listInit->get_designations(), listInit->get_initializers()) ) {
+			// iterate designations and initializers in pairs, moving the cursor to the current designated object and resolving
+			// the initializer against that object.
 			Designation * des = std::get<0>(p);
 			Initializer * init = std::get<1>(p);
@@ -479,7 +430,9 @@
 			init->accept( *this );
 		}
+		// set the set of 'resolved' designations and leave the brace-enclosed initializer-list
 		listInit->get_designations() = newDesignations; // xxx - memory management
 		currentObject.exitListInit();
 
+		// xxx - this part has not be folded into CurrentObject yet
 		// } else if ( TypeInstType * tt = dynamic_cast< TypeInstType * >( initContext ) ) {
 		// 	Type * base = tt->get_baseType()->get_base();
Index: src/ResolvExpr/Unify.cc
===================================================================
--- src/ResolvExpr/Unify.cc	(revision bb1cd95b1669c150547e9c6ca1c0ac29ffadf57a)
+++ src/ResolvExpr/Unify.cc	(revision 6242335009c5d2ebee1bb50d1d228f5aacb0e5bd)
@@ -606,8 +606,8 @@
 			} else if ( tupleParam ) {
 				// bundle other parameters into tuple to match
-				TupleType* binder = new TupleType{ paramTy->get_qualifiers() };
+				std::list< Type * > binderTypes;
 
 				do {
-					binder->get_types().push_back( otherParam->get_type()->clone() );
+					binderTypes.push_back( otherParam->get_type()->clone() );
 					++jt;
 
@@ -618,12 +618,12 @@
 				} while (true);
 
-				otherParamTy = binder;
+				otherParamTy = new TupleType{ paramTy->get_qualifiers(), binderTypes };
 				++it;  // skip ttype parameter for break
 			} else if ( otherTupleParam ) {
 				// bundle parameters into tuple to match other
-				TupleType* binder = new TupleType{ otherParamTy->get_qualifiers() };
+				std::list< Type * > binderTypes;
 
 				do {
-					binder->get_types().push_back( param->get_type()->clone() );
+					binderTypes.push_back( param->get_type()->clone() );
 					++it;
 
@@ -634,5 +634,5 @@
 				} while (true);
 
-				paramTy = binder;
+				paramTy = new TupleType{ otherParamTy->get_qualifiers(), binderTypes };
 				++jt;  // skip ttype parameter for break
 			}
@@ -756,9 +756,9 @@
 			return function->get_returnVals().front()->get_type()->clone();
 		} else {
-			TupleType * tupleType = new TupleType( Type::Qualifiers() );
+			std::list< Type * > types;
 			for ( DeclarationWithType * decl : function->get_returnVals() ) {
-				tupleType->get_types().push_back( decl->get_type()->clone() );
+				types.push_back( decl->get_type()->clone() );
 			} // for
-			return tupleType;
+			return new TupleType( Type::Qualifiers(), types );
 		}
 	}
Index: src/SymTab/ImplementationType.cc
===================================================================
--- src/SymTab/ImplementationType.cc	(revision bb1cd95b1669c150547e9c6ca1c0ac29ffadf57a)
+++ src/SymTab/ImplementationType.cc	(revision 6242335009c5d2ebee1bb50d1d228f5aacb0e5bd)
@@ -5,5 +5,5 @@
 // file "LICENCE" distributed with Cforall.
 //
-// ImplementationType.cc -- 
+// ImplementationType.cc --
 //
 // Author           : Richard C. Bilson
@@ -92,11 +92,11 @@
 
 	void ImplementationType::visit(TupleType *tupleType) {
-		TupleType *newType = new TupleType( Type::Qualifiers() );
+		std::list< Type * > types;
 		for ( std::list< Type* >::iterator i = tupleType->get_types().begin(); i != tupleType->get_types().end(); ++i ) {
 			Type *implType = implementationType( *i, indexer );
 			implType->get_qualifiers() |= tupleType->get_qualifiers();
-			newType->get_types().push_back( implType );
+			types.push_back( implType );
 		} // for
-		result = newType;
+		result = new TupleType( Type::Qualifiers(), types );
 	}
 
Index: src/SynTree/Constant.cc
===================================================================
--- src/SynTree/Constant.cc	(revision bb1cd95b1669c150547e9c6ca1c0ac29ffadf57a)
+++ src/SynTree/Constant.cc	(revision 6242335009c5d2ebee1bb50d1d228f5aacb0e5bd)
@@ -5,5 +5,5 @@
 // file "LICENCE" distributed with Cforall.
 //
-// Constant.cc -- 
+// Constant.cc --
 //
 // Author           : Richard C. Bilson
@@ -46,4 +46,14 @@
 }
 
+unsigned long long Constant::get_ival() const {
+	assertf( safe_dynamic_cast<BasicType*>(type)->isInteger(), "Attempt to retrieve ival from non-integer constant." );
+	return val.ival;
+}
+
+double Constant::get_dval() const {
+	assertf( ! safe_dynamic_cast<BasicType*>(type)->isInteger(), "Attempt to retrieve dval from integer constant." );
+	return val.dval;
+}
+
 void Constant::print( std::ostream &os ) const {
 	os << "(" << rep << " " << val.ival;
Index: src/SynTree/Constant.h
===================================================================
--- src/SynTree/Constant.h	(revision bb1cd95b1669c150547e9c6ca1c0ac29ffadf57a)
+++ src/SynTree/Constant.h	(revision 6242335009c5d2ebee1bb50d1d228f5aacb0e5bd)
@@ -5,5 +5,5 @@
 // file "LICENCE" distributed with Cforall.
 //
-// Constant.h -- 
+// Constant.h --
 //
 // Author           : Richard C. Bilson
@@ -32,4 +32,6 @@
 	std::string & get_value() { return rep; }
 	void set_value( std::string newValue ) { rep = newValue; }
+	unsigned long long get_ival() const;
+	double get_dval() const;
 
 	/// generates a boolean constant of the given bool
Index: src/SynTree/Expression.cc
===================================================================
--- src/SynTree/Expression.cc	(revision bb1cd95b1669c150547e9c6ca1c0ac29ffadf57a)
+++ src/SynTree/Expression.cc	(revision 6242335009c5d2ebee1bb50d1d228f5aacb0e5bd)
@@ -21,11 +21,15 @@
 #include <iterator>
 
+#include "Declaration.h"
+#include "Expression.h"
+#include "Initializer.h"
+#include "Statement.h"
 #include "Type.h"
-#include "Initializer.h"
-#include "Expression.h"
-#include "Declaration.h"
-#include "Statement.h"
 #include "TypeSubstitution.h"
+#include "VarExprReplacer.h"
+
 #include "Common/utility.h"
+#include "Common/PassVisitor.h"
+
 #include "InitTweak/InitTweak.h"
 
@@ -681,6 +685,6 @@
 }
 
-InitExpr::InitExpr( Expression * expr, Type * type, Designation * designation ) : expr( expr ), designation( designation ) {
-	set_result( type );
+InitExpr::InitExpr( Expression * expr, Designation * designation ) : expr( expr ), designation( designation ) {
+	set_result( expr->get_result()->clone() );
 }
 InitExpr::InitExpr( const InitExpr & other ) : Expression( other ), expr( maybeClone( other.expr ) ), designation( maybeClone( other.designation) ) {}
Index: src/SynTree/Expression.h
===================================================================
--- src/SynTree/Expression.h	(revision bb1cd95b1669c150547e9c6ca1c0ac29ffadf57a)
+++ src/SynTree/Expression.h	(revision 6242335009c5d2ebee1bb50d1d228f5aacb0e5bd)
@@ -776,5 +776,5 @@
 class InitExpr : public Expression {
 public:
-	InitExpr( Expression * expr, Type * type, Designation * designation );
+	InitExpr( Expression * expr, Designation * designation );
 	InitExpr( const InitExpr & other );
 	~InitExpr();
Index: src/SynTree/Initializer.cc
===================================================================
--- src/SynTree/Initializer.cc	(revision bb1cd95b1669c150547e9c6ca1c0ac29ffadf57a)
+++ src/SynTree/Initializer.cc	(revision 6242335009c5d2ebee1bb50d1d228f5aacb0e5bd)
@@ -65,6 +65,14 @@
 
 
-ListInit::ListInit( const std::list<Initializer*> &initializers, const std::list<Designation *> &designations, bool maybeConstructed )
-	: Initializer( maybeConstructed ), initializers( initializers ), designations( designations ) {
+ListInit::ListInit( const std::list<Initializer*> &inits, const std::list<Designation *> &des, bool maybeConstructed )
+	: Initializer( maybeConstructed ), initializers( inits ), designations( des ) {
+		// handle the common case where a ListInit is created without designations by making a list of empty designations with the same length as the initializer
+		if ( designations.empty() ) {
+			for ( auto & i : initializers ) {
+				(void)i;
+				designations.push_back( new Designation( {} ) );
+			}
+		}
+		assertf( initializers.size() == designations.size(), "Created ListInit with mismatching initializers (%d) and designations (%d)", initializers.size(), designations.size() );
 }
 
Index: src/SynTree/Mutator.cc
===================================================================
--- src/SynTree/Mutator.cc	(revision bb1cd95b1669c150547e9c6ca1c0ac29ffadf57a)
+++ src/SynTree/Mutator.cc	(revision 6242335009c5d2ebee1bb50d1d228f5aacb0e5bd)
@@ -515,4 +515,5 @@
 	mutateAll( tupleType->get_forall(), *this );
 	mutateAll( tupleType->get_types(), *this );
+	mutateAll( tupleType->get_members(), *this );
 	return tupleType;
 }
Index: src/SynTree/TupleType.cc
===================================================================
--- src/SynTree/TupleType.cc	(revision bb1cd95b1669c150547e9c6ca1c0ac29ffadf57a)
+++ src/SynTree/TupleType.cc	(revision 6242335009c5d2ebee1bb50d1d228f5aacb0e5bd)
@@ -14,16 +14,31 @@
 //
 
+#include "Declaration.h"
+#include "Initializer.h"
 #include "Type.h"
 #include "Common/utility.h"
+#include "Parser/LinkageSpec.h"
 
 TupleType::TupleType( const Type::Qualifiers &tq, const std::list< Type * > & types, const std::list< Attribute * > & attributes ) : Type( tq, attributes ), types( types ) {
+	for ( Type * t : *this ) {
+		// xxx - this is very awkward. TupleTypes should contain objects so that members can be named, but if they don't have an initializer node then
+		// they end up getting constructors, which end up being inserted causing problems. This happens because the object decls have to be visited so that
+		// their types are kept in sync with the types list here. Ultimately, the types list here should be eliminated and perhaps replaced with a list-view
+		// of the object types list, but I digress. The temporary solution here is to make a ListInit with maybeConstructed = false, that way even when the
+		// object is visited, it is never constructed. Ultimately, a better solution might be either:
+		// a) to separate TupleType from its declarations, into TupleDecl and Tuple{Inst?}Type, ala StructDecl and StructInstType
+		// b) separate initializer nodes better, e.g. add a MaybeConstructed node that is replaced by genInit, rather than what currently exists in a bool
+		members.push_back( new ObjectDecl( "" , Type::StorageClasses(), LinkageSpec::Cforall, nullptr, t->clone(), new ListInit( {}, {}, false ) ) );
+	}
 }
 
 TupleType::TupleType( const TupleType& other ) : Type( other ) {
 	cloneAll( other.types, types );
+	cloneAll( other.members, members );
 }
 
 TupleType::~TupleType() {
 	deleteAll( types );
+	deleteAll( members );
 }
 
Index: src/SynTree/Type.h
===================================================================
--- src/SynTree/Type.h	(revision bb1cd95b1669c150547e9c6ca1c0ac29ffadf57a)
+++ src/SynTree/Type.h	(revision 6242335009c5d2ebee1bb50d1d228f5aacb0e5bd)
@@ -481,5 +481,5 @@
 class TupleType : public Type {
   public:
-	TupleType( const Type::Qualifiers & tq, const std::list< Type * > & types = std::list< Type * >(), const std::list< Attribute * > & attributes = std::list< Attribute * >()  );
+	TupleType( const Type::Qualifiers & tq, const std::list< Type * > & types, const std::list< Attribute * > & attributes = std::list< Attribute * >()  );
 	TupleType( const TupleType& );
 	virtual ~TupleType();
@@ -488,6 +488,10 @@
 	typedef value_type::iterator iterator;
 
-	std::list<Type*>& get_types() { return types; }
+	std::list<Type *> & get_types() { return types; }
 	virtual unsigned size() const { return types.size(); };
+
+	// For now, this is entirely synthetic -- tuple types always have unnamed members.
+	// Eventually, we may allow named tuples, in which case members should subsume types
+	std::list<Declaration *> & get_members() { return members; }
 
 	iterator begin() { return types.begin(); }
@@ -506,5 +510,6 @@
 	virtual void print( std::ostream & os, int indent = 0 ) const;
   private:
-	std::list<Type*> types;
+	std::list<Type *> types;
+	std::list<Declaration *> members;
 };
 
Index: src/SynTree/VarExprReplacer.cc
===================================================================
--- src/SynTree/VarExprReplacer.cc	(revision bb1cd95b1669c150547e9c6ca1c0ac29ffadf57a)
+++ src/SynTree/VarExprReplacer.cc	(revision 6242335009c5d2ebee1bb50d1d228f5aacb0e5bd)
@@ -14,14 +14,18 @@
 //
 
+#include "Declaration.h"
 #include "Expression.h"
 #include "VarExprReplacer.h"
 
-VarExprReplacer::VarExprReplacer( const DeclMap & declMap ) : declMap( declMap ) {}
+VarExprReplacer::VarExprReplacer( const DeclMap & declMap, bool debug ) : declMap( declMap ), debug( debug ) {}
 
 // replace variable with new node from decl map
 void VarExprReplacer::visit( VariableExpr * varExpr ) {
-  // xxx - assertions and parameters aren't accounted for in this... (i.e. they aren't inserted into the map when it's made, only DeclStmts are)
-  if ( declMap.count( varExpr->get_var() ) ) {
-    varExpr->set_var( declMap.at( varExpr->get_var() ) );
-  }
+	// xxx - assertions and parameters aren't accounted for in this... (i.e. they aren't inserted into the map when it's made, only DeclStmts are)
+	if ( declMap.count( varExpr->get_var() ) ) {
+		if ( debug ) {
+			std::cerr << "replacing variable reference: " << (void*)varExpr->get_var() << " " << varExpr->get_var() << " with " << (void*)declMap.at( varExpr->get_var() ) << " " << declMap.at( varExpr->get_var() ) << std::endl;
+		}
+		varExpr->set_var( declMap.at( varExpr->get_var() ) );
+	}
 }
Index: src/SynTree/VarExprReplacer.h
===================================================================
--- src/SynTree/VarExprReplacer.h	(revision bb1cd95b1669c150547e9c6ca1c0ac29ffadf57a)
+++ src/SynTree/VarExprReplacer.h	(revision 6242335009c5d2ebee1bb50d1d228f5aacb0e5bd)
@@ -27,6 +27,7 @@
 private:
 	const DeclMap & declMap;
+  bool debug;
 public:
-	VarExprReplacer( const DeclMap & declMap );
+	VarExprReplacer( const DeclMap & declMap, bool debug = false );
 
 	// replace variable with new node from decl map
Index: src/SynTree/Visitor.cc
===================================================================
--- src/SynTree/Visitor.cc	(revision bb1cd95b1669c150547e9c6ca1c0ac29ffadf57a)
+++ src/SynTree/Visitor.cc	(revision 6242335009c5d2ebee1bb50d1d228f5aacb0e5bd)
@@ -407,4 +407,5 @@
 	acceptAll( tupleType->get_forall(), *this );
 	acceptAll( tupleType->get_types(), *this );
+	acceptAll( tupleType->get_members(), *this );
 }
 
Index: src/Tuples/TupleExpansion.cc
===================================================================
--- src/Tuples/TupleExpansion.cc	(revision bb1cd95b1669c150547e9c6ca1c0ac29ffadf57a)
+++ src/Tuples/TupleExpansion.cc	(revision 6242335009c5d2ebee1bb50d1d228f5aacb0e5bd)
@@ -310,20 +310,19 @@
 	Type * makeTupleType( const std::list< Expression * > & exprs ) {
 		// produce the TupleType which aggregates the types of the exprs
-		TupleType *tupleType = new TupleType( Type::Qualifiers( Type::Const | Type::Volatile | Type::Restrict | Type::Lvalue | Type::Atomic | Type::Mutex ) );
-		Type::Qualifiers &qualifiers = tupleType->get_qualifiers();
+		std::list< Type * > types;
+		Type::Qualifiers qualifiers( Type::Const | Type::Volatile | Type::Restrict | Type::Lvalue | Type::Atomic | Type::Mutex );
 		for ( Expression * expr : exprs ) {
 			assert( expr->get_result() );
 			if ( expr->get_result()->isVoid() ) {
 				// if the type of any expr is void, the type of the entire tuple is void
-				delete tupleType;
 				return new VoidType( Type::Qualifiers() );
 			}
 			Type * type = expr->get_result()->clone();
-			tupleType->get_types().push_back( type );
+			types.push_back( type );
 			// the qualifiers on the tuple type are the qualifiers that exist on all component types
 			qualifiers &= type->get_qualifiers();
 		} // for
 		if ( exprs.empty() ) qualifiers = Type::Qualifiers();
-		return tupleType;
+		return new TupleType( qualifiers, types );
 	}
 
Index: src/tests/designations.c
===================================================================
--- src/tests/designations.c	(revision bb1cd95b1669c150547e9c6ca1c0ac29ffadf57a)
+++ src/tests/designations.c	(revision 6242335009c5d2ebee1bb50d1d228f5aacb0e5bd)
@@ -26,214 +26,218 @@
 const int indentAmt = 2;
 void indent(int level) {
-  for (int i = 0; i < level; ++i) {
-    printf(" ");
-  }
+	for (int i = 0; i < level; ++i) {
+		printf(" ");
+	}
 }
 
 // A contains fields with different types (int vs. int *)
 struct A {
-  int x, y;
-  int * ptr;
+	int x, y;
+	int * ptr;
 };
 void printA(struct A a, int level) {
-  indent(level);
-  printf("(A){ %d %d %p }\n", a.x, a.y, a.ptr);
+	indent(level);
+	printf("(A){ %d %d %p }\n", a.x, a.y, a.ptr);
 }
 
 // B contains struct members
 struct B {
-  struct A a0, a1;
+	struct A a0, a1;
 };
 void printB(struct B b, int level) {
-  indent(level);
-  printf("(B){\n");
-  printA(b.a0, level+indentAmt);
-  printA(b.a1, level+indentAmt);
-  indent(level);
-  printf("}\n");
+	indent(level);
+	printf("(B){\n");
+	printA(b.a0, level+indentAmt);
+	printA(b.a1, level+indentAmt);
+	indent(level);
+	printf("}\n");
 }
 
 // C contains an array - tests that after 3 ints, the members of B are initialized.
 struct C {
-  int arr[3];
-  struct B b;
+	int arr[3];
+	struct B b;
 };
 void printC(struct C c, int level) {
-  indent(level);
-  printf("(C){\n");
-  indent(level+indentAmt);
-  printf("(int[]{ %d %d %d }\n", c.arr[0], c.arr[1], c.arr[2]);
-  printB(c.b, level+indentAmt);
-  indent(level);
-  printf("}\n");
+	indent(level);
+	printf("(C){\n");
+	indent(level+indentAmt);
+	printf("(int[]{ %d %d %d }\n", c.arr[0], c.arr[1], c.arr[2]);
+	printB(c.b, level+indentAmt);
+	indent(level);
+	printf("}\n");
 }
 
 // D contains an unnamed aggregate - tests that this doesn't interfere with initialization.
 struct D {
-  struct {
-    int x;
-  };
+	struct {
+		int x;
+	};
 };
 void printD(struct D d, int level) {
-  indent(level);
-  printf("(D){ %d }\n", d.x);
+	indent(level);
+	printf("(D){ %d }\n", d.x);
 }
 
 // E tests unions
 union E {
-  struct A a;
-  struct B b;
-  struct C c;
-  struct D d;
-  int i;
+	struct A a;
+	struct B b;
+	struct C c;
+	struct D d;
+	int i;
 };
 
 int main() {
-  // simple designation case - starting from beginning of structure, leaves ptr default-initialized (zero)
-  struct A y0 = {
-  	.x DES 2,
-  	.y DES 3
-  };
-
-  // simple initializaiton case - initialize all elements explicitly with no designations
-  struct A y1 = {
-    2, 3, 0
-  };
-
-
-  // use designation to move to member y, leaving x default-initialized (zero)
-  struct A y2 = {
-    .y DES 3,
-    0
-  };
+	// simple designation case - starting from beginning of structure, leaves ptr default-initialized (zero)
+	struct A y0 = {
+		.x DES 2,
+		.y DES 3
+	};
+
+	// simple initializaiton case - initialize all elements explicitly with no designations
+	struct A y1 = {
+		2, 3, 0
+	};
+
+
+	// use designation to move to member y, leaving x default-initialized (zero)
+	struct A y2 = {
+		.y DES 3,
+		0
+	};
 
 #if ERROR
-  struct A yErr0 = {
-    {} // error - empty scalar initializer is illegal
-  };
-#endif
-
-  printf("=====A=====\n");
-  printA(y0, 0);
-  printA(y1, 0);
-  printA(y2, 0);
-  printf("=====A=====\n\n");
-
-  // initialize only first element (z0.a.x), leaving everything else default-initialized (zero), no nested curly-braces
-  struct B z0 = { 5 };
-
-  // some nested curly braces, use designation to 'jump around' within structure, leaving some members default-initialized
-  struct B z1 = {
-    { 3 }, // z1.a0
-    { 4 }, // z1.a1
-    .a0 DES { 5 }, // z1.a0
-    { 6 }, // z1.a1
-    .a0.y DES 2, // z1.a0.y
-    0, // z1.a0.ptr
-  };
-
-  // z2.a0.y and z2.a0.ptr default-initialized, everything else explicit
-  struct B z2 = {
-    { 1 },
-    { 2, 3, 0 }
-  };
-
-  // initialize every member, omitting nested curly braces
-  struct B z3 = {
-    1, 2, 0, 4, 5, 0
-  };
-
-  // no initializer - legal C, but garbage values - don't print this one
-  struct B z4;
-
-  // no curly braces - initialize with object of same type
-  struct B z5 = z2;
-
-  // z6.a0.y and z6.a0.ptr default-initialized, everything else explicit.
-  // no curly braces on z6.a1 initializers
-  struct B z6 = {
-    { 1 },
-    2, 3, 0
-  };
-
-  printf("=====B=====\n");
-  printB(z0, 0);
-  printB(z1, 0);
-  printB(z2, 0);
-  printB(z3, 0);
-  printB(z5, 0);
-  printB(z6, 0);
-  printf("=====B=====\n\n");
-
-  // TODO: what about extra things in a nested init? are empty structs skipped??
-
-  // test that initializing 'past array bound' correctly moves to next member.
-  struct C c1 = {
-    2, 3, 4,  // arr
-    5, 6, 0,  // b.a0
-    7, 8, 0,  // b.a1
-  };
-
-  printf("=====C=====\n");
-  printC(c1, 0);
-  printf("=====C=====\n\n");
+	struct A yErr0 = {
+		{} // error - empty scalar initializer is illegal
+	};
+#endif
+
+	printf("=====A=====\n");
+	printA(y0, 0);
+	printA(y1, 0);
+	printA(y2, 0);
+	printf("=====A=====\n\n");
+
+	// initialize only first element (z0.a.x), leaving everything else default-initialized (zero), no nested curly-braces
+	struct B z0 = { 5 };
+
+	// some nested curly braces, use designation to 'jump around' within structure, leaving some members default-initialized
+	struct B z1 = {
+		{ 3 }, // z1.a0
+		{ 4 }, // z1.a1
+		.a0 DES { 5 }, // z1.a0
+		{ 6 }, // z1.a1
+		.a0.y DES 2, // z1.a0.y
+		0, // z1.a0.ptr
+	};
+
+	// z2.a0.y and z2.a0.ptr default-initialized, everything else explicit
+	struct B z2 = {
+		{ 1 },
+		{ 2, 3, 0 }
+	};
+
+	// initialize every member, omitting nested curly braces
+	struct B z3 = {
+		1, 2, 0, 4, 5, 0
+	};
+
+	// no initializer - legal C, but garbage values - don't print this one
+	struct B z4;
+
+	// no curly braces - initialize with object of same type
+	struct B z5 = z2;
+
+	// z6.a0.y and z6.a0.ptr default-initialized, everything else explicit.
+	// no curly braces on z6.a1 initializers
+	struct B z6 = {
+		{ 1 },
+		2, 3, 0
+	};
+
+	printf("=====B=====\n");
+	printB(z0, 0);
+	printB(z1, 0);
+	printB(z2, 0);
+	printB(z3, 0);
+	printB(z5, 0);
+	printB(z6, 0);
+	printf("=====B=====\n\n");
+
+	// TODO: what about extra things in a nested init? are empty structs skipped??
+
+	// test that initializing 'past array bound' correctly moves to next member.
+	struct C c1 = {
+		2, 3, 4,  // arr
+		5, 6, 0,  // b.a0
+		7, 8, 0,  // b.a1
+	};
+
+	printf("=====C=====\n");
+	printC(c1, 0);
+	printf("=====C=====\n\n");
 
 #if ERROR
-  // nested initializer can't refer to same type in C
-  struct C cErr0 = { c1 };
-
-  // must use curly braces to initialize members
-  struct C cErr1 = 2;
-
-  // can't initialize with array compound literal
-  struct C cErr2 = {
-    (int[3]) { 1, 2, 3 }  // error: array initialized from non-constant array expression
-  };
+	// nested initializer can't refer to same type in C
+	struct C cErr0 = { c1 };
+
+	// must use curly braces to initialize members
+	struct C cErr1 = 2;
+
+	// can't initialize with array compound literal
+	struct C cErr2 = {
+		(int[3]) { 1, 2, 3 }  // error: array initialized from non-constant array expression
+	};
 #endif
 
 #if WARNING
-  // can't initialize array with array - converts to int*
-  int cWarn0_arr[3] = { 1, 2, 3 };
-  struct C cWarn0 = {
-    cWarn0_arr  // warning: initialization makes integer from ptr without cast
-  };
-#endif
-
-  // allowed to have 'too many' initialized lists - essentially they are ignored.
-  int i1 = { 3 };
-
-  // doesn't work yet.
-  // designate unnamed object's members
-  // struct D d = { .x DES 3 };
+	// can't initialize array with array - converts to int*
+	int cWarn0_arr[3] = { 1, 2, 3 };
+	struct C cWarn0 = {
+		cWarn0_arr  // warning: initialization makes integer from ptr without cast
+	};
+#endif
+
+	// allowed to have 'too many' initialized lists - essentially they are ignored.
+	int i1 = { 3 };
+
+	// doesn't work yet.
+	// designate unnamed object's members
+	// struct D d = { .x DES 3 };
 #if ERROR
-  struct D d1 = { .y DES 3 };
-#endif
-
-  // simple union initialization - initialized first member (e0.a)
-  union E e0 = {
-    y0
-  };
-
-  // simple union initialization - initializes first member (e1.a) - with nested initializer list
-  union E e1 = {
-    { 2, 3, 0 }
-  };
-
-  // simple union initialization - initializes first member (e2.a) - without nested initializer list
-  union E e2 = {
-    2, 3, 0
-  };
-
-  // move cursor to e4.b.a0.x and initialize until e3.b.a1.ptr inclusive
-  union E e3 = {
-    .b.a0.x DES 2, 3, 0, 5, 6, 0
-  };
-
-  printf("=====E=====\n");
-  printA(e0.a, 0);
-  printA(e1.a, 0);
-  printA(e2.a, 0);
-  printB(e3.b, 0);
-  printf("=====E=====\n\n");
+	struct D d1 = { .y DES 3 };
+#endif
+
+	// simple union initialization - initialized first member (e0.a)
+	union E e0 = {
+		y0
+	};
+
+	// simple union initialization - initializes first member (e1.a) - with nested initializer list
+	union E e1 = {
+		{ 2, 3, 0 }
+	};
+
+	// simple union initialization - initializes first member (e2.a) - without nested initializer list
+	union E e2 = {
+		2, 3, 0
+	};
+
+	// move cursor to e4.b.a0.x and initialize until e3.b.a1.ptr inclusive
+	union E e3 = {
+		.b.a0.x DES 2, 3, 0, 5, 6, 0
+	};
+
+	printf("=====E=====\n");
+	printA(e0.a, 0);
+	printA(e1.a, 0);
+	printA(e2.a, 0);
+	printB(e3.b, 0);
+	printf("=====E=====\n\n");
+
+	// special case of initialization: char[] can be initialized with a string literal
+	const char * str0 = "hello";
+	char str1[] = "hello";
 }
 
