Index: src/SynTree/ReferenceToType.cc
===================================================================
--- src/SynTree/ReferenceToType.cc	(revision 4673385463bf1255bd0a027cd1670ed4a00fcbef)
+++ src/SynTree/ReferenceToType.cc	(revision 63afee01b295cdf30409284a0c1d8f6f5d5b1049)
@@ -59,4 +59,6 @@
 std::string StructInstType::typeString() const { return "struct"; }
 
+std::list<TypeDecl*>& StructInstType::get_baseParameters() { return baseStruct->get_parameters(); }
+
 void StructInstType::lookup( const std::string &name, std::list< Declaration* > &foundDecls ) const {
 	assert( baseStruct );
@@ -65,4 +67,6 @@
 
 std::string UnionInstType::typeString() const { return "union"; }
+
+std::list<TypeDecl*>& UnionInstType::get_baseParameters() { return baseUnion->get_parameters(); }
 
 void UnionInstType::lookup( const std::string &name, std::list< Declaration* > &foundDecls ) const {
Index: src/SynTree/Type.h
===================================================================
--- src/SynTree/Type.h	(revision 4673385463bf1255bd0a027cd1670ed4a00fcbef)
+++ src/SynTree/Type.h	(revision 63afee01b295cdf30409284a0c1d8f6f5d5b1049)
@@ -237,6 +237,10 @@
 	StructDecl *get_baseStruct() const { return baseStruct; }
 	void set_baseStruct( StructDecl *newValue ) { baseStruct = newValue; }
-	
-	// a utility function
+
+	/// Accesses generic parameters of base struct
+	std::list<TypeDecl*>& get_baseParameters();
+	
+	/// Looks up the members of this struct named "name" and places them into "foundDecls".
+	/// Clones declarations into "foundDecls", caller responsible for freeing
 	void lookup( const std::string &name, std::list< Declaration* > &foundDecls ) const;
 
@@ -260,6 +264,10 @@
 	UnionDecl *get_baseUnion() const { return baseUnion; }
 	void set_baseUnion( UnionDecl *newValue ) { baseUnion = newValue; }
-	
-	// a utility function
+
+	/// Accesses generic parameters of base union
+	std::list<TypeDecl*>& get_baseParameters();
+	
+	/// looks up the members of this union named "name" and places them into "foundDecls"
+	/// Clones declarations into "foundDecls", caller responsible for freeing
 	void lookup( const std::string &name, std::list< Declaration* > &foundDecls ) const;
 
Index: src/SynTree/TypeSubstitution.cc
===================================================================
--- src/SynTree/TypeSubstitution.cc	(revision 4673385463bf1255bd0a027cd1670ed4a00fcbef)
+++ src/SynTree/TypeSubstitution.cc	(revision 63afee01b295cdf30409284a0c1d8f6f5d5b1049)
@@ -126,4 +126,5 @@
 Type *TypeSubstitution::handleType( TypeClass *type ) {
 	BoundVarsType oldBoundVars( boundVars );
+	// bind type variables from forall-qualifiers
 	if ( freeOnly ) {
 		for ( std::list< TypeDecl* >::const_iterator tyvar = type->get_forall().begin(); tyvar != type->get_forall().end(); ++tyvar ) {
@@ -136,4 +137,22 @@
 }
 
+template< typename TypeClass >
+Type *TypeSubstitution::handleAggregateType( TypeClass *type ) {
+	BoundVarsType oldBoundVars( boundVars );
+	// bind type variables from forall-qualifiers
+	if ( freeOnly ) {
+		for ( std::list< TypeDecl* >::const_iterator tyvar = type->get_forall().begin(); tyvar != type->get_forall().end(); ++tyvar ) {
+			boundVars.insert( (*tyvar )->get_name() );
+		} // for
+	} // if
+	// bind type variables from generic type instantiations
+	for ( std::list< TypeDecl* >::const_iterator tyvar = type->get_baseParameters().begin(); tyvar != type->get_baseParameters().end(); ++tyvar ) {
+		boundVars.insert( (*tyvar)->get_name() );
+	} // for
+	Type *ret = Mutator::mutate( type );
+	boundVars = oldBoundVars;
+	return ret;
+}
+
 Type * TypeSubstitution::mutate( VoidType *basicType ) {
 	return handleType( basicType );
@@ -157,9 +176,9 @@
 
 Type * TypeSubstitution::mutate( StructInstType *aggregateUseType ) {
-	return handleType( aggregateUseType );
+	return handleAggregateType( aggregateUseType );
 }
 
 Type * TypeSubstitution::mutate( UnionInstType *aggregateUseType ) {
-	return handleType( aggregateUseType );
+	return handleAggregateType( aggregateUseType );
 }
 
Index: src/SynTree/TypeSubstitution.h
===================================================================
--- src/SynTree/TypeSubstitution.h	(revision 4673385463bf1255bd0a027cd1670ed4a00fcbef)
+++ src/SynTree/TypeSubstitution.h	(revision 63afee01b295cdf30409284a0c1d8f6f5d5b1049)
@@ -58,6 +58,9 @@
 	virtual Type* mutate(TypeInstType *aggregateUseType);
 	virtual Expression* mutate(NameExpr *nameExpr);
-	
+
+	/// Records type variable bindings from forall-statements
 	template< typename TypeClass > Type *handleType( TypeClass *type );
+	/// Records type variable bindings from forall-statements and instantiations of generic types
+	template< typename TypeClass > Type *handleAggregateType( TypeClass *type );
 	
 	virtual Type* mutate(VoidType *basicType);
