Index: src/Common/PassVisitor.impl.h
===================================================================
--- src/Common/PassVisitor.impl.h	(revision 982832e24b58f99cf8d892fbb03bfd2c5cd57b15)
+++ src/Common/PassVisitor.impl.h	(revision f92c6969281d9fe4d6f1cd6b904b52c4294d54d1)
@@ -66,4 +66,5 @@
 	DeclList_t* beforeDecls = visitor.get_beforeDecls();
 	DeclList_t* afterDecls  = visitor.get_afterDecls();
+	SemanticError errors;
 
 	for ( std::list< Declaration* >::iterator i = decls.begin(); ; ++i ) {
@@ -73,10 +74,18 @@
 		if ( i == decls.end() ) break;
 
-		// run mutator on declaration
-		maybeAccept( *i, visitor );
+		try {
+			// run visitor on declaration
+			maybeAccept( *i, visitor );
+		} catch( SemanticError &e ) {
+			e.set_location( (*i)->location );
+			errors.append( e );
+		}
 
 		// splice in new declarations before current decl
 		if ( !empty( beforeDecls ) ) { decls.splice( i, *beforeDecls ); }
 	}
+	if ( ! errors.isEmpty() ) {
+		throw errors;
+	}
 }
 
@@ -86,4 +95,5 @@
 	DeclList_t* beforeDecls = mutator.get_beforeDecls();
 	DeclList_t* afterDecls  = mutator.get_afterDecls();
+	SemanticError errors;
 
 	for ( std::list< Declaration* >::iterator i = decls.begin(); ; ++i ) {
@@ -92,10 +102,17 @@
 
 		if ( i == decls.end() ) break;
-
-		// run mutator on declaration
-		*i = maybeMutate( *i, mutator );
+		try {
+			// run mutator on declaration
+			*i = maybeMutate( *i, mutator );
+		} catch( SemanticError &e ) {
+			e.set_location( (*i)->location );
+			errors.append( e );
+		}
 
 		// splice in new declarations before current decl
 		if ( !empty( beforeDecls ) ) { decls.splice( i, *beforeDecls ); }
+	}
+	if ( ! errors.isEmpty() ) {
+		throw errors;
 	}
 }
@@ -445,5 +462,5 @@
 	indexerAddEnum( node );
 
-	// unlike structs, contexts, and unions, enums inject their members into the global scope
+	// unlike structs, traits, and unions, enums inject their members into the global scope
 	maybeMutateRef( node->parameters, *this );
 	maybeMutateRef( node->members   , *this );
Index: src/Common/PassVisitor.proto.h
===================================================================
--- src/Common/PassVisitor.proto.h	(revision 982832e24b58f99cf8d892fbb03bfd2c5cd57b15)
+++ src/Common/PassVisitor.proto.h	(revision f92c6969281d9fe4d6f1cd6b904b52c4294d54d1)
@@ -179,5 +179,5 @@
 
 template<typename pass_type>
-static inline auto indexer_impl_enterScope( pass_type &, int ) {}
+static inline auto indexer_impl_enterScope( pass_type &, long ) {}
 
 template<typename pass_type>
@@ -187,5 +187,5 @@
 
 template<typename pass_type>
-static inline auto indexer_impl_leaveScope( pass_type &, int ) {}
+static inline auto indexer_impl_leaveScope( pass_type &, long ) {}
 
 
@@ -197,5 +197,5 @@
                                                                                                                                \
 template<typename pass_type>                                                                                                   \
-static inline void indexer_impl_##func ( pass_type &, long, type ) {}                                                          \
+static inline void indexer_impl_##func ( pass_type &, long, type ) { }                                                          \
 
 INDEXER_FUNC( addId     , DeclarationWithType * );
@@ -215,5 +215,5 @@
 
 template<typename pass_type>
-static inline auto indexer_impl_addStructFwd( pass_type &, int, StructDecl * ) {}
+static inline auto indexer_impl_addStructFwd( pass_type &, long, StructDecl * ) {}
 
 template<typename pass_type>
@@ -225,5 +225,5 @@
 
 template<typename pass_type>
-static inline auto indexer_impl_addUnionFwd( pass_type &, int, UnionDecl * ) {}
+static inline auto indexer_impl_addUnionFwd( pass_type &, long, UnionDecl * ) {}
 
 template<typename pass_type>
@@ -235,5 +235,5 @@
 
 template<typename pass_type>
-static inline auto indexer_impl_addStruct( pass_type &, int, const std::string & ) {}
+static inline auto indexer_impl_addStruct( pass_type &, long, const std::string & ) {}
 
 template<typename pass_type>
@@ -245,3 +245,3 @@
 
 template<typename pass_type>
-static inline auto indexer_impl_addUnion( pass_type &, int, const std::string & ) {}
+static inline auto indexer_impl_addUnion( pass_type &, long, const std::string & ) {}
