89 references to
System.Reflection.MetadataLoadContext (89)
System\Reflection\MetadataLoadContext.CoreAssembly.cs (1)
72return coreTypes[coreType];
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\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\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 (12)
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\Types\RoDefinitionType.cs (16)
188if (t == ct[CoreType.Boolean]) 190if (t == ct[CoreType.Char]) 192if (t == ct[CoreType.SByte]) 194if (t == ct[CoreType.Byte]) 196if (t == ct[CoreType.Int16]) 198if (t == ct[CoreType.UInt16]) 200if (t == ct[CoreType.Int32]) 202if (t == ct[CoreType.UInt32]) 204if (t == ct[CoreType.Int64]) 206if (t == ct[CoreType.UInt64]) 208if (t == ct[CoreType.Single]) 210if (t == ct[CoreType.Double]) 212if (t == ct[CoreType.String]) 214if (t == ct[CoreType.DateTime]) 216if (t == ct[CoreType.Decimal]) 218if (t == ct[CoreType.DBNull])
System\Reflection\TypeLoading\Types\RoType.TypeClassification.cs (3)
54Type? enumType = coreTypes[CoreType.Enum]; 55Type? valueType = coreTypes[CoreType.ValueType]; 76if (this == coreTypes[primitiveType])