src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateConversionService.cs (2)
26protected abstract bool TryInitializeImplicitConversionState(SemanticDocument document, SyntaxNode expression, ISet<TypeKind> classInterfaceModuleStructTypes, CancellationToken cancellationToken, out SyntaxToken identifierToken, out IMethodSymbol methodSymbol, out INamedTypeSymbol typeToGenerateIn);
27protected abstract bool TryInitializeExplicitConversionState(SemanticDocument document, SyntaxNode expression, ISet<TypeKind> classInterfaceModuleStructTypes, CancellationToken cancellationToken, out SyntaxToken identifierToken, out IMethodSymbol methodSymbol, out INamedTypeSymbol typeToGenerateIn);
Symbols\TypeSymbolExtensions.cs (69)
71if (type.TypeKind != TypeKind.TypeParameter)
117if (type.TypeKind == TypeKind.TypeParameter)
222return type.TypeKind == TypeKind.Enum;
317case TypeKind.Pointer:
318case TypeKind.Dynamic:
319case TypeKind.FunctionPointer:
335return type.TypeKind == TypeKind.Class;
341return type.TypeKind == TypeKind.Struct;
357return type.TypeKind == TypeKind.Dynamic;
363return type.TypeKind == TypeKind.TypeParameter;
369return type.TypeKind == TypeKind.Array;
375return type.TypeKind == TypeKind.Array && ((ArrayTypeSymbol)type).IsSZArray;
400return type.TypeKind == TypeKind.FunctionPointer;
407case TypeKind.Pointer:
408case TypeKind.FunctionPointer:
420case TypeKind.Class:
421case TypeKind.Struct:
424case TypeKind.TypeParameter:
570return type.TypeKind == TypeKind.Delegate;
701case TypeKind.Class:
702case TypeKind.Struct:
703case TypeKind.Interface:
704case TypeKind.Enum:
705case TypeKind.Delegate:
706case TypeKind.Submission:
776case TypeKind.Class:
777case TypeKind.Struct:
778case TypeKind.Interface:
779case TypeKind.Enum:
780case TypeKind.Delegate:
795case TypeKind.Submission:
834case TypeKind.Dynamic:
835case TypeKind.TypeParameter:
836case TypeKind.Submission:
837case TypeKind.Enum:
847goto case TypeKind.Delegate;
849case TypeKind.Error:
850case TypeKind.Class:
851case TypeKind.Struct:
852case TypeKind.Interface:
853case TypeKind.Delegate:
921case TypeKind.Array:
925case TypeKind.Pointer:
929case TypeKind.FunctionPointer:
1164if (ReferenceEquals(parent2.OriginalDefinition, parent1OriginalDefinition) || parent1OriginalDefinition.TypeKind == TypeKind.Submission && parent2.TypeKind == TypeKind.Submission)
1204(type, parameter, unused) => type.TypeKind == TypeKind.TypeParameter && (parameter is null || TypeSymbol.Equals(type, parameter, TypeCompareKind.ConsiderEverything2));
1215(type, parameterContainer, unused) => type.TypeKind == TypeKind.TypeParameter && (object)type.ContainingSymbol == (object)parameterContainer;
1224(type, parameters, unused) => type.TypeKind == TypeKind.TypeParameter && parameters.Contains((TypeParameterSymbol)type);
1233(type, _, _) => type.TypeKind == TypeKind.TypeParameter && type.ContainingSymbol is MethodSymbol;
1244private static readonly Func<TypeSymbol, object?, bool, bool> s_containsDynamicPredicate = (type, unused1, unused2) => type.TypeKind == TypeKind.Dynamic;
1282type.VisitType((TypeSymbol t, object? _, bool _) => t.TypeKind is TypeKind.Pointer or TypeKind.FunctionPointer, null) is object;
1310internal static TypeKind GetNonErrorTypeKindGuess(this TypeSymbol type)
1509case TypeKind.Struct:
1512case TypeKind.Array:
1513case TypeKind.Class:
1514case TypeKind.Delegate:
1515case TypeKind.Dynamic:
1516case TypeKind.Error:
1517case TypeKind.Interface:
1518case TypeKind.Pointer:
1519case TypeKind.FunctionPointer:
1522case TypeKind.Enum:
1525case TypeKind.TypeParameter:
1528case TypeKind.Submission:
1669return type.IsReferenceType && type.TypeKind != TypeKind.TypeParameter;
1677return type.IsValueType && type.TypeKind != TypeKind.TypeParameter;
2003if (taskType.TypeKind == TypeKind.Error)
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateConversionService.cs (2)
26protected abstract bool TryInitializeImplicitConversionState(SemanticDocument document, SyntaxNode expression, ISet<TypeKind> classInterfaceModuleStructTypes, CancellationToken cancellationToken, out SyntaxToken identifierToken, out IMethodSymbol methodSymbol, out INamedTypeSymbol typeToGenerateIn);
27protected abstract bool TryInitializeExplicitConversionState(SemanticDocument document, SyntaxNode expression, ISet<TypeKind> classInterfaceModuleStructTypes, CancellationToken cancellationToken, out SyntaxToken identifierToken, out IMethodSymbol methodSymbol, out INamedTypeSymbol typeToGenerateIn);
Binding\Binder_Lookup.vb (35)
16Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
580Case TypeKind.Class, TypeKind.Module, TypeKind.Structure, TypeKind.Delegate, TypeKind.Array, TypeKind.Enum
583Case TypeKind.Submission
586Case TypeKind.Interface
589Case TypeKind.TypeParameter
592Case TypeKind.Error
606Case TypeKind.Class, TypeKind.Structure, TypeKind.Delegate, TypeKind.Array, TypeKind.Enum
609Case TypeKind.Module
612Case TypeKind.Submission
615Case TypeKind.Interface
618Case TypeKind.TypeParameter
621Case TypeKind.Error
931Case TypeKind.Class, TypeKind.Module, TypeKind.Structure
936Case TypeKind.Interface
941Case TypeKind.TypeParameter
1092Case TypeKind.Class, TypeKind.Module, TypeKind.Structure
1104Case TypeKind.Interface
1116Case TypeKind.TypeParameter
1697Case TypeKind.Interface
1710Case TypeKind.TypeParameter
1964(container.TypeKind = TypeKind.Class OrElse container.TypeKind = TypeKind.Structure) AndAlso
Compilation\ClsComplianceChecker.vb (26)
186If symbol.TypeKind = TypeKind.Delegate Then
340ElseIf symbol.TypeKind = TypeKind.Enum Then
439If type.TypeKind = TypeKind.Delegate AndAlso type.IsImplicitlyDeclared AndAlso TryCast(type, NamedTypeSymbol)?.AssociatedSymbol Is symbol Then
591Case TypeKind.Array
593Case TypeKind.Error, TypeKind.TypeParameter
595Case TypeKind.Class, TypeKind.Structure, TypeKind.Interface, TypeKind.Delegate, TypeKind.Enum, TypeKind.Submission, TypeKind.Module
617Case TypeKind.Array
619Case TypeKind.Error, TypeKind.TypeParameter
621Case TypeKind.Class, TypeKind.Structure, TypeKind.Interface, TypeKind.Delegate, TypeKind.Enum, TypeKind.Submission, TypeKind.Module
636If type.TypeKind = TypeKind.Error Then
892Dim typeKind As TypeKind = xType.TypeKind
897If typeKind = TypeKind.Array Then
Symbols\Source\SourceNamedTypeSymbol.vb (39)
17Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
240If TypeKind = TypeKind.Delegate Then
268ElseIf TypeKind = TypeKind.Enum Then
1110Case TypeKind.TypeParameter
1114Case TypeKind.Interface, TypeKind.Enum, TypeKind.Delegate, TypeKind.Structure, TypeKind.Module, TypeKind.Array ' array can't really occur
1118Case TypeKind.Error, TypeKind.Unknown
1121Case TypeKind.Class
1181Case TypeKind.TypeParameter
1185Case TypeKind.Unknown
1188Case TypeKind.Interface, TypeKind.Error
1232Case TypeKind.TypeParameter
1236Case TypeKind.Unknown
1239Case TypeKind.Interface, TypeKind.Error
1375Case TypeKind.Submission
1381Case TypeKind.Class
1384Case TypeKind.Interface
1387Case TypeKind.Enum
1390Case TypeKind.Structure
1393Case TypeKind.Delegate
1396Case TypeKind.Module
1503Debug.Assert(Me.TypeKind <> TypeKind.Interface)
1505If TypeKind = TypeKind.Enum Then
1508ElseIf TypeKind = TypeKind.Delegate Then
2188Case TypeKind.Class
2215Case TypeKind.Interface
2235Case TypeKind.Module
2270Dim defaultAutoLayoutSize = If(Me.TypeKind = TypeKind.Structure, 1, 0)
2401If Me.TypeKind = TypeKind.Module Then
2451If Me.TypeKind = TypeKind.Structure Then
2494If Me.TypeKind = TypeKind.Module Then
2619If Me.TypeKind = TypeKind.Class AndAlso Not Me.IsGenericType Then
Symbols\TypeSymbolExtensions.vb (46)
118Return type.TypeKind = TypeKind.Enum
140Return type.TypeKind = TypeKind.Class
146Return type.TypeKind = TypeKind.Structure
152Return type.TypeKind = TypeKind.Module
233Return type.TypeKind = TypeKind.Delegate
410Case TypeKind.Array, TypeKind.Delegate, TypeKind.Enum, TypeKind.Structure, TypeKind.Module
412Case TypeKind.Interface, TypeKind.TypeParameter, TypeKind.Unknown
414Case TypeKind.Error, TypeKind.Class, TypeKind.Submission
635Case TypeKind.Array
637Case TypeKind.TypeParameter
735fieldType.TypeKind = TypeKind.Enum
746If type.TypeKind = TypeKind.TypeParameter Then
761Return (type.TypeKind = TypeKind.TypeParameter) AndAlso
774Return (type.TypeKind = TypeKind.TypeParameter) AndAlso
790Private ReadOnly s_isTypeParameterFunc As Func(Of TypeSymbol, Object, Boolean) = Function(type, arg) (type.TypeKind = TypeKind.TypeParameter)
830Case TypeKind.Class,
831TypeKind.Struct,
832TypeKind.Interface,
833TypeKind.Enum,
834TypeKind.Delegate
845Case TypeKind.Submission
855Case TypeKind.Dynamic,
856TypeKind.TypeParameter,
857TypeKind.Submission,
858TypeKind.Enum,
859TypeKind.Module
863Case TypeKind.Class,
864TypeKind.Struct,
865TypeKind.Interface,
866TypeKind.Delegate,
867TypeKind.Error
883Case TypeKind.Array
1060If type.TypeKind = TypeKind.Class Then
1066If typeArgument.TypeKind = TypeKind.Delegate Then
1082If type.TypeKind = TypeKind.Delegate Then
1096If type.TypeKind = TypeKind.Delegate Then
1131If type.TypeKind = TypeKind.TypeParameter Then
1139If type.TypeKind = TypeKind.TypeParameter Then
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SymbolSpecification.cs (19)
67new SymbolKindOrTypeKind(TypeKind.Class),
68new SymbolKindOrTypeKind(TypeKind.Struct),
69new SymbolKindOrTypeKind(TypeKind.Interface),
70new SymbolKindOrTypeKind(TypeKind.Delegate),
71new SymbolKindOrTypeKind(TypeKind.Enum),
72new SymbolKindOrTypeKind(TypeKind.Module),
73new SymbolKindOrTypeKind(TypeKind.Pointer),
80new SymbolKindOrTypeKind(TypeKind.TypeParameter),
298foreach (var typeKindElement in symbolKindListElement.Elements(nameof(TypeKind)))
349public SymbolKindOrTypeKind(TypeKind typeKind)
360public TypeKind? TypeKind => (_category == SymbolCategory.Type) ? (TypeKind)_kind : null;
367SymbolCategory.Type => symbol is ITypeSymbol type && type.TypeKind == (TypeKind)_kind,
376SymbolCategory.Type => new XElement(nameof(TypeKind), GetTypeKindString((TypeKind)_kind)),
381private static string GetTypeKindString(TypeKind typeKind)
388CodeAnalysis.TypeKind.Structure => nameof(CodeAnalysis.TypeKind.Struct),
438=> new((TypeKind)Enum.Parse(typeof(TypeKind), typeKindElement.Value));