@ -137,54 +137,54 @@ namespace ICSharpCode.Decompiler.TypeSystem
@@ -137,54 +137,54 @@ namespace ICSharpCode.Decompiler.TypeSystem
static readonly KnownTypeReference [ ] knownTypeReferences = new KnownTypeReference [ KnownTypeCodeCount ] {
null , // None
new KnownTypeReference ( KnownTypeCode . Object , "System" , "Object" , baseType : KnownTypeCode . None ) ,
new KnownTypeReference ( KnownTypeCode . DBNull , "System" , "DBNull" ) ,
new KnownTypeReference ( KnownTypeCode . Boolean , "System" , "Boolean" , baseType : KnownTypeCode . ValueType ) ,
new KnownTypeReference ( KnownTypeCode . Char , "System" , "Char" , baseType : KnownTypeCode . ValueType ) ,
new KnownTypeReference ( KnownTypeCode . SByte , "System" , "SByte" , baseType : KnownTypeCode . ValueType ) ,
new KnownTypeReference ( KnownTypeCode . Byte , "System" , "Byte" , baseType : KnownTypeCode . ValueType ) ,
new KnownTypeReference ( KnownTypeCode . Int16 , "System" , "Int16" , baseType : KnownTypeCode . ValueType ) ,
new KnownTypeReference ( KnownTypeCode . UInt16 , "System" , "UInt16" , baseType : KnownTypeCode . ValueType ) ,
new KnownTypeReference ( KnownTypeCode . Int32 , "System" , "Int32" , baseType : KnownTypeCode . ValueType ) ,
new KnownTypeReference ( KnownTypeCode . UInt32 , "System" , "UInt32" , baseType : KnownTypeCode . ValueType ) ,
new KnownTypeReference ( KnownTypeCode . Int64 , "System" , "Int64" , baseType : KnownTypeCode . ValueType ) ,
new KnownTypeReference ( KnownTypeCode . UInt64 , "System" , "UInt64" , baseType : KnownTypeCode . ValueType ) ,
new KnownTypeReference ( KnownTypeCode . Single , "System" , "Single" , baseType : KnownTypeCode . ValueType ) ,
new KnownTypeReference ( KnownTypeCode . Double , "System" , "Double" , baseType : KnownTypeCode . ValueType ) ,
new KnownTypeReference ( KnownTypeCode . Decimal , "System" , "Decimal" , baseType : KnownTypeCode . ValueType ) ,
new KnownTypeReference ( KnownTypeCode . DateTime , "System" , "DateTime" , baseType : KnownTypeCode . ValueType ) ,
new KnownTypeReference ( KnownTypeCode . Object , TypeKind . Class , "System" , "Object" , baseType : KnownTypeCode . None ) ,
new KnownTypeReference ( KnownTypeCode . DBNull , TypeKind . Class , "System" , "DBNull" ) ,
new KnownTypeReference ( KnownTypeCode . Boolean , TypeKind . Struct , "System" , "Boolean" ) ,
new KnownTypeReference ( KnownTypeCode . Char , TypeKind . Struct , "System" , "Char" ) ,
new KnownTypeReference ( KnownTypeCode . SByte , TypeKind . Struct , "System" , "SByte" ) ,
new KnownTypeReference ( KnownTypeCode . Byte , TypeKind . Struct , "System" , "Byte" ) ,
new KnownTypeReference ( KnownTypeCode . Int16 , TypeKind . Struct , "System" , "Int16" ) ,
new KnownTypeReference ( KnownTypeCode . UInt16 , TypeKind . Struct , "System" , "UInt16" ) ,
new KnownTypeReference ( KnownTypeCode . Int32 , TypeKind . Struct , "System" , "Int32" ) ,
new KnownTypeReference ( KnownTypeCode . UInt32 , TypeKind . Struct , "System" , "UInt32" ) ,
new KnownTypeReference ( KnownTypeCode . Int64 , TypeKind . Struct , "System" , "Int64" ) ,
new KnownTypeReference ( KnownTypeCode . UInt64 , TypeKind . Struct , "System" , "UInt64" ) ,
new KnownTypeReference ( KnownTypeCode . Single , TypeKind . Struct , "System" , "Single" ) ,
new KnownTypeReference ( KnownTypeCode . Double , TypeKind . Struct , "System" , "Double" ) ,
new KnownTypeReference ( KnownTypeCode . Decimal , TypeKind . Struct , "System" , "Decimal" ) ,
new KnownTypeReference ( KnownTypeCode . DateTime , TypeKind . Struct , "System" , "DateTime" ) ,
null ,
new KnownTypeReference ( KnownTypeCode . String , "System" , "String" ) ,
new KnownTypeReference ( KnownTypeCode . Void , "System" , "Void" ) ,
new KnownTypeReference ( KnownTypeCode . Type , "System" , "Type" ) ,
new KnownTypeReference ( KnownTypeCode . Array , "System" , "Array" ) ,
new KnownTypeReference ( KnownTypeCode . Attribute , "System" , "Attribute" ) ,
new KnownTypeReference ( KnownTypeCode . ValueType , "System" , "ValueType" ) ,
new KnownTypeReference ( KnownTypeCode . Enum , "System" , "Enum" , baseType : KnownTypeCode . ValueType ) ,
new KnownTypeReference ( KnownTypeCode . Delegate , "System" , "Delegate" ) ,
new KnownTypeReference ( KnownTypeCode . MulticastDelegate , "System" , "MulticastDelegate" , baseType : KnownTypeCode . Delegate ) ,
new KnownTypeReference ( KnownTypeCode . Exception , "System" , "Exception" ) ,
new KnownTypeReference ( KnownTypeCode . IntPtr , "System" , "IntPtr" , baseType : KnownTypeCode . ValueType ) ,
new KnownTypeReference ( KnownTypeCode . UIntPtr , "System" , "UIntPtr" , baseType : KnownTypeCode . ValueType ) ,
new KnownTypeReference ( KnownTypeCode . IEnumerable , "System.Collections" , "IEnumerable" ) ,
new KnownTypeReference ( KnownTypeCode . IEnumerator , "System.Collections" , "IEnumerator" ) ,
new KnownTypeReference ( KnownTypeCode . IEnumerableOfT , "System.Collections.Generic" , "IEnumerable" , 1 ) ,
new KnownTypeReference ( KnownTypeCode . IEnumeratorOfT , "System.Collections.Generic" , "IEnumerator" , 1 ) ,
new KnownTypeReference ( KnownTypeCode . ICollection , "System.Collections" , "ICollection" ) ,
new KnownTypeReference ( KnownTypeCode . ICollectionOfT , "System.Collections.Generic" , "ICollection" , 1 ) ,
new KnownTypeReference ( KnownTypeCode . IList , "System.Collections" , "IList" ) ,
new KnownTypeReference ( KnownTypeCode . IListOfT , "System.Collections.Generic" , "IList" , 1 ) ,
new KnownTypeReference ( KnownTypeCode . String , TypeKind . Class , "System" , "String" ) ,
new KnownTypeReference ( KnownTypeCode . Void , TypeKind . Void , "System" , "Void" , baseType : KnownTypeCode . ValueType ) ,
new KnownTypeReference ( KnownTypeCode . Type , TypeKind . Class , "System" , "Type" ) ,
new KnownTypeReference ( KnownTypeCode . Array , TypeKind . Class , "System" , "Array" ) ,
new KnownTypeReference ( KnownTypeCode . Attribute , TypeKind . Class , "System" , "Attribute" ) ,
new KnownTypeReference ( KnownTypeCode . ValueType , TypeKind . Class , "System" , "ValueType" ) ,
new KnownTypeReference ( KnownTypeCode . Enum , TypeKind . Class , "System" , "Enum" , baseType : KnownTypeCode . ValueType ) ,
new KnownTypeReference ( KnownTypeCode . Delegate , TypeKind . Class , "System" , "Delegate" ) ,
new KnownTypeReference ( KnownTypeCode . MulticastDelegate , TypeKind . Class , "System" , "MulticastDelegate" , baseType : KnownTypeCode . Delegate ) ,
new KnownTypeReference ( KnownTypeCode . Exception , TypeKind . Class , "System" , "Exception" ) ,
new KnownTypeReference ( KnownTypeCode . IntPtr , TypeKind . Struct , "System" , "IntPtr" ) ,
new KnownTypeReference ( KnownTypeCode . UIntPtr , TypeKind . Struct , "System" , "UIntPtr" ) ,
new KnownTypeReference ( KnownTypeCode . IEnumerable , TypeKind . Interface , "System.Collections" , "IEnumerable" ) ,
new KnownTypeReference ( KnownTypeCode . IEnumerator , TypeKind . Interface , "System.Collections" , "IEnumerator" ) ,
new KnownTypeReference ( KnownTypeCode . IEnumerableOfT , TypeKind . Interface , "System.Collections.Generic" , "IEnumerable" , 1 ) ,
new KnownTypeReference ( KnownTypeCode . IEnumeratorOfT , TypeKind . Interface , "System.Collections.Generic" , "IEnumerator" , 1 ) ,
new KnownTypeReference ( KnownTypeCode . ICollection , TypeKind . Interface , "System.Collections" , "ICollection" ) ,
new KnownTypeReference ( KnownTypeCode . ICollectionOfT , TypeKind . Interface , "System.Collections.Generic" , "ICollection" , 1 ) ,
new KnownTypeReference ( KnownTypeCode . IList , TypeKind . Interface , "System.Collections" , "IList" ) ,
new KnownTypeReference ( KnownTypeCode . IListOfT , TypeKind . Interface , "System.Collections.Generic" , "IList" , 1 ) ,
new KnownTypeReference ( KnownTypeCode . IReadOnlyCollectionOfT , "System.Collections.Generic" , "IReadOnlyCollection" , 1 ) ,
new KnownTypeReference ( KnownTypeCode . IReadOnlyListOfT , "System.Collections.Generic" , "IReadOnlyList" , 1 ) ,
new KnownTypeReference ( KnownTypeCode . Task , "System.Threading.Tasks" , "Task" ) ,
new KnownTypeReference ( KnownTypeCode . TaskOfT , "System.Threading.Tasks" , "Task" , 1 , baseType : KnownTypeCode . Task ) ,
new KnownTypeReference ( KnownTypeCode . NullableOfT , "System" , "Nullable" , 1 , baseType : KnownTypeCode . ValueType ) ,
new KnownTypeReference ( KnownTypeCode . IDisposable , "System" , "IDisposable" ) ,
new KnownTypeReference ( KnownTypeCode . INotifyCompletion , "System.Runtime.CompilerServices" , "INotifyCompletion" ) ,
new KnownTypeReference ( KnownTypeCode . ICriticalNotifyCompletion , "System.Runtime.CompilerServices" , "ICriticalNotifyCompletion" ) ,
new KnownTypeReference ( KnownTypeCode . IReadOnlyCollectionOfT , TypeKind . Interface , "System.Collections.Generic" , "IReadOnlyCollection" , 1 ) ,
new KnownTypeReference ( KnownTypeCode . IReadOnlyListOfT , TypeKind . Interface , "System.Collections.Generic" , "IReadOnlyList" , 1 ) ,
new KnownTypeReference ( KnownTypeCode . Task , TypeKind . Class , "System.Threading.Tasks" , "Task" ) ,
new KnownTypeReference ( KnownTypeCode . TaskOfT , TypeKind . Class , "System.Threading.Tasks" , "Task" , 1 , baseType : KnownTypeCode . Task ) ,
new KnownTypeReference ( KnownTypeCode . NullableOfT , TypeKind . Struct , "System" , "Nullable" , 1 ) ,
new KnownTypeReference ( KnownTypeCode . IDisposable , TypeKind . Interface , "System" , "IDisposable" ) ,
new KnownTypeReference ( KnownTypeCode . INotifyCompletion , TypeKind . Interface , "System.Runtime.CompilerServices" , "INotifyCompletion" ) ,
new KnownTypeReference ( KnownTypeCode . ICriticalNotifyCompletion , TypeKind . Interface , "System.Runtime.CompilerServices" , "ICriticalNotifyCompletion" ) ,
new KnownTypeReference ( KnownTypeCode . TypedReference , "System" , "TypedReference" , baseType : KnownTypeCode . ValueType ) ,
new KnownTypeReference ( KnownTypeCode . TypedReference , TypeKind . Struct , "System" , "TypedReference" ) ,
} ;
/// <summary>
@ -196,243 +196,22 @@ namespace ICSharpCode.Decompiler.TypeSystem
@@ -196,243 +196,22 @@ namespace ICSharpCode.Decompiler.TypeSystem
return knownTypeReferences [ ( int ) typeCode ] ;
}
/// <summary>
/// Gets a type reference pointing to the <c>object</c> type.
/// </summary>
public static readonly KnownTypeReference Object = Get ( KnownTypeCode . Object ) ;
/// <summary>
/// Gets a type reference pointing to the <c>System.DBNull</c> type.
/// </summary>
public static readonly KnownTypeReference DBNull = Get ( KnownTypeCode . DBNull ) ;
/// <summary>
/// Gets a type reference pointing to the <c>bool</c> type.
/// </summary>
public static readonly KnownTypeReference Boolean = Get ( KnownTypeCode . Boolean ) ;
/// <summary>
/// Gets a type reference pointing to the <c>char</c> type.
/// </summary>
public static readonly KnownTypeReference Char = Get ( KnownTypeCode . Char ) ;
/// <summary>
/// Gets a type reference pointing to the <c>sbyte</c> type.
/// </summary>
public static readonly KnownTypeReference SByte = Get ( KnownTypeCode . SByte ) ;
/// <summary>
/// Gets a type reference pointing to the <c>byte</c> type.
/// </summary>
public static readonly KnownTypeReference Byte = Get ( KnownTypeCode . Byte ) ;
/// <summary>
/// Gets a type reference pointing to the <c>short</c> type.
/// </summary>
public static readonly KnownTypeReference Int16 = Get ( KnownTypeCode . Int16 ) ;
/// <summary>
/// Gets a type reference pointing to the <c>ushort</c> type.
/// </summary>
public static readonly KnownTypeReference UInt16 = Get ( KnownTypeCode . UInt16 ) ;
/// <summary>
/// Gets a type reference pointing to the <c>int</c> type.
/// </summary>
public static readonly KnownTypeReference Int32 = Get ( KnownTypeCode . Int32 ) ;
/// <summary>
/// Gets a type reference pointing to the <c>uint</c> type.
/// </summary>
public static readonly KnownTypeReference UInt32 = Get ( KnownTypeCode . UInt32 ) ;
/// <summary>
/// Gets a type reference pointing to the <c>long</c> type.
/// </summary>
public static readonly KnownTypeReference Int64 = Get ( KnownTypeCode . Int64 ) ;
/// <summary>
/// Gets a type reference pointing to the <c>ulong</c> type.
/// </summary>
public static readonly KnownTypeReference UInt64 = Get ( KnownTypeCode . UInt64 ) ;
/// <summary>
/// Gets a type reference pointing to the <c>float</c> type.
/// </summary>
public static readonly KnownTypeReference Single = Get ( KnownTypeCode . Single ) ;
/// <summary>
/// Gets a type reference pointing to the <c>double</c> type.
/// </summary>
public static readonly KnownTypeReference Double = Get ( KnownTypeCode . Double ) ;
/// <summary>
/// Gets a type reference pointing to the <c>decimal</c> type.
/// </summary>
public static readonly KnownTypeReference Decimal = Get ( KnownTypeCode . Decimal ) ;
/// <summary>
/// Gets a type reference pointing to the <c>System.DateTime</c> type.
/// </summary>
public static readonly KnownTypeReference DateTime = Get ( KnownTypeCode . DateTime ) ;
/// <summary>
/// Gets a type reference pointing to the <c>string</c> type.
/// </summary>
public static readonly KnownTypeReference String = Get ( KnownTypeCode . String ) ;
/// <summary>
/// Gets a type reference pointing to the <c>void</c> type.
/// </summary>
public static readonly KnownTypeReference Void = Get ( KnownTypeCode . Void ) ;
/// <summary>
/// Gets a type reference pointing to the <c>System.Type</c> type.
/// </summary>
public static readonly KnownTypeReference Type = Get ( KnownTypeCode . Type ) ;
/// <summary>
/// Gets a type reference pointing to the <c>System.Array</c> type.
/// </summary>
public static readonly KnownTypeReference Array = Get ( KnownTypeCode . Array ) ;
/// <summary>
/// Gets a type reference pointing to the <c>System.Attribute</c> type.
/// </summary>
public static readonly KnownTypeReference Attribute = Get ( KnownTypeCode . Attribute ) ;
/// <summary>
/// Gets a type reference pointing to the <c>System.ValueType</c> type.
/// </summary>
public static readonly KnownTypeReference ValueType = Get ( KnownTypeCode . ValueType ) ;
/// <summary>
/// Gets a type reference pointing to the <c>System.Enum</c> type.
/// </summary>
public static readonly KnownTypeReference Enum = Get ( KnownTypeCode . Enum ) ;
/// <summary>
/// Gets a type reference pointing to the <c>System.Delegate</c> type.
/// </summary>
public static readonly KnownTypeReference Delegate = Get ( KnownTypeCode . Delegate ) ;
/// <summary>
/// Gets a type reference pointing to the <c>System.MulticastDelegate</c> type.
/// </summary>
public static readonly KnownTypeReference MulticastDelegate = Get ( KnownTypeCode . MulticastDelegate ) ;
/// <summary>
/// Gets a type reference pointing to the <c>System.Exception</c> type.
/// </summary>
public static readonly KnownTypeReference Exception = Get ( KnownTypeCode . Exception ) ;
/// <summary>
/// Gets a type reference pointing to the <c>System.IntPtr</c> type.
/// </summary>
public static readonly KnownTypeReference IntPtr = Get ( KnownTypeCode . IntPtr ) ;
/// <summary>
/// Gets a type reference pointing to the <c>System.UIntPtr</c> type.
/// </summary>
public static readonly KnownTypeReference UIntPtr = Get ( KnownTypeCode . UIntPtr ) ;
/// <summary>
/// Gets a type reference pointing to the <c>System.Collections.IEnumerable</c> type.
/// </summary>
public static readonly KnownTypeReference IEnumerable = Get ( KnownTypeCode . IEnumerable ) ;
/// <summary>
/// Gets a type reference pointing to the <c>System.Collections.IEnumerator</c> type.
/// </summary>
public static readonly KnownTypeReference IEnumerator = Get ( KnownTypeCode . IEnumerator ) ;
/// <summary>
/// Gets a type reference pointing to the <c>System.Collections.Generic.IEnumerable{T}</c> type.
/// </summary>
public static readonly KnownTypeReference IEnumerableOfT = Get ( KnownTypeCode . IEnumerableOfT ) ;
/// <summary>
/// Gets a type reference pointing to the <c>System.Collections.Generic.IEnumerator{T}</c> type.
/// </summary>
public static readonly KnownTypeReference IEnumeratorOfT = Get ( KnownTypeCode . IEnumeratorOfT ) ;
/// <summary>
/// Gets a type reference pointing to the <c>System.Collections.ICollection</c> type.
/// </summary>
public static readonly KnownTypeReference ICollection = Get ( KnownTypeCode . ICollection ) ;
/// <summary>
/// Gets a type reference pointing to the <c>System.Collections.Generic.ICollection{T}</c> type.
/// </summary>
public static readonly KnownTypeReference ICollectionOfT = Get ( KnownTypeCode . ICollectionOfT ) ;
/// <summary>
/// Gets a type reference pointing to the <c>System.Collections.IList</c> type.
/// </summary>
public static readonly KnownTypeReference IList = Get ( KnownTypeCode . IList ) ;
/// <summary>
/// Gets a type reference pointing to the <c>System.Collections.Generic.IList{T}</c> type.
/// </summary>
public static readonly KnownTypeReference IListOfT = Get ( KnownTypeCode . IListOfT ) ;
/// <summary>
/// Gets a type reference pointing to the <c>System.Collections.Generic.IReadOnlyCollection{T}</c> type.
/// </summary>
public static readonly KnownTypeReference IReadOnlyCollectionOfT = Get ( KnownTypeCode . IReadOnlyCollectionOfT ) ;
/// <summary>
/// Gets a type reference pointing to the <c>System.Collections.Generic.IReadOnlyList{T}</c> type.
/// </summary>
public static readonly KnownTypeReference IReadOnlyListOfT = Get ( KnownTypeCode . IReadOnlyListOfT ) ;
/// <summary>
/// Gets a type reference pointing to the <c>System.Threading.Tasks.Task</c> type.
/// </summary>
public static readonly KnownTypeReference Task = Get ( KnownTypeCode . Task ) ;
/// <summary>
/// Gets a type reference pointing to the <c>System.Threading.Tasks.Task{T}</c> type.
/// </summary>
public static readonly KnownTypeReference TaskOfT = Get ( KnownTypeCode . TaskOfT ) ;
/// <summary>
/// Gets a type reference pointing to the <c>System.Nullable{T}</c> type.
/// </summary>
public static readonly KnownTypeReference NullableOfT = Get ( KnownTypeCode . NullableOfT ) ;
/// <summary>
/// Gets a type reference pointing to the <c>System.IDisposable</c> type.
/// </summary>
public static readonly KnownTypeReference IDisposable = Get ( KnownTypeCode . IDisposable ) ;
/// <summary>
/// Gets a type reference pointing to the <c>System.Runtime.CompilerServices.INotifyCompletion</c> type.
/// </summary>
public static readonly KnownTypeReference INotifyCompletion = Get ( KnownTypeCode . INotifyCompletion ) ;
/// <summary>
/// Gets a type reference pointing to the <c>System.Runtime.CompilerServices.ICriticalNotifyCompletion</c> type.
/// </summary>
public static readonly KnownTypeReference ICriticalNotifyCompletion = Get ( KnownTypeCode . ICriticalNotifyCompletion ) ;
/// <summary>
/// Gets a type reference pointing to the <c>System.TypedReference</c> type.
/// </summary>
public static readonly KnownTypeReference TypedReference = Get ( KnownTypeCode . TypedReference ) ;
readonly KnownTypeCode knownTypeCode ;
readonly string namespaceName ;
readonly string name ;
readonly int typeParameterCount ;
internal readonly KnownTypeCode baseType ;
private KnownTypeReference ( KnownTypeCode knownTypeCode , string namespaceName , string name , int typeParameterCount = 0 , KnownTypeCode baseType = KnownTypeCode . Object )
internal readonly TypeKind typeKind ;
private KnownTypeReference ( KnownTypeCode knownTypeCode , TypeKind typeKind , string namespaceName , string name , int typeParameterCount = 0 , KnownTypeCode baseType = KnownTypeCode . Object )
{
if ( typeKind = = TypeKind . Struct & & baseType = = KnownTypeCode . Object )
baseType = KnownTypeCode . ValueType ;
this . knownTypeCode = knownTypeCode ;
this . namespaceName = namespaceName ;
this . name = name ;
this . typeParameterCount = typeParameterCount ;
this . typeKind = typeKind ;
this . baseType = baseType ;
}