private static string GetAssemblyQualifiedName(this ITypeElement type,
                                                       ISubstitution substitution,
                                                       IDictionary <DeclaredElementInstance, IName> seenElements)
        {
            if (type == null)
            {
                return(Names.UnknownType.Identifier);
            }

            var clrTypeName      = type.GetClrName();
            var containingModule = type.Module.ContainingProjectModule;

            Asserts.NotNull(containingModule, "module is null");
            var moduleName = containingModule.GetQualifiedName();

            var typeParameters = type.GetTypeParametersList(substitution, seenElements);

            string myName;
            var    parent     = type.GetContainingType();
            var    myFullName = clrTypeName.FullName;

            if (parent != null)
            {
                var parentName = parent.GetName <ITypeName>(substitution);
                // including the generic `N ticks
                var parentFullName = parentName.FullName;
                // shortName does not include the generic `N ticks, so we have to find it in the fullname...
                var startOfShortName = myFullName.LastIndexOf("+", StringComparison.Ordinal) + 1;
                //  ... and ignore the leading part
                var fullShortName = myFullName.Substring(startOfShortName);
                myName = string.Format("{0}+{1}", parentFullName, fullShortName);
            }
            else
            {
                myName = myFullName;
            }

            return(string.Format(
                       "{0}{1}, {2}",
                       myName,
                       typeParameters,
                       moduleName));
        }