未验证 提交 6023e201 编写于 作者: Y Youssef Victor 提交者: GitHub

Fallback to IEnumerable<> if IAsyncEnumerable<> not found

上级 57f248fd
......@@ -1235,6 +1235,8 @@ private IEnumerable<TypeInferenceInfo> InferTypeInForEachStatement(ForEachStatem
? this.Compilation.GetSpecialType(SpecialType.System_Collections_Generic_IEnumerable_T)
: this.Compilation.GetTypeByMetadataName(typeof(IAsyncEnumerable<>).FullName);
enumerableType ??= this.Compilation.GetSpecialType(SpecialType.System_Collections_Generic_IEnumerable_T);
// foreach (int v = Goo())
var variableTypes = GetTypes(forEachStatementSyntax.Type);
if (!variableTypes.Any())
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册