Closed stakx closed 6 years ago
class Cup<T> { public T[] Array; public (bool, T) Tuple; }
typeof(Cup<>).GetField("Array").FieldType.GetFormattedName(); // => [] typeof(Cup<>).GetField("Tuple").FieldType.GetFormattedName(); // => (bool, )
In cases where a generic type parameter is used outside its generic type definition to construct another type, it would probably make sense to unconditionally imply TypeNameFormatOptions.GenericParameterNames:
TypeNameFormatOptions.GenericParameterNames
typeof(Cup<>).GetField("Array").FieldType.GetFormattedName(); // => T[] typeof(Cup<>).GetField("Tuple").FieldType.GetFormattedName(); // => (bool, T)
Or, with other words, it is only in generic type definitions that parameter names may be omitted.
Current, actual behavior:
Expected behavior:
In cases where a generic type parameter is used outside its generic type definition to construct another type, it would probably make sense to unconditionally imply
TypeNameFormatOptions.GenericParameterNames
:Or, with other words, it is only in generic type definitions that parameter names may be omitted.