1 instantiation of RuntimeType
System.Private.CoreLib (1)
System\Reflection\Runtime\TypeInfos\RuntimeTypeInfo.cs (1)
633RuntimeType type = new RuntimeType(this);
243 references to RuntimeType
System.Private.CoreLib (243)
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)
79RuntimeType? t = elementType.UnderlyingSystemType as RuntimeType; 94RuntimeType? t = elementType.UnderlyingSystemType as RuntimeType; 111RuntimeType? t = elementType.UnderlyingSystemType as RuntimeType; 128RuntimeType? t = elementType.UnderlyingSystemType as RuntimeType; 156RuntimeType? t = elementType.UnderlyingSystemType as RuntimeType; 211RuntimeType? t = arrayType as RuntimeType; 248RuntimeType? t = arrayType as RuntimeType; 304RuntimeType? 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 (62)
33internal static IList<CustomAttributeData> GetCustomAttributesInternal(RuntimeType target) 43PseudoCustomAttribute.GetCustomAttributes(target, (RuntimeType)typeof(object), ref pcas); 57PseudoCustomAttribute.GetCustomAttributes(target, (RuntimeType)typeof(object), ref pcas); 71PseudoCustomAttribute.GetCustomAttributes(target, (RuntimeType)typeof(object), ref pcas); 145PseudoCustomAttribute.GetCustomAttributes(target, (RuntimeType)typeof(object), ref pcas); 164internal static CustomAttributeEncoding TypeToCustomAttributeEncoding(RuntimeType type) 274m_ctorParams[i] = new CustomAttributeCtorParameter(new CustomAttributeType((RuntimeType)parameters[i].ParameterType)); 293new CustomAttributeType((RuntimeType)fi.FieldType)); 301new CustomAttributeType((RuntimeType)pi.PropertyType)); 773RuntimeType argumentType = (RuntimeType)namedArgument.Type.Resolve(module, default).ToType(); 881public CustomAttributeType(RuntimeType parameterType) 891parameterType = (RuntimeType)parameterType.GetElementType()!; 899encodedEnumType = RuntimeCustomAttributeData.TypeToCustomAttributeEncoding((RuntimeType)Enum.GetUnderlyingType(parameterType)); 918internal static bool IsDefined(RuntimeType type, RuntimeType? caType, bool inherit) 938type = (type.BaseType as RuntimeType)!; 949type = (type.BaseType as RuntimeType)!; 955internal static bool IsDefined(RuntimeMethodInfo method, RuntimeType caType, bool inherit) 990internal static bool IsDefined(RuntimeConstructorInfo ctor, RuntimeType caType) 1004internal static bool IsDefined(RuntimePropertyInfo property, RuntimeType caType) 1018internal static bool IsDefined(RuntimeEventInfo e, RuntimeType caType) 1032internal static bool IsDefined(RuntimeFieldInfo field, RuntimeType caType) 1047internal static bool IsDefined(RuntimeParameterInfo parameter, RuntimeType caType) 1062internal static bool IsDefined(RuntimeAssembly assembly, RuntimeType caType) 1075internal static bool IsDefined(RuntimeModule module, RuntimeType caType) 1089internal static object[] GetCustomAttributes(RuntimeType type, RuntimeType caType, bool inherit) 1098type = (type.GetGenericTypeDefinition() as RuntimeType)!; 1131type = (type.BaseType as RuntimeType)!; 1132} while (type != (RuntimeType)typeof(object) && type != null); 1142internal static object[] GetCustomAttributes(RuntimeMethodInfo method, RuntimeType caType, bool inherit) 1192internal static object[] GetCustomAttributes(RuntimeConstructorInfo ctor, RuntimeType caType) 1206internal static object[] GetCustomAttributes(RuntimePropertyInfo property, RuntimeType caType) 1220internal static object[] GetCustomAttributes(RuntimeEventInfo e, RuntimeType caType) 1234internal static object[] GetCustomAttributes(RuntimeFieldInfo field, RuntimeType caType) 1250internal static object[] GetCustomAttributes(RuntimeParameterInfo parameter, RuntimeType caType) 1266internal static object[] GetCustomAttributes(RuntimeAssembly assembly, RuntimeType caType) 1281internal static object[] GetCustomAttributes(RuntimeModule module, RuntimeType caType) 1301int pcaCount, RuntimeType attributeFilterType) 1319private static bool MatchesTypeFilter(RuntimeType attributeType, RuntimeType attributeFilterType) 1323for (RuntimeType? type = attributeType; type != null; type = (RuntimeType?)type.BaseType) 1336RuntimeType attributeType, bool mustBeInheritable, ref ListBuilder<object> derivedAttributes) 1371internal static AttributeUsageAttribute GetAttributeUsage(RuntimeType decoratedAttribute) 1411internal static object[] CreateAttributeArrayHelper(RuntimeType caType, int elementCount) 1460private static readonly HashSet<RuntimeType> s_pca = CreatePseudoCustomAttributeHashSet(); 1464private static HashSet<RuntimeType> CreatePseudoCustomAttributeHashSet() 1482HashSet<RuntimeType> set = new HashSet<RuntimeType>(pcas.Length); 1483foreach (RuntimeType runtimeType in pcas) 1496internal static void GetCustomAttributes(RuntimeType type, RuntimeType caType, ref ListBuilder<Attribute> pcas) 1518internal static bool IsDefined(RuntimeType type, RuntimeType? caType) 1540internal static void GetCustomAttributes(RuntimeMethodInfo method, RuntimeType caType, ref ListBuilder<Attribute> pcas) 1563internal static bool IsDefined(RuntimeMethodInfo method, RuntimeType? caType) 1586internal static void GetCustomAttributes(RuntimeParameterInfo parameter, RuntimeType caType, ref ListBuilder<Attribute> pcas) 1619internal static bool IsDefined(RuntimeParameterInfo parameter, RuntimeType? caType) 1648internal static void GetCustomAttributes(RuntimeFieldInfo field, RuntimeType caType, ref ListBuilder<Attribute> pcas) 1680internal static bool IsDefined(RuntimeFieldInfo field, RuntimeType? caType)
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)
135RuntimeCustomAttribute.GetCustomAttributes(this, (RuntimeType)typeof(object)); 141if (attributeType.UnderlyingSystemType is not RuntimeType attributeRuntimeType) 157if (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)
36RuntimeCustomAttribute.GetCustomAttributes(this, (RuntimeType)typeof(object)); 42if (attributeType.UnderlyingSystemType is not RuntimeType attributeRuntimeType) 58if (attributeType.UnderlyingSystemType is not RuntimeType attributeRuntimeType)
System\Reflection\Runtime\MethodInfos\RuntimeNamedMethodInfo.cs (1)
125if (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\ParameterInfos\RuntimeParameterInfo.cs (3)
34return RuntimeCustomAttribute.GetCustomAttributes(this, (RuntimeType)typeof(object)); 41if (attributeType.UnderlyingSystemType is not RuntimeType attributeRuntimeType) 63if (attributeType.UnderlyingSystemType is not RuntimeType attributeRuntimeType)
System\Reflection\Runtime\PropertyInfos\RuntimePropertyInfo.cs (3)
287RuntimeCustomAttribute.GetCustomAttributes(this, (RuntimeType)typeof(object)); 293if (attributeType.UnderlyingSystemType is not RuntimeType attributeRuntimeType) 309if (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 (16)
42RuntimeType attributeType = (RuntimeType)customAttribute.GetAttributeTypeHandle(reader) 52RuntimeType attributeType) 148internal static object? ParseValue(MetadataReader reader, Handle value, RuntimeType argumentType) 477RuntimeType enumType = (RuntimeType)enumTypeHandle.Resolve(_reader, default).ToType(); 484RuntimeCustomAttributeData.TypeToCustomAttributeEncoding((RuntimeType)enumType.GetEnumUnderlyingType()); 511RuntimeType attributeFilterType, 539RuntimeType attributeFilterType, 542out RuntimeType attributeType) 545attributeType = (RuntimeType)attributeTypeHandle.Resolve(reader, new TypeContext(null, null)).ToType(); 563RuntimeType? attributeFilterType, 580out RuntimeType attributeType)) 604(RuntimeType)constructorParameters[index].ParameterType); 616RuntimeType type = (RuntimeType)namedArgument.Type.Resolve(reader, default).ToType();
System\Reflection\RuntimeMethodInfo.cs (4)
74if (!(delegateType is RuntimeType runtimeDelegateType)) 89RuntimeCustomAttribute.GetCustomAttributes(this, (RuntimeType)typeof(object), inherit); 95if (attributeType.UnderlyingSystemType is not RuntimeType attributeRuntimeType) 111if (attributeType.UnderlyingSystemType is not RuntimeType attributeRuntimeType)
System\Runtime\CompilerServices\RuntimeHelpers.NativeAot.cs (3)
243if (type is not RuntimeType) 264if (type is not RuntimeType) 303if (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)
619if (c.UnderlyingSystemType is not RuntimeType fromRuntimeType) 803if (attributeType.UnderlyingSystemType is not RuntimeType attributeRuntimeType) 811return RuntimeCustomAttribute.GetCustomAttributes(this, (RuntimeType)typeof(object), inherit); 818if (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>();