100 references to LocalDeclarationKind
Microsoft.CodeAnalysis.CSharp (100)
Binder\Binder_Expressions.cs (1)
3170Debug.Assert(localSymbol.DeclarationKind == LocalDeclarationKind.OutVariable);
Binder\Binder_Statements.cs (22)
201BindForOrUsingOrFixedDeclarations(declarationSyntax, LocalDeclarationKind.FixedVariable, diagnostics, out declarations); 727var kind = isConst ? LocalDeclarationKind.Constant : LocalDeclarationKind.RegularVariable; 948LocalDeclarationKind kind, 974LocalDeclarationKind kind, 1057if (kind != LocalDeclarationKind.FixedVariable) 1071if (kind == LocalDeclarationKind.FixedVariable) 1108if (kind == LocalDeclarationKind.FixedVariable || kind == LocalDeclarationKind.UsingVariable) 1121else if (kind == LocalDeclarationKind.Constant && initializerOpt != null && !localDiagnostics.HasAnyResolvedErrors()) 1194private SourceLocalSymbol LocateDeclaredVariableSymbol(VariableDeclaratorSyntax declarator, TypeSyntax typeSyntax, LocalDeclarationKind outerKind) 1196LocalDeclarationKind kind = outerKind == LocalDeclarationKind.UsingVariable ? LocalDeclarationKind.UsingVariable : LocalDeclarationKind.RegularVariable; 1200private SourceLocalSymbol LocateDeclaredVariableSymbol(SyntaxToken identifier, TypeSyntax typeSyntax, EqualsValueClauseSyntax equalsValue, LocalDeclarationKind kind) 2794internal BoundStatement BindForOrUsingOrFixedDeclarations(VariableDeclarationSyntax nodeOpt, LocalDeclarationKind localKind, BindingDiagnosticBag diagnostics, out ImmutableArray<BoundLocalDeclaration> declarations) 2803Debug.Assert(typeSyntax is not ScopedTypeSyntax || localKind is LocalDeclarationKind.RegularVariable or LocalDeclarationKind.UsingVariable); 2814if (localKind == LocalDeclarationKind.RegularVariable) 3334if (local?.DeclarationKind == LocalDeclarationKind.CatchVariable)
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 (4)
613kind: LocalDeclarationKind.PatternVariable, 635kind: node.IsOutVarDeclaration() ? LocalDeclarationKind.OutVariable : LocalDeclarationKind.DeclarationExpressionVariable, 660kind: LocalDeclarationKind.DeconstructionVariable,
Binder\FixedStatementBinder.cs (1)
48locals.Add(MakeLocal(_syntax.Declaration, declarator, LocalDeclarationKind.FixedVariable, allowScoped: false));
Binder\ForEachLoopBinder.cs (4)
80LocalDeclarationKind.ForEachIterationVariable, 103LocalDeclarationKind kind, 140LocalDeclarationKind kind, 428iterationVariables.All(local => local.DeclarationKind == LocalDeclarationKind.ForEachIterationVariable),
Binder\ForLoopBinder.cs (2)
48var localSymbol = MakeLocal(_syntax.Declaration, vdecl, LocalDeclarationKind.RegularVariable, allowScoped: true); 84initializer = originalBinder.BindForOrUsingOrFixedDeclarations(node.Declaration, LocalDeclarationKind.RegularVariable, diagnostics, out _);
Binder\LocalScopeBinder.cs (5)
200LocalDeclarationKind kind; 203kind = LocalDeclarationKind.Constant; 207kind = LocalDeclarationKind.UsingVariable; 211kind = LocalDeclarationKind.RegularVariable; 331protected SourceLocalSymbol MakeLocal(VariableDeclarationSyntax declaration, VariableDeclaratorSyntax declarator, LocalDeclarationKind kind, bool allowScoped, Binder initializerBinderOpt = null)
Binder\UsingStatementBinder.cs (2)
58locals.Add(MakeLocal(declarationSyntax, declarator, LocalDeclarationKind.UsingVariable, allowScoped: true)); 128originalBinder.BindForOrUsingOrFixedDeclarations(declarationSyntax, LocalDeclarationKind.UsingVariable, diagnostics, out declarationsOpt);
CodeGen\EmitStatement.cs (1)
1787if (local.DeclarationKind == LocalDeclarationKind.FixedVariable && local.IsPinned) // Excludes pointer local and string local in fixed string case.
CodeGen\Optimizer.cs (2)
2344internal override LocalDeclarationKind DeclarationKind 2346get { return LocalDeclarationKind.None; }
Compilation\CSharpSemanticModel.cs (2)
3282return (local is SourceLocalSymbol { DeclarationKind: LocalDeclarationKind.ForEachIterationVariable } sourceLocal 3321return ((object)local != null && local.DeclarationKind == LocalDeclarationKind.CatchVariable)
FlowAnalysis\DataFlowsOutWalker.cs (1)
162return local?.DeclarationKind == LocalDeclarationKind.CatchVariable ? local : null;
FlowAnalysis\DefiniteAssignment.cs (3)
2261if (local.DeclarationKind == LocalDeclarationKind.UsingVariable) 2325if (symbol.DeclarationKind != LocalDeclarationKind.PatternVariable && !string.IsNullOrEmpty(symbol.Name)) // avoid diagnostics for parser-inserted names 2691ReportIfUnused(local, assigned: local.DeclarationKind != LocalDeclarationKind.CatchVariable);
FlowAnalysis\NullableWalker.cs (2)
3445if (local.DeclarationKind != LocalDeclarationKind.None) 12009if (local.DeclarationKind == LocalDeclarationKind.CatchVariable)
FlowAnalysis\NullableWalker.PlaceholderLocal.cs (2)
53internal override LocalDeclarationKind DeclarationKind => LocalDeclarationKind.None;
FlowAnalysis\VariablesDeclaredWalker.cs (1)
150if (local?.DeclarationKind == LocalDeclarationKind.CatchVariable)
Lowering\LocalRewriter\LocalRewriter.PatternLocalRewriter.cs (1)
545Debug.Assert(l.LocalSymbol.DeclarationKind == LocalDeclarationKind.PatternVariable);
Lowering\MethodToClassRewriter.cs (1)
505Debug.Assert(leftLocal.LocalSymbol.DeclarationKind == LocalDeclarationKind.None);
Symbols\LocalSymbol.cs (11)
26internal abstract LocalDeclarationKind DeclarationKind 221return this.DeclarationKind == LocalDeclarationKind.CatchVariable; 232return this.DeclarationKind == LocalDeclarationKind.Constant; 249return this.DeclarationKind == LocalDeclarationKind.UsingVariable; 260return this.DeclarationKind == LocalDeclarationKind.FixedVariable; 271return this.DeclarationKind == LocalDeclarationKind.ForEachIterationVariable; 281/// tracked by the EnC diffing algorithm. For example, for <see cref="LocalDeclarationKind.CatchVariable"/> variable 306case LocalDeclarationKind.Constant: 307case LocalDeclarationKind.FixedVariable: 308case LocalDeclarationKind.ForEachIterationVariable: 309case LocalDeclarationKind.UsingVariable:
Symbols\Source\SourceLocalSymbol.cs (27)
36private readonly LocalDeclarationKind _declarationKind; 48LocalDeclarationKind declarationKind) 51Debug.Assert(declarationKind != LocalDeclarationKind.None); 115return new ForEachLocalSymbol(containingMethod, binder, typeSyntax, identifierToken, collection, LocalDeclarationKind.ForEachIterationVariable); 141LocalDeclarationKind kind, 161LocalDeclarationKind kind, 178return typeSyntax?.SkipScoped(out _).SkipRef().IsVar != false && kind != LocalDeclarationKind.DeclarationExpressionVariable 207LocalDeclarationKind declarationKind, 211Debug.Assert(declarationKind != LocalDeclarationKind.ForEachIterationVariable); 222internal override LocalDeclarationKind DeclarationKind 432case LocalDeclarationKind.RegularVariable: 436case LocalDeclarationKind.Constant: 437case LocalDeclarationKind.FixedVariable: 438case LocalDeclarationKind.UsingVariable: 442case LocalDeclarationKind.ForEachIterationVariable: 446case LocalDeclarationKind.CatchVariable: 450case LocalDeclarationKind.OutVariable: 451case LocalDeclarationKind.DeclarationExpressionVariable: 452case LocalDeclarationKind.DeconstructionVariable: 453case LocalDeclarationKind.PatternVariable: 531LocalDeclarationKind declarationKind, 535Debug.Assert(declarationKind != LocalDeclarationKind.ForEachIterationVariable); 631LocalDeclarationKind declarationKind) : 634Debug.Assert(declarationKind == LocalDeclarationKind.ForEachIterationVariable); 671LocalDeclarationKind declarationKind, 735LocalDeclarationKind declarationKind, 812Debug.Assert(this.DeclarationKind == LocalDeclarationKind.DeclarationExpressionVariable);
Symbols\Synthesized\SynthesizedLocal.cs (2)
108internal sealed override LocalDeclarationKind DeclarationKind 110get { return LocalDeclarationKind.None; }
Symbols\Synthesized\TypeSubstitutedLocalSymbol.cs (1)
37internal override LocalDeclarationKind DeclarationKind
Symbols\UpdatedContainingSymbolLocal.cs (1)
84internal override LocalDeclarationKind DeclarationKind => _underlyingLocal.DeclarationKind;