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