214 references to CoreType
System.Reflection.MetadataLoadContext (214)
System\Reflection\DefaultBinder.cs (1)
19_objectType = loader.TryGetCoreType(CoreType.Object);
System\Reflection\MetadataLoadContext.CoreAssembly.cs (2)
57internal RoType GetCoreType(CoreType coreType) 69internal RoType? TryGetCoreType(CoreType coreType)
System\Reflection\MetadataLoadContext.KnownConstructors.cs (13)
11internal ConstructorInfo? TryGetFieldOffsetCtor() => _lazyFieldOffset ??= TryGetConstructor(CoreType.FieldOffsetAttribute, CoreType.Int32); 14internal ConstructorInfo? TryGetInCtor() => _lazyIn ??= TryGetConstructor(CoreType.InAttribute); 17internal ConstructorInfo? TryGetOutCtor() => _lazyOut ??= TryGetConstructor(CoreType.OutAttribute); 20internal ConstructorInfo? TryGetOptionalCtor() => _lazyOptional ??= TryGetConstructor(CoreType.OptionalAttribute); 23internal ConstructorInfo? TryGetPreserveSigCtor() => _lazyPreserveSig ??= TryGetConstructor(CoreType.PreserveSigAttribute); 26internal ConstructorInfo? TryGetComImportCtor() => _lazyComImport ??= TryGetConstructor(CoreType.ComImportAttribute); 29internal ConstructorInfo? TryGetDllImportCtor() => _lazyDllImport ??= TryGetConstructor(CoreType.DllImportAttribute, CoreType.String); 32internal ConstructorInfo? TryGetMarshalAsCtor() => _lazyMarshalAs ??= TryGetConstructor(CoreType.MarshalAsAttribute, CoreType.UnmanagedType); 35private ConstructorInfo? TryGetConstructor(CoreType attributeCoreType, params CoreType[] parameterCoreTypes)
System\Reflection\TypeLoading\Constructors\RoSyntheticConstructor.cs (1)
43RoType returnType = GetRoModule().Loader.GetCoreType(CoreType.Void);
System\Reflection\TypeLoading\CustomAttributes\CustomAttributeHelpers.cs (17)
90if (ct[CoreType.String] == null || 91ct[CoreType.Boolean] == null || 92ct[CoreType.UnmanagedType] == null || 93ct[CoreType.VarEnum] == null || 94ct[CoreType.Type] == null || 95ct[CoreType.Int16] == null || 96ct[CoreType.Int32] == null) 112CustomAttributeTypedArgument[] cats = { new CustomAttributeTypedArgument(ct[CoreType.UnmanagedType]!, (int)(ma.Value)) }; 116attributeType.ToCustomAttributeNamedArgument(nameof(MarshalAsAttribute.ArraySubType), ct[CoreType.UnmanagedType], (int)ma.ArraySubType), 117attributeType.ToCustomAttributeNamedArgument(nameof(MarshalAsAttribute.IidParameterIndex), ct[CoreType.Int32], ma.IidParameterIndex), 118attributeType.ToCustomAttributeNamedArgument(nameof(MarshalAsAttribute.SafeArraySubType), ct[CoreType.VarEnum], (int)ma.SafeArraySubType), 119attributeType.ToCustomAttributeNamedArgument(nameof(MarshalAsAttribute.SizeConst), ct[CoreType.Int32], ma.SizeConst), 120attributeType.ToCustomAttributeNamedArgument(nameof(MarshalAsAttribute.SizeParamIndex), ct[CoreType.Int16], ma.SizeParamIndex), 125cans.Add(attributeType.ToCustomAttributeNamedArgument(nameof(MarshalAsAttribute.SafeArrayUserDefinedSubType), ct[CoreType.Type], ma.SafeArrayUserDefinedSubType)); 130cans.Add(attributeType.ToCustomAttributeNamedArgument(nameof(MarshalAsAttribute.MarshalType), ct[CoreType.String], ma.MarshalType)); 135cans.Add(attributeType.ToCustomAttributeNamedArgument(nameof(MarshalAsAttribute.MarshalTypeRef), ct[CoreType.Type], ma.MarshalTypeRef)); 140cans.Add(attributeType.ToCustomAttributeNamedArgument(nameof(MarshalAsAttribute.MarshalCookie), ct[CoreType.String], ma.MarshalCookie));
System\Reflection\TypeLoading\Events\RoEvent.cs (1)
73public sealed override bool IsMulticast => Loader.GetCoreType(CoreType.MulticastDelegate).IsAssignableFrom(EventHandlerType);
System\Reflection\TypeLoading\Fields\RoField.cs (1)
60Type int32Type = Loader.GetCoreType(CoreType.Int32); // Since we got the constructor, we know the Int32 exists.
System\Reflection\TypeLoading\General\Assignability.cs (17)
45if (toTypeInfo.IsConstructedGenericType && toTypeInfo.GetGenericTypeDefinition() == coreTypes[CoreType.NullableT]) 103if (toTypeInfo.Equals(coreTypes[CoreType.Object])) 106if (toTypeInfo.Equals(coreTypes[CoreType.UIntPtr])) 125if (toTypeInfo.Equals(coreTypes[CoreType.Object])) 128if (toTypeInfo.Equals(coreTypes[CoreType.ValueType])) 162if (toTypeInfo.Equals(coreTypes[CoreType.Object]) && fromTypeInfo.IsInterface) 258if (t.Equals(coreTypes[CoreType.Byte])) 259return coreTypes[CoreType.SByte] ?? throw new TypeLoadException(SR.Format(SR.CoreTypeNotFound, "System.SByte")); 261if (t.Equals(coreTypes[CoreType.UInt16])) 262return coreTypes[CoreType.Int16] ?? throw new TypeLoadException(SR.Format(SR.CoreTypeNotFound, "System.Int16")); 264if (t.Equals(coreTypes[CoreType.UInt32])) 265return coreTypes[CoreType.Int32] ?? throw new TypeLoadException(SR.Format(SR.CoreTypeNotFound, "System.Int32")); 267if (t.Equals(coreTypes[CoreType.UInt64])) 268return coreTypes[CoreType.Int64] ?? throw new TypeLoadException(SR.Format(SR.CoreTypeNotFound, "System.Int64")); 326return t.IsClass && !t.Equals(coreTypes[CoreType.Object]) && !t.Equals(coreTypes[CoreType.ValueType]) && !t.Equals(coreTypes[CoreType.Enum]);
System\Reflection\TypeLoading\General\CoreType.cs (48)
81public static void GetFullName(this CoreType coreType, out ReadOnlySpan<byte> ns, out ReadOnlySpan<byte> name) 85case CoreType.Array: ns = Utf8Constants.System; name = Utf8Constants.Array; return; 86case CoreType.Boolean: ns = Utf8Constants.System; name = Utf8Constants.Boolean; return; 87case CoreType.Byte: ns = Utf8Constants.System; name = Utf8Constants.Byte; return; 88case CoreType.Char: ns = Utf8Constants.System; name = Utf8Constants.Char; return; 89case CoreType.Double: ns = Utf8Constants.System; name = Utf8Constants.Double; return; 90case CoreType.Enum: ns = Utf8Constants.System; name = Utf8Constants.Enum; return; 91case CoreType.Int16: ns = Utf8Constants.System; name = Utf8Constants.Int16; return; 92case CoreType.Int32: ns = Utf8Constants.System; name = Utf8Constants.Int32; return; 93case CoreType.Int64: ns = Utf8Constants.System; name = Utf8Constants.Int64; return; 94case CoreType.IntPtr: ns = Utf8Constants.System; name = Utf8Constants.IntPtr; return; 95case CoreType.NullableT: ns = Utf8Constants.System; name = Utf8Constants.NullableT; return; 96case CoreType.Object: ns = Utf8Constants.System; name = Utf8Constants.Object; return; 97case CoreType.SByte: ns = Utf8Constants.System; name = Utf8Constants.SByte; return; 98case CoreType.Single: ns = Utf8Constants.System; name = Utf8Constants.Single; return; 99case CoreType.String: ns = Utf8Constants.System; name = Utf8Constants.String; return; 100case CoreType.TypedReference: ns = Utf8Constants.System; name = Utf8Constants.TypedReference; return; 101case CoreType.UInt16: ns = Utf8Constants.System; name = Utf8Constants.UInt16; return; 102case CoreType.UInt32: ns = Utf8Constants.System; name = Utf8Constants.UInt32; return; 103case CoreType.UInt64: ns = Utf8Constants.System; name = Utf8Constants.UInt64; return; 104case CoreType.UIntPtr: ns = Utf8Constants.System; name = Utf8Constants.UIntPtr; return; 105case CoreType.ValueType: ns = Utf8Constants.System; name = Utf8Constants.ValueType; return; 106case CoreType.Void: ns = Utf8Constants.System; name = Utf8Constants.Void; return; 107case CoreType.MulticastDelegate: ns = Utf8Constants.System; name = Utf8Constants.MulticastDelegate; return; 108case CoreType.IEnumerableT: ns = Utf8Constants.SystemCollectionsGeneric; name = Utf8Constants.IEnumerableT; return; 109case CoreType.ICollectionT: ns = Utf8Constants.SystemCollectionsGeneric; name = Utf8Constants.ICollectionT; return; 110case CoreType.IListT: ns = Utf8Constants.SystemCollectionsGeneric; name = Utf8Constants.IListT; return; 111case CoreType.IReadOnlyListT: ns = Utf8Constants.SystemCollectionsGeneric; name = Utf8Constants.IReadOnlyListT; return; 112case CoreType.Type: ns = Utf8Constants.System; name = Utf8Constants.Type; return; 113case CoreType.DBNull: ns = Utf8Constants.System; name = Utf8Constants.DBNull; return; 114case CoreType.Decimal: ns = Utf8Constants.System; name = Utf8Constants.Decimal; return; 115case CoreType.DateTime: ns = Utf8Constants.System; name = Utf8Constants.DateTime; return; 116case CoreType.ComImportAttribute: ns = Utf8Constants.SystemRuntimeInteropServices; name = Utf8Constants.ComImportAttribute; return; 117case CoreType.DllImportAttribute: ns = Utf8Constants.SystemRuntimeInteropServices; name = Utf8Constants.DllImportAttribute; return; 118case CoreType.CallingConvention: ns = Utf8Constants.SystemRuntimeInteropServices; name = Utf8Constants.CallingConvention; return; 119case CoreType.CharSet: ns = Utf8Constants.SystemRuntimeInteropServices; name = Utf8Constants.CharSet; return; 120case CoreType.MarshalAsAttribute: ns = Utf8Constants.SystemRuntimeInteropServices; name = Utf8Constants.MarshalAsAttribute; return; 121case CoreType.UnmanagedType: ns = Utf8Constants.SystemRuntimeInteropServices; name = Utf8Constants.UnmanagedType; return; 122case CoreType.VarEnum: ns = Utf8Constants.SystemRuntimeInteropServices; name = Utf8Constants.VarEnum; return; 123case CoreType.InAttribute: ns = Utf8Constants.SystemRuntimeInteropServices; name = Utf8Constants.InAttribute; return; 124case CoreType.OutAttribute: ns = Utf8Constants.SystemRuntimeInteropServices; name = Utf8Constants.OutAttriubute; return; 125case CoreType.OptionalAttribute: ns = Utf8Constants.SystemRuntimeInteropServices; name = Utf8Constants.OptionalAttribute; return; 126case CoreType.PreserveSigAttribute: ns = Utf8Constants.SystemRuntimeInteropServices; name = Utf8Constants.PreserveSigAttribute; return; 127case CoreType.FieldOffsetAttribute: ns = Utf8Constants.SystemRuntimeInteropServices; name = Utf8Constants.FieldOffsetAttribute; return; 128case CoreType.CallConvCdecl: ns = Utf8Constants.SystemRuntimeCompilerServices; name = Utf8Constants.CallConvCdecl; return; 129case CoreType.CallConvStdcall: ns = Utf8Constants.SystemRuntimeCompilerServices; name = Utf8Constants.CallConvStdcall; return; 130case CoreType.CallConvThiscall: ns = Utf8Constants.SystemRuntimeCompilerServices; name = Utf8Constants.CallConvThiscall; return; 131case CoreType.CallConvFastcall: ns = Utf8Constants.SystemRuntimeCompilerServices; name = Utf8Constants.CallConvFastcall; return;
System\Reflection\TypeLoading\General\CoreTypes.cs (4)
16int numCoreTypes = (int)CoreType.NumCoreTypes; 29((CoreType)i).GetFullName(out ReadOnlySpan<byte> ns, out ReadOnlySpan<byte> name); 45public RoType? this[CoreType coreType] => _coreTypes[(int)coreType]; 46public Exception? GetException(CoreType coreType) => _exceptions[(int)coreType];
System\Reflection\TypeLoading\General\Ecma\EcmaDefaultValueProcessing.cs (9)
98if (cats[0].ArgumentType != ct[CoreType.Int64]) 114if (cats[0].ArgumentType != ct[CoreType.Byte] || 115cats[1].ArgumentType != ct[CoreType.Byte]) 121if (cats[2].ArgumentType == ct[CoreType.Int32] && cats[3].ArgumentType == ct[CoreType.Int32] && cats[4].ArgumentType == ct[CoreType.Int32]) 130if (cats[2].ArgumentType == ct[CoreType.UInt32] && cats[3].ArgumentType == ct[CoreType.UInt32] && cats[4].ArgumentType == ct[CoreType.UInt32])
System\Reflection\TypeLoading\General\Ecma\EcmaHelpers.cs (32)
31public static CoreType ToCoreType(this PrimitiveTypeCode typeCode) 35case PrimitiveTypeCode.Boolean: return CoreType.Boolean; 36case PrimitiveTypeCode.Byte: return CoreType.Byte; 37case PrimitiveTypeCode.Char: return CoreType.Char; 38case PrimitiveTypeCode.Double: return CoreType.Double; 39case PrimitiveTypeCode.Int16: return CoreType.Int16; 40case PrimitiveTypeCode.Int32: return CoreType.Int32; 41case PrimitiveTypeCode.Int64: return CoreType.Int64; 42case PrimitiveTypeCode.IntPtr: return CoreType.IntPtr; 43case PrimitiveTypeCode.Object: return CoreType.Object; 44case PrimitiveTypeCode.SByte: return CoreType.SByte; 45case PrimitiveTypeCode.Single: return CoreType.Single; 46case PrimitiveTypeCode.String: return CoreType.String; 47case PrimitiveTypeCode.TypedReference: return CoreType.TypedReference; 48case PrimitiveTypeCode.UInt16: return CoreType.UInt16; 49case PrimitiveTypeCode.UInt32: return CoreType.UInt32; 50case PrimitiveTypeCode.UInt64: return CoreType.UInt64; 51case PrimitiveTypeCode.UIntPtr: return CoreType.UIntPtr; 52case PrimitiveTypeCode.Void: return CoreType.Void; 55return CoreType.Void; 64if (type == coreTypes[CoreType.Boolean]) return PrimitiveTypeCode.Boolean; 65if (type == coreTypes[CoreType.Char]) return PrimitiveTypeCode.Char; 66if (type == coreTypes[CoreType.Byte]) return PrimitiveTypeCode.Byte; 67if (type == coreTypes[CoreType.Int16]) return PrimitiveTypeCode.Int16; 68if (type == coreTypes[CoreType.Int32]) return PrimitiveTypeCode.Int32; 69if (type == coreTypes[CoreType.Int64]) return PrimitiveTypeCode.Int64; 70if (type == coreTypes[CoreType.IntPtr]) return PrimitiveTypeCode.IntPtr; 71if (type == coreTypes[CoreType.SByte]) return PrimitiveTypeCode.SByte; 72if (type == coreTypes[CoreType.UInt16]) return PrimitiveTypeCode.UInt16; 73if (type == coreTypes[CoreType.UInt32]) return PrimitiveTypeCode.UInt32; 74if (type == coreTypes[CoreType.UInt64]) return PrimitiveTypeCode.UInt64; 75if (type == coreTypes[CoreType.UIntPtr]) return PrimitiveTypeCode.UIntPtr;
System\Reflection\TypeLoading\Methods\RoDefinitionMethod.DllImport.cs (14)
21if (ct[CoreType.String] == null || 22ct[CoreType.Boolean] == null || 23ct[CoreType.DllImportAttribute] == null || 24ct[CoreType.CharSet] == null || 25ct[CoreType.CallingConvention] == null) 39CustomAttributeTypedArgument[] cats = { new CustomAttributeTypedArgument(ct[CoreType.String]!, dia.Value) }; 42attributeType.ToCustomAttributeNamedArgument(nameof(DllImportAttribute.EntryPoint), ct[CoreType.String], dia.EntryPoint), 43attributeType.ToCustomAttributeNamedArgument(nameof(DllImportAttribute.CharSet), ct[CoreType.CharSet], (int)dia.CharSet), 44attributeType.ToCustomAttributeNamedArgument(nameof(DllImportAttribute.CallingConvention), ct[CoreType.CallingConvention], (int)dia.CallingConvention), 45attributeType.ToCustomAttributeNamedArgument(nameof(DllImportAttribute.ExactSpelling), ct[CoreType.Boolean], dia.ExactSpelling), 46attributeType.ToCustomAttributeNamedArgument(nameof(DllImportAttribute.PreserveSig), ct[CoreType.Boolean], dia.PreserveSig), 47attributeType.ToCustomAttributeNamedArgument(nameof(DllImportAttribute.SetLastError), ct[CoreType.Boolean], dia.SetLastError), 48attributeType.ToCustomAttributeNamedArgument(nameof(DllImportAttribute.BestFitMapping), ct[CoreType.Boolean], dia.BestFitMapping), 49attributeType.ToCustomAttributeNamedArgument(nameof(DllImportAttribute.ThrowOnUnmappableChar), ct[CoreType.Boolean], dia.ThrowOnUnmappableChar),
System\Reflection\TypeLoading\Modules\Ecma\EcmaModule.TypeProvider.cs (2)
63public RoType GetSystemType() => Loader.GetCoreType(CoreType.Type); 64public bool IsSystemType(RoType type) => type == Loader.TryGetCoreType(CoreType.Type);
System\Reflection\TypeLoading\Types\RoArrayType.cs (10)
37internal sealed override RoType? ComputeBaseTypeWithoutDesktopQuirk() => Loader.GetCoreType(CoreType.Array); 45foreach (CoreType coreType in s_typesImplementedByArray) 61private static readonly CoreType[] s_typesImplementedByArray = 63CoreType.IEnumerableT, 64CoreType.ICollectionT, 65CoreType.IListT, 66CoreType.IReadOnlyListT, 79RoType systemInt32 = Loader.GetCoreType(CoreType.Int32); 156RoType systemInt32 = Loader.GetCoreType(CoreType.Int32); 158RoType systemVoid = Loader.GetCoreType(CoreType.Void);
System\Reflection\TypeLoading\Types\RoDefinitionType.cs (17)
138if (cta.ArgumentType != Loader.TryGetCoreType(CoreType.String)) 191if (t == ct[CoreType.Boolean]) 193if (t == ct[CoreType.Char]) 195if (t == ct[CoreType.SByte]) 197if (t == ct[CoreType.Byte]) 199if (t == ct[CoreType.Int16]) 201if (t == ct[CoreType.UInt16]) 203if (t == ct[CoreType.Int32]) 205if (t == ct[CoreType.UInt32]) 207if (t == ct[CoreType.Int64]) 209if (t == ct[CoreType.UInt64]) 211if (t == ct[CoreType.Single]) 213if (t == ct[CoreType.Double]) 215if (t == ct[CoreType.String]) 217if (t == ct[CoreType.DateTime]) 219if (t == ct[CoreType.Decimal]) 221if (t == ct[CoreType.DBNull])
System\Reflection\TypeLoading\Types\RoGenericParameterType.cs (1)
74return Loader.GetCoreType(CoreType.Object);
System\Reflection\TypeLoading\Types\RoModifiedFunctionPointerType.cs (4)
46private Type CDeclType => Loader.GetCoreType(CoreType.CallConvCdecl); 47private Type StdCallType => Loader.GetCoreType(CoreType.CallConvStdcall); 48private Type ThisCallType => Loader.GetCoreType(CoreType.CallConvThiscall); 49private Type FastCallType => Loader.GetCoreType(CoreType.CallConvFastcall);
System\Reflection\TypeLoading\Types\RoType.cs (1)
166baseType = Loader.GetCoreType(CoreType.Object);
System\Reflection\TypeLoading\Types\RoType.TypeClassification.cs (19)
54Type? enumType = coreTypes[CoreType.Enum]; 55Type? valueType = coreTypes[CoreType.ValueType]; 74foreach (CoreType primitiveType in s_primitiveTypes) 85private static readonly CoreType[] s_primitiveTypes = new CoreType[] 87CoreType.Boolean, 88CoreType.Char, 89CoreType.SByte, 90CoreType.Byte, 91CoreType.Int16, 92CoreType.UInt16, 93CoreType.Int32, 94CoreType.UInt32, 95CoreType.Int64, 96CoreType.UInt64, 97CoreType.Single, 98CoreType.Double, 99CoreType.IntPtr, 100CoreType.UIntPtr,