Ejemplo n.º 1
0
        private static string GetFullName(this Type @this, SortedSet <string> namespaces, NullableContext context)
        {
            var dissector      = TypeDissector.Create(@this);
            var pointer        = dissector.IsPointer ? "*" : string.Empty;
            var array          = dissector.IsArray ? $"[]{(context.GetNextFlag() == NullableContext.Annotated ? "?" : string.Empty)}" : string.Empty;
            var typeAnnotation = dissector.RootType.IsValueType ? string.Empty :
                                 context.GetNextFlag() == NullableContext.Annotated ? "?" : string.Empty;

            // We're discarding the "0" flag for generic value types.
            if (dissector.RootType.IsValueType && dissector.RootType.IsGenericType)
            {
                context.GetNextFlag();
            }
            return($"{dissector.SafeName}{dissector.RootType.GetGenericArguments(namespaces, context).arguments}{typeAnnotation}{pointer}{array}");
        }