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)
2628
receiver = new BoundCapturedReceiverPlaceholder(receiver.Syntax, receiver,
_localScopeDepth
, receiver.Type).MakeCompilerGenerated();
3206
SetLocalScopes(localSymbol, refEscapeScope:
_localScopeDepth
, valEscapeScope: inferredDestinationValEscape);
3288
SetLocalScopes(localSymbol, refEscapeScope:
_localScopeDepth
, valEscapeScope: inferredDestinationValEscape);
3644
CheckRefEscape(expr.Syntax, expr,
_localScopeDepth
, escapeTo, checkingReceiver: false, diagnostics: diagnostics);
3648
CheckValEscape(expr.Syntax, expr,
_localScopeDepth
, escapeTo, checkingReceiver: false, diagnostics: diagnostics);
Binder\Binder_Operators.cs (1)
5804
var currentScope =
_localScopeDepth
;
Binder\Binder_Statements.cs (6)
1564
var leftEscape = GetRefEscape(op1,
_localScopeDepth
);
1565
var rightEscape = GetRefEscape(op2,
_localScopeDepth
);
1584
leftEscape = GetValEscape(op1,
_localScopeDepth
);
1585
rightEscape = GetValEscape(op2,
_localScopeDepth
);
1624
var leftEscape = GetValEscape(op1,
_localScopeDepth
);
1653
CheckInvocationArgMixing(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
;
407
GetAwaitableInstancePlaceholders(placeholders, awaitableInfo,
_localScopeDepth
);
436
using var _2 = new PatternInput(this, GetValEscape(node.Expression,
_localScopeDepth
));
445
using var _ = new PatternInput(this, GetValEscape(node.Expression,
_localScopeDepth
));
491
_localScopeDepth
:
494
_localScopeDepth
:
534
GetRefEscape(initializer,
_localScopeDepth
).IsConvertibleTo(refEscapeScope));
544
SetLocalScopes(localSymbol,
_localScopeDepth
,
_localScopeDepth
);
546
valEscapeScope = GetValEscape(initializer,
_localScopeDepth
);
549
refEscapeScope = GetRefEscape(initializer,
_localScopeDepth
);
600
_localScopeDepth
,
617
using var _ = new PatternInput(this, GetValEscape(node.Expression,
_localScopeDepth
));
656
using (new PatternInput(this,
_localScopeDepth
))
709
SetLocalScopes(local,
_localScopeDepth
, _patternInputValEscape);
816
_localScopeDepth
,
831
placeholders.Add((interpolationData.ReceiverPlaceholder, SafeContextAndLocation.Create(
_localScopeDepth
)));
850
valEscapeScope = receiver.GetRefKind().IsWritableReference() ? GetRefEscape(receiver,
_localScopeDepth
) : GetValEscape(receiver,
_localScopeDepth
);
878
valEscapeScope = GetValEscape(arguments[argIndex],
_localScopeDepth
);
935
_localScopeDepth
,
956
var escapeFrom = GetValEscape(node.InitializerExpressionOpt,
_localScopeDepth
);
976
if (!escapeFrom.IsConvertibleTo(GetValEscape(argument,
_localScopeDepth
)))
1006
_localScopeDepth
,
1024
_localScopeDepth
,
1036
GetAwaitableInstancePlaceholders(placeholders, node.AwaitableInfo, GetValEscape(node.Expression,
_localScopeDepth
));
1104
placeholders.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
,
1229
collectionEscape = GetValEscape(node.Expression,
_localScopeDepth
);
1236
AddLocalScopes(local, refEscapeScope: local.RefKind == RefKind.None ?
_localScopeDepth
: collectionEscape, valEscapeScope: collectionEscape);