82 references to StaticConstructor
ILLink.RoslynAnalyzer (2)
ISymbolExtensions.cs (2)
202 => (symbol as IMethodSymbol)?.MethodKind is MethodKind.Constructor or MethodKind.StaticConstructor; 205 => (symbol as IMethodSymbol)?.MethodKind == MethodKind.StaticConstructor;
Microsoft.CodeAnalysis (1)
Symbols\MethodKind.cs (1)
93/// <inheritdoc cref="StaticConstructor"/>
Microsoft.CodeAnalysis.CodeStyle (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.cs (1)
288=> symbol is IMethodSymbol { MethodKind: MethodKind.StaticConstructor };
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SymbolSpecification.cs (1)
400CodeAnalysis.MethodKind.SharedConstructor => nameof(CodeAnalysis.MethodKind.StaticConstructor),
Microsoft.CodeAnalysis.CodeStyle.Fixes (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationNamedTypeSymbol.cs (1)
184this.GetMembers().OfType<IMethodSymbol>().Where(m => m.MethodKind == MethodKind.StaticConstructor && m.IsStatic));
Microsoft.CodeAnalysis.CSharp (42)
Binder\Binder.ValueChecks.cs (1)
1427MethodKind desiredMethodKind = fieldIsStatic ? MethodKind.StaticConstructor : MethodKind.Constructor;
Binder\Binder_Expressions.cs (2)
4773constructor.MethodKind == MethodKind.StaticConstructor); // error scenario: constructor initializer on static constructor 6581Debug.Assert(constructor.MethodKind == MethodKind.Constructor || constructor.MethodKind == MethodKind.StaticConstructor);
Binder\Binder_Statements.cs (1)
1798MethodKind.StaticConstructor :
CodeGen\CodeGenerator_HasHome.cs (1)
252return containingSymbol is MethodSymbol { MethodKind: MethodKind.StaticConstructor } or FieldSymbol { IsStatic: true };
Compiler\MethodCompiler.cs (3)
534method.MethodKind == MethodKind.StaticConstructor ? processedStaticInitializers : 1075if ((methodSymbol.MethodKind == MethodKind.Constructor || methodSymbol.MethodKind == MethodKind.StaticConstructor) && 1760if (method.MethodKind == MethodKind.StaticConstructor &&
Emitter\Model\MethodSymbolAdapter.cs (1)
638|| this.MethodKind == MethodKind.StaticConstructor;
Emitter\Model\SynthesizedPrivateImplementationDetailsStaticConstructor.cs (1)
24public override MethodKind MethodKind => MethodKind.StaticConstructor;
Lowering\ClosureConversion\ClosureConversion.cs (1)
1673_currentMethod.MethodKind != MethodKind.StaticConstructor &&
Lowering\InitializerRewriter.cs (1)
22Debug.Assert((method.MethodKind == MethodKind.Constructor) || (method.MethodKind == MethodKind.StaticConstructor));
Lowering\Instrumentation\ModuleCancellationInstrumenter.cs (2)
50if (method.MethodKind is not (MethodKind.Constructor or MethodKind.StaticConstructor) && 84if (isMethodBody && _factory.TopLevelMethod.MethodKind == MethodKind.StaticConstructor)
Lowering\Instrumentation\StackOverflowProbingInstrumenter.cs (2)
40if (method.MethodKind is not (MethodKind.Constructor or MethodKind.StaticConstructor) && 74if (isMethodBody && _factory.TopLevelMethod.MethodKind == MethodKind.StaticConstructor)
Lowering\LocalRewriter\LocalRewriter_Conversion.cs (1)
582&& _factory.TopLevelMethod.MethodKind != MethodKind.StaticConstructor // Avoid caching twice if people do it manually.
SymbolDisplay\SymbolDisplayVisitor.Members.cs (2)
326case MethodKind.StaticConstructor: 468case MethodKind.StaticConstructor:
Symbols\MemberSymbolExtensions.cs (1)
363case MethodKind.StaticConstructor:
Symbols\Metadata\PE\PEMethodSymbol.cs (1)
1192return MethodKind.StaticConstructor;
Symbols\MethodSymbol.cs (2)
608case MethodKind.StaticConstructor: 671return ((MethodKind == MethodKind.Constructor || MethodKind == MethodKind.StaticConstructor) && IsImplicitlyDeclared);
Symbols\MethodSymbolExtensions.cs (1)
131case MethodKind.StaticConstructor:
Symbols\NamedTypeSymbol.cs (1)
286Debug.Assert(method.MethodKind == MethodKind.StaticConstructor);
Symbols\PublicModel\MethodSymbol.cs (2)
67case MethodKind.StaticConstructor: 68return MethodKind.StaticConstructor;
Symbols\Source\SourceConstructorSymbol.cs (4)
21var methodKind = syntax.Modifiers.Any(SyntaxKind.StaticKeyword) ? MethodKind.StaticConstructor : MethodKind.Constructor; 64if (methodKind == MethodKind.StaticConstructor) 126var defaultAccess = (methodKind == MethodKind.StaticConstructor) ? DeclarationModifiers.None : DeclarationModifiers.Private; 139if (methodKind == MethodKind.StaticConstructor)
Symbols\Source\SourceConstructorSymbolBase.cs (1)
64if (MethodKind == MethodKind.StaticConstructor && (_lazyParameters.Length != 0) &&
Symbols\Source\SourceMemberContainerSymbol.cs (2)
4088case MethodKind.StaticConstructor: 4826case MethodKind.StaticConstructor:
Symbols\Source\SourceMemberMethodSymbol.cs (1)
1098if ((!IsStatic || MethodKind is MethodKind.StaticConstructor) &&
Symbols\Source\SourceMethodSymbolWithAttributes.cs (4)
158case MethodKind.StaticConstructor: 1480case MethodKind.StaticConstructor: 1507var errorCode = (this.MethodKind == MethodKind.Constructor || this.MethodKind == MethodKind.StaticConstructor) ? 1664case MethodKind.StaticConstructor:
Symbols\Symbol_Attributes.cs (1)
59case MethodKind.StaticConstructor:
Symbols\Synthesized\SynthesizedStaticConstructor.cs (1)
193return MethodKind.StaticConstructor;
Symbols\TypeMap.cs (1)
193stopAt?.MethodKind == MethodKind.StaticConstructor ||
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (1)
Emit\EmitMetadataTests.cs (1)
623Assert.Equal(MethodKind.StaticConstructor, cctor.MethodKind);
Microsoft.CodeAnalysis.CSharp.Features (2)
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (2)
947if (symbol is not IMethodSymbol { MethodKind: MethodKind.Constructor or MethodKind.StaticConstructor } method) 1986MethodKind.StaticConstructor => FeaturesResources.static_constructor,
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (9)
Symbols\DefaultInterfaceImplementationTests.cs (5)
43953Assert.Equal(MethodKind.StaticConstructor, cctor.MethodKind); 44670Assert.Equal(MethodKind.StaticConstructor, cctor.MethodKind); 44768Assert.Equal(MethodKind.StaticConstructor, cctor.MethodKind); 45236Assert.Equal(MethodKind.StaticConstructor, cctor.MethodKind); 45704Assert.Equal(MethodKind.StaticConstructor, cctor.MethodKind);
Symbols\Metadata\PE\LoadingMethods.cs (1)
1182Assert.Equal(m.Name == ".cctor" ? MethodKind.StaticConstructor : MethodKind.Constructor, ((MethodSymbol)m).MethodKind);
Symbols\ModuleInitializers\ModuleInitializersTests.cs (1)
133Assert.Equal(MethodKind.StaticConstructor, staticConstructor.MethodKind);
Symbols\Source\MethodTests.cs (2)
1904Assert.Equal(MethodKind.StaticConstructor, staticConstructor.MethodKind); 1928Assert.Equal(MethodKind.StaticConstructor, staticConstructor.MethodKind);
Microsoft.CodeAnalysis.Test.Utilities (2)
Diagnostics\FieldCouldBeReadOnlyAnalyzer.cs (1)
49ITypeSymbol staticConstructorType = containingMethod.MethodKind == MethodKind.StaticConstructor ? containingMethod.ContainingType : null;
Diagnostics\TrackingDiagnosticAnalyzer.cs (1)
130new { SymbolKind = SymbolKind.Method, MethodKind = MethodKind.StaticConstructor, ReturnsVoid = true },
Microsoft.CodeAnalysis.VisualBasic (4)
SymbolDisplay\SymbolDisplayVisitor.Members.vb (3)
197Case MethodKind.Constructor, MethodKind.StaticConstructor 338Case MethodKind.Constructor, MethodKind.StaticConstructor 437MethodKind.StaticConstructor
Symbols\NamedTypeSymbol.vb (1)
429Debug.Assert(method.MethodKind = MethodKind.StaticConstructor)
Microsoft.CodeAnalysis.VisualBasic.Features (1)
EditAndContinue\VisualBasicEditAndContinueAnalyzer.vb (1)
1441Case MethodKind.StaticConstructor
Microsoft.CodeAnalysis.Workspaces (7)
FindSymbols\FindReferences\Finders\ConstructorSymbolReferenceFinder.cs (1)
25=> symbol.MethodKind is MethodKind.Constructor or MethodKind.StaticConstructor;
Rename\RenameUtilities.cs (1)
362MethodKind.StaticConstructor or
Rename\SymbolicRenameLocations.ReferenceProcessing.cs (1)
210MethodKind: MethodKind.Constructor or MethodKind.StaticConstructor or MethodKind.Destructor,
Shared\Extensions\ISymbolExtensions.cs (1)
475if (methodSymbol.MethodKind is MethodKind.Constructor or MethodKind.StaticConstructor)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.cs (1)
288=> symbol is IMethodSymbol { MethodKind: MethodKind.StaticConstructor };
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SymbolSpecification.cs (1)
400CodeAnalysis.MethodKind.SharedConstructor => nameof(CodeAnalysis.MethodKind.StaticConstructor),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationNamedTypeSymbol.cs (1)
184this.GetMembers().OfType<IMethodSymbol>().Where(m => m.MethodKind == MethodKind.StaticConstructor && m.IsStatic));
Microsoft.CodeAnalysis.Workspaces.UnitTests (2)
CodeStyle\NamingStylePreferencesUpgradeTests.cs (1)
191[InlineData(typeof(MethodKind), nameof(MethodKind.AnonymousFunction), nameof(MethodKind.LambdaMethod), nameof(MethodKind.SharedConstructor), nameof(MethodKind.StaticConstructor))]
UtilityTest\DocumentationCommentIdTests.cs (1)
155CheckDeclarationId<IMethodSymbol>("M:Acme.Widget.#cctor", compilation, s => s.MethodKind == MethodKind.StaticConstructor);
Microsoft.VisualStudio.LanguageServices (2)
Progression\GraphBuilder.cs (2)
390else if (methodSymbol.MethodKind == MethodKind.StaticConstructor) 532case MethodKind.StaticConstructor:
Microsoft.VisualStudio.LanguageServices.CSharp (3)
CodeModel\CSharpCodeModelService.cs (1)
2195case MethodKind.StaticConstructor:
ObjectBrowser\DescriptionBuilder.cs (2)
192not MethodKind.StaticConstructor and 262methodSymbol.MethodKind != MethodKind.StaticConstructor)
Microsoft.VisualStudio.LanguageServices.VisualBasic (1)
CodeModel\VisualBasicCodeModelService.vb (1)
2549MethodKind.StaticConstructor