Index: src/SynTree/TypeSubstitution.cc
===================================================================
--- src/SynTree/TypeSubstitution.cc	(revision 9554d9b8896c38886ce2b6bb9384a2f1927f81d6)
+++ src/SynTree/TypeSubstitution.cc	(revision d5f1cfcb3da36b3d88f9e2eecdc29fe3aae0843e)
@@ -72,4 +72,24 @@
 Type *TypeSubstitution::lookup( std::string formalType ) const {
 	TypeEnvType::const_iterator i = typeEnv.find( formalType );
+	
+	// break on not in substitution set
+	if ( i == typeEnv.end() ) return 0;
+	
+	// attempt to transitively follow TypeInstType links.
+	while ( TypeInstType *actualType = dynamic_cast< TypeInstType* >( i->second ) ) {
+		const std::string& typeName = actualType->get_name();
+		
+		// break cycles in the transitive follow
+		if ( formalType == typeName ) break;
+		
+		// Look for the type this maps to, returning previous mapping if none-such
+		i = typeEnv.find( typeName );
+		if ( i == typeEnv.end() ) return actualType;
+	}
+	
+	// return type from substitution set
+	return i->second;
+	
+#if 0
 	if ( i == typeEnv.end() ) {
 		return 0;
@@ -77,4 +97,5 @@
 		return i->second;
 	} // if
+#endif
 }
 
