提交 cbe53f54 编写于 作者: Š Šimon Koníček

Adding a comment

上级 b4501d10
......@@ -1777,7 +1777,8 @@ private IEnumerable<TypeInferenceInfo> InferTypeInYieldStatement(YieldStatementS
var memberSymbol = GetDeclaredMemberSymbolFromOriginalSemanticModel(declaration);
var memberType = GetMemberType(memberSymbol, out _);
// We don't care what the type is, as long as it has 1 type argument. This will work for IEnumerable, IEnumerator,
// IAsyncEnumerable, IAsyncEnumerator and it's also good for error recovery in case there is a missing using.
return memberType is INamedTypeSymbol namedType && namedType.TypeArguments.Length == 1
? SpecializedCollections.SingletonEnumerable(new TypeInferenceInfo(namedType.TypeArguments[0]))
: SpecializedCollections.EmptyEnumerable<TypeInferenceInfo>();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册