Index: src/InitTweak/GenInit.cc
===================================================================
--- src/InitTweak/GenInit.cc	(revision 668e971a4b0566f4b96f071a18a0a01df07df822)
+++ src/InitTweak/GenInit.cc	(revision 8f9cc50b091ccf00d76ddcc332e7e31fe53bfaac)
@@ -246,5 +246,6 @@
 			}
 		}
-		return managedTypes.find( SymTab::Mangler::mangle( type ) ) != managedTypes.end();
+		// a type is managed if it appears in the map of known managed types, or if it contains any polymorphism (is a type variable or generic type containing a type variable)
+		return managedTypes.find( SymTab::Mangler::mangle( type ) ) != managedTypes.end() || GenPoly::isPolyType( type );
 	}
 
Index: src/ResolvExpr/Resolver.cc
===================================================================
--- src/ResolvExpr/Resolver.cc	(revision 668e971a4b0566f4b96f071a18a0a01df07df822)
+++ src/ResolvExpr/Resolver.cc	(revision 8f9cc50b091ccf00d76ddcc332e7e31fe53bfaac)
@@ -66,6 +66,6 @@
 		void handlePtrType( PtrType * type );
 
-	  void resolveAggrInit( AggregateDecl *, InitIterator &, InitIterator & );
-	  void resolveSingleAggrInit( Declaration *, InitIterator &, InitIterator & );
+	  void resolveAggrInit( ReferenceToType *, InitIterator &, InitIterator & );
+	  void resolveSingleAggrInit( Declaration *, InitIterator &, InitIterator &, TypeSubstitution sub );
 	  void fallbackInit( ConstructorInit * ctorInit );
 
@@ -396,8 +396,28 @@
 	}
 
-	void Resolver::resolveSingleAggrInit( Declaration * dcl, InitIterator & init, InitIterator & initEnd ) {
+	template< typename AggrInst >
+	TypeSubstitution makeGenericSubstitutuion( AggrInst * inst ) {
+		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 ) {
 		DeclarationWithType * dt = dynamic_cast< DeclarationWithType * >( dcl );
 		assert( dt );
-		initContext = dt->get_type();
+		// need to substitute for generic types, so that casts are to concrete types
+		initContext = dt->get_type()->clone();
+		sub.apply( initContext );
+
 		try {
 			if ( init == initEnd ) return; // stop when there are no more initializers
@@ -406,8 +426,6 @@
 		} catch( SemanticError & ) {
 			// need to delve deeper, if you can
-			if ( StructInstType * sit = dynamic_cast< StructInstType * >( dt->get_type() ) ) {
-				resolveAggrInit( sit->get_baseStruct(), init, initEnd );
-			} else if ( UnionInstType * uit = dynamic_cast< UnionInstType * >( dt->get_type() ) ) {
-				resolveAggrInit( uit->get_baseUnion(), init, initEnd );
+			if ( ReferenceToType * type = isStructOrUnion( initContext ) ) {
+				resolveAggrInit( type, init, initEnd );
 			} else {
 				// member is not an aggregate type, so can't go any deeper
@@ -419,15 +437,20 @@
 	}
 
-	void Resolver::resolveAggrInit( AggregateDecl * aggr, InitIterator & init, InitIterator & initEnd ) {
-		if ( StructDecl * st = dynamic_cast< StructDecl * >( aggr ) ) {
+	void Resolver::resolveAggrInit( ReferenceToType * inst, InitIterator & init, InitIterator & initEnd ) {
+
+		if ( StructInstType * sit = dynamic_cast< StructInstType * >( inst ) ) {
+			TypeSubstitution sub = makeGenericSubstitutuion( sit );
+			StructDecl * st = sit->get_baseStruct();
 			// 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 );
+				resolveSingleAggrInit( *it, init, initEnd, sub );
 			}
-		} else if ( UnionDecl * un = dynamic_cast< UnionDecl * >( aggr ) ) {
+		} else if ( UnionInstType * uit = dynamic_cast< UnionInstType * >( inst ) ) {
+			TypeSubstitution sub = makeGenericSubstitutuion( sit );
+			UnionDecl * un = uit->get_baseUnion();
 			// only resolve to the first member of a union
-			resolveSingleAggrInit( *un->get_members().begin(), init, initEnd );
+			resolveSingleAggrInit( *un->get_members().begin(), init, initEnd, sub );
 		} // if
 	}
@@ -449,8 +472,6 @@
 				(*iter++)->accept( *this );
 			}
-		} else if ( StructInstType * st = dynamic_cast< StructInstType * >( initContext ) ) {
-			resolveAggrInit( st->get_baseStruct(), iter, end );
-		} else if ( UnionInstType * st = dynamic_cast< UnionInstType * >( initContext ) ) {
-			resolveAggrInit( st->get_baseUnion(), iter, end );
+		} else if ( ReferenceToType * type = isStructOrUnion( initContext ) ) {
+			resolveAggrInit( type, iter, end );
 		} else if ( TypeInstType * tt = dynamic_cast< TypeInstType * >( initContext ) ) {
 			Type * base = tt->get_baseType()->get_base();
