30 references to EnumeratorResult
Microsoft.CodeAnalysis.CSharp (30)
Binder\ForEachLoopBinder.cs (30)
791EnumeratorResult found = GetEnumeratorInfoCore(syntax, collectionSyntax, ref collectionExpr, isAsync, diagnostics, out builder);
794case EnumeratorResult.Succeeded:
796case EnumeratorResult.FailedAndReported:
812bool wrongAsync = GetEnumeratorInfoCore(syntax, collectionSyntax, ref originalCollectionExpr, !isAsync, BindingDiagnosticBag.Discarded, builder: out _) == EnumeratorResult.Succeeded;
835private EnumeratorResult GetEnumeratorInfoCore(SyntaxNode syntax, SyntaxNode collectionSyntax, ref BoundExpression collectionExpr, bool isAsync, BindingDiagnosticBag diagnostics, out ForEachEnumeratorInfo.Builder builder)
837EnumeratorResult result;
863return EnumeratorResult.FailedAndReported;
872return EnumeratorResult.FailedAndReported;
888((result is EnumeratorResult.Succeeded && builder.ElementTypeWithAnnotations.Equals(elementField.TypeWithAnnotations, TypeCompareKind.AllIgnoreOptions) &&
890result is EnumeratorResult.FailedAndReported))
900if (result == EnumeratorResult.Succeeded)
920return EnumeratorResult.FailedAndReported;
937EnumeratorResult getEnumeratorInfo(SyntaxNode syntax, SyntaxNode collectionSyntax, ref BoundExpression collectionExpr, bool isAsync, BindingDiagnosticBag diagnostics, out ForEachEnumeratorInfo.Builder builder)
957return EnumeratorResult.FailedAndReported;
965return EnumeratorResult.FailedAndReported;
971return EnumeratorResult.FailedAndReported;
978return EnumeratorResult.Succeeded;
995return EnumeratorResult.FailedAndReported;
1002return EnumeratorResult.FailedAndReported;
1005if (SatisfiesIEnumerableInterfaces(collectionSyntax, ref builder, unwrappedCollectionExpr, isAsync, diagnostics, unwrappedCollectionExprType) is not EnumeratorResult.FailedNotReported and var result)
1019return EnumeratorResult.Succeeded;
1027return EnumeratorResult.FailedNotReported;
1030EnumeratorResult createPatternBasedEnumeratorResult(ref ForEachEnumeratorInfo.Builder builder, BoundExpression collectionExpr, bool isAsync, bool viaExtensionMethod, BindingDiagnosticBag diagnostics)
1061return EnumeratorResult.Succeeded;
1066return EnumeratorResult.FailedAndReported;
1070private EnumeratorResult SatisfiesIEnumerableInterfaces(SyntaxNode collectionSyntax, ref ForEachEnumeratorInfo.Builder builder, BoundExpression collectionExpr, bool isAsync, BindingDiagnosticBag diagnostics, TypeSymbol unwrappedCollectionExprType)
1074return EnumeratorResult.FailedNotReported;
1085return EnumeratorResult.FailedAndReported;
1117return EnumeratorResult.FailedAndReported;
1194return EnumeratorResult.Succeeded;