3 writes to _localScopeDepth
Microsoft.CodeAnalysis.CSharp (3)
Binder\RefSafetyAnalysis.cs (3)
86_localScopeDepth = CurrentMethodScope - 1; 98_analysis._localScopeDepth++; 111_analysis._localScopeDepth--;
45 references to _localScopeDepth
Microsoft.CodeAnalysis.CSharp (45)
Binder\Binder.ValueChecks.cs (5)
2324receiver = new BoundCapturedReceiverPlaceholder(receiver.Syntax, receiver, _localScopeDepth, receiver.Type).MakeCompilerGenerated(); 2879SetLocalScopes(localSymbol, refEscapeScope: _localScopeDepth, valEscapeScope: inferredDestinationValEscape); 2971SetLocalScopes(localSymbol, refEscapeScope: _localScopeDepth, valEscapeScope: inferredDestinationValEscape); 3325CheckRefEscape(expr.Syntax, expr, _localScopeDepth, escapeTo, checkingReceiver: false, diagnostics: diagnostics); 3329CheckValEscape(expr.Syntax, expr, _localScopeDepth, escapeTo, checkingReceiver: false, diagnostics: diagnostics);
Binder\Binder_Operators.cs (1)
4377var currentScope = _localScopeDepth;
Binder\Binder_Statements.cs (5)
1550var leftEscape = GetRefEscape(op1, _localScopeDepth); 1551var rightEscape = GetRefEscape(op2, _localScopeDepth); 1570leftEscape = GetValEscape(op1, _localScopeDepth); 1571rightEscape = GetValEscape(op2, _localScopeDepth); 1594var leftEscape = GetValEscape(op1, _localScopeDepth);
Binder\RefSafetyAnalysis.cs (34)
101_analysis.AddLocalScopes(local, refEscapeScope: _analysis._localScopeDepth, valEscapeScope: CallingMethodScope); 350? GetValEscape(expr, _localScopeDepth) 351: _localScopeDepth; 366GetAwaitableInstancePlaceholders(placeholders, awaitableInfo, _localScopeDepth); 395using var _2 = new PatternInput(this, GetValEscape(node.Expression, _localScopeDepth)); 404using var _ = new PatternInput(this, GetValEscape(node.Expression, _localScopeDepth)); 450_localScopeDepth : 453_localScopeDepth : 493refEscapeScope >= GetRefEscape(initializer, _localScopeDepth)); 503SetLocalScopes(localSymbol, _localScopeDepth, _localScopeDepth); 505valEscapeScope = GetValEscape(initializer, _localScopeDepth); 508refEscapeScope = GetRefEscape(initializer, _localScopeDepth); 558using var _ = new PatternInput(this, GetValEscape(node.Expression, _localScopeDepth)); 621SetLocalScopes(local, _localScopeDepth, _patternInputValEscape); 668_localScopeDepth, 681placeholders.Add((interpolationData.ReceiverPlaceholder, _localScopeDepth)); 697valEscapeScope = receiver.GetRefKind().IsWritableReference() ? GetRefEscape(receiver, _localScopeDepth) : GetValEscape(receiver, _localScopeDepth); 710valEscapeScope = GetValEscape(arguments[argIndex], _localScopeDepth); 769_localScopeDepth, 789var escapeFrom = GetValEscape(node.InitializerExpressionOpt, _localScopeDepth); 815if (escapeFrom > GetValEscape(argument, _localScopeDepth)) 851_localScopeDepth, 874_localScopeDepth, 885GetAwaitableInstancePlaceholders(placeholders, node.AwaitableInfo, GetValEscape(node.Expression, _localScopeDepth)); 946placeholders.Add((conversion.DeconstructionInfo.InputPlaceholder, GetValEscape(right, _localScopeDepth))); 959? GetValEscape(variable.Expression, _localScopeDepth) 960: _localScopeDepth; 975_localScopeDepth, 1019: new DeconstructionVariable(expr, GetValEscape(expr, _localScopeDepth), null); 1066_localScopeDepth, 1071collectionEscape = GetValEscape(node.Expression, _localScopeDepth); 1078AddLocalScopes(local, refEscapeScope: local.RefKind == RefKind.None ? _localScopeDepth : collectionEscape, valEscapeScope: collectionEscape);