3 writes to _localScopeDepth
Microsoft.CodeAnalysis.CSharp (3)
Binder\RefSafetyAnalysis.cs (3)
87_localScopeDepth = SafeContext.CurrentMethod.Wider(); 99_analysis._localScopeDepth = _analysis._localScopeDepth.Narrower(); 112_analysis._localScopeDepth = _analysis._localScopeDepth.Wider();
50 references to _localScopeDepth
Microsoft.CodeAnalysis.CSharp (50)
Binder\Binder.ValueChecks.cs (5)
2628receiver = new BoundCapturedReceiverPlaceholder(receiver.Syntax, receiver, _localScopeDepth, receiver.Type).MakeCompilerGenerated(); 3206SetLocalScopes(localSymbol, refEscapeScope: _localScopeDepth, valEscapeScope: inferredDestinationValEscape); 3288SetLocalScopes(localSymbol, refEscapeScope: _localScopeDepth, valEscapeScope: inferredDestinationValEscape); 3644CheckRefEscape(expr.Syntax, expr, _localScopeDepth, escapeTo, checkingReceiver: false, diagnostics: diagnostics); 3648CheckValEscape(expr.Syntax, expr, _localScopeDepth, escapeTo, checkingReceiver: false, diagnostics: diagnostics);
Binder\Binder_Operators.cs (1)
5804var currentScope = _localScopeDepth;
Binder\Binder_Statements.cs (6)
1564var leftEscape = GetRefEscape(op1, _localScopeDepth); 1565var rightEscape = GetRefEscape(op2, _localScopeDepth); 1584leftEscape = GetValEscape(op1, _localScopeDepth); 1585rightEscape = GetValEscape(op2, _localScopeDepth); 1624var leftEscape = GetValEscape(op1, _localScopeDepth); 1653CheckInvocationArgMixing(node, in localMethodInvocationInfo, _localScopeDepth, methodInvocationInfo.MethodInfo.Method, diagnostics);
Binder\RefSafetyAnalysis.cs (38)
99_analysis._localScopeDepth = _analysis._localScopeDepth.Narrower(); 102_analysis.AddLocalScopes(local, refEscapeScope: _analysis._localScopeDepth, valEscapeScope: SafeContext.CallingMethod); 112_analysis._localScopeDepth = _analysis._localScopeDepth.Wider(); 391? GetValEscape(expr, _localScopeDepth) 392: _localScopeDepth; 407GetAwaitableInstancePlaceholders(placeholders, awaitableInfo, _localScopeDepth); 436using var _2 = new PatternInput(this, GetValEscape(node.Expression, _localScopeDepth)); 445using var _ = new PatternInput(this, GetValEscape(node.Expression, _localScopeDepth)); 491_localScopeDepth : 494_localScopeDepth : 534GetRefEscape(initializer, _localScopeDepth).IsConvertibleTo(refEscapeScope)); 544SetLocalScopes(localSymbol, _localScopeDepth, _localScopeDepth); 546valEscapeScope = GetValEscape(initializer, _localScopeDepth); 549refEscapeScope = GetRefEscape(initializer, _localScopeDepth); 600_localScopeDepth, 617using var _ = new PatternInput(this, GetValEscape(node.Expression, _localScopeDepth)); 656using (new PatternInput(this, _localScopeDepth)) 709SetLocalScopes(local, _localScopeDepth, _patternInputValEscape); 816_localScopeDepth, 831placeholders.Add((interpolationData.ReceiverPlaceholder, SafeContextAndLocation.Create(_localScopeDepth))); 850valEscapeScope = receiver.GetRefKind().IsWritableReference() ? GetRefEscape(receiver, _localScopeDepth) : GetValEscape(receiver, _localScopeDepth); 878valEscapeScope = GetValEscape(arguments[argIndex], _localScopeDepth); 935_localScopeDepth, 956var escapeFrom = GetValEscape(node.InitializerExpressionOpt, _localScopeDepth); 976if (!escapeFrom.IsConvertibleTo(GetValEscape(argument, _localScopeDepth))) 1006_localScopeDepth, 1024_localScopeDepth, 1036GetAwaitableInstancePlaceholders(placeholders, node.AwaitableInfo, GetValEscape(node.Expression, _localScopeDepth)); 1104placeholders.Add((conversion.DeconstructionInfo.InputPlaceholder, SafeContextAndLocation.Create(GetValEscape(right, _localScopeDepth)))); 1117? GetValEscape(variable.Expression, _localScopeDepth) 1118: _localScopeDepth; 1138_localScopeDepth, 1183: new DeconstructionVariable(expr, GetValEscape(expr, _localScopeDepth), null); 1224_localScopeDepth, 1229collectionEscape = GetValEscape(node.Expression, _localScopeDepth); 1236AddLocalScopes(local, refEscapeScope: local.RefKind == RefKind.None ? _localScopeDepth : collectionEscape, valEscapeScope: collectionEscape);