Index: src/CodeTools/DeclStats.cc
===================================================================
--- src/CodeTools/DeclStats.cc	(revision 97d246da445a8795c4b899478cd650136325c2ef)
+++ src/CodeTools/DeclStats.cc	(revision eed5e4836672e941a1bbd849e2b596cbeadefabc)
@@ -62,4 +62,5 @@
 			std::map<unsigned, unsigned> p_basic;  ///< Count of decls with each percentage of basic type elements
 			std::map<unsigned, unsigned> p_poly;   ///< Count of decls with each percentage of polymorphic elements
+			VectorMap<unsigned> n_types;           ///< Count of decls with each number of distinct types in the pack
 
 			ArgPackStats& operator+= (const ArgPackStats& o) {
@@ -69,4 +70,5 @@
 				sum(p_basic, o.p_basic);
 				sum(p_poly, o.p_poly);
+				sum(n_types, o.n_types);
 				
 				return *this;
@@ -121,19 +123,23 @@
 		/// Update arg pack stats based on a declaration list
 		void analyze( Stats& stats, ArgPackStats& pstats, std::list<DeclarationWithType*>& decls ) {
+			std::unordered_set<std::string> types;
 			unsigned n = 0;
 			unsigned n_basic = 0;
 			unsigned n_poly = 0;
 			for ( auto decl : decls ) {
-				n += decl->get_type()->size();
-				if ( BasicType* bt = dynamic_cast<BasicType*>( decl->get_type() ) ) {
+				Type* dt = decl->get_type();
+
+				n += dt->size();
+				
+				std::stringstream ss;
+				dt->print( ss );
+				types.insert( ss.str() );
+
+				if ( dynamic_cast<BasicType*>( dt ) ) {
 					++n_basic;
-					std::stringstream ss;
-					bt->print( ss );
 					++stats.basic_type_names[ ss.str() ];
-				} else if ( GenPoly::hasPolyBase( decl->get_type() ) ) {
+				} else if ( GenPoly::hasPolyBase( dt ) ) {
 					++n_poly;
 				} else {
-					std::stringstream ss;
-					decl->get_type()->print( ss );
 					++stats.compound_type_names[ ss.str() ];
 				}
@@ -146,4 +152,5 @@
 				++pstats.p_poly[ n_poly*100/n ];
 			}
+			++pstats.n_types.at( types.size() );
 		}
 		
@@ -267,4 +274,5 @@
 			printAllMap("%_basic_" + name, [&extract](const Stats& stats) { return extract(stats).p_basic; });
 			printAllMap("%_poly_" + name, [&extract](const Stats& stats) { return extract(stats).p_poly; });
+			printAllMap("n_distinct_types_" + name, [&extract](const Stats& stats) { return extract(stats).n_types; });
 		}
 		
