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)
2324
receiver = new BoundCapturedReceiverPlaceholder(receiver.Syntax, receiver,
_localScopeDepth
, receiver.Type).MakeCompilerGenerated();
2879
SetLocalScopes(localSymbol, refEscapeScope:
_localScopeDepth
, valEscapeScope: inferredDestinationValEscape);
2971
SetLocalScopes(localSymbol, refEscapeScope:
_localScopeDepth
, valEscapeScope: inferredDestinationValEscape);
3325
CheckRefEscape(expr.Syntax, expr,
_localScopeDepth
, escapeTo, checkingReceiver: false, diagnostics: diagnostics);
3329
CheckValEscape(expr.Syntax, expr,
_localScopeDepth
, escapeTo, checkingReceiver: false, diagnostics: diagnostics);
Binder\Binder_Operators.cs (1)
4377
var currentScope =
_localScopeDepth
;
Binder\Binder_Statements.cs (5)
1550
var leftEscape = GetRefEscape(op1,
_localScopeDepth
);
1551
var rightEscape = GetRefEscape(op2,
_localScopeDepth
);
1570
leftEscape = GetValEscape(op1,
_localScopeDepth
);
1571
rightEscape = GetValEscape(op2,
_localScopeDepth
);
1594
var leftEscape = GetValEscape(op1,
_localScopeDepth
);
Binder\RefSafetyAnalysis.cs (34)
101
_analysis.AddLocalScopes(local, refEscapeScope: _analysis.
_localScopeDepth
, valEscapeScope: CallingMethodScope);
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
refEscapeScope >= GetRefEscape(initializer,
_localScopeDepth
));
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
));
621
SetLocalScopes(local,
_localScopeDepth
, _patternInputValEscape);
668
_localScopeDepth
,
681
placeholders.Add((interpolationData.ReceiverPlaceholder,
_localScopeDepth
));
697
valEscapeScope = receiver.GetRefKind().IsWritableReference() ? GetRefEscape(receiver,
_localScopeDepth
) : GetValEscape(receiver,
_localScopeDepth
);
710
valEscapeScope = GetValEscape(arguments[argIndex],
_localScopeDepth
);
769
_localScopeDepth
,
789
var escapeFrom = GetValEscape(node.InitializerExpressionOpt,
_localScopeDepth
);
815
if (escapeFrom > GetValEscape(argument,
_localScopeDepth
))
851
_localScopeDepth
,
874
_localScopeDepth
,
885
GetAwaitableInstancePlaceholders(placeholders, node.AwaitableInfo, GetValEscape(node.Expression,
_localScopeDepth
));
946
placeholders.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
,
1071
collectionEscape = GetValEscape(node.Expression,
_localScopeDepth
);
1078
AddLocalScopes(local, refEscapeScope: local.RefKind == RefKind.None ?
_localScopeDepth
: collectionEscape, valEscapeScope: collectionEscape);