Index: src/AST/Pass.impl.hpp
===================================================================
--- src/AST/Pass.impl.hpp	(revision 112fe046f8405227f2a94f6adddf307ba760957a)
+++ src/AST/Pass.impl.hpp	(revision b0abc8a02c452bd4a4675437c5aa0ca43e19893c)
@@ -841,5 +841,5 @@
 		for( const auto & clause : node->clauses ) {
 
-			Expr * func = clause.target.func ? clause.target.func->accept(*this) : nullptr;
+			const Expr * func = clause.target.func ? clause.target.func->accept(*this) : nullptr;
 			if(func != clause.target.func) mutated = true;
 
@@ -852,8 +852,8 @@
 			}
 
-			Stmt * stmt = clause.stmt ? clause.stmt->accept(*this) : nullptr;
+			const Stmt * stmt = clause.stmt ? clause.stmt->accept(*this) : nullptr;
 			if(stmt != clause.stmt) mutated = true;
 
-			Expr * cond = clause.cond ? clause.cond->accept(*this) : nullptr;
+			const Expr * cond = clause.cond ? clause.cond->accept(*this) : nullptr;
 			if(cond != clause.cond) mutated = true;
 
@@ -1567,5 +1567,5 @@
 		bool mutated = false;
 		for( const auto & assoc : node->associations ) {
-			Type * type = nullptr;
+			const Type * type = nullptr;
 			if( assoc.type ) {
 				guard_indexer guard { *this };
@@ -1573,5 +1573,5 @@
 				if( type != assoc.type ) mutated = true;
 			}
-			Expr * expr = nullptr;
+			const Expr * expr = nullptr;
 			if( assoc.expr ) {
 				expr = assoc.expr->accept( *this );
@@ -1685,5 +1685,5 @@
 	VISIT_START( node );
 
-	__pass::indexer::addStruct( node->name, 0, pass );
+	__pass::indexer::addStruct( pass, 0, node->name );
 
 	VISIT({
@@ -1702,5 +1702,5 @@
 	VISIT_START( node );
 
-	__pass::indexer::addStruct( node->name, 0, pass );
+	__pass::indexer::addStruct( pass, 0, node->name );
 
 	{
@@ -1885,46 +1885,46 @@
 }
 
-// //--------------------------------------------------------------------------
-// // TypeSubstitution
-// template< typename pass_t >
-// const ast::TypeSubstitution * ast::Pass< pass_t >::visit( const ast::TypeSubstitution * node ) {
-// 	VISIT_START( node );
-
-// 	VISIT(
-// 		{
-// 			bool mutated = false;
-// 			std::unordered_map< std::string, ast::ptr< ast::Type > > new_map;
-// 			for ( const auto & p : node->typeEnv ) {
-// 				guard_indexer guard { *this };
-// 				auto new_node = p.second->accept( *this );
-// 				if (new_node != p.second) mutated = false;
-// 				new_map.insert({ p.first, new_node });
-// 			}
-// 			if (mutated) {
-// 				auto new_node = mutate( node );
-// 				new_node->typeEnv.swap( new_map );
-// 				node = new_node;
-// 			}
-// 		}
-
-// 		{
-// 			bool mutated = false;
-// 			std::unordered_map< std::string, ast::ptr< ast::Expr > > new_map;
-// 			for ( const auto & p : node->varEnv ) {
-// 				guard_indexer guard { *this };
-// 				auto new_node = p.second->accept( *this );
-// 				if (new_node != p.second) mutated = false;
-// 				new_map.insert({ p.first, new_node });
-// 			}
-// 			if (mutated) {
-// 				auto new_node = mutate( node );
-// 				new_node->varEnv.swap( new_map );
-// 				node = new_node;
-// 			}
-// 		}
-// 	)
-
-// 	VISIT_END( TypeSubstitution, node );
-// }
+//--------------------------------------------------------------------------
+// TypeSubstitution
+template< typename pass_t >
+const ast::TypeSubstitution * ast::Pass< pass_t >::visit( const ast::TypeSubstitution * node ) {
+	VISIT_START( node );
+
+	VISIT(
+		{
+			bool mutated = false;
+			std::unordered_map< std::string, ast::ptr< ast::Type > > new_map;
+			for ( const auto & p : node->typeEnv ) {
+				guard_indexer guard { *this };
+				auto new_node = p.second->accept( *this );
+				if (new_node != p.second) mutated = false;
+				new_map.insert({ p.first, new_node });
+			}
+			if (mutated) {
+				auto new_node = mutate( node );
+				new_node->typeEnv.swap( new_map );
+				node = new_node;
+			}
+		}
+
+		{
+			bool mutated = false;
+			std::unordered_map< std::string, ast::ptr< ast::Expr > > new_map;
+			for ( const auto & p : node->varEnv ) {
+				guard_indexer guard { *this };
+				auto new_node = p.second->accept( *this );
+				if (new_node != p.second) mutated = false;
+				new_map.insert({ p.first, new_node });
+			}
+			if (mutated) {
+				auto new_node = mutate( node );
+				new_node->varEnv.swap( new_map );
+				node = new_node;
+			}
+		}
+	)
+
+	VISIT_END( TypeSubstitution, node );
+}
 
 #undef VISIT_START
