Index: src/SynTree/TypeSubstitution.cc
===================================================================
--- src/SynTree/TypeSubstitution.cc	(revision d9f1b2df60273d9c673c37ac6cf70f4752991798)
+++ src/SynTree/TypeSubstitution.cc	(revision 084184bf7504f75f57cd4b92bc5f34c67947ac09)
@@ -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
 }
 
