414 references to Interface
ConfigurationSchemaGenerator (1)
RuntimeSource\Configuration.Binder\ConfigurationBindingGenerator.Parser.cs (1)
602if (!(typeSymbol.IsAbstract || typeSymbol.TypeKind is TypeKind.Interface))
GenerateDocumentationAndConfigFiles (21)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\ITypeSymbolExtensions.cs (3)
49if (type.TypeKind == TypeKind.Interface) 56case TypeKind.Interface: 71if (!baseTypesOnly && candidateBaseType.TypeKind == TypeKind.Interface)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Options\AnalyzerOptionsExtensions.cs (1)
412namedType.TypeKind != TypeKind.Interface ||
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\EditorConfig\EditorConfigNamingStyleParser_SymbolSpec.cs (2)
106private static readonly SymbolKindOrTypeKind s_interface = new(TypeKind.Interface); 335case TypeKind.Interface:
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SymbolSpecification.cs (1)
64new SymbolKindOrTypeKind(TypeKind.Interface),
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\INamedTypeSymbolExtensions.cs (6)
101if (member.ContainingType.TypeKind == TypeKind.Interface) 172if (implementation?.ContainingType.TypeKind == TypeKind.Interface) 210if (type.TypeKind == TypeKind.Interface) 313if (type.TypeKind == TypeKind.Interface) 361if (!interfacesOrAbstractClasses.All(i => i.TypeKind == TypeKind.Interface) && 378return interfacesOrAbstractClasses.First().TypeKind == TypeKind.Interface
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (2)
187if (symbol is { ContainingType.TypeKind: TypeKind.Interface }) 232=> symbol is ITypeSymbol { TypeKind: TypeKind.Interface };
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (3)
46return type is INamedTypeSymbol { TypeKind: TypeKind.Interface } namedType && !allInterfaces.Contains(namedType) 81=> symbol?.TypeKind == TypeKind.Interface; 184IEnumerable<ITypeSymbol> baseTypes = (baseType.TypeKind == TypeKind.Interface) ? type.AllInterfaces : type.GetBaseTypes();
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SignatureComparer.cs (2)
186property1.ContainingType.TypeKind == TypeKind.Interface) 196property2.ContainingType.TypeKind == TypeKind.Interface)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions.cs (1)
124member.ContainingType is { TypeKind: TypeKind.Interface } interfaceBeingImplemented)
ILLink.RoslynAnalyzer (2)
ISymbolExtensions.cs (1)
193return typeSymbol.TypeKind == TypeKind.Interface;
TrimAnalysis\SingleValueExtensions.cs (1)
26TypeKind.Class or TypeKind.Enum or TypeKind.Interface or TypeKind.Struct =>
Microsoft.Analyzers.Extra (1)
CallAnalysis\CallAnalyzer.Handlers.cs (1)
42if (type.TypeKind == TypeKind.Interface)
Microsoft.Analyzers.Local (1)
CallAnalysis\CallAnalyzer.Handlers.cs (1)
42if (type.TypeKind == TypeKind.Interface)
Microsoft.AspNetCore.App.Analyzers (1)
src\aspnetcore\src\Shared\Roslyn\CodeAnalysisExtensions.cs (1)
107if (source.TypeKind == TypeKind.Interface)
Microsoft.AspNetCore.Mvc.Analyzers (1)
src\aspnetcore\src\Shared\Roslyn\CodeAnalysisExtensions.cs (1)
107if (source.TypeKind == TypeKind.Interface)
Microsoft.AspNetCore.Mvc.Api.Analyzers (1)
src\aspnetcore\src\Shared\Roslyn\CodeAnalysisExtensions.cs (1)
107if (source.TypeKind == TypeKind.Interface)
Microsoft.AspNetCore.OpenApi.SourceGenerators (1)
XmlComments\XmlComment.InheritDoc.cs (1)
303else if (typeSymbol.TypeKind == TypeKind.Interface)
Microsoft.CodeAnalysis (1)
Operations\CommonConversion.cs (1)
90ContainingType: { TypeKind: TypeKind.Interface, Name: WellKnownMemberNames.UnionMembersInterfaceName, Arity: 0, ContainingType.IsUnion: true }
Microsoft.CodeAnalysis.Analyzers (22)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.NamedTypeMetricData.cs (1)
135case TypeKind.Interface:
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\ITypeSymbolExtensions.cs (3)
49if (type.TypeKind == TypeKind.Interface) 56case TypeKind.Interface: 71if (!baseTypesOnly && candidateBaseType.TypeKind == TypeKind.Interface)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Options\AnalyzerOptionsExtensions.cs (1)
412namedType.TypeKind != TypeKind.Interface ||
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\EditorConfig\EditorConfigNamingStyleParser_SymbolSpec.cs (2)
106private static readonly SymbolKindOrTypeKind s_interface = new(TypeKind.Interface); 335case TypeKind.Interface:
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SymbolSpecification.cs (1)
64new SymbolKindOrTypeKind(TypeKind.Interface),
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\INamedTypeSymbolExtensions.cs (6)
101if (member.ContainingType.TypeKind == TypeKind.Interface) 172if (implementation?.ContainingType.TypeKind == TypeKind.Interface) 210if (type.TypeKind == TypeKind.Interface) 313if (type.TypeKind == TypeKind.Interface) 361if (!interfacesOrAbstractClasses.All(i => i.TypeKind == TypeKind.Interface) && 378return interfacesOrAbstractClasses.First().TypeKind == TypeKind.Interface
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (2)
187if (symbol is { ContainingType.TypeKind: TypeKind.Interface }) 232=> symbol is ITypeSymbol { TypeKind: TypeKind.Interface };
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (3)
46return type is INamedTypeSymbol { TypeKind: TypeKind.Interface } namedType && !allInterfaces.Contains(namedType) 81=> symbol?.TypeKind == TypeKind.Interface; 184IEnumerable<ITypeSymbol> baseTypes = (baseType.TypeKind == TypeKind.Interface) ? type.AllInterfaces : type.GetBaseTypes();
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SignatureComparer.cs (2)
186property1.ContainingType.TypeKind == TypeKind.Interface) 196property2.ContainingType.TypeKind == TypeKind.Interface)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions.cs (1)
124member.ContainingType is { TypeKind: TypeKind.Interface } interfaceBeingImplemented)
Microsoft.CodeAnalysis.AnalyzerUtilities (24)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.NamedTypeMetricData.cs (1)
135case TypeKind.Interface:
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\ITypeSymbolExtensions.cs (3)
49if (type.TypeKind == TypeKind.Interface) 56case TypeKind.Interface: 71if (!baseTypesOnly && candidateBaseType.TypeKind == TypeKind.Interface)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Options\AnalyzerOptionsExtensions.cs (1)
412namedType.TypeKind != TypeKind.Interface ||
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\DisposeAnalysis\DisposeAnalysis.DisposeDataFlowOperationVisitor.cs (1)
37Debug.Assert(CollectionNamedTypes.All(ct => ct.TypeKind == TypeKind.Interface));
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\TaintedDataAnalysis\TaintedDataSymbolMap.cs (1)
124if (namedTypeSymbol.TypeKind == TypeKind.Interface
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\DataFlowOperationVisitor.cs (1)
1349static bool IsInterfaceOrTypeParameter(ITypeSymbol? type) => type?.TypeKind is TypeKind.Interface or TypeKind.TypeParameter;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\EditorConfig\EditorConfigNamingStyleParser_SymbolSpec.cs (2)
106private static readonly SymbolKindOrTypeKind s_interface = new(TypeKind.Interface); 335case TypeKind.Interface:
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SymbolSpecification.cs (1)
64new SymbolKindOrTypeKind(TypeKind.Interface),
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\INamedTypeSymbolExtensions.cs (6)
101if (member.ContainingType.TypeKind == TypeKind.Interface) 172if (implementation?.ContainingType.TypeKind == TypeKind.Interface) 210if (type.TypeKind == TypeKind.Interface) 313if (type.TypeKind == TypeKind.Interface) 361if (!interfacesOrAbstractClasses.All(i => i.TypeKind == TypeKind.Interface) && 378return interfacesOrAbstractClasses.First().TypeKind == TypeKind.Interface
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (2)
187if (symbol is { ContainingType.TypeKind: TypeKind.Interface }) 232=> symbol is ITypeSymbol { TypeKind: TypeKind.Interface };
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (3)
46return type is INamedTypeSymbol { TypeKind: TypeKind.Interface } namedType && !allInterfaces.Contains(namedType) 81=> symbol?.TypeKind == TypeKind.Interface; 184IEnumerable<ITypeSymbol> baseTypes = (baseType.TypeKind == TypeKind.Interface) ? type.AllInterfaces : type.GetBaseTypes();
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SignatureComparer.cs (2)
186property1.ContainingType.TypeKind == TypeKind.Interface) 196property2.ContainingType.TypeKind == TypeKind.Interface)
Microsoft.CodeAnalysis.CodeStyle (16)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\EditorConfig\EditorConfigNamingStyleParser_SymbolSpec.cs (2)
106private static readonly SymbolKindOrTypeKind s_interface = new(TypeKind.Interface); 335case TypeKind.Interface:
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SymbolSpecification.cs (1)
64new SymbolKindOrTypeKind(TypeKind.Interface),
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\INamedTypeSymbolExtensions.cs (6)
101if (member.ContainingType.TypeKind == TypeKind.Interface) 172if (implementation?.ContainingType.TypeKind == TypeKind.Interface) 210if (type.TypeKind == TypeKind.Interface) 313if (type.TypeKind == TypeKind.Interface) 361if (!interfacesOrAbstractClasses.All(i => i.TypeKind == TypeKind.Interface) && 378return interfacesOrAbstractClasses.First().TypeKind == TypeKind.Interface
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (2)
187if (symbol is { ContainingType.TypeKind: TypeKind.Interface }) 232=> symbol is ITypeSymbol { TypeKind: TypeKind.Interface };
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (3)
46return type is INamedTypeSymbol { TypeKind: TypeKind.Interface } namedType && !allInterfaces.Contains(namedType) 81=> symbol?.TypeKind == TypeKind.Interface; 184IEnumerable<ITypeSymbol> baseTypes = (baseType.TypeKind == TypeKind.Interface) ? type.AllInterfaces : type.GetBaseTypes();
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SignatureComparer.cs (2)
186property1.ContainingType.TypeKind == TypeKind.Interface) 196property2.ContainingType.TypeKind == TypeKind.Interface)
Microsoft.CodeAnalysis.CodeStyle.Fixes (17)
src\roslyn\src\Analyzers\Core\CodeFixes\AddAccessibilityModifiers\AddAccessibilityModifiersHelpers.cs (1)
50if (symbol.ContainingType?.TypeKind == TypeKind.Interface)
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateMember\AbstractGenerateMemberService.cs (2)
25TypeKind.Interface 42if (typeToGenerateIn.TypeKind == TypeKind.Interface && isStatic)
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.CodeAction.cs (2)
76generateMethodBodies: _state.TypeToGenerateIn.TypeKind != TypeKind.Interface)), 92generateMethodBodies: _state.TypeToGenerateIn.TypeKind != TypeKind.Interface,
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.cs (1)
47state.TypeToGenerateIn.TypeKind != TypeKind.Interface &&
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.SignatureInfo.cs (2)
193return isAbstract || State.TypeToGenerateIn.TypeKind == TypeKind.Interface || throwStatement == null 225if (State.TypeToGenerateIn.TypeKind != TypeKind.Interface)
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.State.cs (1)
73generateMethodBodies: TypeToGenerateIn.TypeKind != TypeKind.Interface,
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.CodeAction.cs (2)
118return _state.TypeToGenerateIn.TypeKind != TypeKind.Interface && _refKind != RefKind.None 125if (state.TypeToGenerateIn.TypeKind == TypeKind.Interface)
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.cs (3)
98if (state.TypeToGenerateIn.TypeKind == TypeKind.Interface && state.IsStatic) 108var isOnlyReadAndIsInInterface = state.TypeToGenerateIn.TypeKind == TypeKind.Interface && !state.IsWrittenTo; 142if (state.TypeToGenerateIn.TypeKind != TypeKind.Interface)
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.State.cs (1)
86if (this.TypeToGenerateIn.TypeKind == TypeKind.Interface)
src\roslyn\src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementHelpers.cs (1)
249if (idisposable?.TypeKind == TypeKind.Interface)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions.cs (1)
124member.ContainingType is { TypeKind: TypeKind.Interface } interfaceBeingImplemented)
Microsoft.CodeAnalysis.CSharp (55)
Binder\Binder_Constraints.cs (1)
589case TypeKind.Interface:
Binder\Binder_Conversions.cs (1)
866case TypeKind.Interface:
Binder\Binder_Crefs.cs (1)
777case TypeKind.Interface:
Binder\Binder_Expressions.cs (2)
5305case TypeKind.Interface: 9946case TypeKind.Interface:
Binder\Binder_Lookup.cs (2)
232case TypeKind.Interface: 1921case TypeKind.Interface:
Binder\Binder_Patterns.cs (1)
1864if (iTupleType.TypeKind != TypeKind.Interface)
Binder\ForEachLoopBinder.cs (1)
1652case TypeKind.Interface:
Binder\Semantics\Conversions\ConversionsBase.cs (1)
2681case TypeKind.Interface:
Binder\Semantics\Operators\OperatorFacts.cs (1)
24case TypeKind.Interface:
Binder\Semantics\OverloadResolution\MethodTypeInference.cs (2)
2326case TypeKind.Interface: 2703case TypeKind.Interface:
Compiler\ClsComplianceChecker.cs (1)
1002case TypeKind.Interface:
Compiler\MethodCompiler.cs (1)
643containingType is { IsImplicitlyDeclared: false, TypeKind: TypeKind.Class or TypeKind.Struct or TypeKind.Interface } &&
Emitter\NoPia\EmbeddedType.cs (1)
161case TypeKind.Interface:
Emitter\NoPia\EmbeddedTypesManager.cs (2)
321case TypeKind.Interface: 509if (containerKind == TypeKind.Interface || containerKind == TypeKind.Delegate ||
FlowAnalysis\NullableWalker.cs (1)
6121{ TypeKind: TypeKind.Interface } => type.AllInterfacesNoUseSiteDiagnostics,
SymbolDisplay\SymbolDisplayVisitor.cs (1)
375(containingType.TypeKind != TypeKind.Interface && !IsEnumMember(symbol) & !IsLocalFunction(symbol))))
SymbolDisplay\SymbolDisplayVisitor.Members.cs (1)
936(containingType.TypeKind != TypeKind.Interface && !IsEnumMember(symbol) && !IsLocalFunction(symbol))))
SymbolDisplay\SymbolDisplayVisitor.Types.cs (2)
657case TypeKind.Interface: 780case TypeKind.Interface:
Symbols\ConstraintsHelper.cs (1)
219case TypeKind.Interface:
Symbols\EnumConversions.cs (1)
33return TypeKind.Interface;
Symbols\Metadata\PE\MetadataDecoder.cs (1)
397case TypeKind.Interface:
Symbols\Metadata\PE\NativeIntegerTypeDecoder.cs (1)
97case TypeKind.Interface:
Symbols\Metadata\PE\PENamedTypeSymbol.cs (1)
2247result = TypeKind.Interface;
Symbols\NamedTypeSymbol.cs (1)
1860/// Requires less computation than <see cref="TypeSymbol.TypeKind"/> == <see cref="TypeKind.Interface"/>.
Symbols\Source\ExplicitInterfaceHelpers.cs (1)
199case TypeKind.Interface:
Symbols\Source\SourceMemberContainerSymbol.cs (6)
349case TypeKind.Interface: 399case TypeKind.Interface: 850return this.TypeKind == TypeKind.Interface; 1504case TypeKind.Interface: 3706case TypeKind.Interface: 3989case TypeKind.Interface:
Symbols\Source\SourceMemberContainerSymbol_ImplementationChecks.cs (1)
526case TypeKind.Interface:
Symbols\Source\SourceMethodSymbolWithAttributes.cs (1)
1487if (ContainingSymbol is NamedTypeSymbol { IsComImport: true, TypeKind: TypeKind.Class or TypeKind.Interface })
Symbols\Source\SourceNamedTypeSymbol.cs (1)
826case TypeKind.Interface:
Symbols\Source\SourceNamedTypeSymbol_Bases.cs (5)
568if (guessTypeKind == TypeKind.Interface) 605case TypeKind.Interface: 689if (TypeKind != TypeKind.Class || baseType.TypeKind == TypeKind.Interface) 730bool isInterface = (typeKind == TypeKind.Interface); 812case TypeKind.Interface:
Symbols\Symbol_Attributes.cs (1)
79case TypeKind.Interface:
Symbols\Synthesized\SynthesizedContainer.cs (1)
48internal sealed override bool IsInterface => this.TypeKind == TypeKind.Interface;
Symbols\TypeParameterSymbol.cs (1)
414case TypeKind.Interface:
Symbols\TypeSymbolExtensions.cs (4)
749case TypeKind.Interface: 824case TypeKind.Interface: 898case TypeKind.Interface: 1602case TypeKind.Interface:
Symbols\VarianceSafety.cs (2)
82case TypeKind.Interface: 376case TypeKind.Interface:
Utilities\TypeSymbolExtensions.cs (2)
189case TypeKind.Interface: 281case TypeKind.Interface:
Microsoft.CodeAnalysis.CSharp.CodeStyle (3)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SemanticModelExtensions.cs (1)
211if (containingType != null && containingType.TypeKind == TypeKind.Interface)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (2)
1101if (!original.IsReferenceType || original.TypeKind == TypeKind.Interface) 1444if (originalMemberSymbol.ContainingType.TypeKind == TypeKind.Interface)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (5)
src\roslyn\src\Analyzers\CSharp\CodeFixes\ImplementInterface\CSharpImplementInterfaceService.cs (1)
71if (interfaceSymbolInfo.GetAnySymbol() is INamedTypeSymbol interfaceType && interfaceType.TypeKind == TypeKind.Interface)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\MethodGenerator.cs (1)
293if (constraintType.IsReferenceType && constraintType.TypeKind != TypeKind.Interface)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\NamedTypeGenerator.cs (1)
212namedType.TypeKind == TypeKind.Interface ? SyntaxKind.InterfaceDeclaration : SyntaxKind.ClassDeclaration;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeParameterSymbolExtensions.cs (2)
60typeParameter.ConstraintTypes.Where(t => t.TypeKind == TypeKind.Interface).Concat( 61typeParameter.ConstraintTypes.Where(t => t.TypeKind is not TypeKind.Class and not TypeKind.Interface)));
Microsoft.CodeAnalysis.CSharp.Features (7)
Completion\CompletionProviders\DeclarationName\DeclarationNameRecommender.NameGenerator.cs (1)
105if (type.TypeKind == TypeKind.Interface)
Completion\CompletionProviders\ExplicitInterfaceMemberCompletionProvider.ItemGetter.cs (2)
100if (symbol is not { TypeKind: TypeKind.Interface }) 108if (containingType is not INamedTypeSymbol { TypeKind: TypeKind.Class or TypeKind.Struct or TypeKind.Interface })
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (1)
2557{ ContainingType.TypeKind: TypeKind.Interface }
ExtractMethod\CSharpSelectionResult.ExpressionResult.cs (1)
137info.ConvertedType.TypeKind != TypeKind.Interface)
Snippets\CSharpInterfaceSnippetProvider.cs (1)
19: AbstractCSharpTypeSnippetProvider<InterfaceDeclarationSyntax>(TypeKind.Interface, defaultPrefix: "I")
src\roslyn\src\Analyzers\CSharp\CodeFixes\ImplementInterface\CSharpImplementInterfaceService.cs (1)
71if (interfaceSymbolInfo.GetAnySymbol() is INamedTypeSymbol interfaceType && interfaceType.TypeKind == TypeKind.Interface)
Microsoft.CodeAnalysis.CSharp.Workspaces (7)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SemanticModelExtensions.cs (1)
211if (containingType != null && containingType.TypeKind == TypeKind.Interface)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (2)
1101if (!original.IsReferenceType || original.TypeKind == TypeKind.Interface) 1444if (originalMemberSymbol.ContainingType.TypeKind == TypeKind.Interface)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\MethodGenerator.cs (1)
293if (constraintType.IsReferenceType && constraintType.TypeKind != TypeKind.Interface)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\NamedTypeGenerator.cs (1)
212namedType.TypeKind == TypeKind.Interface ? SyntaxKind.InterfaceDeclaration : SyntaxKind.ClassDeclaration;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeParameterSymbolExtensions.cs (2)
60typeParameter.ConstraintTypes.Where(t => t.TypeKind == TypeKind.Interface).Concat( 61typeParameter.ConstraintTypes.Where(t => t.TypeKind is not TypeKind.Class and not TypeKind.Interface)));
Microsoft.CodeAnalysis.Extensions.Package (13)
Symbols\INamedTypeSymbolExtensions.cs (6)
101if (member.ContainingType.TypeKind == TypeKind.Interface) 172if (implementation?.ContainingType.TypeKind == TypeKind.Interface) 210if (type.TypeKind == TypeKind.Interface) 313if (type.TypeKind == TypeKind.Interface) 361if (!interfacesOrAbstractClasses.All(i => i.TypeKind == TypeKind.Interface) && 378return interfacesOrAbstractClasses.First().TypeKind == TypeKind.Interface
Symbols\ISymbolExtensions.cs (2)
187if (symbol is { ContainingType.TypeKind: TypeKind.Interface }) 232=> symbol is ITypeSymbol { TypeKind: TypeKind.Interface };
Symbols\ITypeSymbolExtensions.cs (3)
46return type is INamedTypeSymbol { TypeKind: TypeKind.Interface } namedType && !allInterfaces.Contains(namedType) 81=> symbol?.TypeKind == TypeKind.Interface; 184IEnumerable<ITypeSymbol> baseTypes = (baseType.TypeKind == TypeKind.Interface) ? type.AllInterfaces : type.GetBaseTypes();
Symbols\SignatureComparer.cs (2)
186property1.ContainingType.TypeKind == TypeKind.Interface) 196property2.ContainingType.TypeKind == TypeKind.Interface)
Microsoft.CodeAnalysis.Features (48)
AddConstructorParametersFromMembers\AddConstructorParametersFromMembersCodeRefactoringProvider.State.cs (1)
56ContainingType.TypeKind == TypeKind.Interface ||
Completion\Providers\AbstractObjectCreationCompletionProvider.cs (1)
85if (type.TypeKind is TypeKind.Interface or TypeKind.Pointer or TypeKind.Dynamic ||
Completion\Providers\AbstractRecommendationServiceBasedCompletionProvider.cs (1)
121if (namedType.TypeKind == TypeKind.Interface)
Completion\Providers\ImportCompletionProvider\ExtensionMemberImportCompletionHelper.SymbolComputer_Constraints.cs (1)
31=> CheckConstraints(receiverTypeSymbol, typeParameter, TypeKind.Interface, static type => type.GetAllInterfacesIncludingThis());
ConvertForEachToFor\AbstractConvertForEachToForCodeRefactoringProvider.cs (1)
279if (collectionType.TypeKind == TypeKind.Interface && knownCollectionInterfaces.Contains(collectionType.OriginalDefinition))
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (3)
332TypeKind.Interface => FeaturesResources.interface_, 3852if (symbol.ContainingType is { TypeKind: TypeKind.Interface }) 6072var isInInterface = newMember.ContainingType.TypeKind == TypeKind.Interface;
ExtractInterface\AbstractExtractInterfaceService.cs (3)
144typeKind: TypeKind.Interface, 263var candidateInterfaceName = type.TypeKind == TypeKind.Interface ? type.Name : "I" + type.Name; 323if (typeToExtractFrom.TypeKind == TypeKind.Interface)
ExtractInterface\ExtractInterfaceCodeAction.cs (1)
26=> _typeAnalysisResult.TypeToExtractFrom is { TypeKind: TypeKind.Interface }
GenerateConstructors\AbstractGenerateConstructorsCodeRefactoringProvider.State.cs (1)
67if (ContainingType == null || ContainingType.TypeKind == TypeKind.Interface)
GenerateEqualsAndGetHashCodeFromMembers\GenerateEqualsAndGetHashCodeFromMembersCodeRefactoringProvider.cs (1)
179if (info.ContainingType != null && info.ContainingType.TypeKind != TypeKind.Interface)
GenerateType\AbstractGenerateTypeService.GenerateNamedType.cs (4)
139if (_state.BaseTypeOrInterfaceOpt.TypeKind == TypeKind.Interface || argumentList.Count == 0) 277if (_state.BaseTypeOrInterfaceOpt == null || _state.BaseTypeOrInterfaceOpt.TypeKind == TypeKind.Interface) 287if (_state.BaseTypeOrInterfaceOpt != null && _state.BaseTypeOrInterfaceOpt.TypeKind == TypeKind.Interface) 316? TypeKind.Interface
GenerateType\AbstractGenerateTypeService.State.cs (2)
253if (baseType.TypeKind is not TypeKind.Class and not TypeKind.Interface) 283(BaseTypeOrInterfaceOpt == null || BaseTypeOrInterfaceOpt.TypeKind == TypeKind.Interface))
GoToBase\FindBaseHelpers.cs (1)
18TypeKind: TypeKind.Class or TypeKind.Interface or TypeKind.Struct,
InheritanceMargin\AbstractInheritanceMarginService.cs (1)
73return !symbol.IsStatic && namedType.TypeKind is TypeKind.Interface or TypeKind.Class or TypeKind.Struct;
InheritanceMargin\AbstractInheritanceMarginService_Helpers.cs (1)
324if (memberSymbol.TypeKind == TypeKind.Interface)
InitializeParameter\AbstractInitializeParameterCodeRefactoringProvider.cs (1)
84methodSymbol.ContainingType.TypeKind == TypeKind.Interface)
IntroduceVariable\AbstractIntroduceVariableService.State.cs (1)
98if (containingType?.TypeKind is TypeKind.Interface)
PullMemberUp\MemberAndDestinationValidator.cs (1)
17if (destination.TypeKind is not TypeKind.Interface and not TypeKind.Class)
PullMemberUp\MembersPuller.cs (3)
66TypeKind.Interface => PullMembersIntoInterfaceAsync(document, pullMembersUpOptions, cancellationToken), 127if (analysisResult.Member.ContainingType.TypeKind == TypeKind.Interface) 492return destination.TypeKind == TypeKind.Interface
PullMemberUp\PullMembersUpOptionsBuilder.cs (1)
18if (destination.TypeKind == TypeKind.Interface)
ReplacePropertyWithMethods\ReplacePropertyWithMethodsCodeRefactoringProvider.cs (1)
379if (property.ContainingType.TypeKind == TypeKind.Interface)
Shared\Extensions\ISymbolExtensions_2.cs (1)
74case TypeKind.Interface:
src\roslyn\src\Analyzers\Core\CodeFixes\AddAccessibilityModifiers\AddAccessibilityModifiersHelpers.cs (1)
50if (symbol.ContainingType?.TypeKind == TypeKind.Interface)
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateMember\AbstractGenerateMemberService.cs (2)
25TypeKind.Interface 42if (typeToGenerateIn.TypeKind == TypeKind.Interface && isStatic)
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.CodeAction.cs (2)
76generateMethodBodies: _state.TypeToGenerateIn.TypeKind != TypeKind.Interface)), 92generateMethodBodies: _state.TypeToGenerateIn.TypeKind != TypeKind.Interface,
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.cs (1)
47state.TypeToGenerateIn.TypeKind != TypeKind.Interface &&
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.SignatureInfo.cs (2)
193return isAbstract || State.TypeToGenerateIn.TypeKind == TypeKind.Interface || throwStatement == null 225if (State.TypeToGenerateIn.TypeKind != TypeKind.Interface)
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.State.cs (1)
73generateMethodBodies: TypeToGenerateIn.TypeKind != TypeKind.Interface,
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.CodeAction.cs (2)
118return _state.TypeToGenerateIn.TypeKind != TypeKind.Interface && _refKind != RefKind.None 125if (state.TypeToGenerateIn.TypeKind == TypeKind.Interface)
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.cs (3)
98if (state.TypeToGenerateIn.TypeKind == TypeKind.Interface && state.IsStatic) 108var isOnlyReadAndIsInInterface = state.TypeToGenerateIn.TypeKind == TypeKind.Interface && !state.IsWrittenTo; 142if (state.TypeToGenerateIn.TypeKind != TypeKind.Interface)
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.State.cs (1)
86if (this.TypeToGenerateIn.TypeKind == TypeKind.Interface)
src\roslyn\src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementHelpers.cs (1)
249if (idisposable?.TypeKind == TypeKind.Interface)
Microsoft.CodeAnalysis.ResxSourceGenerator (21)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.NamedTypeMetricData.cs (1)
135case TypeKind.Interface:
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\ITypeSymbolExtensions.cs (3)
49if (type.TypeKind == TypeKind.Interface) 56case TypeKind.Interface: 71if (!baseTypesOnly && candidateBaseType.TypeKind == TypeKind.Interface)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Options\AnalyzerOptionsExtensions.cs (1)
412namedType.TypeKind != TypeKind.Interface ||
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\EditorConfig\EditorConfigNamingStyleParser_SymbolSpec.cs (2)
106private static readonly SymbolKindOrTypeKind s_interface = new(TypeKind.Interface); 335case TypeKind.Interface:
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SymbolSpecification.cs (1)
64new SymbolKindOrTypeKind(TypeKind.Interface),
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\INamedTypeSymbolExtensions.cs (6)
101if (member.ContainingType.TypeKind == TypeKind.Interface) 172if (implementation?.ContainingType.TypeKind == TypeKind.Interface) 210if (type.TypeKind == TypeKind.Interface) 313if (type.TypeKind == TypeKind.Interface) 361if (!interfacesOrAbstractClasses.All(i => i.TypeKind == TypeKind.Interface) && 378return interfacesOrAbstractClasses.First().TypeKind == TypeKind.Interface
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (2)
187if (symbol is { ContainingType.TypeKind: TypeKind.Interface }) 232=> symbol is ITypeSymbol { TypeKind: TypeKind.Interface };
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (3)
46return type is INamedTypeSymbol { TypeKind: TypeKind.Interface } namedType && !allInterfaces.Contains(namedType) 81=> symbol?.TypeKind == TypeKind.Interface; 184IEnumerable<ITypeSymbol> baseTypes = (baseType.TypeKind == TypeKind.Interface) ? type.AllInterfaces : type.GetBaseTypes();
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SignatureComparer.cs (2)
186property1.ContainingType.TypeKind == TypeKind.Interface) 196property2.ContainingType.TypeKind == TypeKind.Interface)
Microsoft.CodeAnalysis.VisualBasic (52)
Binding\Binder_Conversions.vb (1)
797Case TypeKind.Interface
Binding\Binder_Expressions.vb (2)
1213Case TYPEKIND.Interface 3812Case TYPEKIND.TypeParameter, TYPEKIND.Interface
Binding\Binder_Lookup.vb (5)
586Case TypeKind.Interface 615Case TypeKind.Interface 936Case TypeKind.Interface 1104Case TypeKind.Interface 1697Case TypeKind.Interface
Binding\Binder_ObjectInitializer.vb (2)
220Case TypeKind.Interface 227TypeKind.Interface
Binding\Binder_Utils.vb (2)
1180Case TypeKind.Interface 1253Case TypeKind.Interface
Compilation\ClsComplianceChecker.vb (2)
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 (1)
743Case TypeKind.Interface
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 (2)
254Case TypeKind.Interface 415If containerKind = TypeKind.Interface OrElse
Semantics\AccessCheck.vb (2)
444Case TypeKind.Interface 506Case TypeKind.Interface
Semantics\Conversions.vb (1)
2878Case TypeKind.Interface
Semantics\TypeInference\TypeArgumentInference.vb (2)
1781If fixedTypeTypeKind <> TypeKind.Class AndAlso fixedTypeTypeKind <> TypeKind.Interface Then 1808Debug.Assert(fixedTypeTypeKind = TypeKind.Interface)
SymbolDisplay\SymbolDisplayVisitor.Members.vb (1)
616(containingType.TypeKind <> TypeKind.Interface AndAlso Not IsEnumMember(symbol))) Then
SymbolDisplay\SymbolDisplayVisitor.Types.vb (2)
265Case TypeKind.Interface 464Case TypeKind.Interface
SymbolDisplay\SymbolDisplayVisitor.vb (1)
349(containingType.TypeKind <> TypeKind.Interface AndAlso Not IsEnumMember(symbol))) Then
Symbols\ConstraintsHelper.vb (1)
215Case TypeKind.Interface,
Symbols\Metadata\PE\MetadataDecoder.vb (1)
349Case TypeKind.Interface
Symbols\Metadata\PE\PENamedTypeSymbol.vb (1)
1018result = TypeKind.Interface
Symbols\NamedTypeSymbol.vb (2)
822If Me.TypeKind = TypeKind.Interface Then 1088''' Requires less computation than <see cref="TypeSymbol.TypeKind"/>== <see cref="TypeKind.Interface"/>.
Symbols\Source\OverrideHidingHelper.vb (1)
27Case TypeKind.Class, TypeKind.Interface, TypeKind.Structure
Symbols\Source\SourceMemberContainerTypeSymbol.vb (5)
37[Interface] = CUShort(TypeKind.Interface) << TypeKindShift 339Case TypeKind.Interface 1269Return Me.TypeKind = TypeKind.Interface 3504If myTypeKind = TypeKind.Class OrElse myTypeKind = TypeKind.Interface OrElse myTypeKind = TypeKind.Structure OrElse myTypeKind = TypeKind.Module Then 3508Dim canDeclareOperators As Boolean = (myTypeKind <> TypeKind.Module AndAlso myTypeKind <> TypeKind.Interface)
Symbols\Source\SourceMemberMethodSymbol.vb (1)
757Case TypeKind.Interface, TypeKind.Structure, TypeKind.Enum, TypeKind.Delegate
Symbols\Source\SourceNamedTypeSymbol.vb (6)
1121Case TypeKind.Interface, TypeKind.Enum, TypeKind.Delegate, TypeKind.Structure, TypeKind.Module, TypeKind.Array ' array can't really occur 1195Case TypeKind.Interface, TypeKind.Error 1246Case TypeKind.Interface, TypeKind.Error 1391Case TypeKind.Interface 1510Debug.Assert(Me.TypeKind <> TypeKind.Interface) 2294Case TypeKind.Interface
Symbols\Source\SourceNamedTypeSymbol_ComClass.vb (1)
966Return TypeKind.Interface
Symbols\Symbol_Attributes.vb (1)
105Case TypeKind.Interface
Symbols\SymbolExtensions.vb (1)
39Case TypeKind.Interface
Symbols\TypeSymbolExtensions.vb (3)
412Case TypeKind.Interface, TypeKind.TypeParameter, TypeKind.Unknown 832TypeKind.Interface, 865TypeKind.Interface,
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (2)
src\roslyn\src\Analyzers\VisualBasic\CodeFixes\ImplementInterface\VisualBasicImplementInterfaceService.vb (1)
83interfaceTypes = interfaceTypes.WhereNotNull().Where(Function(t) t.TypeKind = TypeKind.Interface).ToImmutableArray()
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\NamedTypeGenerator.vb (1)
100Dim isInterface = namedType.TypeKind = TypeKind.Interface
Microsoft.CodeAnalysis.VisualBasic.Features (6)
CodeFixes\GenerateEvent\GenerateEventCodeFixProvider.vb (3)
189Not (targetType.TypeKind = TypeKind.Class OrElse targetType.TypeKind = TypeKind.Interface) OrElse 260If targetType Is Nothing OrElse (targetType.TypeKind <> TypeKind.Interface AndAlso targetType.TypeKind <> TypeKind.Class) Then 356Not (targetType.TypeKind = TypeKind.Class OrElse targetType.TypeKind = TypeKind.Interface) OrElse
ExtractMethod\VisualBasicSelectionResult.vb (1)
192info.ConvertedType.TypeKind <> TypeKind.Interface Then
NavigationBar\VisualBasicNavigationBarItemService.vb (1)
115If type.TypeKind <> TypeKind.Interface Then
src\roslyn\src\Analyzers\VisualBasic\CodeFixes\ImplementInterface\VisualBasicImplementInterfaceService.vb (1)
83interfaceTypes = interfaceTypes.WhereNotNull().Where(Function(t) t.TypeKind = TypeKind.Interface).ToImmutableArray()
Microsoft.CodeAnalysis.VisualBasic.NetAnalyzers (2)
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\BasicOverrideEqualsOnOverloadingOperatorEquals.vb (1)
43If type.TypeKind = TypeKind.Interface OrElse type.IsImplicitClass OrElse type.SpecialType = SpecialType.System_Object Then
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\BasicOverrideGetHashCodeOnOverridingEquals.vb (1)
44If type.TypeKind = TypeKind.Interface OrElse type.IsImplicitClass OrElse type.SpecialType = SpecialType.System_Object Then
Microsoft.CodeAnalysis.VisualBasic.Workspaces (5)
Recommendations\VisualBasicRecommendationServiceRunner.vb (3)
404Dim isInterface = TryCast(typeOrAssemblySymbol, ITypeSymbol)?.TypeKind = TypeKind.Interface 463Return namedTypeSymbol.TypeKind = TypeKind.Interface OrElse 479If namedTypeSymbol.TypeKind = TypeKind.Interface Then
Simplification\Reducers\VisualBasicEscapingReducer.vb (1)
105If type.TypeKind <> TypeKind.Interface AndAlso type.TypeKind <> TypeKind.Enum Then
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\NamedTypeGenerator.vb (1)
100Dim isInterface = namedType.TypeKind = TypeKind.Interface
Microsoft.CodeAnalysis.Workspaces (28)
Classification\ClassificationExtensions.cs (1)
15TypeKind.Interface => ClassificationTypeNames.InterfaceName,
Editing\SyntaxGenerator.cs (2)
786TypeKind.Interface => InterfaceDeclaration( 899case TypeKind.Interface:
FindSymbols\FindReferences\DependentTypeFinder.cs (1)
46private static readonly Func<INamedTypeSymbol, bool> s_isInterface = static t => t is { TypeKind: TypeKind.Interface };
FindSymbols\FindReferences\DependentTypeFinder_ImplementingTypes.cs (1)
22if (type?.TypeKind == TypeKind.Interface)
Recommendations\AbstractRecommendationServiceRunner.cs (1)
465else if (originalConstraintType.TypeKind == TypeKind.Interface)
Rename\RenameUtilities.cs (1)
264symbol.ContainingType.TypeKind == TypeKind.Interface)
Rename\SymbolicRenameLocations.ReferenceProcessing.cs (1)
108((INamedTypeSymbol)referencedSymbol.ContainingSymbol).TypeKind == TypeKind.Interface &&
Shared\Extensions\ISymbolExtensions.cs (1)
495else if (typeSymbol.TypeKind == TypeKind.Interface)
Shared\Extensions\ITypeSymbolExtensions.cs (2)
159typeSymbol.TypeKind == TypeKind.Interface) 192if (type.TypeKind == TypeKind.Interface &&
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\EditorConfig\EditorConfigNamingStyleParser_SymbolSpec.cs (2)
106private static readonly SymbolKindOrTypeKind s_interface = new(TypeKind.Interface); 335case TypeKind.Interface:
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SymbolSpecification.cs (1)
64new SymbolKindOrTypeKind(TypeKind.Interface),
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\INamedTypeSymbolExtensions.cs (6)
101if (member.ContainingType.TypeKind == TypeKind.Interface) 172if (implementation?.ContainingType.TypeKind == TypeKind.Interface) 210if (type.TypeKind == TypeKind.Interface) 313if (type.TypeKind == TypeKind.Interface) 361if (!interfacesOrAbstractClasses.All(i => i.TypeKind == TypeKind.Interface) && 378return interfacesOrAbstractClasses.First().TypeKind == TypeKind.Interface
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (2)
187if (symbol is { ContainingType.TypeKind: TypeKind.Interface }) 232=> symbol is ITypeSymbol { TypeKind: TypeKind.Interface };
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (3)
46return type is INamedTypeSymbol { TypeKind: TypeKind.Interface } namedType && !allInterfaces.Contains(namedType) 81=> symbol?.TypeKind == TypeKind.Interface; 184IEnumerable<ITypeSymbol> baseTypes = (baseType.TypeKind == TypeKind.Interface) ? type.AllInterfaces : type.GetBaseTypes();
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SignatureComparer.cs (2)
186property1.ContainingType.TypeKind == TypeKind.Interface) 196property2.ContainingType.TypeKind == TypeKind.Interface)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions.cs (1)
124member.ContainingType is { TypeKind: TypeKind.Interface } interfaceBeingImplemented)
Microsoft.DotNet.ApiCompatibility (8)
Rules\CannotAddAbstractMember.cs (1)
34if (leftContainingType.TypeKind != TypeKind.Interface && !leftContainingType.IsEffectivelySealed(_settings.IncludeInternalSymbols))
Rules\CannotAddMemberToInterface.cs (1)
25if (left == null && right != null && right.ContainingType.TypeKind == TypeKind.Interface)
Rules\CannotAddOrRemoveVirtualKeyword.cs (2)
33if (leftContainingType.TypeKind == TypeKind.Interface || rightContainingType.TypeKind == TypeKind.Interface)
Rules\CannotRemoveBaseTypeOrInterface.cs (2)
28if (left.TypeKind != TypeKind.Interface && right.TypeKind != TypeKind.Interface)
Rules\CannotSealType.cs (2)
25if (left == null || right == null || left.TypeKind == TypeKind.Interface || right.TypeKind == TypeKind.Interface)
Microsoft.DotNet.ApiSymbolExtensions (1)
SymbolExtensions.cs (1)
42if (type.TypeKind == TypeKind.Interface)
Microsoft.Gen.Logging (2)
Parsing\Parser.LogProperties.cs (1)
19private static readonly HashSet<TypeKind> _allowedTypeKinds = [TypeKind.Class, TypeKind.Struct, TypeKind.Interface];
Parsing\Parser.TagProvider.cs (1)
161if (target.TypeKind == TypeKind.Interface)
Microsoft.Interop.ComInterfaceGenerator (3)
Analyzers\ComInterfaceGeneratorDiagnosticsAnalyzer.cs (1)
86if (typeSymbol.TypeKind != TypeKind.Interface)
Analyzers\ConvertComImportToGeneratedComInterfaceAnalyzer.cs (1)
52if (type is not { TypeKind: TypeKind.Interface, IsComImport: true }
Analyzers\GeneratedComInterfaceAttributeAnalyzer.cs (1)
32if (typeSymbol.TypeKind != TypeKind.Interface)
Roslyn.Diagnostics.Analyzers (25)
DefaultableTypeShouldHaveDefaultableFieldsAnalyzer.cs (1)
115case TypeKind.Interface:
ImmutableArrayBoxingAnalyzer.cs (1)
83if (conversionOperation.Type?.TypeKind != TypeKind.Interface)
IRemoteJsonServiceParameterAnalyzer.cs (1)
64if (namedTypeSymbol.TypeKind != TypeKind.Interface ||
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.NamedTypeMetricData.cs (1)
135case TypeKind.Interface:
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\ITypeSymbolExtensions.cs (3)
49if (type.TypeKind == TypeKind.Interface) 56case TypeKind.Interface: 71if (!baseTypesOnly && candidateBaseType.TypeKind == TypeKind.Interface)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Options\AnalyzerOptionsExtensions.cs (1)
412namedType.TypeKind != TypeKind.Interface ||
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\EditorConfig\EditorConfigNamingStyleParser_SymbolSpec.cs (2)
106private static readonly SymbolKindOrTypeKind s_interface = new(TypeKind.Interface); 335case TypeKind.Interface:
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SymbolSpecification.cs (1)
64new SymbolKindOrTypeKind(TypeKind.Interface),
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\INamedTypeSymbolExtensions.cs (6)
101if (member.ContainingType.TypeKind == TypeKind.Interface) 172if (implementation?.ContainingType.TypeKind == TypeKind.Interface) 210if (type.TypeKind == TypeKind.Interface) 313if (type.TypeKind == TypeKind.Interface) 361if (!interfacesOrAbstractClasses.All(i => i.TypeKind == TypeKind.Interface) && 378return interfacesOrAbstractClasses.First().TypeKind == TypeKind.Interface
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (2)
187if (symbol is { ContainingType.TypeKind: TypeKind.Interface }) 232=> symbol is ITypeSymbol { TypeKind: TypeKind.Interface };
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (3)
46return type is INamedTypeSymbol { TypeKind: TypeKind.Interface } namedType && !allInterfaces.Contains(namedType) 81=> symbol?.TypeKind == TypeKind.Interface; 184IEnumerable<ITypeSymbol> baseTypes = (baseType.TypeKind == TypeKind.Interface) ? type.AllInterfaces : type.GetBaseTypes();
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SignatureComparer.cs (2)
186property1.ContainingType.TypeKind == TypeKind.Interface) 196property2.ContainingType.TypeKind == TypeKind.Interface)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions.cs (1)
124member.ContainingType is { TypeKind: TypeKind.Interface } interfaceBeingImplemented)
Roslyn.Diagnostics.CSharp.Analyzers (7)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SemanticModelExtensions.cs (1)
211if (containingType != null && containingType.TypeKind == TypeKind.Interface)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (2)
1101if (!original.IsReferenceType || original.TypeKind == TypeKind.Interface) 1444if (originalMemberSymbol.ContainingType.TypeKind == TypeKind.Interface)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\MethodGenerator.cs (1)
293if (constraintType.IsReferenceType && constraintType.TypeKind != TypeKind.Interface)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\NamedTypeGenerator.cs (1)
212namedType.TypeKind == TypeKind.Interface ? SyntaxKind.InterfaceDeclaration : SyntaxKind.ClassDeclaration;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeParameterSymbolExtensions.cs (2)
60typeParameter.ConstraintTypes.Where(t => t.TypeKind == TypeKind.Interface).Concat( 61typeParameter.ConstraintTypes.Where(t => t.TypeKind is not TypeKind.Class and not TypeKind.Interface)));
System.Text.Json.SourceGeneration (4)
Helpers\RoslynExtensions.cs (4)
106if (type.IsAbstract || type.TypeKind is TypeKind.Interface || type is not INamedTypeSymbol namedType) 132if (baseType.TypeKind is TypeKind.Interface) 160if (baseType.TypeKind is TypeKind.Interface) 236if (type.TypeKind != TypeKind.Interface)