1 write to _syntax
Microsoft.CodeAnalysis.CSharp (1)
Binder\ForEachLoopBinder.cs (1)
51_syntax = syntax;
82 references to _syntax
Microsoft.CodeAnalysis.CSharp (82)
Binder\ForEachLoopBinder.cs (82)
40return (_syntax.Kind() == SyntaxKind.ForEachStatement) ? (SourceLocalSymbol)this.Locals[0] : null; 45=> _syntax.AwaitKeyword != default; 56switch (_syntax.Kind()) 60var syntax = (ForEachVariableStatementSyntax)_syntax; 71var syntax = (ForEachStatementSyntax)_syntax; 81throw ExceptionUtilities.UnexpectedValue(_syntax.Kind()); 176BoundExpression collectionExpr = originalBinder.GetBinder(_syntax.Expression).BindRValueWithoutTargetType(_syntax.Expression, diagnostics); 182ExpressionSyntax variables = ((ForEachVariableStatementSyntax)_syntax).Variable; 185var valuePlaceholder = new BoundDeconstructValuePlaceholder(_syntax.Expression, variableSymbol: null, isDiscardExpression: false, inferredType.Type ?? CreateErrorType("var")); 192right: _syntax.Expression, 198return new BoundExpressionStatement(_syntax, deconstruction); 205CheckFeatureAvailability(_syntax, MessageID.IDS_FeatureAsyncStreams, diagnostics, _syntax.AwaitKeyword.GetLocation()); 209BoundExpression collectionExpr = originalBinder.GetBinder(_syntax.Expression).BindRValueWithoutTargetType(_syntax.Expression, diagnostics); 238var expr = _syntax.Expression; 239ReportBadAwaitDiagnostics(expr, _syntax.AwaitKeyword.GetLocation(), diagnostics, ref hasErrors); 255switch (_syntax.Kind()) 259var node = (ForEachStatementSyntax)_syntax; 347var node = (ForEachVariableStatementSyntax)_syntax; 353var valuePlaceholder = new BoundDeconstructValuePlaceholder(_syntax.Expression, variableSymbol: null, isDiscardExpression: false, iterationVariableType.Type).MakeCompilerGenerated(); 359right: _syntax.Expression, 394throw ExceptionUtilities.UnexpectedValue(_syntax.Kind()); 397BoundStatement body = originalBinder.BindPossibleEmbeddedStatement(_syntax.Statement, diagnostics); 405_syntax.HasErrors || 415_syntax, 433var foreachKeyword = _syntax.ForEachKeyword; 455var elementPlaceholder = new BoundValuePlaceholder(_syntax, inferredType.Type).MakeCompilerGenerated(); 479BoundExpression elementConversion = CreateConversion(_syntax, elementPlaceholder, elementConversionClassification, isCast: false, conversionGroupOpt: null, iterationVariableType.Type, createConversionDiagnostics); 485var location = _syntax.ForEachKeyword.GetLocation(); 511diagnostics.Add(_syntax.ForEachKeyword.GetLocation(), useSiteInfo); 554builder.CurrentPlaceholder = new BoundValuePlaceholder(_syntax, builder.CurrentPropertyGetter.ReturnType).MakeCompilerGenerated(); 555builder.CurrentConversion = CreateConversion(_syntax, builder.CurrentPlaceholder, currentConversionClassification, isCast: false, conversionGroupOpt: null, builder.ElementType, diagnostics); 575_syntax, 594? this.GetWellKnownType(WellKnownType.System_Threading_Tasks_ValueTask, diagnostics, this._syntax) 598var expr = _syntax.Expression; 599ReportBadAwaitDiagnostics(expr, _syntax.AwaitKeyword.GetLocation(), diagnostics, ref hasErrors); 734diagnostics.Add(errorCode, _syntax.Expression.Location, 755diagnostics.Add(ErrorCode.ERR_AnonMethGrpInForEach, _syntax.Expression.Location, collectionExpr.Display); 772diagnostics.Add(ErrorCode.ERR_BadDynamicAwaitForEach, _syntax.Expression.Location); 804diagnostics.Add(ErrorCode.ERR_ForEachMissingMember, _syntax.Expression.Location, unwrappedCollectionExprType, GetEnumeratorMethodName); 811diagnostics.Add(ErrorCode.ERR_AwaitForEachMissingMember, _syntax.Expression.Location, unwrappedCollectionExprType, GetAsyncEnumeratorMethodName); 864diagnostics.Add(isAsync ? ErrorCode.ERR_BadGetAsyncEnumerator : ErrorCode.ERR_BadGetEnumerator, _syntax.Expression.Location, getEnumeratorMethod.ReturnType, getEnumeratorMethod); 881CSharpSyntaxNode errorLocationSyntax = _syntax.Expression; 914diagnostics.Add(ErrorCode.ERR_AwaitForEachMissingMember, _syntax.Expression.Location, unwrappedCollectionExprType, GetAsyncEnumeratorMethodName); 1004diagnostics.Add(ErrorCode.ERR_NullNotValid, _syntax.Expression.Location); 1024var receiver = new BoundDisposableValuePlaceholder(_syntax, enumeratorType); 1025patternDisposeMethod = TryFindDisposePatternMethod(receiver, _syntax, isAsync, BindingDiagnosticBag.Discarded); 1036_syntax, 1069diagnostics.Add(_syntax, useSiteInfo); 1076builder.CollectionType = GetSpecialType(SpecialType.System_Collections_IEnumerable, diagnostics, _syntax); 1081((_syntax as ForEachStatementSyntax)?.Type.IsVar == true) ? 1083GetSpecialType(SpecialType.System_Object, diagnostics, _syntax)); 1088TypeWithAnnotations.Create(GetSpecialType(SpecialType.System_Char, diagnostics, _syntax)) : 1095builder.GetEnumeratorInfo = GetParameterlessSpecialTypeMemberInfo(SpecialMember.System_Collections_IEnumerable__GetEnumerator, _syntax, diagnostics); 1096builder.CurrentPropertyGetter = (MethodSymbol)GetSpecialTypeMember(SpecialMember.System_Collections_IEnumerator__get_Current, diagnostics, _syntax); 1097builder.MoveNextInfo = GetParameterlessSpecialTypeMemberInfo(SpecialMember.System_Collections_IEnumerator__MoveNext, _syntax, diagnostics); 1165diagnostics.Add(_syntax.Expression, useSiteInfo); 1222var dummyReceiver = new BoundImplicitReceiver(_syntax.Expression, patternType); 1230diagnostics.Add(_syntax.Expression, useSiteInfo); 1244diagnostics.Add(ErrorCode.WRN_PatternNotPublicOrNotInstance, _syntax.Expression.Location, patternType, patternName.Localize(), result); 1248else if (result.CallsAreOmitted(_syntax.SyntaxTree)) 1259_syntax, 1276diagnostics.Add(ErrorCode.WRN_PatternIsAmbiguous, _syntax.Expression.Location, patternType, MessageID.IDS_Collection.Localize(), 1293_syntax.Expression, 1310if (result.CallsAreOmitted(_syntax.SyntaxTree)) 1321diagnostics.Add(_syntax, useSiteInfo); 1347diagnostics.Add(ErrorCode.WRN_PatternIsAmbiguous, _syntax.Expression.Location, collectionExpr.Type, MessageID.IDS_Collection.Localize(), 1354location: _syntax.Expression.Location, 1355nodeOpt: _syntax.Expression, 1359invokedExpression: _syntax.Expression, 1427diagnostics.Add(_syntax.Expression, useSiteInfo); 1455diagnostics.Add(_syntax.Expression, useSiteInfo); 1506diagnostics.Add(ErrorCode.WRN_PatternBadSignature, _syntax.Expression.Location, enumeratorType, MessageID.IDS_Collection.Localize(), patternMemberCandidate); 1509diagnostics.Add(_syntax.Expression, useSiteInfo); 1569diagnostics.Add(_syntax.Expression, useSiteInfo); 1666diagnostics.Add(_syntax.Expression, useSiteInfo); 1670diagnostics.Add(lookupResult.Error, _syntax.Expression.Location); 1676diagnostics.Add(ErrorCode.ERR_NoSuchMember, _syntax.Expression.Location, patternType, memberName); 1682if (_syntax == scopeDesignator) 1699return _syntax;