4 types derived from SourceLocalSymbol
Microsoft.CodeAnalysis.CSharp (4)
Symbols\Source\SourceLocalSymbol.cs (4)
513private sealed class LocalWithInitializer : SourceLocalSymbol 605private sealed class ForEachLocalSymbol : SourceLocalSymbol 644private sealed class DeconstructionLocalSymbol : SourceLocalSymbol 707private sealed class LocalSymbolWithEnclosingContext : SourceLocalSymbol
3 instantiations of SourceLocalSymbol
Microsoft.CodeAnalysis.CSharp (3)
Symbols\Source\SourceLocalSymbol.cs (3)
150: new SourceLocalSymbol(containingSymbol, scopeBinder, allowRefKind: false, allowScoped: true, closestTypeSyntax, identifierToken, kind); 181: new SourceLocalSymbol(containingSymbol, scopeBinder, allowRefKind: false, allowScoped: true, typeSyntax, identifierToken, kind); 215: new SourceLocalSymbol(containingSymbol, scopeBinder, allowRefKind: allowRefKind, allowScoped: allowScoped, typeSyntax, identifierToken, declarationKind);
82 references to SourceLocalSymbol
Microsoft.CodeAnalysis.CSharp (65)
Binder\Binder.ValueChecks.cs (5)
2387private bool ShouldInferDeclarationExpressionValEscape(BoundExpression argument, [NotNullWhen(true)] out SourceLocalSymbol? localSymbol) 2395if (symbol is SourceLocalSymbol local && 2406Debug.Assert(symbol is null or SourceLocalSymbol or GlobalExpressionVariable); 2504if (ShouldInferDeclarationExpressionValEscape(argument, out var localSymbol)) 2599if (ShouldInferDeclarationExpressionValEscape(argument, out var localSymbol))
Binder\Binder_Deconstruct.cs (1)
870SourceLocalSymbol localSymbol = LookupLocal(designation.Identifier);
Binder\Binder_Expressions.cs (2)
1879else if ((localSymbol as SourceLocalSymbol)?.IsVar == true && localSymbol.ForbiddenZone?.Contains(node) == true) 2935SourceLocalSymbol localSymbol = this.LookupLocal(designation.Identifier);
Binder\Binder_Patterns.cs (1)
870SourceLocalSymbol localSymbol = this.LookupLocal(identifier);
Binder\Binder_Statements.cs (6)
976SourceLocalSymbol localSymbol, 1203private SourceLocalSymbol LocateDeclaredVariableSymbol(VariableDeclaratorSyntax declarator, TypeSyntax typeSyntax, LocalDeclarationKind outerKind) 1209private SourceLocalSymbol LocateDeclaredVariableSymbol(SyntaxToken identifier, TypeSyntax typeSyntax, EqualsValueClauseSyntax equalsValue, LocalDeclarationKind kind) 1211SourceLocalSymbol localSymbol = this.LookupLocal(identifier); 1217localSymbol = SourceLocalSymbol.MakeLocal( 1839protected virtual SourceLocalSymbol LookupLocal(SyntaxToken nameToken)
Binder\BuckStopsHereBinder.cs (1)
53protected override SourceLocalSymbol? LookupLocal(SyntaxToken nameToken)
Binder\CatchClauseBinder.cs (1)
34locals.Add(SourceLocalSymbol.MakeLocal(this.ContainingMemberOrLambda, this, allowRefKind: false, allowScoped: false, declarationOpt.Type, declarationOpt.Identifier, LocalDeclarationKind.CatchVariable, initializer: null));
Binder\ExpressionVariableFinder.cs (3)
550return SourceLocalSymbol.MakeLocalSymbolWithEnclosingContext( 572return SourceLocalSymbol.MakeLocalSymbolWithEnclosingContext( 597return SourceLocalSymbol.MakeDeconstructionLocal(
Binder\ForEachLoopBinder.cs (7)
36private SourceLocalSymbol IterationVariable 40return (_syntax.Kind() == SyntaxKind.ForEachStatement) ? (SourceLocalSymbol)this.Locals[0] : null; 72var iterationVariable = SourceLocalSymbol.MakeForeachLocal( 134SourceLocalSymbol localSymbol = SourceLocalSymbol.MakeDeconstructionLocal( 298SourceLocalSymbol local = this.IterationVariable;
Binder\ForLoopBinder.cs (1)
48var localSymbol = MakeLocal(_syntax.Declaration, vdecl, LocalDeclarationKind.RegularVariable, allowScoped: true);
Binder\InContainerBinder.cs (1)
136protected override SourceLocalSymbol LookupLocal(SyntaxToken nameToken)
Binder\InMethodBinder.cs (1)
59protected override SourceLocalSymbol LookupLocal(SyntaxToken nameToken)
Binder\LocalScopeBinder.cs (6)
215var localSymbol = MakeLocal(decl.Declaration, vdecl, kind, allowScoped: true, localDeclarationBinder); 285protected SourceLocalSymbol MakeLocal(VariableDeclarationSyntax declaration, VariableDeclaratorSyntax declarator, LocalDeclarationKind kind, bool allowScoped, Binder initializerBinderOpt = null) 287return SourceLocalSymbol.MakeLocal( 335protected override SourceLocalSymbol LookupLocal(SyntaxToken nameToken) 340if (result.IdentifierToken == nameToken) return (SourceLocalSymbol)result; 347return (SourceLocalSymbol)local;
Binder\RefSafetyAnalysis.cs (2)
428var localSymbol = (SourceLocalSymbol)node.LocalSymbol;
Binder\WithExternAliasesBinder.cs (1)
62protected sealed override SourceLocalSymbol? LookupLocal(SyntaxToken nameToken)
Binder\WithUsingNamespacesAndTypesBinder.cs (1)
218protected override SourceLocalSymbol? LookupLocal(SyntaxToken nameToken)
BoundTree\NullabilityRewriter.cs (2)
98case SourceLocalSymbol local: 143Symbol remapLocal(SourceLocalSymbol local)
BoundTree\VariablePendingInference.cs (2)
51var localSymbol = (SourceLocalSymbol)this.VariableSymbol;
Compilation\CSharpSemanticModel.cs (2)
3275return (local is SourceLocalSymbol { DeclarationKind: LocalDeclarationKind.ForEachIterationVariable } sourceLocal 3287internal abstract LocalSymbol GetAdjustedLocalSymbol(SourceLocalSymbol originalSymbol);
Compilation\MemberSemanticModel.cs (2)
690return GetAdjustedLocalSymbol((SourceLocalSymbol)local); 699internal override LocalSymbol GetAdjustedLocalSymbol(SourceLocalSymbol local)
Compilation\SpeculativeSemanticModelWithMemberModel.cs (1)
336internal override LocalSymbol GetAdjustedLocalSymbol(SourceLocalSymbol local)
Compilation\SyntaxTreeSemanticModel.cs (1)
1857internal override LocalSymbol GetAdjustedLocalSymbol(SourceLocalSymbol originalSymbol)
FlowAnalysis\DefiniteAssignment.cs (1)
2190if ((localSymbol as SourceLocalSymbol)?.IsVar == true && localSymbol.ForbiddenZone?.Contains(node.Syntax) == true)
FlowAnalysis\NullableWalker.cs (2)
2943if (local is SourceLocalSymbol { IsVar: true } && local.ForbiddenZone?.Contains(node.Syntax) == true) 10193else if (iterationVariable is SourceLocalSymbol { IsVar: true })
FlowAnalysis\NullableWalker.SnapshotManager.cs (1)
63internal TypeWithAnnotations? GetUpdatedTypeForLocalSymbol(SourceLocalSymbol symbol)
FlowAnalysis\NullableWalker_Patterns.cs (1)
641if (variableAccess is BoundLocal { LocalSymbol: SourceLocalSymbol local } boundLocal)
Symbols\Source\SourceLocalSymbol.cs (4)
109public static SourceLocalSymbol MakeForeachLocal( 136public static SourceLocalSymbol MakeDeconstructionLocal( 201public static SourceLocalSymbol MakeLocal( 500return obj is SourceLocalSymbol symbol
Symbols\UpdatedContainingSymbolLocal.cs (6)
18internal static UpdatedContainingSymbolAndNullableAnnotationLocal CreateForTest(SourceLocalSymbol underlyingLocal, Symbol updatedContainingSymbol, TypeWithAnnotations updatedType) 23private UpdatedContainingSymbolAndNullableAnnotationLocal(SourceLocalSymbol underlyingLocal, Symbol updatedContainingSymbol, TypeWithAnnotations updatedType, bool assertContaining) 34internal UpdatedContainingSymbolAndNullableAnnotationLocal(SourceLocalSymbol underlyingLocal, Symbol updatedContainingSymbol, TypeWithAnnotations updatedType) 39private readonly SourceLocalSymbol _underlyingLocal; 55SourceLocalSymbol? otherSource = otherLocal switch 58SourceLocalSymbol source => source,
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (3)
CodeGen\CodeGenDeconstructTests.cs (2)
3586var local = symbol.GetSymbol<SourceLocalSymbol>();
CodeGen\CodeGenTupleTest.cs (1)
1616var xSymbol = model.GetDeclaredSymbol(x).GetSymbol<SourceLocalSymbol>().Type;
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (10)
Semantics\InteractiveSemanticModelTests.cs (1)
129Assert.IsAssignableFrom<SourceLocalSymbol>(symbol.GetSymbol());
Semantics\OutVarTests.cs (2)
1176var local = symbol.GetSymbol<SourceLocalSymbol>();
Semantics\RefFieldTests.cs (7)
12949foreach (SourceLocalSymbol local in locals) 13013foreach (SourceLocalSymbol local in locals) 13087var locals = decls.Select(d => model.GetDeclaredSymbol(d).GetSymbol<SourceLocalSymbol>()).ToArray(); 13160foreach (SourceLocalSymbol local in locals) 14642foreach (SourceLocalSymbol local in locals) 26651foreach (SourceLocalSymbol local in locals) 26711foreach (SourceLocalSymbol local in locals)
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (4)
Symbols\Source\UpdatedContainingSymbolAndNullableAnntotationTests.cs (4)
38var local1 = model.GetDeclaredSymbol(varDeclarators.First()).GetSymbol<SourceLocalSymbol>(); 39var local2 = model.GetDeclaredSymbol(varDeclarators.ElementAt(1)).GetSymbol<SourceLocalSymbol>();