466 references to Delegate
GenerateDocumentationAndConfigFiles (13)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IMethodSymbolExtensions.cs (1)
528=> methodSymbol.Parameters.Any(p => p.Type.TypeKind == TypeKind.Delegate);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.Walker.cs (1)
410symbol.GetSymbolType()?.TypeKind != TypeKind.Delegate)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\EditorConfig\EditorConfigNamingStyleParser_SymbolSpec.cs (2)
113private static readonly SymbolKindOrTypeKind s_delegate = new(TypeKind.Delegate); 341case TypeKind.Delegate:
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SymbolSpecification.cs (1)
65new SymbolKindOrTypeKind(TypeKind.Delegate),
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (2)
308=> symbol is ITypeSymbol { TypeKind: TypeKind.Delegate }; 696if (!methods.Any(x => x.Name == WellKnownMemberNames.OnCompleted && x.ReturnsVoid && x.Parameters is [{ Type.TypeKind: TypeKind.Delegate }]))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (2)
84=> symbol?.TypeKind == TypeKind.Delegate; 262case TypeKind.Delegate:
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (1)
513if (x.TypeKind == TypeKind.Delegate)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (1)
195if (x.TypeKind == TypeKind.Delegate)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationSymbolFactory.cs (1)
488typeKind: TypeKind.Delegate,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationNamedTypeSymbol.cs (1)
95return this.TypeKind == TypeKind.Delegate
Metrics (12)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.NamedTypeMetricData.cs (1)
148case TypeKind.Delegate:
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IMethodSymbolExtensions.cs (1)
528=> methodSymbol.Parameters.Any(p => p.Type.TypeKind == TypeKind.Delegate);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.Walker.cs (1)
410symbol.GetSymbolType()?.TypeKind != TypeKind.Delegate)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\EditorConfig\EditorConfigNamingStyleParser_SymbolSpec.cs (2)
113private static readonly SymbolKindOrTypeKind s_delegate = new(TypeKind.Delegate); 341case TypeKind.Delegate:
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SymbolSpecification.cs (1)
65new SymbolKindOrTypeKind(TypeKind.Delegate),
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (2)
308=> symbol is ITypeSymbol { TypeKind: TypeKind.Delegate }; 696if (!methods.Any(x => x.Name == WellKnownMemberNames.OnCompleted && x.ReturnsVoid && x.Parameters is [{ Type.TypeKind: TypeKind.Delegate }]))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (2)
84=> symbol?.TypeKind == TypeKind.Delegate; 262case TypeKind.Delegate:
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (1)
513if (x.TypeKind == TypeKind.Delegate)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (1)
195if (x.TypeKind == TypeKind.Delegate)
Metrics.Legacy (12)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.NamedTypeMetricData.cs (1)
148case TypeKind.Delegate:
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IMethodSymbolExtensions.cs (1)
528=> methodSymbol.Parameters.Any(p => p.Type.TypeKind == TypeKind.Delegate);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.Walker.cs (1)
410symbol.GetSymbolType()?.TypeKind != TypeKind.Delegate)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\EditorConfig\EditorConfigNamingStyleParser_SymbolSpec.cs (2)
113private static readonly SymbolKindOrTypeKind s_delegate = new(TypeKind.Delegate); 341case TypeKind.Delegate:
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SymbolSpecification.cs (1)
65new SymbolKindOrTypeKind(TypeKind.Delegate),
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (2)
308=> symbol is ITypeSymbol { TypeKind: TypeKind.Delegate }; 696if (!methods.Any(x => x.Name == WellKnownMemberNames.OnCompleted && x.ReturnsVoid && x.Parameters is [{ Type.TypeKind: TypeKind.Delegate }]))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (2)
84=> symbol?.TypeKind == TypeKind.Delegate; 262case TypeKind.Delegate:
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (1)
513if (x.TypeKind == TypeKind.Delegate)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (1)
195if (x.TypeKind == TypeKind.Delegate)
Microsoft.Analyzers.Local (1)
ApiLifecycle\AssemblyAnalysis.cs (1)
195if (type.TypeKind != TypeKind.Delegate)
Microsoft.CodeAnalysis.Analyzers (14)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.NamedTypeMetricData.cs (1)
148case TypeKind.Delegate:
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IMethodSymbolExtensions.cs (1)
528=> methodSymbol.Parameters.Any(p => p.Type.TypeKind == TypeKind.Delegate);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.Walker.cs (1)
410symbol.GetSymbolType()?.TypeKind != TypeKind.Delegate)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\EditorConfig\EditorConfigNamingStyleParser_SymbolSpec.cs (2)
113private static readonly SymbolKindOrTypeKind s_delegate = new(TypeKind.Delegate); 341case TypeKind.Delegate:
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SymbolSpecification.cs (1)
65new SymbolKindOrTypeKind(TypeKind.Delegate),
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (2)
308=> symbol is ITypeSymbol { TypeKind: TypeKind.Delegate }; 696if (!methods.Any(x => x.Name == WellKnownMemberNames.OnCompleted && x.ReturnsVoid && x.Parameters is [{ Type.TypeKind: TypeKind.Delegate }]))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (2)
84=> symbol?.TypeKind == TypeKind.Delegate; 262case TypeKind.Delegate:
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (1)
513if (x.TypeKind == TypeKind.Delegate)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (1)
195if (x.TypeKind == TypeKind.Delegate)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationSymbolFactory.cs (1)
488typeKind: TypeKind.Delegate,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationNamedTypeSymbol.cs (1)
95return this.TypeKind == TypeKind.Delegate
Microsoft.CodeAnalysis.AnalyzerUtilities (14)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.NamedTypeMetricData.cs (1)
148case TypeKind.Delegate:
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IMethodSymbolExtensions.cs (1)
528=> methodSymbol.Parameters.Any(p => p.Type.TypeKind == TypeKind.Delegate);
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\DataFlowOperationVisitor.cs (2)
2404if (argument.Parameter?.Type.TypeKind == TypeKind.Delegate || 2411if (argument.Parameter.Type.TypeKind == TypeKind.Delegate)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.Walker.cs (1)
410symbol.GetSymbolType()?.TypeKind != TypeKind.Delegate)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\EditorConfig\EditorConfigNamingStyleParser_SymbolSpec.cs (2)
113private static readonly SymbolKindOrTypeKind s_delegate = new(TypeKind.Delegate); 341case TypeKind.Delegate:
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SymbolSpecification.cs (1)
65new SymbolKindOrTypeKind(TypeKind.Delegate),
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (2)
308=> symbol is ITypeSymbol { TypeKind: TypeKind.Delegate }; 696if (!methods.Any(x => x.Name == WellKnownMemberNames.OnCompleted && x.ReturnsVoid && x.Parameters is [{ Type.TypeKind: TypeKind.Delegate }]))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (2)
84=> symbol?.TypeKind == TypeKind.Delegate; 262case TypeKind.Delegate:
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (1)
513if (x.TypeKind == TypeKind.Delegate)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (1)
195if (x.TypeKind == TypeKind.Delegate)
Microsoft.CodeAnalysis.BannedApiAnalyzers (14)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.NamedTypeMetricData.cs (1)
148case TypeKind.Delegate:
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IMethodSymbolExtensions.cs (1)
528=> methodSymbol.Parameters.Any(p => p.Type.TypeKind == TypeKind.Delegate);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.Walker.cs (1)
410symbol.GetSymbolType()?.TypeKind != TypeKind.Delegate)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\EditorConfig\EditorConfigNamingStyleParser_SymbolSpec.cs (2)
113private static readonly SymbolKindOrTypeKind s_delegate = new(TypeKind.Delegate); 341case TypeKind.Delegate:
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SymbolSpecification.cs (1)
65new SymbolKindOrTypeKind(TypeKind.Delegate),
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (2)
308=> symbol is ITypeSymbol { TypeKind: TypeKind.Delegate }; 696if (!methods.Any(x => x.Name == WellKnownMemberNames.OnCompleted && x.ReturnsVoid && x.Parameters is [{ Type.TypeKind: TypeKind.Delegate }]))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (2)
84=> symbol?.TypeKind == TypeKind.Delegate; 262case TypeKind.Delegate:
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (1)
513if (x.TypeKind == TypeKind.Delegate)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (1)
195if (x.TypeKind == TypeKind.Delegate)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationSymbolFactory.cs (1)
488typeKind: TypeKind.Delegate,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationNamedTypeSymbol.cs (1)
95return this.TypeKind == TypeKind.Delegate
Microsoft.CodeAnalysis.CodeStyle (10)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.Walker.cs (1)
410symbol.GetSymbolType()?.TypeKind != TypeKind.Delegate)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\EditorConfig\EditorConfigNamingStyleParser_SymbolSpec.cs (2)
113private static readonly SymbolKindOrTypeKind s_delegate = new(TypeKind.Delegate); 341case TypeKind.Delegate:
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SymbolSpecification.cs (1)
65new SymbolKindOrTypeKind(TypeKind.Delegate),
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (2)
308=> symbol is ITypeSymbol { TypeKind: TypeKind.Delegate }; 696if (!methods.Any(x => x.Name == WellKnownMemberNames.OnCompleted && x.ReturnsVoid && x.Parameters is [{ Type.TypeKind: TypeKind.Delegate }]))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (2)
84=> symbol?.TypeKind == TypeKind.Delegate; 262case TypeKind.Delegate:
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (1)
513if (x.TypeKind == TypeKind.Delegate)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (1)
195if (x.TypeKind == TypeKind.Delegate)
Microsoft.CodeAnalysis.CodeStyle.Fixes (2)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationSymbolFactory.cs (1)
488typeKind: TypeKind.Delegate,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationNamedTypeSymbol.cs (1)
95return this.TypeKind == TypeKind.Delegate
Microsoft.CodeAnalysis.CSharp (69)
Binder\Binder_Constraints.cs (1)
610case TypeKind.Delegate:
Binder\Binder_Conversions.cs (5)
786case TypeKind.Delegate: 2810Debug.Assert(delegateType is NamedTypeSymbol { TypeKind: TypeKind.Delegate, DelegateInvokeMethod: { HasUseSiteError: false } } 2956TypeKind.Delegate => ErrorCode.ERR_MethDelegateMismatch, 2964TypeKind.Delegate => ErrorCode.ERR_DelegateRefMismatch, 3001Debug.Assert(Conversions.IsAssignableFromMulticastDelegate(delegateOrFuncPtrType, ref discardedUseSiteInfo) || delegateOrFuncPtrType.TypeKind == TypeKind.Delegate || delegateOrFuncPtrType.TypeKind == TypeKind.FunctionPointer);
Binder\Binder_Crefs.cs (1)
774case TypeKind.Delegate:
Binder\Binder_Expressions.cs (4)
2848if (targetType.TypeKind != TypeKind.Delegate || 2902TypeKind.Delegate => ErrorCode.ERR_CannotConvertAddressOfToDelegate, 5245case TypeKind.Delegate: 5490else if (argument.Type.TypeKind == TypeKind.Delegate)
Binder\Binder_Lookup.cs (2)
258case TypeKind.Delegate: 1947case TypeKind.Delegate:
Binder\Binder_Operators.cs (1)
1276(object)left.Type != null && left.Type.TypeKind == TypeKind.Delegate)
Binder\Binder_Statements.cs (2)
2513case TypeKind.Delegate when fromAddressOf: 2516case TypeKind.Delegate:
Binder\Semantics\Conversions\ConversionsBase.cs (1)
2664case TypeKind.Delegate:
Binder\Semantics\OverloadResolution\OverloadResolutionResult.cs (1)
1222else if (argument.Kind == BoundKind.MethodGroup && parameterType.TypeKind == TypeKind.Delegate &&
Compilation\CSharpCompilation.cs (1)
4390if (csharpLeftType.TypeKind is TypeKind.Delegate &&
Compiler\ClsComplianceChecker.cs (4)
254if (symbol.TypeKind == TypeKind.Delegate) 474if (type.TypeKind == TypeKind.Delegate) 738System.Diagnostics.Debug.Assert(method.ContainingType.TypeKind == TypeKind.Delegate); 1003case TypeKind.Delegate:
Emitter\Model\MethodSymbolAdapter.cs (1)
635return this.IsExtern || (object)ContainingType != null && ContainingType.TypeKind == TypeKind.Delegate;
Emitter\Model\NamedTypeSymbolAdapter.cs (1)
524case TypeKind.Delegate:
Emitter\NoPia\EmbeddedType.cs (1)
159case TypeKind.Delegate:
Emitter\NoPia\EmbeddedTypesManager.cs (3)
293case TypeKind.Delegate: 400Debug.Assert(namedType.TypeKind == TypeKind.Struct || namedType.TypeKind == TypeKind.Enum || namedType.TypeKind == TypeKind.Delegate); 456if (containerKind == TypeKind.Interface || containerKind == TypeKind.Delegate ||
FlowAnalysis\NullableWalker.cs (2)
9501NamedTypeSymbol { TypeKind: TypeKind.Delegate, DelegateInvokeMethod: { Parameters: { } parameters } signature } => (signature, parameters), 10260case BoundExpression arg when arg.Type is { TypeKind: TypeKind.Delegate }:
Lowering\ClosureConversion\ExpressionLambdaRewriter.cs (1)
799if ((object)d != null && d.TypeKind == TypeKind.Delegate)
SymbolDisplay\SymbolDisplayVisitor.Types.cs (6)
328if (symbol.IsAnonymousType && symbol.TypeKind != TypeKind.Delegate) 381if (symbolName is null && symbol.IsAnonymousType && symbol.TypeKind == TypeKind.Delegate) 629symbol.TypeKind == TypeKind.Delegate && 646case TypeKind.Delegate: 724if (symbol.IsAnonymousType && symbol.TypeKind != TypeKind.Delegate) 770case TypeKind.Delegate:
Symbols\AnonymousTypes\PublicSymbols\AnonymousType.DelegatePublicSymbol.cs (1)
37public override TypeKind TypeKind => TypeKind.Delegate;
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.DelegateTemplateSymbol.cs (1)
227public override TypeKind TypeKind => TypeKind.Delegate;
Symbols\ConstraintsHelper.cs (3)
221case TypeKind.Delegate: 223Debug.Assert(inherited || currentCompilation == null || constraintType.TypeKind != TypeKind.Delegate); 1569case TypeKind.Delegate:
Symbols\EnumConversions.cs (1)
27return TypeKind.Delegate;
Symbols\Metadata\PE\MetadataDecoder.cs (1)
411case TypeKind.Delegate:
Symbols\Metadata\PE\NativeIntegerTypeDecoder.cs (1)
98case TypeKind.Delegate:
Symbols\Metadata\PE\PEMethodSymbol.cs (1)
1324if (_containingType.TypeKind == TypeKind.Delegate)
Symbols\Metadata\PE\PENamedTypeSymbol.cs (2)
1992case TypeKind.Delegate: 2055result = TypeKind.Delegate;
Symbols\NamedTypeSymbol.cs (1)
179if (TypeKind != TypeKind.Delegate)
Symbols\Source\SourceMemberContainerSymbol.cs (3)
350case TypeKind.Delegate: 385case TypeKind.Delegate: 2540if (this.TypeKind is TypeKind.Delegate or TypeKind.Extension)
Symbols\Source\SourceMemberContainerSymbol_ImplementationChecks.cs (1)
514case TypeKind.Delegate:
Symbols\Source\SourceNamedTypeSymbol.cs (1)
817case TypeKind.Delegate:
Symbols\Source\SourceNamedTypeSymbol_Bases.cs (3)
44TypeKind is not (TypeKind.Enum or TypeKind.Delegate or TypeKind.Submission)) 521baseType.TypeKind == TypeKind.Delegate || 749case TypeKind.Delegate:
Symbols\Symbol_Attributes.cs (1)
73case TypeKind.Delegate:
Symbols\Synthesized\SynthesizedInstanceConstructor.cs (1)
88if (_containingType.TypeKind == TypeKind.Delegate)
Symbols\TypeSymbolExtensions.cs (6)
571return type.TypeKind == TypeKind.Delegate; 706case TypeKind.Delegate: 781case TypeKind.Delegate: 848goto case TypeKind.Delegate; 854case TypeKind.Delegate: 1516case TypeKind.Delegate:
Symbols\VarianceSafety.cs (2)
83case TypeKind.Delegate: 377case TypeKind.Delegate:
Utilities\TypeSymbolExtensions.cs (1)
194case TypeKind.Delegate:
Microsoft.CodeAnalysis.CSharp.CodeStyle (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (2)
253if (originalDelegateCreationOperation.Type?.TypeKind != TypeKind.Delegate) 270if (rewrittenDelegateCreationOperation.Type?.TypeKind != TypeKind.Delegate)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (5)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\NamedTypeGenerator.cs (2)
96if (info.Context.GenerateMembers && namedType.TypeKind != TypeKind.Delegate) 192else if (namedType.TypeKind == TypeKind.Delegate)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (3)
443if (type.TypeKind == TypeKind.Delegate) 1033if (parentTypes.Any(static parentType => parentType.InferredType.SpecialType == SpecialType.System_String || parentType.InferredType.TypeKind == TypeKind.Delegate)) 1035return parentTypes.Where(parentType => parentType.InferredType.SpecialType == SpecialType.System_String || parentType.InferredType.TypeKind == TypeKind.Delegate);
Microsoft.CodeAnalysis.CSharp.CodeStyle.UnitTests (1)
src\Analyzers\CSharp\Tests\NamingStyles\NamingStylesTests.cs (1)
226[InlineData("delegate void [|c2|]();", "delegate void C2();", TypeKind.Delegate, Accessibility.Private)]
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (29)
CodeActions\GenerateType\GenerateTypeTests_Dialog.cs (28)
2554typeKind: TypeKind.Delegate, 2591typeKind: TypeKind.Delegate, 2626typeKind: TypeKind.Delegate, 2661typeKind: TypeKind.Delegate, 2696typeKind: TypeKind.Delegate, 2727typeKind: TypeKind.Delegate, 2758typeKind: TypeKind.Delegate, 2790typeKind: TypeKind.Delegate, 2827typeKind: TypeKind.Delegate, 2864typeKind: TypeKind.Delegate, 2899typeKind: TypeKind.Delegate, 2934typeKind: TypeKind.Delegate, 2966typeKind: TypeKind.Delegate, 2997typeKind: TypeKind.Delegate, 3034typeKind: TypeKind.Delegate, 3071typeKind: TypeKind.Delegate, 3106typeKind: TypeKind.Delegate, 3141typeKind: TypeKind.Delegate, 3173typeKind: TypeKind.Delegate, 3204typeKind: TypeKind.Delegate, 3240typeKind: TypeKind.Delegate, 3273typeKind: TypeKind.Delegate, 3613typeKind: TypeKind.Delegate, 3640typeKind: TypeKind.Delegate, 3677typeKind: TypeKind.Delegate, 3706typeKind: TypeKind.Delegate, 3819typeKind: TypeKind.Delegate, 3860typeKind: TypeKind.Delegate,
SymbolKey\SymbolKeyTestBase.cs (1)
408else if (tinfo.Type != null && tinfo.Type.TypeKind != TypeKind.Delegate)
Microsoft.CodeAnalysis.CSharp.Features (6)
ChangeSignature\CSharpChangeSignatureService.cs (1)
166if (typeSymbol != null && typeSymbol.IsKind(SymbolKind.NamedType) && ((ITypeSymbol)typeSymbol).TypeKind == TypeKind.Delegate)
Completion\CompletionProviders\NamedParameterCompletionProvider.cs (1)
174if (semanticModel.GetTypeInfo(objectCreationExpression, cancellationToken).Type is INamedTypeSymbol type && within != null && type.TypeKind != TypeKind.Delegate)
SignatureHelp\InvocationExpressionSignatureHelpProvider.cs (2)
81if (invokedType is INamedTypeSymbol { TypeKind: TypeKind.Delegate } or IFunctionPointerTypeSymbol) 129if (invokedType is INamedTypeSymbol { TypeKind: TypeKind.Delegate } expressionType)
SignatureHelp\ObjectCreationExpressionSignatureHelpProvider.cs (2)
77if (type.TypeKind == TypeKind.Delegate) 114Debug.Assert(type.TypeKind == TypeKind.Delegate);
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (1)
src\Analyzers\CSharp\Tests\NamingStyles\NamingStylesTests.cs (1)
226[InlineData("delegate void [|c2|]();", "delegate void C2();", TypeKind.Delegate, Accessibility.Private)]
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (10)
Semantics\NullableReferenceTypesTests.cs (4)
116686Assert.Equal(TypeKind.Delegate, compilation1.GetTypeByMetadataName("D").TypeKind); 116706Assert.Equal(TypeKind.Delegate, compilation2.GetTypeByMetadataName("D").TypeKind); 116717Assert.Equal(TypeKind.Delegate, compilation3.GetTypeByMetadataName("D").TypeKind); 116826Assert.Equal(TypeKind.Delegate, compilation7.GetTypeByMetadataName("D").TypeKind);
Semantics\ScriptSemanticsTests.cs (1)
475Assert.Equal(TypeKind.Delegate, members[0].TypeKind);
Semantics\UseSiteErrorTests.cs (5)
2312Assert.Equal(TypeKind.Delegate, compilation1.GetTypeByMetadataName("D").TypeKind); 2330Assert.Equal(TypeKind.Delegate, compilation2.GetTypeByMetadataName("D").TypeKind); 2341Assert.Equal(TypeKind.Delegate, compilation3.GetTypeByMetadataName("D").TypeKind); 2386Assert.Equal(TypeKind.Delegate, compilation5.GetTypeByMetadataName("D").TypeKind); 2427Assert.Equal(TypeKind.Delegate, compilation7.GetTypeByMetadataName("D").TypeKind);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (18)
Compilation\SemanticModelGetSemanticInfoTests.cs (14)
5657Assert.Equal(TypeKind.Delegate, semanticInfo.ConvertedType.TypeKind); 6436Assert.Equal(TypeKind.Delegate, semanticInfo.ConvertedType.TypeKind); 7168Assert.Equal(TypeKind.Delegate, semanticInfo.Type.TypeKind); 7170Assert.Equal(TypeKind.Delegate, semanticInfo.ConvertedType.TypeKind); 7232Assert.Equal(TypeKind.Delegate, semanticInfo.Type.TypeKind); 7234Assert.Equal(TypeKind.Delegate, semanticInfo.ConvertedType.TypeKind); 7850Assert.Equal(TypeKind.Delegate, semanticInfo.Type.TypeKind); 7852Assert.Equal(TypeKind.Delegate, semanticInfo.ConvertedType.TypeKind); 7916Assert.Equal(TypeKind.Delegate, semanticInfo.Type.TypeKind); 7918Assert.Equal(TypeKind.Delegate, semanticInfo.ConvertedType.TypeKind); 7982Assert.Equal(TypeKind.Delegate, semanticInfo.Type.TypeKind); 7984Assert.Equal(TypeKind.Delegate, semanticInfo.ConvertedType.TypeKind); 10712Assert.Equal(TypeKind.Delegate, semanticInfo.Type.TypeKind); 10714Assert.Equal(TypeKind.Delegate, semanticInfo.ConvertedType.TypeKind);
Symbols\Metadata\PE\TypeKindTests.cs (1)
58Assert.Equal(TypeKind.Delegate, func.TypeKind);
Symbols\Source\DelegateTests.cs (3)
110Assert.Equal(TypeKind.Delegate, fieldType.TypeKind); 130Assert.Equal(TypeKind.Delegate, v.TypeKind); 208Assert.Equal(TypeKind.Delegate, d.TypeKind);
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (1)
Parsing\ReadOnlyStructs.cs (1)
128Assert.Equal(TypeKind.Delegate, s2.TypeKind);
Microsoft.CodeAnalysis.CSharp.Test.Utilities (4)
Extensions.cs (2)
473if ((typeSym.TypeKind == TypeKind.Interface || typeSym.TypeKind == TypeKind.Class || typeSym.TypeKind == TypeKind.Struct || typeSym.TypeKind == TypeKind.Delegate)) 718return type.TypeKind == TypeKind.Delegate;
UsesIsNullableVisitor.cs (2)
171case TypeKind.Delegate: 186case TypeKind.Delegate:
Microsoft.CodeAnalysis.CSharp.Workspaces (7)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (2)
253if (originalDelegateCreationOperation.Type?.TypeKind != TypeKind.Delegate) 270if (rewrittenDelegateCreationOperation.Type?.TypeKind != TypeKind.Delegate)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\NamedTypeGenerator.cs (2)
96if (info.Context.GenerateMembers && namedType.TypeKind != TypeKind.Delegate) 192else if (namedType.TypeKind == TypeKind.Delegate)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (3)
443if (type.TypeKind == TypeKind.Delegate) 1033if (parentTypes.Any(static parentType => parentType.InferredType.SpecialType == SpecialType.System_String || parentType.InferredType.TypeKind == TypeKind.Delegate)) 1035return parentTypes.Where(parentType => parentType.InferredType.SpecialType == SpecialType.System_String || parentType.InferredType.TypeKind == TypeKind.Delegate);
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (1)
SymbolFinder\SymbolFinderTests.cs (1)
585var delegates = transitiveImpls.Where(i => i.TypeKind == TypeKind.Delegate);
Microsoft.CodeAnalysis.Extensions.Package (6)
Symbols\ISymbolExtensions.cs (2)
308=> symbol is ITypeSymbol { TypeKind: TypeKind.Delegate }; 696if (!methods.Any(x => x.Name == WellKnownMemberNames.OnCompleted && x.ReturnsVoid && x.Parameters is [{ Type.TypeKind: TypeKind.Delegate }]))
Symbols\ITypeSymbolExtensions.cs (2)
84=> symbol?.TypeKind == TypeKind.Delegate; 262case TypeKind.Delegate:
Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (1)
513if (x.TypeKind == TypeKind.Delegate)
Symbols\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (1)
195if (x.TypeKind == TypeKind.Delegate)
Microsoft.CodeAnalysis.Features (10)
Completion\Providers\AbstractObjectInitializerCompletionProvider.cs (1)
165return type.TypeKind is not (TypeKind.Delegate or TypeKind.Struct or TypeKind.FunctionPointer or TypeKind.Pointer);
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (6)
292return (symbol is IParameterSymbol { ContainingType: not { TypeKind: TypeKind.Delegate } }) 333TypeKind.Delegate => FeaturesResources.delegate_, 3448if (oldSymbol is not INamedTypeSymbol { TypeKind: TypeKind.Delegate }) 3715=> IsMember(symbol) || symbol is INamedTypeSymbol { TypeKind: TypeKind.Delegate }; 4762newParameter.ContainingType is INamedTypeSymbol { TypeKind: TypeKind.Delegate } newContainingDelegateType) 4770if (hasReturnTypeAttributeChange && newSymbol is INamedTypeSymbol { TypeKind: TypeKind.Delegate } newDelegateType)
GenerateType\AbstractGenerateTypeService.GenerateNamedType.cs (1)
43if (options.TypeKind == TypeKind.Delegate)
LanguageServices\SymbolDisplayService\AbstractSymbolDisplayService.AbstractSymbolDescriptionBuilder.cs (1)
543if (symbol.TypeKind == TypeKind.Delegate)
Shared\Extensions\ISymbolExtensions_2.cs (1)
65case TypeKind.Delegate:
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (14)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.NamedTypeMetricData.cs (1)
148case TypeKind.Delegate:
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IMethodSymbolExtensions.cs (1)
528=> methodSymbol.Parameters.Any(p => p.Type.TypeKind == TypeKind.Delegate);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.Walker.cs (1)
410symbol.GetSymbolType()?.TypeKind != TypeKind.Delegate)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\EditorConfig\EditorConfigNamingStyleParser_SymbolSpec.cs (2)
113private static readonly SymbolKindOrTypeKind s_delegate = new(TypeKind.Delegate); 341case TypeKind.Delegate:
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SymbolSpecification.cs (1)
65new SymbolKindOrTypeKind(TypeKind.Delegate),
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (2)
308=> symbol is ITypeSymbol { TypeKind: TypeKind.Delegate }; 696if (!methods.Any(x => x.Name == WellKnownMemberNames.OnCompleted && x.ReturnsVoid && x.Parameters is [{ Type.TypeKind: TypeKind.Delegate }]))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (2)
84=> symbol?.TypeKind == TypeKind.Delegate; 262case TypeKind.Delegate:
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (1)
513if (x.TypeKind == TypeKind.Delegate)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (1)
195if (x.TypeKind == TypeKind.Delegate)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationSymbolFactory.cs (1)
488typeKind: TypeKind.Delegate,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationNamedTypeSymbol.cs (1)
95return this.TypeKind == TypeKind.Delegate
Microsoft.CodeAnalysis.PublicApiAnalyzers (13)
DeclarePublicApiAnalyzer.Impl.cs (1)
798if (methodSymbol is { ContainingType.TypeKind: TypeKind.Delegate, MethodKind: not MethodKind.DelegateInvoke })
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.NamedTypeMetricData.cs (1)
148case TypeKind.Delegate:
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IMethodSymbolExtensions.cs (1)
528=> methodSymbol.Parameters.Any(p => p.Type.TypeKind == TypeKind.Delegate);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.Walker.cs (1)
410symbol.GetSymbolType()?.TypeKind != TypeKind.Delegate)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\EditorConfig\EditorConfigNamingStyleParser_SymbolSpec.cs (2)
113private static readonly SymbolKindOrTypeKind s_delegate = new(TypeKind.Delegate); 341case TypeKind.Delegate:
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SymbolSpecification.cs (1)
65new SymbolKindOrTypeKind(TypeKind.Delegate),
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (2)
308=> symbol is ITypeSymbol { TypeKind: TypeKind.Delegate }; 696if (!methods.Any(x => x.Name == WellKnownMemberNames.OnCompleted && x.ReturnsVoid && x.Parameters is [{ Type.TypeKind: TypeKind.Delegate }]))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (2)
84=> symbol?.TypeKind == TypeKind.Delegate; 262case TypeKind.Delegate:
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (1)
513if (x.TypeKind == TypeKind.Delegate)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (1)
195if (x.TypeKind == TypeKind.Delegate)
Microsoft.CodeAnalysis.ResxSourceGenerator (12)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.NamedTypeMetricData.cs (1)
148case TypeKind.Delegate:
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IMethodSymbolExtensions.cs (1)
528=> methodSymbol.Parameters.Any(p => p.Type.TypeKind == TypeKind.Delegate);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.Walker.cs (1)
410symbol.GetSymbolType()?.TypeKind != TypeKind.Delegate)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\EditorConfig\EditorConfigNamingStyleParser_SymbolSpec.cs (2)
113private static readonly SymbolKindOrTypeKind s_delegate = new(TypeKind.Delegate); 341case TypeKind.Delegate:
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SymbolSpecification.cs (1)
65new SymbolKindOrTypeKind(TypeKind.Delegate),
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (2)
308=> symbol is ITypeSymbol { TypeKind: TypeKind.Delegate }; 696if (!methods.Any(x => x.Name == WellKnownMemberNames.OnCompleted && x.ReturnsVoid && x.Parameters is [{ Type.TypeKind: TypeKind.Delegate }]))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (2)
84=> symbol?.TypeKind == TypeKind.Delegate; 262case TypeKind.Delegate:
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (1)
513if (x.TypeKind == TypeKind.Delegate)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (1)
195if (x.TypeKind == TypeKind.Delegate)
Microsoft.CodeAnalysis.VisualBasic (69)
Binding\Binder_Conversions.vb (4)
790Case TypeKind.Delegate 1231If targetType.TypeKind <> TypeKind.Delegate AndAlso targetType.TypeKind <> TypeKind.Error Then 1383If(targetDelegateType.TypeKind = TypeKind.Delegate AndAlso targetDelegateType.IsFromCompilation(Me.Compilation), 1435If(targetDelegateType.TypeKind = TypeKind.Delegate AndAlso targetDelegateType.IsFromCompilation(Me.Compilation),
Binding\Binder_Delegates.vb (1)
234ElseIf targetType.TypeKind <> TypeKind.Delegate Then
Binding\Binder_Invocation.vb (1)
288ElseIf targetType.Kind = SymbolKind.NamedType AndAlso targetType.TypeKind = TypeKind.Delegate Then
Binding\Binder_Lookup.vb (2)
580Case TypeKind.Class, TypeKind.Module, TypeKind.Structure, TypeKind.Delegate, TypeKind.Array, TypeKind.Enum 606Case TypeKind.Class, TypeKind.Structure, TypeKind.Delegate, TypeKind.Array, TypeKind.Enum
Binding\Binder_ObjectInitializer.vb (2)
80Case TypeKind.Delegate 240TypeKind.Delegate,
Binding\BinderFactory.vb (1)
395containingType.TypeKind = TypeKind.Delegate Then
Binding\DocumentationCommentBinder.vb (1)
44If commentedNamedType IsNot Nothing AndAlso commentedNamedType.TypeKind <> TypeKind.Delegate Then
Binding\DocumentationCommentParamBinder.vb (1)
30If namedType.TypeKind = TypeKind.Delegate Then
Compilation\ClsComplianceChecker.vb (4)
186If symbol.TypeKind = TypeKind.Delegate Then 439If type.TypeKind = TypeKind.Delegate AndAlso type.IsImplicitlyDeclared AndAlso TryCast(type, NamedTypeSymbol)?.AssociatedSymbol Is symbol Then 595Case TypeKind.Class, TypeKind.Structure, TypeKind.Interface, TypeKind.Delegate, TypeKind.Enum, TypeKind.Submission, TypeKind.Module 621Case TypeKind.Class, TypeKind.Structure, TypeKind.Interface, TypeKind.Delegate, TypeKind.Enum, TypeKind.Submission, TypeKind.Module
Compilation\DocumentationComments\DocumentationCommentCompiler.Common.vb (2)
739Case TypeKind.Delegate 768If namedType.TypeKind <> TypeKind.Delegate Then
Compilation\DocumentationComments\DocumentationCommentCompiler.Includes.vb (2)
123If namedType.TypeKind = TYPEKIND.Delegate Then 131Me.ParamAndParamRefSupported = namedType.TypeKind = TYPEKIND.Delegate
Compilation\DocumentationComments\DocumentationCommentCompiler.NamedType.vb (2)
107If namedType.TypeKind = TypeKind.Delegate Then 116If namedType.TypeKind = TypeKind.Delegate Then
Compilation\SyntaxTreeSemanticModel.vb (1)
1080Debug.Assert(typeSymbol.TypeKind = TYPEKIND.Delegate)
Emit\NamedTypeSymbolAdapter.vb (1)
462Case TypeKind.Enum, TypeKind.Interface, TypeKind.Delegate
Emit\NoPia\EmbeddedType.vb (1)
128Case TypeKind.Enum, TypeKind.Delegate, TypeKind.Interface
Emit\NoPia\EmbeddedTypesManager.vb (3)
238TypeKind.Delegate 333namedType.TypeKind = TypeKind.Delegate) 383containerKind = TypeKind.Delegate OrElse
Lowering\ExpressionLambdaRewriter\ExpressionLambdaRewriter.vb (1)
461Debug.Assert(delegateType.TypeKind = TYPEKIND.Delegate)
Semantics\Conversions.vb (2)
2872Case TypeKind.Delegate 2912Return type.TypeKind = TypeKind.Delegate
SymbolDisplay\SymbolDisplayVisitor.Types.vb (4)
202symbol.TypeKind = TypeKind.Delegate AndAlso 261Case TypeKind.Delegate 339Case TypeKind.Delegate 459Case TypeKind.Delegate
Symbols\AnonymousTypes\AnonymousType_SymbolCollection.vb (1)
102Case TypeKind.Delegate
Symbols\AnonymousTypes\AnonymousTypeManager_Templates.vb (1)
185Case TypeKind.Delegate
Symbols\AnonymousTypes\PublicSymbols\AnonymousDelegate_TypePublicSymbol.vb (1)
123Return TypeKind.Delegate
Symbols\AnonymousTypes\PublicSymbols\AnonymousTypeOrDelegatePublicSymbol.vb (1)
22(TypeKind = TypeKind.Delegate AndAlso TypeOf Me Is AnonymousDelegatePublicSymbol))
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousDelegate_TemplateSymbol.vb (1)
163Return TypeKind.Delegate
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousTypeOrDelegateTemplateSymbol.vb (3)
54Debug.Assert(TypeKind = TypeKind.Class OrElse TypeKind = TypeKind.Delegate) 61If TypeKind = TypeKind.Delegate AndAlso typeDescr.Fields.IsSubDescription() Then 68Debug.Assert(TypeKind = TypeKind.Delegate)
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousTypeOrDelegateTypeParameterSymbol.vb (1)
65If _container.TypeKind = TypeKind.Delegate Then
Symbols\ConstraintsHelper.vb (1)
248TypeKind.Delegate,
Symbols\EventSymbol.vb (1)
171If type IsNot Nothing AndAlso type.TypeKind = TypeKind.Delegate Then
Symbols\Metadata\PE\MetadataDecoder.vb (1)
359Case TypeKind.Delegate,
Symbols\Metadata\PE\PEMethodSymbol.vb (1)
421If Not IsShared AndAlso String.Equals(name, WellKnownMemberNames.DelegateInvokeName, StringComparison.Ordinal) AndAlso _containingType.TypeKind = TypeKind.Delegate Then
Symbols\Metadata\PE\PENamedTypeSymbol.vb (1)
1034result = TypeKind.Delegate
Symbols\NamedTypeSymbol.vb (1)
232If TypeKind <> TypeKind.Delegate Then
Symbols\Source\SourceMemberContainerTypeSymbol.vb (3)
39[Delegate] = CUShort(TypeKind.Delegate) << TypeKindShift 341Case TypeKind.Delegate 1646If TypeKind <> TypeKind.Delegate Then
Symbols\Source\SourceMemberMethodSymbol.vb (1)
757Case TypeKind.Interface, TypeKind.Structure, TypeKind.Enum, TypeKind.Delegate
Symbols\Source\SourceNamedTypeSymbol.vb (4)
244If TypeKind = TypeKind.Delegate Then 1118Case TypeKind.Interface, TypeKind.Enum, TypeKind.Delegate, TypeKind.Structure, TypeKind.Module, TypeKind.Array ' array can't really occur 1397Case TypeKind.Delegate 1512ElseIf TypeKind = TypeKind.Delegate Then
Symbols\Symbol_Attributes.vb (1)
111Case TypeKind.Delegate
Symbols\SymbolExtensions.vb (1)
45Case TypeKind.Delegate
Symbols\SynthesizedSymbols\SynthesizedEventDelegateSymbol.vb (1)
369Return TypeKind.Delegate
Symbols\TypeSymbolExtensions.vb (7)
233Return type.TypeKind = TypeKind.Delegate 410Case TypeKind.Array, TypeKind.Delegate, TypeKind.Enum, TypeKind.Structure, TypeKind.Module 834TypeKind.Delegate 866TypeKind.Delegate, 1066If typeArgument.TypeKind = TypeKind.Delegate Then 1082If type.TypeKind = TypeKind.Delegate Then 1096If type.TypeKind = TypeKind.Delegate Then
Microsoft.CodeAnalysis.Workspaces (21)
Classification\ClassificationExtensions.cs (1)
17TypeKind.Delegate => ClassificationTypeNames.DelegateName,
Editing\SyntaxGenerator.cs (2)
799TypeKind.Delegate => type.GetMembers(WellKnownMemberNames.DelegateInvokeName) is [IMethodSymbol invoke, ..] 901case TypeKind.Delegate:
FindSymbols\FindReferences\DependentTypeFinder_ImplementingTypes.cs (1)
56TypeKind.Delegate or
FindSymbols\FindReferences\Finders\OrdinaryMethodReferenceFinder.cs (1)
30return symbol.ContainingType.TypeKind == TypeKind.Delegate
FindSymbols\FindReferences\FindReferencesSearchEngine.SymbolSet.cs (1)
126if (searchSymbol.IsConstructor() && searchSymbol.ContainingType.TypeKind == TypeKind.Delegate)
Rename\RenameUtilities.cs (1)
338if (symbol is INamedTypeSymbol { IsImplicitlyDeclared: true, TypeKind: TypeKind.Delegate, AssociatedSymbol: not null } typeSymbol)
Shared\Extensions\IMethodSymbolExtensions.cs (1)
17Contract.ThrowIfFalse(delegateType.TypeKind == TypeKind.Delegate);
Shared\Extensions\SemanticModelExtensions.cs (1)
144if (namedType.TypeKind == TypeKind.Delegate ||
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.Walker.cs (1)
410symbol.GetSymbolType()?.TypeKind != TypeKind.Delegate)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\EditorConfig\EditorConfigNamingStyleParser_SymbolSpec.cs (2)
113private static readonly SymbolKindOrTypeKind s_delegate = new(TypeKind.Delegate); 341case TypeKind.Delegate:
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SymbolSpecification.cs (1)
65new SymbolKindOrTypeKind(TypeKind.Delegate),
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (2)
308=> symbol is ITypeSymbol { TypeKind: TypeKind.Delegate }; 696if (!methods.Any(x => x.Name == WellKnownMemberNames.OnCompleted && x.ReturnsVoid && x.Parameters is [{ Type.TypeKind: TypeKind.Delegate }]))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (2)
84=> symbol?.TypeKind == TypeKind.Delegate; 262case TypeKind.Delegate:
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (1)
513if (x.TypeKind == TypeKind.Delegate)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (1)
195if (x.TypeKind == TypeKind.Delegate)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationSymbolFactory.cs (1)
488typeKind: TypeKind.Delegate,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationNamedTypeSymbol.cs (1)
95return this.TypeKind == TypeKind.Delegate
Microsoft.CodeAnalysis.Workspaces.UnitTests (5)
EditorConfigParsing\NamingStyleParserTests.cs (1)
166symbolKind => Assert.Equal(new SymbolKindOrTypeKind(TypeKind.Delegate), symbolKind),
Options\EditorConfigNamingStyleParserTests.cs (4)
175new SymbolKindOrTypeKind(TypeKind.Delegate) 223new SymbolKindOrTypeKind(TypeKind.Delegate) 338[InlineData("*", new object[] { SymbolKind.Namespace, TypeKind.Class, TypeKind.Struct, TypeKind.Interface, TypeKind.Enum, SymbolKind.Property, MethodKind.Ordinary, MethodKind.LocalFunction, SymbolKind.Field, SymbolKind.Event, TypeKind.Delegate, SymbolKind.Parameter, SymbolKind.TypeParameter, SymbolKind.Local })] 339[InlineData(null, new object[] { SymbolKind.Namespace, TypeKind.Class, TypeKind.Struct, TypeKind.Interface, TypeKind.Enum, SymbolKind.Property, MethodKind.Ordinary, MethodKind.LocalFunction, SymbolKind.Field, SymbolKind.Event, TypeKind.Delegate, SymbolKind.Parameter, SymbolKind.TypeParameter, SymbolKind.Local })]
Microsoft.Gen.Logging (2)
Parsing\Parser.LogProperties.cs (1)
307|| (property.Type.TypeKind == TypeKind.Delegate)
Parsing\Parser.Records.cs (1)
120if (memberType.TypeKind == TypeKind.Delegate)
Microsoft.Interop.ComInterfaceGenerator (1)
Analyzers\ConvertComImportToGeneratedComInterfaceAnalyzer.cs (1)
226public bool CanProvideMarshallingInfoForType(ITypeSymbol type) => type is { TypeKind: TypeKind.Array or TypeKind.Delegate } or { SpecialType: SpecialType.System_Array or SpecialType.System_Object };
Microsoft.Interop.SourceGeneration (1)
ManagedTypeInfo.cs (1)
64if (type.TypeKind == TypeKind.Delegate)
Microsoft.VisualStudio.LanguageServices (4)
GenerateType\GenerateTypeDialogViewModel.cs (1)
210PopulateTypeKind(TypeKind.Delegate, "delegate", "Delegate");
Library\ObjectBrowser\AbstractDescriptionBuilder.cs (2)
180if (symbol.TypeKind == TypeKind.Delegate) 443return symbol is INamedTypeSymbol { TypeKind: TypeKind.Delegate }
Library\ObjectBrowser\ObjectList.cs (1)
210case TypeKind.Delegate:
Microsoft.VisualStudio.LanguageServices.CSharp (4)
CodeModel\CSharpCodeModelService.cs (1)
758TypeKind.Delegate)
CodeModel\CSharpCodeModelService_Prototype.cs (1)
39if (namedType.TypeKind == TypeKind.Delegate)
ObjectBrowser\DescriptionBuilder.cs (2)
33Debug.Assert(typeSymbol.TypeKind == TypeKind.Delegate); 179typeSymbol.TypeKind != TypeKind.Delegate)
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (1)
GlyphExtensionsTests.cs (1)
119typeKind: TypeKind.Delegate);
Microsoft.VisualStudio.LanguageServices.Implementation (4)
CodeModel\AbstractCodeModelService.cs (2)
225case TypeKind.Delegate: 559case TypeKind.Delegate:
Options\Style\NamingPreferences\SymbolSpecification\SymbolSpecificationViewModel.cs (2)
60new SymbolKindViewModel(TypeKind.Delegate, ServicesVSResources.NamingSpecification_CSharp_Delegate, specification), 102new SymbolKindViewModel(TypeKind.Delegate, ServicesVSResources.NamingSpecification_VisualBasic_Delegate, specification),
Roslyn.Diagnostics.Analyzers (15)
DefaultableTypeShouldHaveDefaultableFieldsAnalyzer.cs (1)
116case TypeKind.Delegate:
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.NamedTypeMetricData.cs (1)
148case TypeKind.Delegate:
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IMethodSymbolExtensions.cs (1)
528=> methodSymbol.Parameters.Any(p => p.Type.TypeKind == TypeKind.Delegate);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.Walker.cs (1)
410symbol.GetSymbolType()?.TypeKind != TypeKind.Delegate)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\EditorConfig\EditorConfigNamingStyleParser_SymbolSpec.cs (2)
113private static readonly SymbolKindOrTypeKind s_delegate = new(TypeKind.Delegate); 341case TypeKind.Delegate:
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SymbolSpecification.cs (1)
65new SymbolKindOrTypeKind(TypeKind.Delegate),
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (2)
308=> symbol is ITypeSymbol { TypeKind: TypeKind.Delegate }; 696if (!methods.Any(x => x.Name == WellKnownMemberNames.OnCompleted && x.ReturnsVoid && x.Parameters is [{ Type.TypeKind: TypeKind.Delegate }]))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (2)
84=> symbol?.TypeKind == TypeKind.Delegate; 262case TypeKind.Delegate:
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (1)
513if (x.TypeKind == TypeKind.Delegate)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (1)
195if (x.TypeKind == TypeKind.Delegate)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationSymbolFactory.cs (1)
488typeKind: TypeKind.Delegate,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationNamedTypeSymbol.cs (1)
95return this.TypeKind == TypeKind.Delegate
Roslyn.Diagnostics.Analyzers.UnitTests (4)
CreateTestAccessorTests.cs (4)
147[InlineData(TypeKind.Delegate)] 154TypeKind.Delegate => "delegate void $$Method();", 234[InlineData(TypeKind.Delegate)] 242TypeKind.Delegate => "Delegate Function $$SomeType() As Integer",
Roslyn.Diagnostics.CSharp.Analyzers (7)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (2)
253if (originalDelegateCreationOperation.Type?.TypeKind != TypeKind.Delegate) 270if (rewrittenDelegateCreationOperation.Type?.TypeKind != TypeKind.Delegate)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\NamedTypeGenerator.cs (2)
96if (info.Context.GenerateMembers && namedType.TypeKind != TypeKind.Delegate) 192else if (namedType.TypeKind == TypeKind.Delegate)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (3)
443if (type.TypeKind == TypeKind.Delegate) 1033if (parentTypes.Any(static parentType => parentType.InferredType.SpecialType == SpecialType.System_String || parentType.InferredType.TypeKind == TypeKind.Delegate)) 1035return parentTypes.Where(parentType => parentType.InferredType.SpecialType == SpecialType.System_String || parentType.InferredType.TypeKind == TypeKind.Delegate);
Test.Utilities (11)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IMethodSymbolExtensions.cs (1)
528=> methodSymbol.Parameters.Any(p => p.Type.TypeKind == TypeKind.Delegate);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.Walker.cs (1)
410symbol.GetSymbolType()?.TypeKind != TypeKind.Delegate)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\EditorConfig\EditorConfigNamingStyleParser_SymbolSpec.cs (2)
113private static readonly SymbolKindOrTypeKind s_delegate = new(TypeKind.Delegate); 341case TypeKind.Delegate:
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SymbolSpecification.cs (1)
65new SymbolKindOrTypeKind(TypeKind.Delegate),
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (2)
308=> symbol is ITypeSymbol { TypeKind: TypeKind.Delegate }; 696if (!methods.Any(x => x.Name == WellKnownMemberNames.OnCompleted && x.ReturnsVoid && x.Parameters is [{ Type.TypeKind: TypeKind.Delegate }]))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (2)
84=> symbol?.TypeKind == TypeKind.Delegate; 262case TypeKind.Delegate:
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (1)
513if (x.TypeKind == TypeKind.Delegate)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (1)
195if (x.TypeKind == TypeKind.Delegate)
Text.Analyzers (16)
IdentifiersShouldBeSpelledCorrectly.cs (2)
494SymbolKind.Parameter => symbol.ContainingType.TypeKind == TypeKind.Delegate 514SymbolKind.Parameter => symbol.ContainingType.TypeKind == TypeKind.Delegate
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.NamedTypeMetricData.cs (1)
148case TypeKind.Delegate:
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IMethodSymbolExtensions.cs (1)
528=> methodSymbol.Parameters.Any(p => p.Type.TypeKind == TypeKind.Delegate);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.Walker.cs (1)
410symbol.GetSymbolType()?.TypeKind != TypeKind.Delegate)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\EditorConfig\EditorConfigNamingStyleParser_SymbolSpec.cs (2)
113private static readonly SymbolKindOrTypeKind s_delegate = new(TypeKind.Delegate); 341case TypeKind.Delegate:
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SymbolSpecification.cs (1)
65new SymbolKindOrTypeKind(TypeKind.Delegate),
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (2)
308=> symbol is ITypeSymbol { TypeKind: TypeKind.Delegate }; 696if (!methods.Any(x => x.Name == WellKnownMemberNames.OnCompleted && x.ReturnsVoid && x.Parameters is [{ Type.TypeKind: TypeKind.Delegate }]))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (2)
84=> symbol?.TypeKind == TypeKind.Delegate; 262case TypeKind.Delegate:
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (1)
513if (x.TypeKind == TypeKind.Delegate)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (1)
195if (x.TypeKind == TypeKind.Delegate)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationSymbolFactory.cs (1)
488typeKind: TypeKind.Delegate,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationNamedTypeSymbol.cs (1)
95return this.TypeKind == TypeKind.Delegate