34 references to EnumeratorResult
Microsoft.CodeAnalysis.CSharp (34)
Binder\ForEachLoopBinder.cs (34)
768EnumeratorResult found = GetEnumeratorInfoCore(syntax, collectionSyntax, ref collectionExpr, isAsync, diagnostics, out builder);
771case EnumeratorResult.Succeeded:
773case EnumeratorResult.FailedAndReported:
789bool wrongAsync = GetEnumeratorInfoCore(syntax, collectionSyntax, ref originalCollectionExpr, !isAsync, BindingDiagnosticBag.Discarded, builder: out _) == EnumeratorResult.Succeeded;
812private EnumeratorResult GetEnumeratorInfoCore(SyntaxNode syntax, SyntaxNode collectionSyntax, ref BoundExpression collectionExpr, bool isAsync, BindingDiagnosticBag diagnostics, out ForEachEnumeratorInfo.Builder builder)
814EnumeratorResult result;
840return EnumeratorResult.FailedAndReported;
849return EnumeratorResult.FailedAndReported;
865((result is EnumeratorResult.Succeeded && builder.ElementTypeWithAnnotations.Equals(elementField.TypeWithAnnotations, TypeCompareKind.AllIgnoreOptions) &&
867result is EnumeratorResult.FailedAndReported))
877if (result == EnumeratorResult.Succeeded)
897return EnumeratorResult.FailedAndReported;
914EnumeratorResult getEnumeratorInfo(SyntaxNode syntax, SyntaxNode collectionSyntax, ref BoundExpression collectionExpr, bool isAsync, BindingDiagnosticBag diagnostics, out ForEachEnumeratorInfo.Builder builder)
930return EnumeratorResult.FailedAndReported;
938return EnumeratorResult.FailedAndReported;
944return EnumeratorResult.FailedAndReported;
952return EnumeratorResult.FailedAndReported;
955return EnumeratorResult.Succeeded;
966return EnumeratorResult.FailedAndReported;
976return EnumeratorResult.FailedAndReported;
983return EnumeratorResult.FailedAndReported;
986if (SatisfiesIEnumerableInterfaces(collectionSyntax, ref builder, unwrappedCollectionExpr, isAsync, diagnostics, unwrappedCollectionExprType) is not EnumeratorResult.FailedNotReported and var result)
1001return EnumeratorResult.FailedAndReported;
1005return EnumeratorResult.Succeeded;
1013return EnumeratorResult.FailedNotReported;
1016EnumeratorResult createPatternBasedEnumeratorResult(ref ForEachEnumeratorInfo.Builder builder, BoundExpression collectionExpr, bool isAsync, bool viaExtensionMethod, BindingDiagnosticBag diagnostics)
1033return EnumeratorResult.Succeeded;
1038return EnumeratorResult.FailedAndReported;
1042private EnumeratorResult SatisfiesIEnumerableInterfaces(SyntaxNode collectionSyntax, ref ForEachEnumeratorInfo.Builder builder, BoundExpression collectionExpr, bool isAsync, BindingDiagnosticBag diagnostics, TypeSymbol unwrappedCollectionExprType)
1046return EnumeratorResult.FailedNotReported;
1051return EnumeratorResult.FailedAndReported;
1062return EnumeratorResult.FailedAndReported;
1094return EnumeratorResult.FailedAndReported;
1171return EnumeratorResult.Succeeded;