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 (123)
25internal RuntimeType GetRuntimeTypeChecked() =>
42private static RuntimeType GetRuntimeTypeFromHandleSlow(IntPtr handle)
44RuntimeType? typeObject = null;
50private static extern RuntimeType? GetRuntimeTypeFromHandleIfExists(IntPtr handle);
52private static RuntimeType GetRuntimeTypeFromHandle(IntPtr handle)
58internal static unsafe RuntimeType GetRuntimeType(MethodTable* pMT)
80internal RuntimeType? m_type;
93internal RuntimeTypeHandle(RuntimeType? type)
103internal static bool IsTypeDefinition(RuntimeType type)
121internal static bool IsPrimitive(RuntimeType type)
126internal static bool IsByRef(RuntimeType type)
132internal static bool IsPointer(RuntimeType type)
138internal static bool IsArray(RuntimeType type)
144internal static bool IsSZArray(RuntimeType type)
150internal static bool IsFunctionPointer(RuntimeType type)
156internal static bool HasElementType(RuntimeType type)
215[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] RuntimeType type,
216RuntimeType genericParameter)
238[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] RuntimeType type,
239RuntimeType genericParameter1,
240RuntimeType genericParameter2)
279internal static object InternalAlloc(RuntimeType type)
290internal static object InternalAllocNoChecks(RuntimeType type)
308RuntimeType rt,
358internal RuntimeType GetRuntimeType()
363internal static RuntimeAssembly GetAssembly(RuntimeType type)
368static RuntimeAssembly GetAssemblyWorker(RuntimeType type)
377private static extern RuntimeAssembly? GetAssemblyIfExists(RuntimeType type);
382internal static RuntimeModule GetModule(RuntimeType type)
387static RuntimeModule GetModuleWorker(RuntimeType type)
396private static extern RuntimeModule? GetModuleIfExists(RuntimeType type);
412internal static extern TypeAttributes GetAttributes(RuntimeType type);
417internal static RuntimeType? GetElementType(RuntimeType type)
425RuntimeType result = GetRuntimeTypeFromHandle(handle);
431internal static extern bool CompareCanonicalHandles(RuntimeType left, RuntimeType right);
434internal static extern int GetArrayRank(RuntimeType type);
437internal static extern int GetToken(RuntimeType type);
442internal static RuntimeMethodHandleInternal GetMethodAt(RuntimeType type, int slot)
458internal static Type[] GetArgumentTypesFromFunctionPointer(RuntimeType type)
470internal static extern bool IsUnmanagedFunctionPointer(RuntimeType type);
478internal IntroducedMethodEnumerator(RuntimeType type)
506internal static IntroducedMethodEnumerator GetIntroducedMethods(RuntimeType type)
512private static extern RuntimeMethodHandleInternal GetFirstIntroducedMethod(RuntimeType type);
520internal static bool GetFields(RuntimeType type, Span<IntPtr> buffer, out int count)
541internal static Type[] GetInterfaces(RuntimeType type)
589internal static extern int GetNumVirtuals(RuntimeType type);
594internal static int GetNumVirtualsAndStaticVirtuals(RuntimeType type)
624internal static bool IsVisible(RuntimeType type)
646internal static unsafe MdUtf8String GetUtf8Name(RuntimeType type)
662internal static bool CanCastTo(RuntimeType type, RuntimeType target)
676internal static unsafe RuntimeType? GetDeclaringType(RuntimeType type)
698RuntimeType result = GetRuntimeTypeFromHandle(retTypeHandle);
706internal static IRuntimeMethodInfo? GetDeclaringMethodForGenericParameter(RuntimeType type)
718internal RuntimeType[] GetInstantiationInternal()
720RuntimeType[]? types = null;
737internal RuntimeType Instantiate(RuntimeType inst)
741RuntimeType? type = null;
748internal RuntimeType Instantiate(Type[]? inst)
754RuntimeType? type = null;
765internal RuntimeType MakeArray(int rank)
767RuntimeType? type = null;
776internal RuntimeType MakeSZArray()
778RuntimeType? type = null;
787internal RuntimeType MakeByRef()
789RuntimeType? type = null;
798internal RuntimeType MakePointer()
800RuntimeType? type = null;
813internal static extern bool IsGenericVariable(RuntimeType type);
816private static extern int GetGenericVariableIndex(RuntimeType type);
820RuntimeType type = GetRuntimeTypeChecked();
829internal static extern bool ContainsGenericVariables(RuntimeType handle);
839internal static bool SatisfiesConstraints(RuntimeType paramType, RuntimeType? typeContext, RuntimeMethodInfo? methodContext, RuntimeType toType)
850internal static void RegisterCollectibleTypeDependency(RuntimeType type, RuntimeAssembly? assembly)
1069internal static unsafe RuntimeType GetDeclaringType(RuntimeMethodHandleInternal method)
1076internal static RuntimeType GetDeclaringType(IRuntimeMethodInfo method)
1078RuntimeType type = GetDeclaringType(method.Value);
1175internal static object ReboxToNullable(object? src, RuntimeType destNullableType)
1192internal static RuntimeType[] GetMethodInstantiationInternal(IRuntimeMethodInfo method)
1194RuntimeType[]? types = null;
1200internal static RuntimeType[] GetMethodInstantiationInternal(RuntimeMethodHandleInternal method)
1202RuntimeType[]? types = null;
1209RuntimeType[]? types = null;
1226private static extern RuntimeMethodHandleInternal GetStubIfNeededInternal(RuntimeMethodHandleInternal method, RuntimeType declaringType);
1231internal static RuntimeMethodHandleInternal GetStubIfNeeded(RuntimeMethodHandleInternal method, RuntimeType declaringType, RuntimeType[]? methodInstantiation)
1243static RuntimeMethodHandleInternal GetStubIfNeededWorker(RuntimeMethodHandleInternal method, RuntimeType declaringType, RuntimeType[]? methodInstantiation)
1248internal static extern RuntimeMethodHandleInternal GetMethodFromCanonical(RuntimeMethodHandleInternal method, RuntimeType declaringType);
1307internal static RuntimeMethodBody? GetMethodBody(IRuntimeMethodInfo method, RuntimeType declaringType)
1488internal static RuntimeType GetApproxDeclaringType(RuntimeFieldHandleInternal field)
1497internal static RuntimeType GetApproxDeclaringType(IRuntimeFieldInfo field)
1499RuntimeType type = GetApproxDeclaringType(field.Value);
1555internal static object? GetValue(RtFieldInfo field, object? instance, RuntimeType fieldType, RuntimeType? declaringType, ref bool isClassInitialized)
1576internal static object? GetValueDirect(RtFieldInfo field, RuntimeType fieldType, TypedReference typedRef, RuntimeType? contextType)
1598internal static void SetValue(RtFieldInfo field, object? obj, object? value, RuntimeType fieldType, RuntimeType? declaringType, ref bool isClassInitialized)
1617internal static void SetValueDirect(RtFieldInfo field, RuntimeType fieldType, TypedReference typedRef, object? value, RuntimeType? contextType)
1631internal static RuntimeFieldHandleInternal GetStaticFieldForGenericType(RuntimeFieldHandleInternal field, RuntimeType declaringType)
1782RuntimeType? type = null;
1916internal static RuntimeType GetModuleType(RuntimeModule module)
1918RuntimeType? type = null;
1951private RuntimeType[]? _arguments;
1952private RuntimeType _declaringType;
1953private RuntimeType _returnTypeORfieldType;
1990RuntimeType[] arguments,
1991RuntimeType returnType,
2005public Signature(IRuntimeMethodInfo methodHandle, RuntimeType declaringType)
2012public Signature(IRuntimeFieldInfo fieldHandle, RuntimeType declaringType)
2019public Signature(void* pCorSig, int cCorSig, RuntimeType declaringType)
2028internal RuntimeType[] Arguments
2036internal RuntimeType ReturnType => _returnTypeORfieldType;
2037internal RuntimeType FieldType => _returnTypeORfieldType;
2136internal 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);
599RuntimeType declaringType = ReflectedType;
763RuntimeType declaringType = ReflectedType;
811RuntimeType declaringType = ReflectedType;
817RuntimeType? populatingType = declaringType;
842PopulateLiteralFields(filter, (RuntimeType)iface, ref list);
843PopulateRtFields(filter, (RuntimeType)iface, ref list);
850private unsafe void PopulateRtFields(Filter filter, RuntimeType declaringType, ref ListBuilder<RuntimeFieldInfo> list)
867ReadOnlySpan<IntPtr> fieldHandles, RuntimeType declaringType, ref ListBuilder<RuntimeFieldInfo> list)
913private void PopulateLiteralFields(Filter filter, RuntimeType declaringType, ref ListBuilder<RuntimeFieldInfo> list)
973ref ListBuilder<RuntimeType> list,
975[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.Interfaces)] RuntimeType iList,
988RuntimeType iFace = (RuntimeType)iFaces[j];
1000private RuntimeType[] PopulateInterfaces(Filter filter)
1002ListBuilder<RuntimeType> list = default;
1004RuntimeType declaringType = ReflectedType;
1011RuntimeType interfaceType = (RuntimeType)iface;
1025RuntimeType arrayType = (RuntimeType)ReflectedType.GetElementType()!;
1029AddSpecialInterface(ref list, filter, (RuntimeType)typeof(IList<>).MakeGenericType(arrayType), true);
1033AddSpecialInterface(ref list, filter, (RuntimeType)typeof(IReadOnlyList<>).MakeGenericType(arrayType), false);
1034AddSpecialInterface(ref list, filter, (RuntimeType)typeof(IReadOnlyCollection<>).MakeGenericType(arrayType), false);
1040var al = new HashSet<RuntimeType>();
1048RuntimeType constraint = (RuntimeType)constraints[i];
1054al.Add((RuntimeType)temp[j]);
1058foreach (RuntimeType rt in al)
1074private RuntimeType[] PopulateNestedClasses(Filter filter)
1076RuntimeType declaringType = ReflectedType;
1087return Array.Empty<RuntimeType>();
1089ListBuilder<RuntimeType> list = default;
1098RuntimeType nestedType;
1131RuntimeType declaringType = ReflectedType;
1140RuntimeType? populatingType = declaringType;
1157Filter filter, RuntimeType declaringType, Dictionary<string, RuntimeEventInfo>? csEventInfos, ref ListBuilder<RuntimeEventInfo> list)
1222RuntimeType declaringType = ReflectedType;
1250RuntimeType? populatingType = declaringType;
1268RuntimeType declaringType,
1419internal RuntimeType ReflectedType => m_runtimeTypeCache.GetRuntimeType();
1426private readonly RuntimeType m_runtimeType;
1427private RuntimeType? m_enclosingType;
1437private MemberInfoCache<RuntimeType>? m_interfaceCache;
1438private MemberInfoCache<RuntimeType>? m_nestedClassesCache;
1447private RuntimeType? _genericTypeDefinition;
1451internal RuntimeTypeCache(RuntimeType runtimeType)
1499public static FunctionPointerCache Create(RuntimeType type)
1504public void InitializeCompositeCache(RuntimeType.CompositeCacheEntry compositeEntry) => compositeEntry._functionPointerCache = this;
1505public static ref FunctionPointerCache? GetStorageRef(RuntimeType.CompositeCacheEntry compositeEntry) => ref compositeEntry._functionPointerCache;
1565RuntimeModule module = ((RuntimeType)type).GetRuntimeModule();
1579internal RuntimeType? GetEnclosingType()
1584RuntimeType? enclosingType = RuntimeTypeHandle.GetDeclaringType(GetRuntimeType());
1586m_enclosingType = enclosingType ?? (RuntimeType)typeof(void);
1592internal RuntimeType GetRuntimeType() => m_runtimeType;
1604for (RuntimeType? t = m_runtimeType; t != null; t = t.GetBaseType())
1629internal RuntimeType GetGenericTypeDefinition()
1636RuntimeType CacheGenericDefinition()
1638RuntimeType genericDefinition = null!;
1645RuntimeType type = m_runtimeType;
1733internal RuntimeType[] GetInterfaceList(MemberListType listType, string? name)
1738internal RuntimeType[] GetNestedTypeList(MemberListType listType, string? name)
1743internal MethodBase GetMethod(RuntimeType declaringType, RuntimeMethodHandleInternal method)
1749internal MethodBase GetConstructor(RuntimeType declaringType, RuntimeMethodHandleInternal constructor)
1771internal unsafe RuntimeType? GetParentType()
1785RuntimeType result = RuntimeTypeHandle.GetRuntimeType(pParentMT);
1801internal static MethodBase? GetMethodBase(RuntimeType? reflectedType, IRuntimeMethodInfo methodHandle)
1811internal static MethodBase? GetMethodBase(RuntimeType? reflectedType, RuntimeMethodHandleInternal methodHandle)
1826RuntimeType declaredType = RuntimeMethodHandle.GetDeclaringType(methodHandle);
1828RuntimeType[]? methodInstantiation = null;
1864RuntimeType declaringDefinition = (RuntimeType)declaredType.GetGenericTypeDefinition();
1866RuntimeType? baseType = reflectedType;
1870RuntimeType baseDefinition = baseType;
1873baseDefinition = (RuntimeType)baseDefinition.GetGenericTypeDefinition();
1964internal static FieldInfo GetFieldInfo(RuntimeType? reflectedType, IRuntimeFieldInfo field)
1975RuntimeType declaredType = RuntimeFieldHandle.GetApproxDeclaringType(fieldHandle);
1995private static RuntimePropertyInfo GetPropertyInfo(RuntimeType reflectedType, int tkProperty)
2012internal static void ValidateGenericArguments(MemberInfo definition, RuntimeType[] genericArguments, Exception? e)
2014RuntimeType? typeContext;
2016RuntimeType[] genericParameters;
2020typeContext = (RuntimeType)definition;
2026typeContext = (RuntimeType?)methodContext.DeclaringType;
2243Debug.Assert(type is RuntimeType);
2405internal static readonly RuntimeType ValueType = (RuntimeType)typeof(ValueType);
2407private static readonly RuntimeType ObjectType = (RuntimeType)typeof(object);
2408private static readonly RuntimeType StringType = (RuntimeType)typeof(string);
2431return (o is RuntimeType t) && (t.m_handle == m_handle);
2638RuntimeType[] cache = Cache.GetNestedTypeList(listType, name);
2643RuntimeType nestedClass = cache[i];
2688RuntimeType[] candidates = Cache.GetInterfaceList(MemberListType.All, null);
2736RuntimeType ifaceRtType = interfaceType as RuntimeType ??
2774RuntimeType reflectedType = RuntimeMethodHandle.GetDeclaringType(classRtMethodHandle);
2998RuntimeType[] cache = Cache.GetInterfaceList(listType, name);
3000RuntimeType? match = null;
3004RuntimeType iface = cache[i];
3027RuntimeType[] cache = Cache.GetNestedTypeList(listType, name);
3029RuntimeType? match = null;
3033RuntimeType nestedType = cache[i];
3133RuntimeType? runtimeType = this;
3158private static RuntimeMethodInfo? GetMethodWithSameMetadataDefinitionAs(RuntimeType runtimeType, MemberInfo method)
3174private static RuntimeConstructorInfo? GetConstructorWithSameMetadataDefinitionAs(RuntimeType runtimeType, MemberInfo constructor)
3190private static RuntimePropertyInfo? GetPropertyWithSameMetadataDefinitionAs(RuntimeType runtimeType, MemberInfo property)
3206private static RuntimeFieldInfo? GetFieldWithSameMetadataDefinitionAs(RuntimeType runtimeType, MemberInfo field)
3222private static RuntimeEventInfo? GetEventWithSameMetadataDefinitionAs(RuntimeType runtimeType, MemberInfo eventInfo)
3238private static RuntimeType? GetNestedTypeWithSameMetadataDefinitionAs(RuntimeType runtimeType, MemberInfo nestedType)
3240RuntimeType[] cache = runtimeType.Cache.GetNestedTypeList(MemberListType.CaseSensitive, nestedType.Name);
3244RuntimeType candidate = cache[i];
3261RuntimeType thisType = this;
3288RuntimeType? rtType = type as RuntimeType;
3292RuntimeType? baseType = GetBaseType();
3577internal RuntimeType[] GetGenericArgumentsInternal()
3596RuntimeType[] genericParameters = GetGenericArgumentsInternal();
3600if (instantiation.Length == 1 && instantiation[0] is RuntimeType rt)
3614RuntimeType[] instantiationRuntimeType = new RuntimeType[instantiation.Length];
3621RuntimeType? rtInstantiationElem = instantiationElem as RuntimeType;
3703public sealed override bool HasSameMetadataDefinitionAs(MemberInfo other) => HasSameMetadataDefinitionAsCore<RuntimeType>(other);
3725private static bool CanValueSpecialCast(RuntimeType valueType, RuntimeType targetType)
3761RuntimeType srcType = pointer != null ? pointer.GetPointerType() : (RuntimeType)value.GetType();