6 overrides of RefKind
Microsoft.CodeAnalysis.CSharp (6)
CodeGen\Optimizer.cs (1)
2428public override RefKind RefKind
FlowAnalysis\NullableWalker.PlaceholderLocal.cs (1)
59public override RefKind RefKind => RefKind.None;
Symbols\Source\SourceLocalSymbol.cs (1)
480public override RefKind RefKind
Symbols\Synthesized\SynthesizedLocal.cs (1)
98public sealed override RefKind RefKind
Symbols\Synthesized\TypeSubstitutedLocalSymbol.cs (1)
105public override RefKind RefKind
Symbols\UpdatedContainingSymbolLocal.cs (1)
79public override RefKind RefKind => _underlyingLocal.RefKind;
61 references to RefKind
Microsoft.CodeAnalysis.CSharp (61)
Binder\Binder.ValueChecks.cs (4)
1037if (localSymbol.RefKind == RefKind.RefReadOnly || 1038(localSymbol.RefKind == RefKind.None && !localSymbol.IsWritableVariable)) 1046if (localSymbol.RefKind == RefKind.None) 1078if (localSymbol.RefKind == RefKind.None)
Binder\Binder_Expressions.cs (2)
2055if (IsBadLocalOrParameterCapture(localSymbol, type, localSymbol.RefKind)) 2059if (localSymbol.RefKind == RefKind.None && type.IsRestrictedType(ignoreSpanLikeTypes: true))
Binder\Binder_Operators.cs (1)
2680return localSymbol.RefKind != RefKind.None;
Binder\RefSafetyAnalysis.cs (1)
1103AddLocalScopes(local, refEscapeScope: local.RefKind == RefKind.None ? _localScopeDepth : collectionEscape, valEscapeScope: collectionEscape);
BoundTree\BoundExpressionExtensions.cs (1)
25return ((BoundLocal)node).LocalSymbol.RefKind;
CodeGen\CodeGenerator_HasHome.cs (2)
94return !((CodeGenerator.IsStackLocal(local, stackLocalsOpt) && local.RefKind == RefKind.None) || 95(!IsAnyReadOnly(addressKind) && local.RefKind == RefKind.RefReadOnly));
CodeGen\EmitAddress.cs (2)
274if (local.RefKind != RefKind.None) 282throw ExceptionUtilities.UnexpectedValue(local.RefKind);
CodeGen\EmitExpression.cs (6)
1292return ((BoundLocal)receiver).LocalSymbol.RefKind != RefKind.None; 1392bool isRefLocal = local.LocalSymbol.RefKind != RefKind.None; 2214return ((BoundLocal)receiver).LocalSymbol.RefKind != RefKind.None; 2762return ((BoundLocal)left).LocalSymbol.RefKind == RefKind.None; 2832if (left.LocalSymbol.RefKind != RefKind.None && !assignmentOperator.IsRef) 3077if (local.LocalSymbol.RefKind != RefKind.None && !assignment.IsRef)
CodeGen\EmitStatement.cs (5)
749Debug.Assert(local.RefKind == RefKind.None || local.SynthesizedKind.IsLongLived(), 1147Debug.Assert(exceptionSourceLocal.LocalSymbol.RefKind == RefKind.None); 1283if (local.RefKind == RefKind.None && !IsStackLocal(local)) 1789Debug.Assert(local.RefKind == RefKind.None); 1805(local.RefKind != RefKind.None ? LocalSlotConstraints.ByRef : LocalSlotConstraints.None);
CodeGen\Optimizer.cs (11)
858if (node.LocalSymbol.RefKind != RefKind.None) 878if (node.LocalSymbol.RefKind != RefKind.None) 986if (localSymbol.RefKind is RefKind.RefReadOnly or RefKindExtensions.StrictIn && 1049if (((BoundLocal)lhs).LocalSymbol.RefKind != RefKind.None) 1221if (unwrappedSequence is BoundLocal { LocalSymbol: { RefKind: not RefKind.None } localSymbol }) 1428if (localSym.RefKind == RefKind.None) 1874Debug.Assert(local.RefKind == RefKind.None, "cannot take a ref of a ref"); 1935return top.Item2 == (local.RefKind == RefKind.None ? ExprContext.Value : ExprContext.Address) && 2134return new BoundDup(node.Syntax, node.LocalSymbol.RefKind, node.Type); 2162var isIndirectLocalStore = left.LocalSymbol.RefKind != RefKind.None && !node.IsRef; 2191left.LocalSymbol.RefKind == RefKind.Ref &&
FlowAnalysis\AbstractFlowPass.cs (3)
1293VisitRvalue(node.InitializerOpt, isKnownToBeAnLvalue: node.LocalSymbol.RefKind != RefKind.None); 1296if (node.LocalSymbol.RefKind != RefKind.None) 1298WriteArgument(node.InitializerOpt, node.LocalSymbol.RefKind, method: null);
FlowAnalysis\DefiniteAssignment.cs (2)
1571if (local.LocalSymbol.RefKind != RefKind.None && !isRef) 2771NoteWrite(iterationVariable, null, read: true, isRef: iterationVariable.RefKind != RefKind.None);
FlowAnalysis\NullableWalker.cs (1)
10148case BoundLocal { LocalSymbol.RefKind: RefKind.None }:
Lowering\LocalRewriter\LocalRewriter_Call.cs (1)
1628var localRefKind = ((BoundLocal)argument).LocalSymbol.RefKind;
Lowering\LocalRewriter\LocalRewriter_CompoundAssignmentOperator.cs (1)
858return localsMayBeAssignedOrCaptured || ((BoundLocal)expression).LocalSymbol.RefKind != RefKind.None;
Lowering\LocalRewriter\LocalRewriter_DeconstructionAssignmentOperator.cs (1)
168case BoundLocal { LocalSymbol: { RefKind: RefKind.None } localSymbol }:
Lowering\LocalRewriter\LocalRewriter_FixedStatement.cs (1)
36if (pinnedTemp.RefKind == RefKind.None)
Lowering\LocalRewriter\LocalRewriter_UnaryOperator.cs (1)
489return ((BoundLocal)expression).LocalSymbol.RefKind != RefKind.None;
Lowering\MethodToClassRewriter.cs (1)
493if (leftLocal.LocalSymbol.RefKind != RefKind.None &&
Lowering\SpillSequenceSpiller.cs (5)
538Left: BoundLocal { LocalSymbol: { SynthesizedKind: SynthesizedLocalKind.LoweringTemp, RefKind: RefKind.Ref } receiverRefLocal }, 541ValueTypeReceiver: BoundLocal { LocalSymbol: { SynthesizedKind: SynthesizedLocalKind.LoweringTemp, RefKind: RefKind.Ref } } valueTypeReceiver, 550Left: BoundLocal { LocalSymbol: { SynthesizedKind: SynthesizedLocalKind.LoweringTemp, RefKind: RefKind.None } referenceTypeClone }, 551Right: BoundLocal { LocalSymbol: { SynthesizedKind: SynthesizedLocalKind.LoweringTemp, RefKind: RefKind.Ref } originalReceiverReference } 554Value: BoundLocal { LocalSymbol: { SynthesizedKind: SynthesizedLocalKind.LoweringTemp, RefKind: RefKind.None } } referenceTypeReceiver
Lowering\StateMachineRewriter\IteratorAndAsyncCaptureWalker.cs (2)
91Debug.Assert(local.RefKind != RefKind.None); 213(variable is LocalSymbol { RefKind: not RefKind.None } refLocal && !canRefLocalBeHoisted(refLocal)))
Lowering\StateMachineRewriter\MethodToStateMachineRewriter.cs (1)
313if (local.RefKind != RefKind.None)
Lowering\StateMachineRewriter\StateMachineRewriter.cs (2)
171if (local.RefKind != RefKind.None) 179Debug.Assert(local.RefKind == RefKind.None);
Symbols\LocalSymbol.cs (1)
365public bool IsRef => RefKind != RefKind.None;
Symbols\PublicModel\LocalSymbol.cs (1)
52RefKind ILocalSymbol.RefKind => _underlying.RefKind;
Symbols\SymbolExtensions.cs (1)
518refKind = local.RefKind;
Symbols\Synthesized\TypeSubstitutedLocalSymbol.cs (1)
107get { return _originalVariable.RefKind; }