private static ISet <TypeReference> CheckRecursion(ISubstitutionMap substitutionMap) { var substitutes = new HashSet <TypeReference>(substitutionMap.Values.Select(t => t.TargetType)); substitutionMap.CheckRecursions(substitutes); return(substitutes); }