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