1 write to declaration
Microsoft.CodeAnalysis.CSharp (1)
Symbols\Source\SourceMemberContainerSymbol.cs (1)
234this.declaration = declaration;
59 references to declaration
Microsoft.CodeAnalysis.CSharp (59)
Symbols\Source\SourceMemberContainerSymbol.cs (39)
393var partCount = declaration.Declarations.Length; 398var decl = declaration.Declarations[i]; 410mods, allowedModifiers, declaration.Declarations[i].NameLocation, diagnostics, 453: ErrorCode.ERR_DuplicateNameInNS, declaration.Declarations[i].NameLocation, this.Name, this.ContainingSymbol); 462diagnostics.Add(ErrorCode.ERR_DuplicateNameInClass, declaration.Declarations[i].NameLocation, this.ContainingSymbol, this.Name); 472var singleDeclaration = declaration.Declarations[i]; 795return this.declaration; 862private SyntaxTree? AssociatedSyntaxTree => IsFileLocal ? declaration.Declarations[0].Location.SourceTree : null; 918var kind = this.declaration.Declarations[0].Kind; 927return this.declaration.Declarations[0].Kind == DeclarationKind.ImplicitClass; 935return this.declaration.Declarations[0].Kind == DeclarationKind.Record; 943return this.declaration.Declarations[0].Kind == DeclarationKind.RecordStruct; 959return declaration.Arity; 967return declaration.Name; 983_lazyLexicalSortKey.SetFrom(declaration.GetLexicalSortKey(this.DeclaringCompilation)); 989=> ImmutableArray<Location>.CastUp(declaration.NameLocations.ToImmutable()); 992=> declaration.Declarations[0].NameLocation; 998return this.declaration.SyntaxReferences; 1013var declarations = declaration.Declarations; 1099foreach (var declaration in this.declaration.Declarations) 1119if (declaration.Declarations.Length >= 1 && position == declaration.Declarations[0].Location.SourceSpan.Start) 1270return (IsTupleType || IsRecord || IsRecordStruct) ? GetMembers().Select(m => m.Name) : this.declaration.MemberNames; 1329foreach (var childDeclaration in declaration.Children) 1406hasDeclaredMembers = declaration.Declarations.Any(static decl => decl.HasRequiredMembers); 1500if (_lazyMembersDictionary != null || declaration.MemberNames.Contains(name) || declaration.Kind is DeclarationKind.Record or DeclarationKind.RecordStruct) 1879var tree = declaration.Declarations[0].SyntaxReference.SyntaxTree; 1928if (declaration.Kind != DeclarationKind.Record && 1929declaration.Kind != DeclarationKind.RecordStruct) 3319foreach (var singleDecl in declaration.Declarations) 3518foreach (var decl in this.declaration.Declarations) 4175if (declaration.Kind is not (DeclarationKind.Record or DeclarationKind.RecordStruct) && declaredMembersAndInitializers.PrimaryConstructor is null) 4183if (declaration.Kind is not (DeclarationKind.Record or DeclarationKind.RecordStruct)) 4227bool isRecordClass = declaration.Kind == DeclarationKind.Record; 4274diagnostics.Add(ErrorCode.WRN_RecordEqualsWithoutGetHashCode, thisEquals.GetFirstLocation(), declaration.Name); 5379bool containsExtensionMethods = ((this.IsStatic && !this.IsGenericType) || this.IsScriptClass) && this.declaration.ContainsExtensionMethods; 5393bool anyMemberHasAttributes = this.declaration.AnyMemberHasAttributes; 5418if (!declaration.AnyMemberHasAttributes)
Symbols\Source\SourceNamedTypeSymbol.cs (14)
104return new SourceNamedTypeSymbol(ContainingType, declaration, BindingDiagnosticBag.Discarded, newData); 140if (declaration.Arity == 0) 146var typeParameterNames = new string[declaration.Arity]; 147var typeParameterVarianceKeywords = new string[declaration.Arity]; 240declaration.NameLocations.First(), 248declaration.NameLocations.First(), 324foreach (var decl in declaration.Declarations) 383foreach (var decl in declaration.Declarations) 405foreach (var decl in declaration.Declarations) 788return declaration.GetAttributeDeclarations(quickAttributes: null); 793return declaration.GetAttributeDeclarations(quickAttributes); 1077foreach (var decl in this.declaration.Declarations) 1719if (this.declaration.Declarations.All(d => d.IsSimpleProgram)) 1780return this.declaration.Declarations.Any(static d => d.IsSimpleProgram);
Symbols\Source\SourceNamedTypeSymbol_Bases.cs (5)
128if (declaration.Kind == DeclarationKind.Record) 214foreach (var decl in this.declaration.Declarations) 243foreach (var singleDeclaration in this.declaration.Declarations) 298foreach (var decl in this.declaration.Declarations) 370if (declaration.Kind is DeclarationKind.Record or DeclarationKind.RecordStruct)
Symbols\Source\SourceNamedTypeSymbol_Enum.cs (1)
52var decl = this.declaration.Declarations[0];