From 6a04a33c4f81c15bd87e623b445fe787d0c75a71 Mon Sep 17 00:00:00 2001 From: Daniel Grunwald Date: Sun, 29 Sep 2019 09:30:25 +0200 Subject: [PATCH] Add IAsyncEnumerable/IAsyncEnumerator known types. --- .../TypeSystem/KnownTypeReference.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ICSharpCode.Decompiler/TypeSystem/KnownTypeReference.cs b/ICSharpCode.Decompiler/TypeSystem/KnownTypeReference.cs index 29d14224c..e9c100d31 100644 --- a/ICSharpCode.Decompiler/TypeSystem/KnownTypeReference.cs +++ b/ICSharpCode.Decompiler/TypeSystem/KnownTypeReference.cs @@ -137,15 +137,19 @@ namespace ICSharpCode.Decompiler.TypeSystem MemoryOfT, /// System.Runtime.CompilerServices.Unsafe Unsafe, + /// System.Collections.Generic.IAsyncEnumerable{T} + IAsyncEnumerableOfT, + /// System.Collections.Generic.IAsyncEnumerator{T} + IAsyncEnumeratorOfT, } - + /// /// Contains well-known type references. /// [Serializable] 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] { null, // None @@ -203,6 +207,8 @@ namespace ICSharpCode.Decompiler.TypeSystem new KnownTypeReference(KnownTypeCode.ReadOnlySpanOfT, TypeKind.Struct, "System", "ReadOnlySpan", 1), new KnownTypeReference(KnownTypeCode.MemoryOfT, TypeKind.Struct, "System", "Memory", 1), 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), }; ///