private static void FindUsedUnusableTypes(IEnumerable<IType> types, INamingConventionResolver namingConvention, HashSet<ITypeDefinition> result) { foreach (var t in types) { if (t is ITypeDefinition) { if (namingConvention.GetTypeSemantics((ITypeDefinition)t).Type == TypeScriptSemantics.ImplType.NotUsableFromScript) result.Add((ITypeDefinition)t); } else if (t is ParameterizedType) { var pt = (ParameterizedType)t; FindUsedUnusableTypes(new[] { pt.GetDefinition() }.Concat(pt.TypeArguments), namingConvention, result); } } }