int
is an alias for Int32
and is also defined as a keyword in the C# language specification.
The Reference Source has this code:
[Serializable]
[System.Runtime.InteropServices.StructLayout(LayoutKind.Sequential)]
[System.Runtime.InteropServices.ComVisible(true)]
#if GENERICS_WORK
public struct Int32 : IComparable, IFormattable, IConvertible
, IComparable<Int32>, IEquatable<Int32>
/// , IArithmetic<Int32>
#else
public struct Int32 : IComparable, IFormattable, IConvertible
#endif
{
internal int m_value;
public const int MaxValue = 0x7fffffff;
public const int MinValue = unchecked((int)0x80000000);
Int32
encapsulates an int
. Can somebody explain why the alias is used internally for the alias' definition? This is the same as long pointing to Int64
and then Int64
declaring a long
variable. I suppose it's the compilers prerogative to do what it pleases and int
always means 32 bit memory location and this is just a way of adding methods but it is bugging me.