internal static String ToDisplayStringIfAvailable(this Type type, List <int> genericParameterOffsets)
        {
            RuntimeTypeHandle runtimeTypeHandle = RuntimeAugments.GetTypeHandleIfAvailable(type);
            bool hasRuntimeTypeHandle           = !runtimeTypeHandle.Equals(default(RuntimeTypeHandle));

            if (type.HasElementType)
            {
                if (type.IsArray)
                {
                    int rank = type.GetArrayRank();
                    if (rank == 1)
                    {
                        // Multidims of rank 1 are not supported on Project N so we can safely assume this is not the multidim case.
                        // Unfortunately, I can't assert it here because Reflection doesn't have any api to distinguish these cases.
                        return(CreateArrayTypeStringIfAvailable(type.GetElementType(), false, 1));
                    }
                    else
                    {
                        // Multidim arrays. This is the one case where GetElementType() isn't pay-for-play safe so
                        // talk to the diagnostic mapping tables directly if possible or give up.
                        if (!hasRuntimeTypeHandle)
                        {
                            return(null);
                        }

                        RuntimeTypeHandle elementTypeHandle;
                        if (!DiagnosticMappingTables.TryGetMultiDimArrayTypeElementType(runtimeTypeHandle, rank, out elementTypeHandle))
                        {
                            return(null);
                        }
                        Type elementType = Type.GetTypeFromHandle(elementTypeHandle);
                        return(CreateArrayTypeStringIfAvailable(elementType, true, rank));
                    }
                }
                else
                {
                    String s = type.GetElementType().ToDisplayStringIfAvailable(null);
                    if (s == null)
                    {
                        return(null);
                    }
                    return(s + (type.IsPointer ? "*" : "&"));
                }
            }
            else if (((hasRuntimeTypeHandle && RuntimeAugments.IsGenericType(runtimeTypeHandle)) || type.IsConstructedGenericType))
            {
                Type   genericTypeDefinition;
                Type[] genericTypeArguments;
                if (hasRuntimeTypeHandle)
                {
                    RuntimeTypeHandle   genericTypeDefinitionHandle;
                    RuntimeTypeHandle[] genericTypeArgumentHandles;

                    if (!DiagnosticMappingTables.TryGetConstructedGenericTypeComponents(runtimeTypeHandle, out genericTypeDefinitionHandle, out genericTypeArgumentHandles))
                    {
                        return(null);
                    }
                    genericTypeDefinition = Type.GetTypeFromHandle(genericTypeDefinitionHandle);
                    genericTypeArguments  = new Type[genericTypeArgumentHandles.Length];
                    for (int i = 0; i < genericTypeArguments.Length; i++)
                    {
                        genericTypeArguments[i] = Type.GetTypeFromHandle(genericTypeArgumentHandles[i]);
                    }
                }
                else
                {
                    genericTypeDefinition = type.GetGenericTypeDefinition();
                    genericTypeArguments  = type.GenericTypeArguments;
                }

                return(CreateConstructedGenericTypeStringIfAvailable(genericTypeDefinition, genericTypeArguments));
            }
            else if (type.IsGenericParameter)
            {
                return(type.Name);
            }
            else if (hasRuntimeTypeHandle)
            {
                String s;
                if (!DiagnosticMappingTables.TryGetDiagnosticStringForNamedType(runtimeTypeHandle, out s, genericParameterOffsets))
                {
                    return(null);
                }

                return(s);
            }
            else
            {
                return(null);
            }
        }