353 references to Constructor
ConfigurationSchemaGenerator (1)
RuntimeSource\Configuration.Binder\Parser\ConfigurationBinder.cs (1)
111IMethodReferenceOperation m when m.Method.MethodKind == MethodKind.Constructor => m.Method.ContainingType,
ILLink.RoslynAnalyzer (2)
ISymbolExtensions.cs (1)
202 => (symbol as IMethodSymbol)?.MethodKind is MethodKind.Constructor or MethodKind.StaticConstructor;
TrimAnalysis\MethodReturnValue.cs (1)
22 Debug.Assert (!isNewObj || methodSymbol.MethodKind == MethodKind.Constructor, "isNewObj can only be true for constructors");
Microsoft.CodeAnalysis.CodeStyle (6)
src\Analyzers\Core\Analyzers\Helpers\DeserializationConstructorCheck.cs (1)
19methodSymbol.MethodKind == MethodKind.Constructor &&
src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (1)
771case MethodKind.Constructor:
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.cs (1)
298if (method.MethodKind != MethodKind.Constructor)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\IParameterSymbolExtensions.cs (2)
30MethodKind: MethodKind.Constructor, 62MethodKind: MethodKind.Constructor,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.cs (1)
285=> symbol is IMethodSymbol { MethodKind: MethodKind.Constructor };
Microsoft.CodeAnalysis.CodeStyle.Fixes (5)
src\Analyzers\Core\CodeFixes\AddParameter\AbstractAddParameterCodeFixProvider.cs (1)
138var isConstructorInitializer = candidates.All(m => m.MethodKind == MethodKind.Constructor);
src\Analyzers\Core\CodeFixes\AddParameter\AddParameterService.cs (2)
168if (method.MethodKind != MethodKind.Constructor) 194if (parameter.ContainingSymbol is not IMethodSymbol { MethodKind: MethodKind.Constructor, DeclaringSyntaxReferences: [var reference] } constructor)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationConstructorSymbol.cs (1)
34public override MethodKind MethodKind => MethodKind.Constructor;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationNamedTypeSymbol.cs (1)
174this.GetMembers().OfType<IMethodSymbol>().Where(m => m.MethodKind == MethodKind.Constructor && !m.IsStatic));
Microsoft.CodeAnalysis.CSharp (91)
Binder\Binder.ValueChecks.cs (3)
1427MethodKind desiredMethodKind = fieldIsStatic ? MethodKind.StaticConstructor : MethodKind.Constructor; 1889if (method.MethodKind == MethodKind.Constructor || method.IsInitOnly) 2506if (method.MethodKind == MethodKind.Constructor)
Binder\Binder_Crefs.cs (1)
780int signatureMemberArity = candidateMethodKind == MethodKind.Constructor
Binder\Binder_Expressions.cs (3)
2082(this.ContainingMember() is MethodSymbol { MethodKind: MethodKind.Constructor } containingMember && (object)containingMember != primaryCtor)) && // We are in a non-primary instance constructor 4772Debug.Assert(constructor.MethodKind == MethodKind.Constructor || 6581Debug.Assert(constructor.MethodKind == MethodKind.Constructor || constructor.MethodKind == MethodKind.StaticConstructor);
Binder\Binder_Statements.cs (2)
1799MethodKind.Constructor) || 3807if (constructor.MethodKind != MethodKind.Constructor || constructor.IsExtern)
Binder\Semantics\OverloadResolution\OverloadResolutionResult.cs (1)
512Debug.Assert(firstSupported.Member is MethodSymbol { MethodKind: MethodKind.Constructor });
BoundTree\BoundNodeExtensions.cs (1)
62return method.MethodKind == MethodKind.Constructor &&
CodeGen\CodeGenerator_HasHome.cs (1)
256return (containingSymbol is MethodSymbol { MethodKind: MethodKind.Constructor } or FieldSymbol { IsStatic: false } or MethodSymbol { IsInitOnly: true }) &&
CodeGen\EmitExpression.cs (1)
2186if (method.IsEffectivelyReadOnly && method.MethodKind != MethodKind.Constructor)
Compilation\CSharpCompilation.cs (1)
3078if (symbol.Kind == SymbolKind.Method && symbol.IsImplicitlyDeclared && ((MethodSymbol)symbol).MethodKind == MethodKind.Constructor)
Compilation\MethodBodySemanticModel.cs (1)
240if (MemberSymbol is MethodSymbol methodSymbol && methodSymbol.MethodKind == MethodKind.Constructor &&
Compiler\MethodCompiler.cs (3)
533(method.MethodKind == MethodKind.Constructor || method.IsScriptInitializer) ? processedInstanceInitializers : 1075if ((methodSymbol.MethodKind == MethodKind.Constructor || methodSymbol.MethodKind == MethodKind.StaticConstructor) && 2338if (method.MethodKind == MethodKind.Constructor && !method.IsExtern)
Emitter\Model\MethodSymbolAdapter.cs (2)
388return AdaptedMethodSymbol.MethodKind == MethodKind.Constructor; 637return this.MethodKind == MethodKind.Constructor
Emitter\Model\NamedTypeSymbolAdapter.cs (1)
631if ((alwaysIncludeConstructors && method.MethodKind == MethodKind.Constructor) || method.GetCciAdapter().ShouldInclude(context))
Emitter\NoPia\EmbeddedMethod.cs (1)
70return UnderlyingMethod.AdaptedMethodSymbol.MethodKind == MethodKind.Constructor;
FlowAnalysis\AbstractFlowPass.cs (1)
1421if (method is null || method.MethodKind != MethodKind.Constructor)
FlowAnalysis\DefiniteAssignment.cs (3)
102&& CurrentSymbol is MethodSymbol { MethodKind: MethodKind.Constructor, ContainingType.TypeKind: TypeKind.Struct }; 1258Debug.Assert(CurrentSymbol is MethodSymbol { MethodKind: MethodKind.Constructor, ContainingType.TypeKind: TypeKind.Struct }); 1311if (CurrentSymbol is not MethodSymbol { MethodKind: MethodKind.Constructor, ContainingType.TypeKind: TypeKind.Struct })
FlowAnalysis\FlowAnalysisPass.cs (1)
113Debug.Assert(method.MethodKind == MethodKind.Constructor);
FlowAnalysis\NullableWalker.cs (2)
467Debug.Assert(baseOrThisInitializer is null or { MethodKind: MethodKind.Constructor }); 1522return constructorBody is BoundConstructorMethodBody { Initializer: BoundExpressionStatement { Expression: BoundCall { Method: { MethodKind: MethodKind.Constructor } initializerMethod } } }
Lowering\ClosureConversion\ClosureConversion.cs (2)
189_seenBaseCall = method.MethodKind != MethodKind.Constructor; // only used for ctors 789if (_currentMethod.MethodKind == MethodKind.Constructor &&
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) && 156if (method.MethodKind is not (MethodKind.Ordinary or MethodKind.Constructor))
Lowering\Instrumentation\StackOverflowProbingInstrumenter.cs (1)
40if (method.MethodKind is not (MethodKind.Constructor or MethodKind.StaticConstructor) &&
Lowering\LocalRewriter\LocalRewriter_Call.cs (1)
665var requiresInstanceReceiver = methodOrIndexer.RequiresInstanceReceiver() && methodOrIndexer is not MethodSymbol { MethodKind: MethodKind.Constructor } and not FunctionPointerMethodSymbol;
Lowering\LocalRewriter\LocalRewriter_CollectionExpression.cs (1)
922if (asSpanMethod is MethodSymbol { MethodKind: MethodKind.Constructor } constructor)
Lowering\LocalRewriter\LocalRewriter_Range.cs (1)
167case MethodKind.Constructor:
src\Compilers\CSharp\CSharpAnalyzerDriver\CSharpDeclarationComputer.cs (1)
109Debug.Assert(ctor.MethodKind == MethodKind.Constructor && typeDeclaration.ParameterList is object);
SymbolDisplay\SymbolDisplayVisitor.Members.cs (2)
325case MethodKind.Constructor: 467case MethodKind.Constructor:
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.ConstructorSymbol.cs (1)
45get { return MethodKind.Constructor; }
Symbols\Compilation_WellKnownMembers.cs (1)
262targetMethodKind = MethodKind.Constructor;
Symbols\ErrorMethodSymbol.cs (2)
206return MethodKind.Constructor; 283Debug.Assert(MethodKind == MethodKind.Constructor);
Symbols\MemberSymbolExtensions.cs (3)
362case MethodKind.Constructor: 375if ((object)method != null && method.MethodKind == MethodKind.Constructor) 440return method.MethodKind == MethodKind.Constructor && method.ParameterCount == 0;
Symbols\Metadata\PE\PEMethodSymbol.cs (4)
1197return MethodKind.Constructor; 1468var diag = PEUtilities.DeriveCompilerFeatureRequiredAttributeDiagnostic(this, containingModule, Handle, allowedFeatures: MethodKind == MethodKind.Constructor ? CompilerFeatureRequiredFeatures.RequiredMembers : CompilerFeatureRequiredFeatures.None, decoder); 1556Debug.Assert(MethodKind == MethodKind.Constructor); 1578var result = ObsoleteAttributeHelpers.GetObsoleteDataFromMetadata(_handle, (PEModuleSymbol)ContainingModule, ignoreByRefLikeMarker: false, ignoreRequiredMemberMarker: MethodKind == MethodKind.Constructor);
Symbols\Metadata\PE\PEParameterSymbol.cs (1)
885case "" when !ContainingSymbol.RequiresInstanceReceiver() || ContainingSymbol is MethodSymbol { MethodKind: MethodKind.Constructor or MethodKind.DelegateInvoke }:
Symbols\MethodSymbol.cs (7)
369protected bool IsValidReadOnlyTarget => !IsStatic && ContainingType.IsStructType() && MethodKind != MethodKind.Constructor && !IsInitOnly; 589internal bool HasSetsRequiredMembers => MethodKind == MethodKind.Constructor && HasSetsRequiredMembersImpl; 605case MethodKind.Constructor: 655return MethodKind == MethodKind.Constructor && ContainingType.IsScriptClass; 671return ((MethodKind == MethodKind.Constructor || MethodKind == MethodKind.StaticConstructor) && IsImplicitlyDeclared); 682return MethodKind == MethodKind.Constructor && IsImplicitlyDeclared; 1201or MethodKind.Constructor
Symbols\MethodSymbolExtensions.cs (1)
130case MethodKind.Constructor:
Symbols\NamedTypeSymbol.cs (1)
278Debug.Assert(method.MethodKind == MethodKind.Constructor);
Symbols\NativeIntegerTypeSymbol.cs (1)
113case MethodKind.Constructor:
Symbols\PublicModel\MethodSymbol.cs (2)
41case MethodKind.Constructor: 42return MethodKind.Constructor;
Symbols\Source\SourceComplexParameterSymbol.cs (1)
1351if (!ContainingSymbol.RequiresInstanceReceiver() || ContainingSymbol is MethodSymbol { MethodKind: MethodKind.Constructor or MethodKind.DelegateInvoke or MethodKind.LambdaMethod })
Symbols\Source\SourceConstructorSymbol.cs (3)
21var methodKind = syntax.Modifiers.Any(SyntaxKind.StaticKeyword) ? MethodKind.StaticConstructor : MethodKind.Constructor; 53if (methodKind == MethodKind.Constructor && syntax.Initializer != null) 175else if (ContainingType.IsStatic && methodKind == MethodKind.Constructor)
Symbols\Source\SourceDelegateMethodSymbol.cs (1)
217: base(delegateType, voidType, syntax, MethodKind.Constructor, RefKind.None, DeclarationModifiers.Public)
Symbols\Source\SourceMemberContainerSymbol.cs (8)
2144if (method1.MethodKind == MethodKind.Constructor && 2160var methodKind = method1.MethodKind == MethodKind.Constructor ? MessageID.IDS_SK_CONSTRUCTOR : MessageID.IDS_SK_METHOD; 4070case MethodKind.Constructor: 4116if (m.MethodKind == MethodKind.Constructor && m.ParameterCount == 0) 4158if (hasInitializers && !builder.NonTypeMembers.Any(member => member is MethodSymbol { MethodKind: MethodKind.Constructor })) 4210case MethodSymbol { MethodKind: not (MethodKind.Ordinary or MethodKind.Constructor) }: 4348MethodKind.Constructor, 4816case MethodKind.Constructor:
Symbols\Source\SourceMethodSymbolWithAttributes.cs (5)
156case MethodKind.Constructor: 1479case MethodKind.Constructor: 1507var errorCode = (this.MethodKind == MethodKind.Constructor || this.MethodKind == MethodKind.StaticConstructor) ? 1663case MethodKind.Constructor: 1743if (this.ContainingType.IsComImport && this.MethodKind == MethodKind.Constructor)
Symbols\Source\SourceNamedTypeSymbol.cs (1)
1800&& !GetMembers().All(m => m is not MethodSymbol { MethodKind: MethodKind.Constructor, ObsoleteKind: ObsoleteAttributeKind.None } method
Symbols\Source\ThisParameterSymbol.cs (1)
152if (_containingMethod?.MethodKind == MethodKind.Constructor)
Symbols\Symbol_Attributes.cs (1)
58case MethodKind.Constructor:
Symbols\SymbolExtensions.cs (1)
828=> method is { MethodKind: MethodKind.Constructor, HasSetsRequiredMembers: false };
Symbols\Synthesized\Records\SynthesizedPrimaryConstructor.cs (1)
42MethodKind.Constructor,
Symbols\Synthesized\Records\SynthesizedRecordCopyCtor.cs (1)
135if (member is MethodSymbol { ContainingType.IsRecord: true, MethodKind: MethodKind.Constructor } method)
Symbols\Synthesized\SynthesizedInstanceConstructor.cs (1)
190get { return MethodKind.Constructor; }
Symbols\TypeMap.cs (1)
194stopAt?.MethodKind == MethodKind.Constructor);
Microsoft.CodeAnalysis.CSharp.CodeStyle (3)
src\Analyzers\CSharp\Analyzers\MakeStructFieldsWritable\CSharpMakeStructFieldsWritableDiagnosticAnalyzer.cs (1)
88if (context.OwningSymbol is IMethodSymbol { MethodKind: MethodKind.Constructor })
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForNewDiagnosticAnalyzer.cs (1)
54if (symbol is not IMethodSymbol { MethodKind: MethodKind.Constructor, Parameters: [var parameter] } ||
src\Analyzers\CSharp\Analyzers\UseCollectionInitializer\CSharpUseCollectionInitializerAnalyzer.cs (1)
65MethodKind: MethodKind.Constructor,
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (2)
Emit\CompilationEmitTests.cs (1)
2732var cciMethods = class1TypeDef.GetMethods(context).Where(m => ((MethodSymbol)m.GetInternalSymbol()).MethodKind != MethodKind.Constructor);
Emit\EmitMetadataTests.cs (1)
602Assert.Equal(MethodKind.Constructor, ctor.MethodKind);
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (4)
Attributes\AttributeTests_CallerInfoAttributes.cs (2)
4405Assert.Equal(MethodKind.Constructor, ctor.MethodKind); 4435Assert.Equal(MethodKind.Constructor, ctor.MethodKind);
Semantics\PrimaryConstructorTests.cs (2)
134Assert.Equal(MethodKind.Constructor, members.Cast<MethodSymbol>().Single().MethodKind); 821Assert.All(c.GetMembers(), m => Assert.True(m is MethodSymbol { MethodKind: MethodKind.Constructor }));
Microsoft.CodeAnalysis.CSharp.Features (6)
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (1)
947if (symbol is not IMethodSymbol { MethodKind: MethodKind.Constructor or MethodKind.StaticConstructor } method)
InitializeParameter\CSharpInitializeMemberFromPrimaryConstructorParameterCodeRefactoringProvider.cs (1)
55if (parameter.ContainingSymbol is not IMethodSymbol { MethodKind: MethodKind.Constructor } constructor)
src\Analyzers\CSharp\Analyzers\MakeStructFieldsWritable\CSharpMakeStructFieldsWritableDiagnosticAnalyzer.cs (1)
88if (context.OwningSymbol is IMethodSymbol { MethodKind: MethodKind.Constructor })
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForNewDiagnosticAnalyzer.cs (1)
54if (symbol is not IMethodSymbol { MethodKind: MethodKind.Constructor, Parameters: [var parameter] } ||
src\Analyzers\CSharp\Analyzers\UseCollectionInitializer\CSharpUseCollectionInitializerAnalyzer.cs (1)
65MethodKind: MethodKind.Constructor,
src\Compilers\CSharp\CSharpAnalyzerDriver\CSharpDeclarationComputer.cs (1)
109Debug.Assert(ctor.MethodKind == MethodKind.Constructor && typeDeclaration.ParameterList is object);
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (3)
Semantics\LocalFunctionTests.cs (1)
1063Assert.Equal(MethodKind.Constructor, attrConstructor.MethodKind);
Semantics\NativeIntegerTests.cs (2)
345return !(nativeIntegerMember is IMethodSymbol { MethodKind: MethodKind.Constructor }); 459return !(nativeIntegerMember is MethodSymbol { MethodKind: MethodKind.Constructor });
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (97)
Compilation\GetSemanticInfoTests.cs (3)
1074Assert.Equal(MethodKind.Constructor, ((IMethodSymbol)baseConstructor).MethodKind); 1093Assert.Equal(MethodKind.Constructor, ((IMethodSymbol)baseConstructor).MethodKind); 1116Assert.Equal(MethodKind.Constructor, invokedConstructor.MethodKind);
Compilation\SemanticModelAPITests.cs (3)
1371Assert.Equal(MethodKind.Constructor, method.MethodKind); 2087Assert.Equal(MethodKind.Constructor, method.MethodKind); 2104Assert.Equal(MethodKind.Constructor, method.MethodKind);
Compilation\SemanticModelGetSemanticInfoTests.cs (4)
4886Assert.Equal(MethodKind.Constructor, ((IMethodSymbol)semanticInfo.Symbol.ContainingSymbol).MethodKind); 4893Assert.Equal(MethodKind.Constructor, ((IMethodSymbol)semanticInfo.Symbol.ContainingSymbol).MethodKind); 6373Assert.Equal(MethodKind.Constructor, ((IMethodSymbol)symbol).MethodKind); 7295Assert.Equal(MethodKind.Constructor, ((IMethodSymbol)semanticInfo.Symbol).MethodKind);
DocumentationComments\CrefTests.cs (1)
3326Assert.Equal(MethodKind.Constructor, ((IMethodSymbol)info.CandidateSymbols[0]).MethodKind);
Symbols\AccessorOverriddenOrHiddenMembersTests.cs (1)
883if (m.MethodKind == MethodKind.Constructor)
Symbols\CheckedUserDefinedOperatorsTests.cs (68)
51var opSymbol = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).First(); 84var opSymbols = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).ToArray(); 118var opSymbols = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).ToArray(); 165var opSymbols = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).ToArray(); 356var opSymbol = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 381var opSymbol = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 457var opSymbol = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 484var opSymbol = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 515var expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).First(); 533expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).First(); 541expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).First(); 687var expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 705expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 713expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 810var expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 818expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 826expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 859var expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 867expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 875expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 904var opSymbol = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 938var opSymbols = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).ToArray(); 981var opSymbols = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).ToArray(); 1017var opSymbols = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).ToArray(); 1268var opSymbol = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).First(); 1302var opSymbols = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).ToArray(); 1337var opSymbols = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).ToArray(); 1371var opSymbols = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).ToArray(); 1526var opSymbol = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 1553var opSymbol = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 1635var opSymbol = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 1662var opSymbol = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 1695var expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).First(); 1714expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).First(); 1722expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).First(); 1818var expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 1836expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 1851expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 1884var expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 1892expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 1900expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 1928var expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 1946expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 1954expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 2053var expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 2071expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 2079expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 2112var expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 2120expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 2128expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 2181var opSymbol = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 2226var opSymbols = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).ToArray(); 2441var opSymbol = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 2468var opSymbol = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 2502var opSymbol = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).First(); 2538var opSymbols = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).ToArray(); 2578var opSymbols = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).ToArray(); 2617var opSymbols = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).ToArray(); 2758var opSymbol = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 2781var opSymbol = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 2854var expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).First(); 2872expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).First(); 2880expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).First(); 3020var expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 3038expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 3046expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 3188var opSymbol = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 3220var opSymbols = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).ToArray();
Symbols\Metadata\MetadataMemberTests.cs (1)
164Assert.Equal(MethodKind.Constructor, ctor.MethodKind);
Symbols\Metadata\PE\LoadingMethods.cs (1)
1182Assert.Equal(m.Name == ".cctor" ? MethodKind.StaticConstructor : MethodKind.Constructor, ((MethodSymbol)m).MethodKind);
Symbols\RequiredMembersTests.cs (1)
70foreach (var ctor in type.GetMembers().Where(m => m is MethodSymbol { MethodKind: MethodKind.Constructor }))
Symbols\Source\DeclaringSyntaxNodeTests.cs (1)
523if (memb.Kind == SymbolKind.Method && ((IMethodSymbol)memb).MethodKind == MethodKind.Constructor)
Symbols\Source\MethodTests.cs (1)
120Assert.Equal(MethodKind.Constructor, m.MethodKind);
Symbols\StaticAbstractMembersInInterfacesTests.cs (4)
32191var opSymbol = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 32228var opSymbols = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).ToArray(); 32439var opSymbol = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 32626var opSymbol = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single();
Symbols\TypeTests.cs (2)
1205.Count(m => !(m is MethodSymbol) || (m as MethodSymbol).MethodKind != MethodKind.Constructor)); 2466var method = typeMembers.OfType<MethodSymbol>().First(m => m is { MethodKind: not MethodKind.Constructor });
Symbols\UnsignedRightShiftTests.cs (6)
2706var expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).First(); 2724expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).First(); 2732expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).First(); 2878var expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).First(); 2896expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).First(); 2904expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).First();
Microsoft.CodeAnalysis.CSharp.Workspaces (1)
Classification\SyntaxClassification\NameSyntaxClassifier.cs (1)
256if (methodSymbol.MethodKind == MethodKind.Constructor)
Microsoft.CodeAnalysis.Features (13)
CodeLens\CodeLensFindReferenceProgress.cs (1)
124(definition as IMethodSymbol)?.MethodKind == MethodKind.Constructor;
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (1)
357MethodKind.Constructor => FeaturesResources.constructor,
GoToBase\AbstractGoToBaseService.cs (1)
45if (bases.Length == 0 && symbol is IMethodSymbol { MethodKind: MethodKind.Constructor } constructor)
InitializeParameter\AbstractInitializeMemberFromParameterCodeRefactoringProviderMemberCreation.cs (1)
67if (method.MethodKind != MethodKind.Constructor)
IntroduceParameter\AbstractIntroduceParameterCodeRefactoringProvider.cs (2)
85if (methodKind is not (MethodKind.Ordinary or MethodKind.LocalFunction or MethodKind.Constructor)) 160if (methodSymbol.MethodKind is not MethodKind.Constructor)
RQName\RQNodeBuilder.cs (1)
212if (symbol.MethodKind == MethodKind.Constructor)
src\Analyzers\Core\Analyzers\Helpers\DeserializationConstructorCheck.cs (1)
19methodSymbol.MethodKind == MethodKind.Constructor &&
src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (1)
771case MethodKind.Constructor:
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.cs (1)
298if (method.MethodKind != MethodKind.Constructor)
src\Analyzers\Core\CodeFixes\AddParameter\AbstractAddParameterCodeFixProvider.cs (1)
138var isConstructorInitializer = candidates.All(m => m.MethodKind == MethodKind.Constructor);
src\Analyzers\Core\CodeFixes\AddParameter\AddParameterService.cs (2)
168if (method.MethodKind != MethodKind.Constructor) 194if (parameter.ContainingSymbol is not IMethodSymbol { MethodKind: MethodKind.Constructor, DeclaringSyntaxReferences: [var reference] } constructor)
Microsoft.CodeAnalysis.Test.Utilities (2)
Diagnostics\FieldCouldBeReadOnlyAnalyzer.cs (1)
48bool inConstructor = containingMethod.MethodKind == MethodKind.Constructor;
Diagnostics\TrackingDiagnosticAnalyzer.cs (1)
119new { SymbolKind = SymbolKind.Method, MethodKind = MethodKind.Constructor, ReturnsVoid = true },
Microsoft.CodeAnalysis.VisualBasic (60)
Analysis\FlowAnalysis\AbstractFlowPass.vb (2)
1226Debug.Assert(method.Kind <> MethodKind.Constructor) 1297Debug.Assert(method.Kind <> MethodKind.Constructor)
Analysis\InitializerRewriter.vb (1)
273If methodSymbol.MethodKind = MethodKind.Constructor Then
Binding\Binder_Expressions.vb (2)
1874If containingMethodKind = MethodKind.Constructor Then 1916Return MethodKind.Constructor
Binding\Binder_Invocation.vb (2)
58If Me.ContainingMember.Kind = SymbolKind.Method AndAlso DirectCast(Me.ContainingMember, MethodSymbol).MethodKind = MethodKind.Constructor Then 716Return methodGroup.Methods(0).MethodKind = MethodKind.Constructor
Binding\Binder_Lambda.vb (1)
730Case MethodKind.SharedConstructor, MethodKind.Constructor
Binding\Binder_Lookup.vb (1)
1963containingMethod.MethodKind = MethodKind.Constructor AndAlso
Binding\Binder_Statements.vb (2)
347If methodSymbol.MethodKind = MethodKind.Constructor Then 416If Not methodSymbol.IsImplicitlyDeclared AndAlso methodSymbol.MethodKind = MethodKind.Constructor Then
Binding\Binder_Utils.vb (1)
1645MethodKindConstructor = CUInt(MethodKind.Constructor) << MethodKindShift
CodeGen\EmitAddress.vb (1)
281Return Me._method.MethodKind = MethodKind.Constructor AndAlso
Compilation\MethodCompiler.vb (7)
138DirectCast(symbol, MethodSymbol).MethodKind = MethodKind.Constructor Then 693ElseIf method.MethodKind = MethodKind.Constructor OrElse method.IsScriptInitializer Then 767sourceMethod.MethodKind = MethodKind.Constructor AndAlso 1475If method.MethodKind = MethodKind.Constructor OrElse method.MethodKind = MethodKind.SharedConstructor Then 1811If method.MethodKind = MethodKind.Constructor Then 1847If referencedMethod IsNot Nothing AndAlso referencedMethod.MethodKind = MethodKind.Constructor Then 1908Debug.Assert(constructor.MethodKind = MethodKind.Constructor)
Compilation\SemanticModel.vb (1)
1867(result.Kind = SymbolKind.Method AndAlso DirectCast(result, MethodSymbol).MethodKind = MethodKind.Constructor) Then
Emit\MethodSymbolAdapter.vb (2)
307Return AdaptedMethodSymbol.MethodKind = MethodKind.Constructor 547Dim result = Me.MethodKind = MethodKind.Constructor OrElse
Emit\NoPia\EmbeddedMethod.vb (1)
55Return UnderlyingMethod.AdaptedMethodSymbol.MethodKind = MethodKind.Constructor
Lowering\LambdaRewriter\LambdaFrameConstructor.vb (1)
25Return MethodKind.Constructor
Lowering\LambdaRewriter\LambdaRewriter.vb (2)
563If _innermostFramePointer.Kind = SymbolKind.Parameter AndAlso _topLevelMethod.MethodKind = MethodKind.Constructor AndAlso 1419If node.Method.MethodKind = MethodKind.Constructor AndAlso receiver IsNot Nothing AndAlso receiver.IsInstanceReference Then
Lowering\LocalRewriter\LocalRewriter_Conversion.vb (2)
978If memberSymbol.MethodKind = MethodKind.Constructor Then 1117If memberSymbol.MethodKind = MethodKind.Constructor Then
Semantics\OverloadResolution.vb (2)
972possiblyConstructor.MethodKind = MethodKind.Constructor AndAlso 3755DirectCast(candidate.Candidate.UnderlyingSymbol, MethodSymbol).MethodKind = MethodKind.Constructor AndAlso
SymbolDisplay\SymbolDisplayVisitor.Members.vb (3)
197Case MethodKind.Constructor, MethodKind.StaticConstructor 338Case MethodKind.Constructor, MethodKind.StaticConstructor 436Case MethodKind.Constructor,
Symbols\EmbeddedSymbols\EmbeddedSymbolManager.SymbolsCollection.vb (3)
240MethodKind.Constructor, 289MethodKind.Constructor 372Debug.Assert(kind = MethodKind.Constructor OrElse
Symbols\Metadata\PE\PEMethodSymbol.vb (5)
399Return MethodKind.Constructor 430Return _packedFlags.MethodKind = MethodKind.Constructor AndAlso ParameterCount = 0 445_packedFlags.MethodKind = MethodKind.Constructor 1272MethodKind = MethodKind.Constructor AndAlso 1372If MethodKind <> MethodKind.Constructor Then
Symbols\MethodSymbol.vb (3)
32Return Me.ParameterCount = 0 AndAlso Me.MethodKind = MethodKind.Constructor 458MethodKind.Constructor, 496Return Me.MethodKind = MethodKind.Constructor AndAlso Me.ContainingType.IsScriptClass
Symbols\NamedTypeSymbol.vb (1)
421Debug.Assert(method.MethodKind = MethodKind.Constructor)
Symbols\PropertySymbol.vb (1)
172If If(TryCast(containingMember, MethodSymbol)?.MethodKind <> MethodKind.Constructor, True) Then
Symbols\Source\OverrideHidingHelper.vb (1)
497Case MethodKind.LambdaMethod, MethodKind.Constructor, MethodKind.SharedConstructor
Symbols\Source\SourceDelegateMethodSymbol.vb (1)
198Return Me.MethodKind = MethodKind.Constructor
Symbols\Source\SourceMemberContainerTypeSymbol.vb (2)
2777(DirectCast(sym, MethodSymbol).MethodKind = MethodKind.Constructor OrElse 2782If method.MethodKind = MethodKind.Constructor AndAlso method.ParameterCount = 0 Then
Symbols\Source\SourceMethodSymbol.vb (2)
1991Case MethodKind.Constructor, 2286Case MethodKind.Constructor,
Symbols\Source\SourceNamedTypeSymbol.vb (2)
2650If method.MethodKind = MethodKind.Constructor AndAlso method.ParameterCount = 0 Then 2659If method.MethodKind = MethodKind.Constructor AndAlso method.CanBeCalledWithNoParameters() Then
Symbols\Symbol_Attributes.vb (1)
74Case MethodKind.Constructor,
Symbols\SymbolExtensions.vb (1)
263Return kind = MethodKind.Constructor OrElse kind = MethodKind.SharedConstructor
Symbols\SynthesizedSymbols\SynthesizedConstructorBase.vb (1)
192Return If(m_isShared, MethodKind.SharedConstructor, MethodKind.Constructor)
Symbols\SynthesizedSymbols\SynthesizedDelegateMethodSymbol.vb (1)
419Return Me.MethodKind = MethodKind.Constructor
Symbols\WellKnownMembers.vb (1)
435targetMethodKind = MethodKind.Constructor
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (1)
src\Analyzers\VisualBasic\CodeFixes\GenerateConstructor\VisualBasicGenerateConstructorService.vb (1)
183Return If(methodSymbol IsNot Nothing AndAlso methodSymbol.MethodKind = MethodKind.Constructor, methodSymbol, Nothing)
Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests (1)
Emit\EmitMetadata.vb (1)
785Assert.Equal(MethodKind.Constructor, ctor.MethodKind)
Microsoft.CodeAnalysis.VisualBasic.Features (2)
EditAndContinue\VisualBasicEditAndContinueAnalyzer.vb (1)
643If method Is Nothing OrElse (method.MethodKind <> MethodKind.Constructor AndAlso method.MethodKind <> MethodKind.SharedConstructor) Then
src\Analyzers\VisualBasic\CodeFixes\GenerateConstructor\VisualBasicGenerateConstructorService.vb (1)
183Return If(methodSymbol IsNot Nothing AndAlso methodSymbol.MethodKind = MethodKind.Constructor, methodSymbol, Nothing)
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (6)
DeclaringSyntaxNodeTests.vb (1)
514If memb.Kind = SymbolKind.Method AndAlso (DirectCast(memb, MethodSymbol)).MethodKind = MethodKind.Constructor Then
Semantics\GetExtendedSemanticInfoTests.vb (4)
4359Assert.Equal(MethodKind.Constructor, method.MethodKind) 4398Assert.Equal(MethodKind.Constructor, method.MethodKind) 4434Assert.Equal(MethodKind.Constructor, method.MethodKind) 4473Assert.Equal(MethodKind.Constructor, method.MethodKind)
Semantics\UsingStatementTest.vb (1)
345If (DirectCast(type.Symbol, MethodSymbol).MethodKind = MethodKind.Constructor) Then
Microsoft.CodeAnalysis.VisualBasic.Symbol.UnitTests (18)
SymbolsTests\AnonymousDelegates\AnonymousDelegates_CreationAndEmit.vb (1)
306Assert.Equal(MethodKind.Constructor, x16.GetMethod(".ctor").MethodKind)
SymbolsTests\CheckedUserDefinedOperatorsTests.vb (9)
179If m.MethodKind <> MethodKind.Constructor Then 188Dim operators = c0_3.GetMembers().OfType(Of IMethodSymbol)().Where(Function(m) m.MethodKind <> MethodKind.Constructor).ToArray() 254If m.MethodKind <> MethodKind.Constructor Then 366If m.MethodKind <> MethodKind.Constructor Then 375Dim operators = c0_3.GetMembers().OfType(Of IMethodSymbol)().Where(Function(m) m.MethodKind <> MethodKind.Constructor).ToArray() 437If m.MethodKind <> MethodKind.Constructor Then 545If m.MethodKind <> MethodKind.Constructor Then 554Dim operators = c0_3.GetMembers().OfType(Of IMethodSymbol)().Where(Function(m) m.MethodKind <> MethodKind.Constructor).ToArray() 612If m.MethodKind <> MethodKind.Constructor Then
SymbolsTests\Metadata\MetadataMemberTests.vb (2)
168Assert.Equal(MethodKind.Constructor, ctor.MethodKind) 732If m.MethodKind = MethodKind.Constructor Then
SymbolsTests\Metadata\PE\LoadingMethods.vb (1)
772Assert.Equal(If(m.Name = ".cctor", MethodKind.SharedConstructor, MethodKind.Constructor), DirectCast(m, MethodSymbol).MethodKind)
SymbolsTests\Source\MethodTests.vb (5)
67Assert.Equal(MethodKind.Constructor, ctor.MethodKind) 243Assert.Equal(MethodKind.Constructor, m1.MethodKind) 262Assert.Equal(MethodKind.Constructor, m2.MethodKind) 389Assert.Equal(MethodKind.Constructor, m1.MethodKind) 414Assert.Equal(MethodKind.Constructor, m2.MethodKind)
Microsoft.CodeAnalysis.VisualBasic.Workspaces (3)
CaseCorrection\VisualBasicCaseCorrectionService.Rewriter.vb (1)
169(symbol.IsKind(SymbolKind.Method) AndAlso DirectCast(symbol, IMethodSymbol).MethodKind = MethodKind.Constructor)
Classification\SyntaxClassification\NameSyntaxClassifier.vb (1)
212Case MethodKind.Constructor
Recommendations\VisualBasicRecommendationServiceRunner.vb (1)
382If method IsNot Nothing AndAlso method.MethodKind = MethodKind.Constructor Then
Microsoft.CodeAnalysis.Workspaces (13)
Editing\SyntaxGenerator.cs (2)
736case MethodKind.Constructor: 833case MethodKind.Constructor:
FindSymbols\FindReferences\Finders\ConstructorInitializerSymbolReferenceFinder.cs (1)
19=> symbol.MethodKind == MethodKind.Constructor;
FindSymbols\FindReferences\Finders\ConstructorSymbolReferenceFinder.cs (2)
25=> symbol.MethodKind is MethodKind.Constructor or MethodKind.StaticConstructor; 64if (symbol.MethodKind == MethodKind.Constructor)
Rename\RenameUtilities.cs (1)
361if (methodSymbol.MethodKind is MethodKind.Constructor 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\IParameterSymbolExtensions.cs (2)
30MethodKind: MethodKind.Constructor, 62MethodKind: MethodKind.Constructor,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.cs (1)
285=> symbol is IMethodSymbol { MethodKind: MethodKind.Constructor };
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationConstructorSymbol.cs (1)
34public override MethodKind MethodKind => MethodKind.Constructor;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationNamedTypeSymbol.cs (1)
174this.GetMembers().OfType<IMethodSymbol>().Where(m => m.MethodKind == MethodKind.Constructor && !m.IsStatic));
Microsoft.CodeAnalysis.Workspaces.UnitTests (2)
UtilityTest\DocumentationCommentIdTests.cs (2)
156CheckDeclarationId<IMethodSymbol>("M:Acme.Widget.#ctor", compilation, s => s.MethodKind == MethodKind.Constructor && s.Parameters.Length == 0); 157CheckDeclarationId<IMethodSymbol>("M:Acme.Widget.#ctor(System.String)", compilation, s => s.MethodKind == MethodKind.Constructor && s.Parameters.Length == 1);
Microsoft.Gen.Logging (1)
Parsing\Parser.Records.cs (1)
73if (m is not IMethodSymbol { MethodKind: MethodKind.Constructor } ctorMethod)
Microsoft.VisualStudio.LanguageServices (5)
Implementation\VsRefactorNotifyService.cs (1)
165if (methodSymbol.MethodKind is MethodKind.Constructor or
Library\ObjectBrowser\AbstractListItemFactory.cs (1)
347if (methodSymbol.MethodKind is MethodKind.Destructor or MethodKind.Constructor ||
Progression\GraphBuilder.cs (2)
386if (methodSymbol.MethodKind == MethodKind.Constructor) 531case MethodKind.Constructor:
Progression\GraphQueries\CallsGraphQuery.cs (1)
55(newSymbol.CanBeReferencedByName || ((IMethodSymbol)newSymbol).MethodKind == MethodKind.Constructor))
Microsoft.VisualStudio.LanguageServices.CSharp (2)
CodeModel\CSharpCodeModelService.cs (1)
2194case MethodKind.Constructor:
ObjectBrowser\DescriptionBuilder.cs (1)
190if (methodSymbol.MethodKind is not MethodKind.Constructor and
Microsoft.VisualStudio.LanguageServices.UnitTests (2)
CommonControls\NewTypeDestinationSelectionViewModelTests.vb (1)
238Dim extractableMembers = DirectCast(symbol, INamedTypeSymbol).GetMembers().Where(Function(s) Not (TypeOf s Is IMethodSymbol) OrElse DirectCast(s, IMethodSymbol).MethodKind <> MethodKind.Constructor)
ExtractInterface\ExtractInterfaceViewModelTests.vb (1)
301Dim extractableMembers = DirectCast(symbol, INamedTypeSymbol).GetMembers().Where(Function(s) Not (TypeOf s Is IMethodSymbol) OrElse DirectCast(s, IMethodSymbol).MethodKind <> MethodKind.Constructor)
Microsoft.VisualStudio.LanguageServices.VisualBasic (1)
CodeModel\VisualBasicCodeModelService.vb (1)
2548Case MethodKind.Constructor,