4 instantiations of TypeName
System.Private.CoreLib (4)
src\libraries\System.Reflection.Metadata\src\System\Reflection\Metadata\TypeNameParser.cs (4)
217
TypeName result =
new
(fullName, assemblyName, declaringType: declaringType);
220
result =
new
(fullName: null, assemblyName, elementOrGenericType: result, declaringType, genericArgs);
230
result =
new
(fullName: null, assemblyName, elementOrGenericType: result, rankOrModifier: parsedModifier);
277
declaringType =
new
(fullTypeName, assemblyName, declaringType: declaringType, nestedNameLength: fullNameLength);
53 references to TypeName
System.Private.CoreLib (53)
src\Internal\VersionResilientHashCode.CoreCLR.cs (2)
29
public static int TypeHashCode(
TypeName
type)
71
private static int GenericInstanceHashCode(int hashcode, ReadOnlySpan<
TypeName
> instantiation)
src\libraries\System.Private.CoreLib\src\System\Reflection\TypeNameResolver.cs (6)
34
private Type? Resolve(
TypeName
typeName)
68
private Type? GetSimpleType(
TypeName
typeName)
72
TypeName
current = typeName;
85
nestedTypeNames[--nestingDepth] =
TypeName
.Unescape(current.Name);
102
private Type? GetGenericType(
TypeName
typeName)
108
ReadOnlySpan<
TypeName
> genericArgs = typeName.GetGenericArguments();
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\TypeMapLazyDictionary.cs (3)
160
TypeName
parsedSource = TypeNameParser.Parse(sourceTypeBuffer.Buffer, throwOnError: true)!;
346
private static int ComputeHashCode(
TypeName
key)
404
TypeName
parsedSourceTypeName,
src\libraries\System.Reflection.Metadata\src\System\Reflection\Metadata\TypeName.cs (22)
35
private readonly
TypeName
? _elementOrGenericType;
36
private readonly
TypeName
? _declaringType;
38
private readonly List<
TypeName
>? _genericArguments;
46
TypeName
? elementOrGenericType = default,
47
TypeName
? declaringType = default,
49
List<
TypeName
>? genericTypeArguments = default,
133
/// Returns assembly name which contains this type, or null if this <see cref="
TypeName
"/> was not
146
public
TypeName
DeclaringType
210
foreach (
TypeName
genericArg in GetGenericArguments())
376
TypeName
rootTypeName = this;
414
/// Represents the total number of <see cref="
TypeName
"/> instances that are used to describe
420
/// as the total number of <see cref="
TypeName
"/> instances that would be created if
421
/// you were to totally deconstruct this instance and visit each intermediate <see cref="
TypeName
"/>
428
/// involves inspecting 8 <see cref="
TypeName
"/> instances total:
441
/// <exception cref="OverflowException">The total number of <see cref="
TypeName
"/> instances that are used to describe
459
foreach (
TypeName
genericArgument in GetGenericArguments())
479
public
TypeName
GetElementType()
496
public
TypeName
GetGenericTypeDefinition()
514
public static
TypeName
Parse(ReadOnlySpan<char> typeName, TypeNameParseOptions? options = default)
524
public static bool TryParse(ReadOnlySpan<char> typeName, [NotNullWhen(true)] out
TypeName
? result, TypeNameParseOptions? options = default)
565
/// If this <see cref="
TypeName
"/> represents a constructed generic type, returns an array
574
ReadOnlySpan<
TypeName
> GetGenericArguments() => CollectionsMarshal.AsSpan(_genericArguments);
src\libraries\System.Reflection.Metadata\src\System\Reflection\Metadata\TypeNameParser.cs (10)
31
internal static
TypeName
? Parse(ReadOnlySpan<char> typeName, bool throwOnError, TypeNameParseOptions? options = default)
46
TypeName
? parsedName = parser.ParseNextTypeName(allowFullyQualifiedName: true, ref recursiveDepth);
70
private
TypeName
? ParseNextTypeName(bool allowFullyQualifiedName, ref int recursiveDepth)
90
List<
TypeName
>? genericArgs = null;
108
TypeName
? genericArg = ParseNextTypeName(allowFullyQualifiedName: doubleBrackets, ref recursiveDepth);
123
genericArgs = new List<
TypeName
>(2);
216
TypeName
? declaringType = GetDeclaringType(fullName, nestedNameLengths, assemblyName);
217
TypeName
result = new(fullName, assemblyName, declaringType: declaringType);
262
private static
TypeName
? GetDeclaringType(string fullTypeName, List<int>? nestedNameLengths, AssemblyNameInfo? assemblyName)
271
TypeName
? declaringType = null;
src\System\Reflection\TypeNameResolver.CoreCLR.cs (10)
63
TypeName
? parsed = TypeNameParser.Parse(typeName, throwOnError);
87
TypeName
? parsed = TypeNameParser.Parse(typeName, throwOnError, new() { IsAssemblyGetType = true });
118
TypeName
parsed =
TypeName
.Parse(typeName);
153
TypeName
? parsed = TypeNameParser.Parse(typeName, throwOnError);
201
private Type? GetType(string escapedTypeName, ReadOnlySpan<string> nestedTypeNames,
TypeName
parsedName)
283
return GetTypeFromDefaultAssemblies(
TypeName
.Unescape(escapedTypeName), nestedTypeNames, parsedName);
291
type = runtimeAssembly.GetTypeCore(
TypeName
.Unescape(escapedTypeName), useReflectionForNestedTypes ? default : nestedTypeNames,
334
nestedTypeNames[i], (i > 0) ? nestedTypeNames[i - 1] :
TypeName
.Unescape(escapedTypeName)),
344
private Type? GetTypeFromDefaultAssemblies(string typeName, ReadOnlySpan<string> nestedTypeNames,
TypeName
parsedName)