Index: src/GenPoly/Box.cc
===================================================================
--- src/GenPoly/Box.cc	(revision 6c3a988fe7dbaec419f8cc1c6be3085432447a99)
+++ src/GenPoly/Box.cc	(revision dd0c97ba0a6e76dbcf399c982e690763d09792f5)
@@ -136,8 +136,13 @@
 			template< typename DeclClass >
 			DeclClass *handleDecl( DeclClass *decl, Type *type );
-
-			using PolyMutator::mutate;
+			template< typename AggDecl >
+			AggDecl * handleAggDecl( AggDecl * aggDecl );
+
+			typedef PolyMutator Parent;
+			using Parent::mutate;
 			virtual DeclarationWithType *mutate( FunctionDecl *functionDecl ) override;
 			virtual ObjectDecl *mutate( ObjectDecl *objectDecl ) override;
+			virtual StructDecl *mutate( StructDecl *structDecl ) override;
+			virtual UnionDecl *mutate( UnionDecl *unionDecl ) override;
 			virtual TypeDecl *mutate( TypeDecl *typeDecl ) override;
 			virtual TypedefDecl *mutate( TypedefDecl *typedefDecl ) override;
@@ -1275,5 +1280,5 @@
 		template< typename DeclClass >
 		DeclClass * Pass2::handleDecl( DeclClass *decl, Type *type ) {
-			DeclClass *ret = static_cast< DeclClass *>( Mutator::mutate( decl ) );
+			DeclClass *ret = static_cast< DeclClass *>( Parent::mutate( decl ) );
 
 			return ret;
@@ -1309,4 +1314,21 @@
 		}
 
+		template< typename AggDecl >
+		AggDecl * Pass2::handleAggDecl( AggDecl * aggDecl ) {
+			// prevent tyVars from leaking into containing scope
+			scopeTyVars.beginScope();
+			Parent::mutate( aggDecl );
+			scopeTyVars.endScope();
+			return aggDecl;
+		}
+
+		StructDecl * Pass2::mutate( StructDecl *aggDecl ) {
+			return handleAggDecl( aggDecl );
+		}
+
+		UnionDecl * Pass2::mutate( UnionDecl *aggDecl ) {
+			return handleAggDecl( aggDecl );
+		}
+
 		TypeDecl * Pass2::mutate( TypeDecl *typeDecl ) {
 			addToTyVarMap( typeDecl, scopeTyVars );
@@ -1314,5 +1336,5 @@
 				return handleDecl( typeDecl, typeDecl->get_base() );
 			} else {
-				return Mutator::mutate( typeDecl );
+				return Parent::mutate( typeDecl );
 			}
 		}
@@ -1326,5 +1348,5 @@
 			makeTyVarMap( pointerType, scopeTyVars );
 
-			Type *ret = Mutator::mutate( pointerType );
+			Type *ret = Parent::mutate( pointerType );
 
 			scopeTyVars.endScope();
