Skip to content
This repository has been archived by the owner on Nov 1, 2020. It is now read-only.

Commit

Permalink
Modernize CommonRuntimeTypes
Browse files Browse the repository at this point in the history
  • Loading branch information
MichalStrehovsky committed Feb 3, 2020
1 parent c462f44 commit 8065659
Showing 1 changed file with 24 additions and 49 deletions.
73 changes: 24 additions & 49 deletions src/Common/src/System/CommonRuntimeTypes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,57 +10,32 @@ namespace System
//
internal static class CommonRuntimeTypes
{
internal static Type Object { get { return s_object; } }
internal static Type ValueType { get { return s_valuetype; } }
internal static Type Type { get { return s_type; } }
internal static Type Attribute { get { return s_attribute; } }
internal static Type String { get { return s_string; } }
internal static Type Array { get { return s_array; } }
internal static Type Enum { get { return s_enum; } }
internal static Type Boolean { get { return s_boolean; } }
internal static Type Char { get { return s_char; } }
internal static Type Byte { get { return s_byte; } }
internal static Type SByte { get { return s_sByte; } }
internal static Type UInt16 { get { return s_uInt16; } }
internal static Type Int16 { get { return s_int16; } }
internal static Type UInt32 { get { return s_uInt32; } }
internal static Type Int32 { get { return s_int32; } }
internal static Type UInt64 { get { return s_uInt64; } }
internal static Type Int64 { get { return s_int64; } }
internal static Type UIntPtr { get { return s_uIntPtr; } }
internal static Type IntPtr { get { return s_intPtr; } }
internal static Type Single { get { return s_single; } }
internal static Type Double { get { return s_double; } }
internal static Type Object { get; } = typeof(object);
internal static Type ValueType { get; } = typeof(ValueType);
internal static Type Type { get; } = typeof(Type);
internal static Type Attribute { get; } = typeof(Attribute);
internal static Type String { get; } = typeof(string);
internal static Type Array { get; } = typeof(Array);
internal static Type Enum { get; } = typeof(Enum);
internal static Type Boolean { get; } = typeof(bool);
internal static Type Char { get; } = typeof(char);
internal static Type Byte { get; } = typeof(byte);
internal static Type SByte { get; } = typeof(sbyte);
internal static Type UInt16 { get; } = typeof(ushort);
internal static Type Int16 { get; } = typeof(short);
internal static Type UInt32 { get; } = typeof(uint);
internal static Type Int32 { get; } = typeof(int);
internal static Type UInt64 { get; } = typeof(ulong);
internal static Type Int64 { get; } = typeof(long);
internal static Type UIntPtr { get; } = typeof(UIntPtr);
internal static Type IntPtr { get; } = typeof(IntPtr);
internal static Type Single { get; } = typeof(float);
internal static Type Double { get; } = typeof(double);
internal static Type Decimal { get { return NotSoCommonTypes.s_decimal; } }
internal static Type DateTime { get { return NotSoCommonTypes.s_datetime; } }
internal static Type Nullable { get { return s_nullable; } }
internal static Type Void { get { return s_void; } }
internal static Type MulticastDelegate { get { return s_multicastDelegate; } }

private static Type s_object = typeof(object);
private static Type s_valuetype = typeof(ValueType);
private static Type s_type = typeof(Type);
private static Type s_attribute = typeof(Attribute);
private static Type s_string = typeof(string);
private static Type s_array = typeof(Array);
private static Type s_enum = typeof(Enum);
private static Type s_boolean = typeof(bool);
private static Type s_char = typeof(char);
private static Type s_byte = typeof(byte);
private static Type s_sByte = typeof(sbyte);
private static Type s_uInt16 = typeof(ushort);
private static Type s_int16 = typeof(short);
private static Type s_uInt32 = typeof(uint);
private static Type s_int32 = typeof(int);
private static Type s_uInt64 = typeof(ulong);
private static Type s_int64 = typeof(long);
private static Type s_uIntPtr = typeof(UIntPtr);
private static Type s_intPtr = typeof(IntPtr);
private static Type s_single = typeof(float);
private static Type s_double = typeof(double);
private static Type s_nullable = typeof(Nullable<>);
private static Type s_void = typeof(void);
private static Type s_multicastDelegate = typeof(MulticastDelegate);
internal static Type Nullable { get; } = typeof(Nullable<>);
internal static Type Void { get; } = typeof(void);
internal static Type MulticastDelegate { get; } = typeof(MulticastDelegate);

// Following types are not so common and their ToString and formatting is particularly heavy.
// Make it less likely that they'll get included in small projects by placing them into
Expand Down

0 comments on commit 8065659

Please sign in to comment.