Index: src/AST/GenericSubstitution.cpp
===================================================================
--- src/AST/GenericSubstitution.cpp	(revision f23de79d3598c65a1d98ae2a637ac911add4fd81)
+++ src/AST/GenericSubstitution.cpp	(revision 0b8bf2756f5d522b7c14e40729098a2599ad2997)
@@ -23,5 +23,5 @@
 #include "Pass.hpp"
 #include "Type.hpp"
-#include "TypeSubstitution.cpp"
+#include "TypeSubstitution.hpp"
 
 namespace ast {
@@ -32,5 +32,5 @@
 
 		void previsit( const Type * ty ) {
-			assertf( false, "Attempted generic substitution for non-aggregate type: %s", 
+			assertf( false, "Attempted generic substitution for non-aggregate type: %s",
 				toString( ty ).c_str() );
 		}
Index: src/AST/Pass.proto.hpp
===================================================================
--- src/AST/Pass.proto.hpp	(revision f23de79d3598c65a1d98ae2a637ac911add4fd81)
+++ src/AST/Pass.proto.hpp	(revision 0b8bf2756f5d522b7c14e40729098a2599ad2997)
@@ -115,4 +115,24 @@
 		static constexpr bool value = std::is_void< ret_t >::value ||
 			std::is_base_of<const node_t, typename std::remove_pointer<ret_t>::type >::value;
+	};
+
+	template<bool is_void>
+	struct __assign;
+
+	template<>
+	struct __assign<true> {
+		template<typename pass_t, typename node_t>
+		static inline void result( pass_t & pass, const node_t * & node ) {
+			pass.previsit( node );
+		}
+	};
+
+	template<>
+	struct __assign<false> {
+		template<typename pass_t, typename node_t>
+		static inline void result( pass_t & pass, const node_t * & node ) {
+			node = pass.previsit( node );
+			assertf(node, "Previsit must not return NULL");
+		}
 	};
 
@@ -138,10 +158,10 @@
 			"Previsit may not change the type of the node. It must return its paremeter or void."
 		);
-		if(std::is_void< decltype( pass.previsit(node) ) >::value) {
-			pass.previsit( node );
-		} else {
-			node = pass.previsit( node );
-			assert(node);
-		}
+
+		__assign<
+			std::is_void<
+				decltype( pass.previsit( node ) )
+			>::value
+		>::result( pass, node );
 	}
 
Index: src/AST/module.mk
===================================================================
--- src/AST/module.mk	(revision f23de79d3598c65a1d98ae2a637ac911add4fd81)
+++ src/AST/module.mk	(revision 0b8bf2756f5d522b7c14e40729098a2599ad2997)
@@ -21,4 +21,5 @@
 	AST/DeclReplacer.cpp \
 	AST/Expr.cpp \
+	AST/GenericSubstitution.cpp \
 	AST/Init.cpp \
 	AST/LinkageSpec.cpp \
