Browse Source

Add IAsyncEnumerable/IAsyncEnumerator known types.

pull/1730/head
Daniel Grunwald 6 years ago
parent
commit
6a04a33c4f
  1. 10
      ICSharpCode.Decompiler/TypeSystem/KnownTypeReference.cs

10
ICSharpCode.Decompiler/TypeSystem/KnownTypeReference.cs

@ -137,15 +137,19 @@ namespace ICSharpCode.Decompiler.TypeSystem
MemoryOfT, MemoryOfT,
/// <summary><c>System.Runtime.CompilerServices.Unsafe</c></summary> /// <summary><c>System.Runtime.CompilerServices.Unsafe</c></summary>
Unsafe, Unsafe,
/// <summary><c>System.Collections.Generic.IAsyncEnumerable{T}</c></summary>
IAsyncEnumerableOfT,
/// <summary><c>System.Collections.Generic.IAsyncEnumerator{T}</c></summary>
IAsyncEnumeratorOfT,
} }
/// <summary> /// <summary>
/// Contains well-known type references. /// Contains well-known type references.
/// </summary> /// </summary>
[Serializable] [Serializable]
public sealed class KnownTypeReference : ITypeReference public sealed class KnownTypeReference : ITypeReference
{ {
internal const int KnownTypeCodeCount = (int)KnownTypeCode.Unsafe + 1; internal const int KnownTypeCodeCount = (int)KnownTypeCode.IAsyncEnumeratorOfT + 1;
static readonly KnownTypeReference[] knownTypeReferences = new KnownTypeReference[KnownTypeCodeCount] { static readonly KnownTypeReference[] knownTypeReferences = new KnownTypeReference[KnownTypeCodeCount] {
null, // None null, // None
@ -203,6 +207,8 @@ namespace ICSharpCode.Decompiler.TypeSystem
new KnownTypeReference(KnownTypeCode.ReadOnlySpanOfT, TypeKind.Struct, "System", "ReadOnlySpan", 1), new KnownTypeReference(KnownTypeCode.ReadOnlySpanOfT, TypeKind.Struct, "System", "ReadOnlySpan", 1),
new KnownTypeReference(KnownTypeCode.MemoryOfT, TypeKind.Struct, "System", "Memory", 1), new KnownTypeReference(KnownTypeCode.MemoryOfT, TypeKind.Struct, "System", "Memory", 1),
new KnownTypeReference(KnownTypeCode.Unsafe, TypeKind.Class, "System.Runtime.CompilerServices", "Unsafe", 0), new KnownTypeReference(KnownTypeCode.Unsafe, TypeKind.Class, "System.Runtime.CompilerServices", "Unsafe", 0),
new KnownTypeReference(KnownTypeCode.IAsyncEnumerableOfT, TypeKind.Interface, "System.Collections.Generic", "IAsyncEnumerable", 1),
new KnownTypeReference(KnownTypeCode.IAsyncEnumeratorOfT, TypeKind.Interface, "System.Collections.Generic", "IAsyncEnumerator", 1),
}; };
/// <summary> /// <summary>

Loading…
Cancel
Save