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)
1356RuntimeType enumType = (RuntimeType)GetType();
1373static string HandleRareTypes(RuntimeType enumType, ref byte rawData) =>
1404RuntimeType enumType = (RuntimeType)GetType();
1424static string HandleRareTypes(RuntimeType enumType, char formatChar, ref byte rawData) =>
1451private static string ToString<TUnderlying, TStorage>(RuntimeType enumType, ref byte rawData)
1463private static string ToStringInlined<TUnderlying, TStorage>(RuntimeType enumType, ref byte rawData)
1480private static string ToString<TUnderlying, TStorage>(RuntimeType enumType, char format, ref byte rawData)
1493private static string ToStringInlined<TUnderlying, TStorage>(RuntimeType enumType, char format, ref byte rawData)
1629RuntimeType rtType = ValidateRuntimeType(enumType);
1689RuntimeType enumType = (RuntimeType)GetType();
1749RuntimeType rt = (RuntimeType)typeof(TEnum);
1808RuntimeType rt = (RuntimeType)typeof(TEnum);
1856private static bool TryFormatPrimitiveDefault<TUnderlying, TStorage>(RuntimeType enumType, TUnderlying value, Span<char> destination, out int charsWritten)
1891private static bool TryFormatPrimitiveNonDefault<TUnderlying, TStorage>(RuntimeType enumType, TUnderlying value, Span<char> destination, out int charsWritten, ReadOnlySpan<char> format)
2125private static RuntimeType ValidateRuntimeType(Type enumType)
2129RuntimeType? rt = enumType as RuntimeType;
2147throw new ArgumentException(enumType is not RuntimeType ? SR.Arg_MustBeType : SR.Arg_MustBeEnum, nameof(enumType));
src\libraries\System.Private.CoreLib\src\System\Reflection\FieldAccessor.cs (10)
43RuntimeType fieldType = (RuntimeType)_fieldInfo.FieldType;
178object? ret = RuntimeFieldHandle.GetValue(_fieldInfo, obj, (RuntimeType)_fieldInfo.FieldType, _fieldInfo.m_declaringType, ref isClassInitialized);
193return RuntimeFieldHandle.GetValue(_fieldInfo, obj, (RuntimeType)_fieldInfo.FieldType, _fieldInfo.m_declaringType, ref isClassInitialized);
199if (_fieldInfo.DeclaringType is not null && ((RuntimeType)_fieldInfo.FieldType).IsNullableOfT)
303RuntimeFieldHandle.SetValue(_fieldInfo, obj, value, (RuntimeType)_fieldInfo.FieldType, _fieldInfo.m_declaringType, ref isClassInitialized);
330RuntimeFieldHandle.SetValue(_fieldInfo, obj, value, (RuntimeType)_fieldInfo.FieldType, _fieldInfo.m_declaringType, ref isClassInitialized);
370if (((RuntimeType)_fieldInfo.FieldType).IsActualValueType)
372((RuntimeType)_fieldInfo.FieldType).CheckValue(ref value, binder, culture, invokeAttr);
377((RuntimeType)_fieldInfo.FieldType).CheckValue(ref value, binder, culture, invokeAttr);
src\System\Delegate.CoreCLR.cs (19)
48if (!BindToMethodName(target, (RuntimeType)target.GetType(), method,
64if (target is not RuntimeType rtTarget)
83RuntimeMethodInfo invoke = (RuntimeMethodInfo)RuntimeType.GetMethodBase((RuntimeType)this.GetType(), method)!;
167RuntimeType? declaringType = RuntimeMethodHandle.GetDeclaringType(method);
194declaringType = currentType as RuntimeType;
212declaringType = (RuntimeType)invoke.GetParametersAsSpan()[0].ParameterType;
217_methodBase = (MethodInfo)RuntimeType.GetMethodBase(declaringType, method)!;
231if (type is not RuntimeType rtType)
244if (!d.BindToMethodName(target, (RuntimeType)target.GetType(), method,
268if (type is not RuntimeType rtType)
270if (target is not RuntimeType rtTarget)
301if (type is not RuntimeType rtType)
336if (type is not RuntimeType rtType)
374if (type is not RuntimeType rtType)
395internal static Delegate? CreateDelegateInternal(RuntimeType rtType, RuntimeMethodInfo rtMethod, object? firstArgument, DelegateBindingFlags flags)
411private bool BindToMethodName(object? target, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.AllMethods)] RuntimeType methodType, string method, DelegateBindingFlags flags)
422private bool BindToMethodInfo(object? target, IRuntimeMethodInfo method, RuntimeType methodType, DelegateBindingFlags flags)
435private static MulticastDelegate InternalAlloc(RuntimeType type)
src\System\Enum.CoreCLR.cs (27)
18private static unsafe CorElementType InternalGetCorElementType(RuntimeType rt)
35private static readonly RuntimeType?[] s_underlyingTypes =
39(RuntimeType)typeof(bool),
40(RuntimeType)typeof(char),
41(RuntimeType)typeof(sbyte),
42(RuntimeType)typeof(byte),
43(RuntimeType)typeof(short),
44(RuntimeType)typeof(ushort),
45(RuntimeType)typeof(int),
46(RuntimeType)typeof(uint),
47(RuntimeType)typeof(long),
48(RuntimeType)typeof(ulong),
49(RuntimeType)typeof(float),
50(RuntimeType)typeof(double),
61(RuntimeType)typeof(nint),
62(RuntimeType)typeof(nuint)
66internal static unsafe RuntimeType InternalGetUnderlyingType(RuntimeType enumType)
71RuntimeType? underlyingType = s_underlyingTypes[(int)enumType.GetNativeTypeHandle().AsMethodTable()->GetPrimitiveCorElementType()];
79private static EnumInfo<TStorage> GetEnumInfo<TStorage>(RuntimeType enumType, bool getNames = true)
92static EnumInfo<TStorage> InitializeEnumInfo(RuntimeType enumType, bool getNames)
103internal sealed partial class EnumInfo<TStorage> : RuntimeType.IGenericCacheEntry<EnumInfo<TStorage>>
105public static EnumInfo<TStorage> Create(RuntimeType type, bool getNames)
123public static EnumInfo<TStorage> Create(RuntimeType type) => Create(type, getNames: false);
125public void InitializeCompositeCache(RuntimeType.CompositeCacheEntry compositeEntry) => compositeEntry._enumInfo = this;
128public static ref EnumInfo<TStorage>? GetStorageRef(RuntimeType.CompositeCacheEntry compositeEntry)
129=> ref Unsafe.As<RuntimeType.IGenericCacheEntry?, EnumInfo<TStorage>?>(ref compositeEntry._enumInfo);
src\System\Reflection\RtFieldInfo.cs (8)
8using RuntimeTypeCache = System.RuntimeType.RuntimeTypeCache;
20private RuntimeType? m_fieldType;
37RuntimeFieldHandleInternal handle, RuntimeType declaringType, RuntimeTypeCache reflectedTypeCache, BindingFlags bindingFlags)
96return RuntimeFieldHandle.GetValueDirect(this, (RuntimeType)FieldType, obj, (RuntimeType?)DeclaringType);
112RuntimeFieldHandle.SetValueDirect(this, (RuntimeType)FieldType, obj, value, (RuntimeType?)DeclaringType);
131private RuntimeType InitializeFieldType()
src\System\Reflection\RuntimeCustomAttributeData.cs (18)
18internal static IList<CustomAttributeData> GetCustomAttributesInternal(RuntimeType target)
23RuntimeType.ListBuilder<Attribute> pcas = default;
24PseudoCustomAttribute.GetCustomAttributes(target, (RuntimeType)typeof(object), ref pcas);
33RuntimeType.ListBuilder<Attribute> pcas = default;
34PseudoCustomAttribute.GetCustomAttributes(target, (RuntimeType)typeof(object), ref pcas);
43RuntimeType.ListBuilder<Attribute> pcas = default;
44PseudoCustomAttribute.GetCustomAttributes(target, (RuntimeType)typeof(object), ref pcas);
92RuntimeType.ListBuilder<Attribute> pcas = default;
94PseudoCustomAttribute.GetCustomAttributes(target, (RuntimeType)typeof(object), ref pcas);
98private static ReadOnlyCollection<CustomAttributeData> GetCombinedList(IList<CustomAttributeData> customAttributes, ref RuntimeType.ListBuilder<Attribute> pseudoAttributes)
113internal static CustomAttributeEncoding TypeToCustomAttributeEncoding(RuntimeType type)
254m_ctor = (RuntimeConstructorInfo)RuntimeType.GetMethodBase(m_scope, caCtorToken)!;
268m_ctorParams[i] = new CustomAttributeCtorParameter(new CustomAttributeType((RuntimeType)parameters[i].ParameterType));
287new CustomAttributeType((RuntimeType)fi.FieldType));
295new CustomAttributeType((RuntimeType)pi.PropertyType));
543private static RuntimeType ResolveType(RuntimeModule scope, string typeName)
545RuntimeType type = TypeNameResolver.GetTypeReferencedByCustomAttribute(typeName, scope);
902enumTag = RuntimeCustomAttributeData.TypeToCustomAttributeEncoding((RuntimeType)enumType.GetEnumUnderlyingType());
src\System\Reflection\RuntimeMethodInfo.CoreCLR.cs (30)
12using RuntimeTypeCache = System.RuntimeType.RuntimeTypeCache;
28private readonly RuntimeType m_declaringType;
56RuntimeMethodHandleInternal handle, RuntimeType declaringType,
74private RuntimeType ReflectedTypeInternal => m_reflectedTypeCache.GetRuntimeType();
111RuntimeType? parent = (RuntimeType?)m_declaringType.BaseType;
121return (RuntimeMethodInfo?)RuntimeType.GetMethodBase(parent, RuntimeTypeHandle.GetMethodAt(parent, slot));
125internal RuntimeType GetDeclaringTypeInternal()
174return CustomAttribute.GetCustomAttributes(this, (typeof(object) as RuntimeType)!, inherit);
181if (attributeType.UnderlyingSystemType is not RuntimeType attributeRuntimeType)
191if (attributeType.UnderlyingSystemType is not RuntimeType attributeRuntimeType)
233internal RuntimeType GetRuntimeType() { return m_declaringType; }
271internal RuntimeType[] ArgumentTypes => Signature.Arguments;
330RuntimeType declaringType = (RuntimeType)DeclaringType!;
331RuntimeType? baseDeclaringType = declaringType;
344declaringType = (RuntimeType)declaringType.BaseType!;
347return (MethodInfo)RuntimeType.GetMethodBase(baseDeclaringType, baseMethodHandle)!;
383RuntimeType rtType = delegateType as RuntimeType ??
401RuntimeType[] methodInstantionRuntimeType = new RuntimeType[methodInstantiation.Length];
412RuntimeType? rtMethodInstantiationElem = methodInstantiationElem as RuntimeType;
426RuntimeType[] genericParameters = GetGenericArgumentsInternal();
428RuntimeType.SanityCheckGenericArguments(methodInstantionRuntimeType, genericParameters);
434ret = RuntimeType.GetMethodBase(ReflectedTypeInternal,
439RuntimeType.ValidateGenericArguments(this, methodInstantionRuntimeType, e);
446internal RuntimeType[] GetGenericArgumentsInternal() =>
457return (RuntimeType.GetMethodBase(m_declaringType, RuntimeMethodHandle.StripMethodInstantiation(this)) as MethodInfo)!;
src\System\RuntimeHandles.cs (122)
25internal RuntimeType GetRuntimeTypeChecked() =>
42private static RuntimeType GetRuntimeTypeFromHandleSlow(IntPtr handle)
44RuntimeType? typeObject = null;
50internal static unsafe RuntimeType GetRuntimeTypeFromHandle(IntPtr handle)
59internal static RuntimeType? GetRuntimeTypeFromHandleMaybeNull(IntPtr handle)
70internal static unsafe RuntimeType GetRuntimeType(MethodTable* pMT)
92internal RuntimeType? m_type;
105internal RuntimeTypeHandle(RuntimeType? type)
115internal static bool IsTypeDefinition(RuntimeType type)
133internal static bool IsPrimitive(RuntimeType type)
138internal static bool IsByRef(RuntimeType type)
144internal static bool IsPointer(RuntimeType type)
150internal static bool IsArray(RuntimeType type)
156internal static bool IsSZArray(RuntimeType type)
162internal static bool IsFunctionPointer(RuntimeType type)
168internal static bool HasElementType(RuntimeType type)
227[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] RuntimeType type,
228RuntimeType genericParameter)
250[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] RuntimeType type,
251RuntimeType genericParameter1,
252RuntimeType genericParameter2)
291internal static object InternalAlloc(RuntimeType type)
329RuntimeType rt,
379internal RuntimeType GetRuntimeType()
384internal static RuntimeAssembly GetAssembly(RuntimeType type)
389static RuntimeAssembly GetAssemblyWorker(RuntimeType type)
398private static extern RuntimeAssembly? GetAssemblyIfExists(RuntimeType type);
403internal static RuntimeModule GetModule(RuntimeType type)
408static RuntimeModule GetModuleWorker(RuntimeType type)
417private static extern RuntimeModule? GetModuleIfExists(RuntimeType type);
433internal static extern TypeAttributes GetAttributes(RuntimeType type);
438internal static RuntimeType? GetElementType(RuntimeType type)
446RuntimeType result = GetRuntimeTypeFromHandle(handle);
452internal static extern bool CompareCanonicalHandles(RuntimeType left, RuntimeType right);
455internal static extern int GetArrayRank(RuntimeType type);
458internal static extern int GetToken(RuntimeType type);
463internal static RuntimeMethodHandleInternal GetMethodAt(RuntimeType type, int slot)
479internal static Type[] GetArgumentTypesFromFunctionPointer(RuntimeType type)
491internal static extern bool IsUnmanagedFunctionPointer(RuntimeType type);
499internal IntroducedMethodEnumerator(RuntimeType type)
527internal static IntroducedMethodEnumerator GetIntroducedMethods(RuntimeType type)
533private static extern RuntimeMethodHandleInternal GetFirstIntroducedMethod(RuntimeType type);
541internal static bool GetFields(RuntimeType type, Span<IntPtr> buffer, out int count)
562internal static Type[] GetInterfaces(RuntimeType type)
610internal static extern int GetNumVirtuals(RuntimeType type);
615internal static int GetNumVirtualsAndStaticVirtuals(RuntimeType type)
645internal static bool IsVisible(RuntimeType type)
667internal static MdUtf8String GetUtf8Name(RuntimeType type)
683internal static bool CanCastTo(RuntimeType type, RuntimeType target)
697internal static RuntimeType? GetDeclaringType(RuntimeType type)
719RuntimeType result = GetRuntimeTypeFromHandle(retTypeHandle);
727internal static IRuntimeMethodInfo? GetDeclaringMethodForGenericParameter(RuntimeType type)
739internal RuntimeType[] GetInstantiationInternal()
741RuntimeType[]? types = null;
758internal RuntimeType Instantiate(RuntimeType inst)
762RuntimeType? type = null;
769internal RuntimeType Instantiate(Type[]? inst)
775RuntimeType? type = null;
786internal RuntimeType MakeArray(int rank)
788RuntimeType? type = null;
797internal RuntimeType MakeSZArray()
799RuntimeType? type = null;
808internal RuntimeType MakeByRef()
810RuntimeType? type = null;
819internal RuntimeType MakePointer()
821RuntimeType? type = null;
834internal static extern bool IsGenericVariable(RuntimeType type);
837private static extern int GetGenericVariableIndex(RuntimeType type);
841RuntimeType type = GetRuntimeTypeChecked();
850internal static extern bool ContainsGenericVariables(RuntimeType handle);
860internal static bool SatisfiesConstraints(RuntimeType paramType, RuntimeType? typeContext, RuntimeMethodInfo? methodContext, RuntimeType toType)
871internal static void RegisterCollectibleTypeDependency(RuntimeType type, RuntimeAssembly? assembly)
1094internal static unsafe RuntimeType GetDeclaringType(RuntimeMethodHandleInternal method)
1101internal static RuntimeType GetDeclaringType(IRuntimeMethodInfo method)
1103RuntimeType type = GetDeclaringType(method.Value);
1200internal static object ReboxToNullable(object? src, RuntimeType destNullableType)
1217internal static RuntimeType[] GetMethodInstantiationInternal(IRuntimeMethodInfo method)
1219RuntimeType[]? types = null;
1225internal static RuntimeType[] GetMethodInstantiationInternal(RuntimeMethodHandleInternal method)
1227RuntimeType[]? types = null;
1234RuntimeType[]? types = null;
1251private static extern RuntimeMethodHandleInternal GetStubIfNeededInternal(RuntimeMethodHandleInternal method, RuntimeType declaringType);
1256internal static RuntimeMethodHandleInternal GetStubIfNeeded(RuntimeMethodHandleInternal method, RuntimeType declaringType, RuntimeType[]? methodInstantiation)
1268static RuntimeMethodHandleInternal GetStubIfNeededWorker(RuntimeMethodHandleInternal method, RuntimeType declaringType, RuntimeType[]? methodInstantiation)
1273internal static extern RuntimeMethodHandleInternal GetMethodFromCanonical(RuntimeMethodHandleInternal method, RuntimeType declaringType);
1332internal static RuntimeMethodBody? GetMethodBody(IRuntimeMethodInfo method, RuntimeType declaringType)
1523internal static RuntimeType GetApproxDeclaringType(RuntimeFieldHandleInternal field)
1532internal static RuntimeType GetApproxDeclaringType(IRuntimeFieldInfo field)
1534RuntimeType type = GetApproxDeclaringType(field.Value);
1590internal static object? GetValue(RtFieldInfo field, object? instance, RuntimeType fieldType, RuntimeType? declaringType, ref bool isClassInitialized)
1611internal static object? GetValueDirect(RtFieldInfo field, RuntimeType fieldType, TypedReference typedRef, RuntimeType? contextType)
1633internal static void SetValue(RtFieldInfo field, object? obj, object? value, RuntimeType fieldType, RuntimeType? declaringType, ref bool isClassInitialized)
1652internal static void SetValueDirect(RtFieldInfo field, RuntimeType fieldType, TypedReference typedRef, object? value, RuntimeType? contextType)
1666internal static RuntimeFieldHandleInternal GetStaticFieldForGenericType(RuntimeFieldHandleInternal field, RuntimeType declaringType)
1845RuntimeType? type = null;
1979internal static RuntimeType GetModuleType(RuntimeModule module)
1981RuntimeType? type = null;
2014private RuntimeType[]? _arguments;
2015private RuntimeType _declaringType;
2016private RuntimeType _returnTypeORfieldType;
2053RuntimeType[] arguments,
2054RuntimeType returnType,
2068public Signature(IRuntimeMethodInfo methodHandle, RuntimeType declaringType)
2075public Signature(IRuntimeFieldInfo fieldHandle, RuntimeType declaringType)
2082public Signature(void* pCorSig, int cCorSig, RuntimeType declaringType)
2091internal RuntimeType[] Arguments
2099internal RuntimeType ReturnType => _returnTypeORfieldType;
2100internal RuntimeType FieldType => _returnTypeORfieldType;
2199internal abstract RuntimeType? GetJitContext(out int securityControlFlags);
src\System\RuntimeType.CoreCLR.cs (130)
214internal MethodBase AddMethod(RuntimeType declaringType, RuntimeMethodHandleInternal method, CacheType cacheType)
315RuntimeType approxDeclaringType = RuntimeFieldHandle.GetApproxDeclaringType(field);
586RuntimeType declaringType = ReflectedType;
752RuntimeType declaringType = ReflectedType;
800RuntimeType declaringType = ReflectedType;
806RuntimeType? populatingType = declaringType;
831PopulateLiteralFields(filter, (RuntimeType)iface, ref list);
832PopulateRtFields(filter, (RuntimeType)iface, ref list);
839private unsafe void PopulateRtFields(Filter filter, RuntimeType declaringType, ref ListBuilder<RuntimeFieldInfo> list)
856ReadOnlySpan<IntPtr> fieldHandles, RuntimeType declaringType, ref ListBuilder<RuntimeFieldInfo> list)
902private void PopulateLiteralFields(Filter filter, RuntimeType declaringType, ref ListBuilder<RuntimeFieldInfo> list)
962ref ListBuilder<RuntimeType> list,
964[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.Interfaces)] RuntimeType iList,
977RuntimeType iFace = (RuntimeType)iFaces[j];
989private RuntimeType[] PopulateInterfaces(Filter filter)
991ListBuilder<RuntimeType> list = default;
993RuntimeType declaringType = ReflectedType;
1000RuntimeType interfaceType = (RuntimeType)iface;
1014RuntimeType arrayType = (RuntimeType)ReflectedType.GetElementType()!;
1018AddSpecialInterface(ref list, filter, (RuntimeType)typeof(IList<>).MakeGenericType(arrayType), true);
1022AddSpecialInterface(ref list, filter, (RuntimeType)typeof(IReadOnlyList<>).MakeGenericType(arrayType), false);
1023AddSpecialInterface(ref list, filter, (RuntimeType)typeof(IReadOnlyCollection<>).MakeGenericType(arrayType), false);
1029var al = new HashSet<RuntimeType>();
1037RuntimeType constraint = (RuntimeType)constraints[i];
1043al.Add((RuntimeType)temp[j]);
1047foreach (RuntimeType rt in al)
1063private RuntimeType[] PopulateNestedClasses(Filter filter)
1065RuntimeType declaringType = ReflectedType;
1076return Array.Empty<RuntimeType>();
1078ListBuilder<RuntimeType> list = default;
1087RuntimeType nestedType;
1120RuntimeType declaringType = ReflectedType;
1129RuntimeType? populatingType = declaringType;
1146Filter filter, RuntimeType declaringType, Dictionary<string, RuntimeEventInfo>? csEventInfos, ref ListBuilder<RuntimeEventInfo> list)
1211RuntimeType declaringType = ReflectedType;
1231RuntimeType? populatingType = declaringType;
1249RuntimeType declaringType,
1400internal RuntimeType ReflectedType => m_runtimeTypeCache.GetRuntimeType();
1407private readonly RuntimeType m_runtimeType;
1408private RuntimeType? m_enclosingType;
1418private MemberInfoCache<RuntimeType>? m_interfaceCache;
1419private MemberInfoCache<RuntimeType>? m_nestedClassesCache;
1428private RuntimeType? _genericTypeDefinition;
1432internal RuntimeTypeCache(RuntimeType runtimeType)
1480public static FunctionPointerCache Create(RuntimeType type)
1485public void InitializeCompositeCache(RuntimeType.CompositeCacheEntry compositeEntry) => compositeEntry._functionPointerCache = this;
1486public static ref FunctionPointerCache? GetStorageRef(RuntimeType.CompositeCacheEntry compositeEntry) => ref compositeEntry._functionPointerCache;
1546RuntimeModule module = ((RuntimeType)type).GetRuntimeModule();
1560internal RuntimeType? GetEnclosingType()
1565RuntimeType? enclosingType = RuntimeTypeHandle.GetDeclaringType(GetRuntimeType());
1567m_enclosingType = enclosingType ?? (RuntimeType)typeof(void);
1573internal RuntimeType GetRuntimeType() => m_runtimeType;
1585for (RuntimeType? t = m_runtimeType; t != null; t = t.GetBaseType())
1610internal RuntimeType GetGenericTypeDefinition()
1617RuntimeType CacheGenericDefinition()
1619RuntimeType genericDefinition = null!;
1626RuntimeType type = m_runtimeType;
1714internal RuntimeType[] GetInterfaceList(MemberListType listType, string? name)
1719internal RuntimeType[] GetNestedTypeList(MemberListType listType, string? name)
1724internal MethodBase GetMethod(RuntimeType declaringType, RuntimeMethodHandleInternal method)
1730internal MethodBase GetConstructor(RuntimeType declaringType, RuntimeMethodHandleInternal constructor)
1752internal unsafe RuntimeType? GetParentType()
1766RuntimeType result = RuntimeTypeHandle.GetRuntimeType(pParentMT);
1782internal static MethodBase? GetMethodBase(RuntimeType? reflectedType, IRuntimeMethodInfo methodHandle)
1792internal static MethodBase? GetMethodBase(RuntimeType? reflectedType, RuntimeMethodHandleInternal methodHandle)
1807RuntimeType declaredType = RuntimeMethodHandle.GetDeclaringType(methodHandle);
1809RuntimeType[]? methodInstantiation = null;
1845RuntimeType declaringDefinition = (RuntimeType)declaredType.GetGenericTypeDefinition();
1847RuntimeType? baseType = reflectedType;
1851RuntimeType baseDefinition = baseType;
1854baseDefinition = (RuntimeType)baseDefinition.GetGenericTypeDefinition();
1945internal static FieldInfo GetFieldInfo(RuntimeType? reflectedType, IRuntimeFieldInfo field)
1956RuntimeType declaredType = RuntimeFieldHandle.GetApproxDeclaringType(fieldHandle);
1976private static RuntimePropertyInfo GetPropertyInfo(RuntimeType reflectedType, int tkProperty)
1993internal static void ValidateGenericArguments(MemberInfo definition, RuntimeType[] genericArguments, Exception? e)
1995RuntimeType? typeContext;
1997RuntimeType[] genericParameters;
2001typeContext = (RuntimeType)definition;
2007typeContext = (RuntimeType?)methodContext.DeclaringType;
2224Debug.Assert(type is RuntimeType);
2386internal static readonly RuntimeType ValueType = (RuntimeType)typeof(ValueType);
2388private static readonly RuntimeType ObjectType = (RuntimeType)typeof(object);
2389private static readonly RuntimeType StringType = (RuntimeType)typeof(string);
2412return (o is RuntimeType t) && (t.m_handle == m_handle);
2619RuntimeType[] cache = Cache.GetNestedTypeList(listType, name);
2624RuntimeType nestedClass = cache[i];
2669RuntimeType[] candidates = Cache.GetInterfaceList(MemberListType.All, null);
2717RuntimeType ifaceRtType = interfaceType as RuntimeType ??
2755RuntimeType reflectedType = RuntimeMethodHandle.GetDeclaringType(classRtMethodHandle);
2979RuntimeType[] cache = Cache.GetInterfaceList(listType, name);
2981RuntimeType? match = null;
2985RuntimeType iface = cache[i];
3008RuntimeType[] cache = Cache.GetNestedTypeList(listType, name);
3010RuntimeType? match = null;
3014RuntimeType nestedType = cache[i];
3114RuntimeType? runtimeType = this;
3139private static RuntimeMethodInfo? GetMethodWithSameMetadataDefinitionAs(RuntimeType runtimeType, MemberInfo method)
3155private static RuntimeConstructorInfo? GetConstructorWithSameMetadataDefinitionAs(RuntimeType runtimeType, MemberInfo constructor)
3171private static RuntimePropertyInfo? GetPropertyWithSameMetadataDefinitionAs(RuntimeType runtimeType, MemberInfo property)
3187private static RuntimeFieldInfo? GetFieldWithSameMetadataDefinitionAs(RuntimeType runtimeType, MemberInfo field)
3203private static RuntimeEventInfo? GetEventWithSameMetadataDefinitionAs(RuntimeType runtimeType, MemberInfo eventInfo)
3219private static RuntimeType? GetNestedTypeWithSameMetadataDefinitionAs(RuntimeType runtimeType, MemberInfo nestedType)
3221RuntimeType[] cache = runtimeType.Cache.GetNestedTypeList(MemberListType.CaseSensitive, nestedType.Name);
3225RuntimeType candidate = cache[i];
3242RuntimeType thisType = this;
3269RuntimeType? rtType = type as RuntimeType;
3273RuntimeType? baseType = GetBaseType();
3559internal RuntimeType[] GetGenericArgumentsInternal()
3578RuntimeType[] genericParameters = GetGenericArgumentsInternal();
3582if (typeArguments.Length == 1 && typeArguments[0] is RuntimeType rt)
3596RuntimeType[] instantiationRuntimeType = new RuntimeType[typeArguments.Length];
3603RuntimeType? rtInstantiationElem = instantiationElem as RuntimeType;
3685public sealed override bool HasSameMetadataDefinitionAs(MemberInfo other) => HasSameMetadataDefinitionAsCore<RuntimeType>(other);
3707private static bool CanValueSpecialCast(RuntimeType valueType, RuntimeType targetType)
3743RuntimeType srcType = pointer != null ? pointer.GetPointerType() : (RuntimeType)value.GetType();