Index: src/ResolvExpr/SpecCost.cc
===================================================================
--- src/ResolvExpr/SpecCost.cc	(revision 20207c02efaa0537d8bd93ff326cf0baf5424a82)
+++ src/ResolvExpr/SpecCost.cc	(revision 978e5eb2a935600a493cda570c9293584824c675)
@@ -43,4 +43,7 @@
 		// mark specialization of base type
 		void postvisit(ReferenceType*) { if ( count >= 0 ) ++count; }
+
+		void postvisit(StructInstType*) { if ( count >= 0 ) ++count; }
+		void postvisit(UnionInstType*) { if ( count >= 0 ) ++count; }
 
 	private:
@@ -82,5 +85,4 @@
 		void previsit(StructInstType* sty) {
 			count = minover( sty->parameters );
-			visit_children = false;
 		}
 
@@ -88,5 +90,4 @@
 		void previsit(UnionInstType* uty) {
 			count = minover( uty->parameters );
-			visit_children = false;
 		}
 
@@ -174,4 +175,7 @@
 		void postvisit( const ast::ArrayType * ) { if ( count >= 0 ) ++count; }
 		void postvisit( const ast::ReferenceType * ) { if ( count >= 0 ) ++count; }
+
+		void postvisit( const ast::StructInstType * ) { if ( count >= 0 ) ++count; }
+		void postvisit( const ast::UnionInstType * ) { if ( count >= 0 ) ++count; }
 
 		// Use the minimal specialization value over returns and params.
@@ -189,5 +193,4 @@
 		void previsit( const ast::StructInstType * sty ) {
 			count = minimumPresent( sty->params, expr_result );
-			visit_children = false;
 		}
 
@@ -195,5 +198,4 @@
 		void previsit( const ast::UnionInstType * uty ) {
 			count = minimumPresent( uty->params, expr_result );
-			visit_children = false;
 		}
 
