3 writes to _localScopeDepth
Microsoft.CodeAnalysis.CSharp (3)
Binder\RefSafetyAnalysis.cs (3)
86
_localScopeDepth
= SafeContext.CurrentMethod.Wider();
98
_analysis.
_localScopeDepth
= _analysis._localScopeDepth.Narrower();
111
_analysis.
_localScopeDepth
= _analysis._localScopeDepth.Wider();
48 references to _localScopeDepth
Microsoft.CodeAnalysis.CSharp (48)
Binder\Binder.ValueChecks.cs (5)
2301
receiver = new BoundCapturedReceiverPlaceholder(receiver.Syntax, receiver,
_localScopeDepth
, receiver.Type).MakeCompilerGenerated();
2856
SetLocalScopes(localSymbol, refEscapeScope:
_localScopeDepth
, valEscapeScope: inferredDestinationValEscape);
2948
SetLocalScopes(localSymbol, refEscapeScope:
_localScopeDepth
, valEscapeScope: inferredDestinationValEscape);
3302
CheckRefEscape(expr.Syntax, expr,
_localScopeDepth
, escapeTo, checkingReceiver: false, diagnostics: diagnostics);
3306
CheckValEscape(expr.Syntax, expr,
_localScopeDepth
, escapeTo, checkingReceiver: false, diagnostics: diagnostics);
Binder\Binder_Operators.cs (1)
4382
var currentScope =
_localScopeDepth
;
Binder\Binder_Statements.cs (5)
1552
var leftEscape = GetRefEscape(op1,
_localScopeDepth
);
1553
var rightEscape = GetRefEscape(op2,
_localScopeDepth
);
1572
leftEscape = GetValEscape(op1,
_localScopeDepth
);
1573
rightEscape = GetValEscape(op2,
_localScopeDepth
);
1597
var leftEscape = GetValEscape(op1,
_localScopeDepth
);
Binder\RefSafetyAnalysis.cs (37)
98
_analysis._localScopeDepth = _analysis.
_localScopeDepth
.Narrower();
101
_analysis.AddLocalScopes(local, refEscapeScope: _analysis.
_localScopeDepth
, valEscapeScope: SafeContext.CallingMethod);
111
_analysis._localScopeDepth = _analysis.
_localScopeDepth
.Wider();
350
? GetValEscape(expr,
_localScopeDepth
)
351
:
_localScopeDepth
;
366
GetAwaitableInstancePlaceholders(placeholders, awaitableInfo,
_localScopeDepth
);
395
using var _2 = new PatternInput(this, GetValEscape(node.Expression,
_localScopeDepth
));
404
using var _ = new PatternInput(this, GetValEscape(node.Expression,
_localScopeDepth
));
450
_localScopeDepth
:
453
_localScopeDepth
:
493
GetRefEscape(initializer,
_localScopeDepth
).IsConvertibleTo(refEscapeScope));
503
SetLocalScopes(localSymbol,
_localScopeDepth
,
_localScopeDepth
);
505
valEscapeScope = GetValEscape(initializer,
_localScopeDepth
);
508
refEscapeScope = GetRefEscape(initializer,
_localScopeDepth
);
558
using var _ = new PatternInput(this, GetValEscape(node.Expression,
_localScopeDepth
));
597
using (new PatternInput(this,
_localScopeDepth
))
646
SetLocalScopes(local,
_localScopeDepth
, _patternInputValEscape);
693
_localScopeDepth
,
706
placeholders.Add((interpolationData.ReceiverPlaceholder,
_localScopeDepth
));
722
valEscapeScope = receiver.GetRefKind().IsWritableReference() ? GetRefEscape(receiver,
_localScopeDepth
) : GetValEscape(receiver,
_localScopeDepth
);
735
valEscapeScope = GetValEscape(arguments[argIndex],
_localScopeDepth
);
794
_localScopeDepth
,
814
var escapeFrom = GetValEscape(node.InitializerExpressionOpt,
_localScopeDepth
);
840
if (!escapeFrom.IsConvertibleTo(GetValEscape(argument,
_localScopeDepth
)))
876
_localScopeDepth
,
899
_localScopeDepth
,
910
GetAwaitableInstancePlaceholders(placeholders, node.AwaitableInfo, GetValEscape(node.Expression,
_localScopeDepth
));
971
placeholders.Add((conversion.DeconstructionInfo.InputPlaceholder, GetValEscape(right,
_localScopeDepth
)));
984
? GetValEscape(variable.Expression,
_localScopeDepth
)
985
:
_localScopeDepth
;
1000
_localScopeDepth
,
1044
: new DeconstructionVariable(expr, GetValEscape(expr,
_localScopeDepth
), null);
1091
_localScopeDepth
,
1096
collectionEscape = GetValEscape(node.Expression,
_localScopeDepth
);
1103
AddLocalScopes(local, refEscapeScope: local.RefKind == RefKind.None ?
_localScopeDepth
: collectionEscape, valEscapeScope: collectionEscape);