System\Reflection\TypeLoading\General\Ecma\EcmaWrappedTypeProvider.cs (27)
18internal abstract class EcmaWrappedTypeProvider : ISignatureTypeProvider<RoType, TypeContext>
33public RoType GetTypeFromDefinition(MetadataReader reader, TypeDefinitionHandle handle, byte rawTypeKind) => _typeProvider.GetTypeFromDefinition(reader, handle, rawTypeKind);
34public RoType GetTypeFromReference(MetadataReader reader, TypeReferenceHandle handle, byte rawTypeKind) => _typeProvider.GetTypeFromReference(reader, handle, rawTypeKind);
35public RoType GetTypeFromSpecification(MetadataReader reader, TypeContext genericContext, TypeSpecificationHandle handle, byte rawTypeKind) => _typeProvider.GetTypeFromSpecification(reader, genericContext, handle, rawTypeKind);
37public RoType GetSZArrayType(RoType elementType) => _typeProvider.GetSZArrayType(elementType.SkipTypeWrappers());
38public RoType GetArrayType(RoType elementType, ArrayShape shape) => _typeProvider.GetArrayType(elementType.SkipTypeWrappers(), shape);
39public RoType GetByReferenceType(RoType elementType) => _typeProvider.GetByReferenceType(elementType.SkipTypeWrappers());
40public RoType GetPointerType(RoType elementType) => _typeProvider.GetPointerType(elementType.SkipTypeWrappers());
41public RoType GetGenericInstantiation(RoType genericType, ImmutableArray<RoType> typeArguments)
44ImmutableArray<RoType> filteredTypeArguments = ImmutableArray<RoType>.Empty;
52public RoType GetGenericTypeParameter(TypeContext genericContext, int index) => _typeProvider.GetGenericTypeParameter(genericContext, index);
53public RoType GetGenericMethodParameter(TypeContext genericContext, int index) => _typeProvider.GetGenericMethodParameter(genericContext, index);
55public RoType GetFunctionPointerType(MethodSignature<RoType> signature) => _typeProvider.GetFunctionPointerType(signature);
57public abstract RoType GetModifiedType(RoType modifier, RoType unmodifiedType, bool isRequired);
58public abstract RoType GetPinnedType(RoType elementType);
60public RoType GetPrimitiveType(PrimitiveTypeCode typeCode) => _typeProvider.GetPrimitiveType(typeCode);
System\Reflection\TypeLoading\General\Helpers.cs (6)
293public static RoType? LoadTypeFromAssemblyQualifiedName(string name, RoAssembly defaultAssembly, bool ignoreCase, bool throwOnError)
299RoType? type = defaultAssembly.GetTypeCore(ns, simpleName, ignoreCase: ignoreCase, out Exception? e);
329return (RoType?)Type.GetType(name, assemblyResolver: assemblyResolver, typeResolver: typeResolver, throwOnError: throwOnError, ignoreCase: ignoreCase);
332public static RoType SkipTypeWrappers(this RoType type)
393public static TypeContext ToTypeContext(this RoType[] instantiation) => new TypeContext(instantiation, null);
System\Reflection\TypeLoading\Modules\Ecma\EcmaModule.TypeProvider.cs (30)
13internal sealed partial class EcmaModule : ISignatureTypeProvider<RoType, TypeContext>, ICustomAttributeTypeProvider<RoType>
19public RoType GetTypeFromDefinition(MetadataReader reader, TypeDefinitionHandle handle, byte rawTypeKind) => handle.ResolveTypeDef(this);
20public RoType GetTypeFromReference(MetadataReader reader, TypeReferenceHandle handle, byte rawTypeKind) => handle.ResolveTypeRef(this);
21public RoType GetTypeFromSpecification(MetadataReader reader, TypeContext genericContext, TypeSpecificationHandle handle, byte rawTypeKind) => handle.ResolveTypeSpec(this, genericContext);
23public RoType GetSZArrayType(RoType elementType) => elementType.GetUniqueArrayType();
24public RoType GetArrayType(RoType elementType, ArrayShape shape) => elementType.GetUniqueArrayType(shape.Rank);
25public RoType GetByReferenceType(RoType elementType) => elementType.GetUniqueByRefType();
26public RoType GetPointerType(RoType elementType) => elementType.GetUniquePointerType();
27public RoType GetGenericInstantiation(RoType genericType, ImmutableArray<RoType> typeArguments)
35public RoType GetGenericTypeParameter(TypeContext genericContext, int index) => genericContext.GetGenericTypeArgumentOrNull(index) ?? throw new BadImageFormatException(SR.Format(SR.GenericTypeParamIndexOutOfRange, index));
36public RoType GetGenericMethodParameter(TypeContext genericContext, int index) => genericContext.GetGenericMethodArgumentOrNull(index) ?? throw new BadImageFormatException(SR.Format(SR.GenericMethodParamIndexOutOfRange, index));
38public RoType GetFunctionPointerType(MethodSignature<RoType> signature) => new RoFunctionPointerType(this, signature);
39public RoType GetModifiedType(RoType modifier, RoType unmodifiedType, bool isRequired)
56public RoType GetPinnedType(RoType elementType) => elementType;
58public RoType GetPrimitiveType(PrimitiveTypeCode typeCode) => Loader.GetCoreType(typeCode.ToCoreType());
63public RoType GetSystemType() => Loader.GetCoreType(CoreType.Type);
64public bool IsSystemType(RoType type) => type == Loader.TryGetCoreType(CoreType.Type);
65public PrimitiveTypeCode GetUnderlyingEnumType(RoType type) => type.GetEnumUnderlyingPrimitiveTypeCode(Loader);
67public RoType GetTypeFromSerializedName(string? name)
System\Reflection\TypeLoading\Modules\RoModule.Unifier.cs (13)
13internal RoArrayType GetUniqueArrayType(RoType elementType)
20private static readonly Func<RoType, RoArrayType> s_szArrayTypeFactory = (e) => new RoArrayType(e, multiDim: false, rank: 1);
21private readonly ConcurrentDictionary<RoType, RoArrayType> _szArrayDict = new ConcurrentDictionary<RoType, RoArrayType>();
26internal RoArrayType GetUniqueArrayType(RoType elementType, int rank)
40internal RoByRefType GetUniqueByRefType(RoType elementType)
47private static readonly Func<RoType, RoByRefType> s_byrefTypeFactory = (e) => new RoByRefType(e);
48private readonly ConcurrentDictionary<RoType, RoByRefType> _byRefDict = new ConcurrentDictionary<RoType, RoByRefType>();
53internal RoPointerType GetUniquePointerType(RoType elementType)
59private readonly ConcurrentDictionary<RoType, RoPointerType> _pointerDict = new ConcurrentDictionary<RoType, RoPointerType>();
64internal RoConstructedGenericType GetUniqueConstructedGenericType(RoDefinitionType genericTypeDefinition, RoType[] genericTypeArguments)