34 references to EnumeratorResult
Microsoft.CodeAnalysis.CSharp (34)
Binder\ForEachLoopBinder.cs (34)
783EnumeratorResult found = GetEnumeratorInfoCore(syntax, collectionSyntax, ref collectionExpr, isAsync, diagnostics, out builder);
786case EnumeratorResult.Succeeded:
788case EnumeratorResult.FailedAndReported:
804bool wrongAsync = GetEnumeratorInfoCore(syntax, collectionSyntax, ref originalCollectionExpr, !isAsync, BindingDiagnosticBag.Discarded, builder: out _) == EnumeratorResult.Succeeded;
827private EnumeratorResult GetEnumeratorInfoCore(SyntaxNode syntax, SyntaxNode collectionSyntax, ref BoundExpression collectionExpr, bool isAsync, BindingDiagnosticBag diagnostics, out ForEachEnumeratorInfo.Builder builder)
829EnumeratorResult result;
855return EnumeratorResult.FailedAndReported;
864return EnumeratorResult.FailedAndReported;
880((result is EnumeratorResult.Succeeded && builder.ElementTypeWithAnnotations.Equals(elementField.TypeWithAnnotations, TypeCompareKind.AllIgnoreOptions) &&
882result is EnumeratorResult.FailedAndReported))
892if (result == EnumeratorResult.Succeeded)
912return EnumeratorResult.FailedAndReported;
929EnumeratorResult getEnumeratorInfo(SyntaxNode syntax, SyntaxNode collectionSyntax, ref BoundExpression collectionExpr, bool isAsync, BindingDiagnosticBag diagnostics, out ForEachEnumeratorInfo.Builder builder)
945return EnumeratorResult.FailedAndReported;
953return EnumeratorResult.FailedAndReported;
959return EnumeratorResult.FailedAndReported;
967return EnumeratorResult.FailedAndReported;
970return EnumeratorResult.Succeeded;
981return EnumeratorResult.FailedAndReported;
991return EnumeratorResult.FailedAndReported;
998return EnumeratorResult.FailedAndReported;
1001if (SatisfiesIEnumerableInterfaces(collectionSyntax, ref builder, unwrappedCollectionExpr, isAsync, diagnostics, unwrappedCollectionExprType) is not EnumeratorResult.FailedNotReported and var result)
1016return EnumeratorResult.FailedAndReported;
1020return EnumeratorResult.Succeeded;
1028return EnumeratorResult.FailedNotReported;
1031EnumeratorResult createPatternBasedEnumeratorResult(ref ForEachEnumeratorInfo.Builder builder, BoundExpression collectionExpr, bool isAsync, bool viaExtensionMethod, BindingDiagnosticBag diagnostics)
1062return EnumeratorResult.Succeeded;
1067return EnumeratorResult.FailedAndReported;
1071private EnumeratorResult SatisfiesIEnumerableInterfaces(SyntaxNode collectionSyntax, ref ForEachEnumeratorInfo.Builder builder, BoundExpression collectionExpr, bool isAsync, BindingDiagnosticBag diagnostics, TypeSymbol unwrappedCollectionExprType)
1075return EnumeratorResult.FailedNotReported;
1080return EnumeratorResult.FailedAndReported;
1091return EnumeratorResult.FailedAndReported;
1123return EnumeratorResult.FailedAndReported;
1200return EnumeratorResult.Succeeded;