1 instantiation of RuntimeType
System.Private.CoreLib (1)
System\Reflection\Runtime\TypeInfos\RuntimeTypeInfo.cs (1)
633RuntimeType type = new RuntimeType(this);
244 references to RuntimeType
System.Private.CoreLib (244)
Internal\Reflection\Augments\ReflectionAugments.cs (6)
46internal static unsafe TypeCode GetRuntimeTypeCode(RuntimeType type) 248if (!(type is RuntimeType runtimeDelegateType)) 277if (!(type is RuntimeType runtimeDelegateType)) 304if (!(type is RuntimeType runtimeDelegateType)) 307if (!(target is RuntimeType runtimeContainingType)) 429enumInfo = Enum.GetEnumInfo((RuntimeType)runtimeTypeInfo.GetGenericTypeDefinition());
src\runtime\src\libraries\System.Private.CoreLib\src\System\Array.cs (16)
96RuntimeType? t = elementType.UnderlyingSystemType as RuntimeType; 111RuntimeType? t = elementType.UnderlyingSystemType as RuntimeType; 128RuntimeType? t = elementType.UnderlyingSystemType as RuntimeType; 145RuntimeType? t = elementType.UnderlyingSystemType as RuntimeType; 173RuntimeType? t = elementType.UnderlyingSystemType as RuntimeType; 228RuntimeType? t = arrayType as RuntimeType; 265RuntimeType? t = arrayType as RuntimeType; 321RuntimeType? t = arrayType as RuntimeType;
src\runtime\src\libraries\System.Private.CoreLib\src\System\DefaultBinder.cs (4)
551if (!(realTypes[i] is RuntimeType || realTypes[i] is SignatureType)) 590if (type.UnderlyingSystemType is not RuntimeType rtType || 677if (indexes[j].UnderlyingSystemType is not RuntimeType rtType || 695if (returnType.UnderlyingSystemType is not RuntimeType rtType ||
src\runtime\src\libraries\System.Private.CoreLib\src\System\Enum.cs (42)
59RuntimeType rt = (RuntimeType)typeof(TEnum); 100internal static string? GetName(RuntimeType enumType, ulong uint64Value) 223RuntimeType rt = (RuntimeType)typeof(TEnum); 256internal static string[] GetNamesNoCopy(RuntimeType enumType) 292Array values = GetValuesAsUnderlyingTypeNoCopy((RuntimeType)typeof(TEnum)); 339internal static Array GetValuesAsUnderlyingType(RuntimeType enumType) 369internal static Array GetValuesAsUnderlyingTypeNoCopy(RuntimeType enumType) 474RuntimeType rt = (RuntimeType)typeof(TEnum); 492internal static bool IsDefinedPrimitive<TStorage>(RuntimeType enumType, TStorage value) 723RuntimeType rt = ValidateRuntimeType(enumType); 774static bool TryParseRareTypes(RuntimeType rt, ReadOnlySpan<char> value, bool ignoreCase, bool throwOnFailure, [NotNullWhen(true)] out long result) 891RuntimeType rt = (RuntimeType)typeof(TEnum); 915RuntimeType enumType, ReadOnlySpan<char> value, bool ignoreCase, bool throwOnFailure, out TUnderlying result) 973RuntimeType enumType, ReadOnlySpan<char> value, bool ignoreCase, bool throwOnFailure, out TUnderlying result) 1043private static bool TryParseByName<TStorage>(RuntimeType enumType, ReadOnlySpan<char> value, bool ignoreCase, bool throwOnFailure, out TStorage result) 1357RuntimeType enumType = (RuntimeType)GetType(); 1374static string HandleRareTypes(RuntimeType enumType, ref byte rawData) => 1405RuntimeType enumType = (RuntimeType)GetType(); 1425static string HandleRareTypes(RuntimeType enumType, char formatChar, ref byte rawData) => 1452private static string ToString<TUnderlying, TStorage>(RuntimeType enumType, ref byte rawData) 1464private static string ToStringInlined<TUnderlying, TStorage>(RuntimeType enumType, ref byte rawData) 1481private static string ToString<TUnderlying, TStorage>(RuntimeType enumType, char format, ref byte rawData) 1494private static string ToStringInlined<TUnderlying, TStorage>(RuntimeType enumType, char format, ref byte rawData) 1630RuntimeType rtType = ValidateRuntimeType(enumType); 1690RuntimeType enumType = (RuntimeType)GetType(); 1750RuntimeType rt = (RuntimeType)typeof(TEnum); 1809RuntimeType rt = (RuntimeType)typeof(TEnum); 1857private static bool TryFormatPrimitiveDefault<TUnderlying, TStorage>(RuntimeType enumType, TUnderlying value, Span<char> destination, out int charsWritten) 1892private static bool TryFormatPrimitiveNonDefault<TUnderlying, TStorage>(RuntimeType enumType, TUnderlying value, Span<char> destination, out int charsWritten, ReadOnlySpan<char> format) 2126private static RuntimeType ValidateRuntimeType(Type enumType) 2130RuntimeType? rt = enumType as RuntimeType; 2148throw new ArgumentException(enumType is not RuntimeType ? SR.Arg_MustBeType : SR.Arg_MustBeEnum, nameof(enumType));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Reflection\Pointer.cs (4)
15private readonly RuntimeType _ptrType; 17private Pointer(void* ptr, RuntimeType ptrType) 29if (type is not RuntimeType rtType) 61internal RuntimeType GetPointerType() => _ptrType;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Reflection\RuntimeCustomAttributeData.cs (60)
32internal static IList<CustomAttributeData> GetCustomAttributesInternal(RuntimeType target) 38PseudoCustomAttribute.GetCustomAttributes(target, (RuntimeType)typeof(object), ref pcas); 48PseudoCustomAttribute.GetCustomAttributes(target, (RuntimeType)typeof(object), ref pcas); 58PseudoCustomAttribute.GetCustomAttributes(target, (RuntimeType)typeof(object), ref pcas); 108PseudoCustomAttribute.GetCustomAttributes(target, (RuntimeType)typeof(object), ref pcas); 127internal static CustomAttributeEncoding TypeToCustomAttributeEncoding(RuntimeType type) 237m_ctorParams[i] = new CustomAttributeCtorParameter(new CustomAttributeType((RuntimeType)parameters[i].ParameterType)); 256new CustomAttributeType((RuntimeType)fi.FieldType)); 264new CustomAttributeType((RuntimeType)pi.PropertyType)); 805public CustomAttributeType(RuntimeType parameterType) 815parameterType = (RuntimeType)parameterType.GetElementType()!; 823encodedEnumType = RuntimeCustomAttributeData.TypeToCustomAttributeEncoding((RuntimeType)Enum.GetUnderlyingType(parameterType)); 842internal static bool IsDefined(RuntimeType type, RuntimeType? caType, bool inherit) 858type = (type.BaseType as RuntimeType)!; 865type = (type.BaseType as RuntimeType)!; 871internal static bool IsDefined(RuntimeMethodInfo method, RuntimeType caType, bool inherit) 898internal static bool IsDefined(RuntimeConstructorInfo ctor, RuntimeType caType) 908internal static bool IsDefined(RuntimePropertyInfo property, RuntimeType caType) 918internal static bool IsDefined(RuntimeEventInfo e, RuntimeType caType) 928internal static bool IsDefined(RuntimeFieldInfo field, RuntimeType caType) 939internal static bool IsDefined(RuntimeParameterInfo parameter, RuntimeType caType) 950internal static bool IsDefined(RuntimeAssembly assembly, RuntimeType caType) 959internal static bool IsDefined(RuntimeModule module, RuntimeType caType) 969internal static object[] GetCustomAttributes(RuntimeType type, RuntimeType caType, bool inherit) 978type = (type.GetGenericTypeDefinition() as RuntimeType)!; 1003type = (type.BaseType as RuntimeType)!; 1004} while (type != (RuntimeType)typeof(object) && type != null); 1014internal static object[] GetCustomAttributes(RuntimeMethodInfo method, RuntimeType caType, bool inherit) 1056internal static object[] GetCustomAttributes(RuntimeConstructorInfo ctor, RuntimeType caType) 1066internal static object[] GetCustomAttributes(RuntimePropertyInfo property, RuntimeType caType) 1076internal static object[] GetCustomAttributes(RuntimeEventInfo e, RuntimeType caType) 1086internal static object[] GetCustomAttributes(RuntimeFieldInfo field, RuntimeType caType) 1098internal static object[] GetCustomAttributes(RuntimeParameterInfo parameter, RuntimeType caType) 1110internal static object[] GetCustomAttributes(RuntimeAssembly assembly, RuntimeType caType) 1120internal static object[] GetCustomAttributes(RuntimeModule module, RuntimeType caType) 1132int pcaCount, RuntimeType attributeFilterType) 1146private static bool MatchesTypeFilter(RuntimeType attributeType, RuntimeType attributeFilterType) 1150for (RuntimeType? type = attributeType; type != null; type = (RuntimeType?)type.BaseType) 1163RuntimeType attributeType, bool mustBeInheritable, ref ListBuilder<object> derivedAttributes) 1198internal static AttributeUsageAttribute GetAttributeUsage(RuntimeType decoratedAttribute) 1238internal static object[] CreateAttributeArrayHelper(RuntimeType caType, int elementCount) 1287private static readonly HashSet<RuntimeType> s_pca = CreatePseudoCustomAttributeHashSet(); 1291private static HashSet<RuntimeType> CreatePseudoCustomAttributeHashSet() 1309HashSet<RuntimeType> set = new HashSet<RuntimeType>(pcas.Length); 1310foreach (RuntimeType runtimeType in pcas) 1323internal static void GetCustomAttributes(RuntimeType type, RuntimeType caType, ref ListBuilder<Attribute> pcas) 1345internal static bool IsDefined(RuntimeType type, RuntimeType? caType) 1367internal static void GetCustomAttributes(RuntimeMethodInfo method, RuntimeType caType, ref ListBuilder<Attribute> pcas) 1390internal static bool IsDefined(RuntimeMethodInfo method, RuntimeType? caType) 1413internal static void GetCustomAttributes(RuntimeParameterInfo parameter, RuntimeType caType, ref ListBuilder<Attribute> pcas) 1446internal static bool IsDefined(RuntimeParameterInfo parameter, RuntimeType? caType) 1475internal static void GetCustomAttributes(RuntimeFieldInfo field, RuntimeType caType, ref ListBuilder<Attribute> pcas) 1507internal static bool IsDefined(RuntimeFieldInfo field, RuntimeType? caType)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Reflection\RuntimeParameterInfo.cs (3)
302return RuntimeCustomAttribute.GetCustomAttributes(this, (typeof(object) as RuntimeType)!); 309if (attributeType.UnderlyingSystemType is not RuntimeType attributeRuntimeType) 325if (attributeType.UnderlyingSystemType is not RuntimeType attributeRuntimeType)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Resources\ResourceManager.cs (1)
224if (resourceSource is not RuntimeType)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshal.cs (10)
94return SizeOfHelper((RuntimeType)structure.GetType(), throwIfNotMarshalable: true); 101return SizeOfHelper((RuntimeType)structure.GetType(), throwIfNotMarshalable: true); 110if (t is not RuntimeType rt) 124RuntimeType t = (RuntimeType)typeof(T); 567if (structureType is not RuntimeType) 1155if (type is not RuntimeType) 1199if (t is not RuntimeType rt) 1223RuntimeType rt = (RuntimeType)typeof(TDelegate);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\TypeMapping.cs (2)
29return TypeMapLazyDictionary.CreateExternalTypeMap((RuntimeType)typeof(TTypeMapGroup)); 47return TypeMapLazyDictionary.CreateProxyTypeMap((RuntimeType)typeof(TTypeMapGroup));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\Serialization\SerializationInfo.cs (2)
339if (type is not RuntimeType) 356Debug.Assert(type is RuntimeType, "[SerializationInfo.GetValue]type is not a runtime type");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Type.cs (8)
35if (this is RuntimeType rt) 497if (RuntimeHelpers.IsKnownConstant(type) && type is RuntimeType) 499return GetRuntimeTypeCode((RuntimeType)type); 505internal static TypeCode GetRuntimeTypeCode(RuntimeType type) 507RuntimeType underlyingType = type; 509underlyingType = (RuntimeType)type.GetEnumUnderlyingType(); 870if (left is null || right is null || left is RuntimeType || right is RuntimeType)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Type.Helpers.cs (2)
22if (underlyingType is RuntimeType) 376if (toType is RuntimeType)
System\ActivatorImplementation.cs (1)
148if (type is not RuntimeType)
System\Array.NativeAot.cs (3)
53private static unsafe Array InternalCreate(RuntimeType elementType, int rank, int* pLengths, int* pLowerBounds) 90private static unsafe Array InternalCreateFromArrayType(RuntimeType arrayType, int rank, int* pLengths, int* pLowerBounds) 251RuntimeType elementType = Type.GetTypeFromMethodTable(pEEType->RelatedParameterType);
System\Enum.NativeAot.cs (4)
24internal static EnumInfo GetEnumInfo(RuntimeType enumType, bool getNames = true) 34internal static EnumInfo<TStorage> GetEnumInfo<TStorage>(RuntimeType enumType, bool getNames = true) 55private static unsafe CorElementType InternalGetCorElementType(RuntimeType rt) 132internal static Type InternalGetUnderlyingType(RuntimeType enumType)
System\Reflection\Runtime\Assemblies\RuntimeAssemblyInfo.cs (3)
173RuntimeCustomAttribute.GetCustomAttributes(this, (RuntimeType)typeof(object)); 179if (attributeType.UnderlyingSystemType is not RuntimeType attributeRuntimeType) 191if (attributeType.UnderlyingSystemType is not RuntimeType attributeRuntimeType)
System\Reflection\Runtime\EventInfos\RuntimeEventInfo.cs (3)
134RuntimeCustomAttribute.GetCustomAttributes(this, (RuntimeType)typeof(object)); 140if (attributeType.UnderlyingSystemType is not RuntimeType attributeRuntimeType) 156if (attributeType.UnderlyingSystemType is not RuntimeType attributeRuntimeType)
System\Reflection\Runtime\FieldInfos\RuntimeFieldInfo.cs (3)
50RuntimeCustomAttribute.GetCustomAttributes(this, (RuntimeType)typeof(object)); 56if (attributeType.UnderlyingSystemType is not RuntimeType attributeRuntimeType) 72if (attributeType.UnderlyingSystemType is not RuntimeType attributeRuntimeType)
System\Reflection\Runtime\General\Helpers.cs (1)
55if (type is RuntimeType runtimeType)
System\Reflection\Runtime\MethodInfos\RuntimeConstructorInfo.cs (3)
35RuntimeCustomAttribute.GetCustomAttributes(this, (RuntimeType)typeof(object)); 41if (attributeType.UnderlyingSystemType is not RuntimeType attributeRuntimeType) 57if (attributeType.UnderlyingSystemType is not RuntimeType attributeRuntimeType)
System\Reflection\Runtime\MethodInfos\RuntimeNamedMethodInfo.cs (1)
124if (typeArgument is not RuntimeType typeArgumentAsRuntimeType)
System\Reflection\Runtime\Modules\RuntimeModule.cs (3)
31RuntimeCustomAttribute.GetCustomAttributes(this, (RuntimeType)typeof(object)); 37if (attributeType.UnderlyingSystemType is not RuntimeType attributeRuntimeType) 53if (attributeType.UnderlyingSystemType is not RuntimeType attributeRuntimeType)
System\Reflection\Runtime\PropertyInfos\RuntimePropertyInfo.cs (3)
286RuntimeCustomAttribute.GetCustomAttributes(this, (RuntimeType)typeof(object)); 292if (attributeType.UnderlyingSystemType is not RuntimeType attributeRuntimeType) 308if (attributeType.UnderlyingSystemType is not RuntimeType attributeRuntimeType)
System\Reflection\Runtime\TypeInfos\RuntimeFunctionPointerTypeInfo.cs (1)
59return other is RuntimeType runtimeType && runtimeType.GetRuntimeTypeInfo() is IRuntimeMemberInfoWithNoMetadataDefinition;
System\Reflection\Runtime\TypeInfos\RuntimeHasElementTypeInfo.cs (1)
74return other is RuntimeType runtimeType && runtimeType.GetRuntimeTypeInfo() is IRuntimeMemberInfoWithNoMetadataDefinition;
System\Reflection\Runtime\TypeInfos\RuntimeTypeDefinitionTypeInfo.cs (1)
23if (other is RuntimeType otherRuntimeType && otherRuntimeType.IsConstructedGenericType)
System\Reflection\Runtime\TypeInfos\RuntimeTypeInfo.cs (9)
197if (!(interfaceType is RuntimeType)) 305if (typeInfo is not RuntimeType) 440if (paramType is not RuntimeType rtType) 481if (typeArgument is RuntimeType typeArgumentAsRuntimeType) 623private RuntimeType _type; 626public RuntimeType ToType() => _type ?? InitializeType(); 628private RuntimeType InitializeType() 633RuntimeType type = new RuntimeType(this); 639_type = (RuntimeType)Type.GetTypeFromHandle(runtimeTypeHandle)!;
System\Reflection\RuntimeCustomAttributeData.NativeAot.cs (19)
29public QCustomAttributeList(RuntimeType target) 79RuntimeType attributeType = (RuntimeType)customAttribute.GetAttributeTypeHandle(reader) 89RuntimeType attributeType) 195RuntimeType argumentType = (RuntimeType)namedArgument.Type.Resolve(module, default).ToType(); 201internal static object? ParseValue(MetadataReader reader, Handle value, RuntimeType argumentType) 568RuntimeType enumType = (RuntimeType)enumTypeHandle.Resolve(_reader, default).ToType(); 575RuntimeCustomAttributeData.TypeToCustomAttributeEncoding((RuntimeType)enumType.GetEnumUnderlyingType()); 601RuntimeType attributeFilterType, 630RuntimeType attributeFilterType, 633out RuntimeType attributeType) 636attributeType = (RuntimeType)attributeTypeHandle.Resolve(reader, new TypeContext(null, null)).ToType(); 653RuntimeType? attributeFilterType, 671out RuntimeType attributeType)) 695(RuntimeType)constructorParameters[index].ParameterType); 707RuntimeType type = (RuntimeType)namedArgument.Type.Resolve(reader, default).ToType();
System\Reflection\RuntimeMethodInfo.cs (4)
73if (!(delegateType is RuntimeType runtimeDelegateType)) 88RuntimeCustomAttribute.GetCustomAttributes(this, (RuntimeType)typeof(object), inherit); 94if (attributeType.UnderlyingSystemType is not RuntimeType attributeRuntimeType) 110if (attributeType.UnderlyingSystemType is not RuntimeType attributeRuntimeType)
System\Runtime\CompilerServices\RuntimeHelpers.NativeAot.cs (3)
238if (type is not RuntimeType) 259if (type is not RuntimeType) 298if (type is not RuntimeType)
System\Runtime\InteropServices\Marshal.NativeAot.cs (3)
19internal static int SizeOfHelper(RuntimeType t, bool throwIfNotMarshalable) 42if (t is not RuntimeType) 158internal static Delegate GetDelegateForFunctionPointerInternal(IntPtr ptr, RuntimeType t)
System\Runtime\InteropServices\TypeMapLazyDictionary.NativeAot.cs (2)
21public static IReadOnlyDictionary<string, Type> CreateExternalTypeMap(RuntimeType typeMapGroup) 64public static IReadOnlyDictionary<Type, Type> CreateProxyTypeMap(RuntimeType typeMapGroup)
System\RuntimeType.NativeAot.cs (4)
627if (c.UnderlyingSystemType is not RuntimeType fromRuntimeType) 811if (attributeType.UnderlyingSystemType is not RuntimeType attributeRuntimeType) 819return RuntimeCustomAttribute.GetCustomAttributes(this, (RuntimeType)typeof(object), inherit); 826if (attributeType.UnderlyingSystemType is not RuntimeType attributeRuntimeType)
System\Type.NativeAot.cs (9)
25internal static unsafe RuntimeType? GetTypeFromMethodTableMaybeNull(MethodTable* pMT) => (pMT == null) ? null : GetTypeFromMethodTable(pMT); 29internal static unsafe RuntimeType GetTypeFromMethodTable(MethodTable* pMT) 31ref RuntimeType? type = ref Unsafe.AsRef<RuntimeType?>(pMT->WritableData); 42private static unsafe RuntimeType GetTypeFromMethodTableSlow(MethodTable* pMT) 47ref RuntimeType? runtimeTypeCache = ref Unsafe.AsRef<RuntimeType?>(pMT->WritableData); 51RuntimeType? type = FrozenObjectHeapManager.Instance.TryAllocateObject<RuntimeType>();