Index: src/Common/PassVisitor.h
===================================================================
--- src/Common/PassVisitor.h	(revision 9dcb6539e06f9ebfe8593419da5d22e6d5af6fad)
+++ src/Common/PassVisitor.h	(revision 982832e24b58f99cf8d892fbb03bfd2c5cd57b15)
@@ -147,5 +147,5 @@
 	virtual Declaration* mutate( EnumDecl *aggregateDecl ) override final;
 	virtual Declaration* mutate( TraitDecl *aggregateDecl ) override final;
-	virtual TypeDecl* mutate( TypeDecl *typeDecl ) override final;
+	virtual Declaration* mutate( TypeDecl *typeDecl ) override final;
 	virtual Declaration* mutate( TypedefDecl *typeDecl ) override final;
 	virtual AsmDecl* mutate( AsmDecl *asmDecl ) override final;
Index: src/Common/PassVisitor.impl.h
===================================================================
--- src/Common/PassVisitor.impl.h	(revision 9dcb6539e06f9ebfe8593419da5d22e6d5af6fad)
+++ src/Common/PassVisitor.impl.h	(revision 982832e24b58f99cf8d892fbb03bfd2c5cd57b15)
@@ -506,5 +506,5 @@
 
 template< typename pass_type >
-TypeDecl * PassVisitor< pass_type >::mutate( TypeDecl * node ) {
+Declaration * PassVisitor< pass_type >::mutate( TypeDecl * node ) {
 	MUTATE_START( node );
 
@@ -521,5 +521,5 @@
 	indexerScopedMutate( node->init, *this );
 
-	MUTATE_END( TypeDecl, node );
+	MUTATE_END( Declaration, node );
 }
 
Index: src/Common/utility.h
===================================================================
--- src/Common/utility.h	(revision 9dcb6539e06f9ebfe8593419da5d22e6d5af6fad)
+++ src/Common/utility.h	(revision 982832e24b58f99cf8d892fbb03bfd2c5cd57b15)
@@ -389,4 +389,38 @@
 }
 
+// -----------------------------------------------------------------------------
+// Helper struct and function to support
+// for ( val : lazy_map( container1, f ) ) {}
+// syntax to have a for each that iterates a container, mapping each element by applying f
+template< typename T, typename Func >
+struct lambda_iterate_t {
+	const T & ref;
+	std::function<Func> f;
+
+	struct iterator {
+		typedef decltype(begin(ref)) Iter;
+		Iter it;
+		std::function<Func> f;
+		iterator( Iter it, std::function<Func> f ) : it(it), f(f) {}
+		iterator & operator++() {
+			++it; return *this;
+		}
+		bool operator!=( const iterator &other ) const { return it != other.it; }
+		auto operator*() const -> decltype(f(*it)) { return f(*it); }
+	};
+
+	lambda_iterate_t( const T & ref, std::function<Func> f ) : ref(ref), f(f) {}
+
+	auto begin() const -> decltype(iterator(std::begin(ref), f)) { return iterator(std::begin(ref), f); }
+	auto end() const   -> decltype(iterator(std::end(ref), f)) { return iterator(std::end(ref), f); }
+};
+
+template< typename... Args >
+lambda_iterate_t<Args...> lazy_map( const Args &... args ) {
+	return lambda_iterate_t<Args...>( args...);
+}
+
+
+
 // Local Variables: //
 // tab-width: 4 //
