3 implementations of SpecialType
Microsoft.CodeAnalysis.CSharp (1)
Symbols\PublicModel\TypeSymbol.cs (1)
169SpecialType ITypeSymbol.SpecialType => UnderlyingTypeSymbol.SpecialType;
Microsoft.CodeAnalysis.Features (1)
MetadataAsSource\AbstractMetadataAsSourceService.WrappedNamedTypeSymbol.cs (1)
69public SpecialType SpecialType => _symbol.SpecialType;
Microsoft.CodeAnalysis.VisualBasic (1)
Symbols\TypeSymbol.vb (1)
287Public ReadOnly Property SpecialType As SpecialType Implements ITypeSymbol.SpecialType, ITypeSymbolInternal.SpecialType
943 references to SpecialType
ConfigurationSchemaGenerator (15)
RuntimeSource\Configuration.Binder\ConfigurationBindingGenerator.Parser.cs (6)
67type.SpecialType is SpecialType.System_Object or SpecialType.System_Void || 223unboundGeneric.OriginalDefinition.SpecialType == SpecialType.System_Nullable_T) 235if (type is IArrayTypeSymbol { ElementType.SpecialType: SpecialType.System_Byte }) 253SpecialType specialType = namedType.SpecialType; 542if (type.OriginalDefinition.SpecialType == SpecialType.System_Nullable_T) 962if (firstParam.Name == "argument" && firstParam.Type.SpecialType == SpecialType.System_Object
RuntimeSource\Configuration.Binder\Parser\ConfigurationBinder.cs (5)
58if (@params[1].Type.SpecialType is SpecialType.System_String) 82if (instanceArg.Parameter?.Type.SpecialType is not SpecialType.System_Object) 200if (paramCount > 3 || @params[1].Type.SpecialType is not SpecialType.System_String) 222if (@params[2].Type.SpecialType is not SpecialType.System_String) 234else if (paramCount is 4 && @params[3].Type.SpecialType is SpecialType.System_Object)
RuntimeSource\Configuration.Binder\Parser\OptionsBuilderConfigurationExtensions.cs (1)
79@params[1].Type.SpecialType is SpecialType.System_String &&
RuntimeSource\Configuration.Binder\Parser\OptionsConfigurationServiceCollectionExtensions.cs (2)
44if (secondParamType.SpecialType is SpecialType.System_String && 60@params[1].Type.SpecialType is SpecialType.System_String &&
RuntimeSource\SourceGenerators\TypeRef.cs (1)
22SpecialType = type.SpecialType;
ILLink.RoslynAnalyzer (13)
ISymbolExtensions.cs (1)
211 methodSymbol.ReturnType.SpecialType == SpecialType.System_Int32 ||
ITypeSymbolExtensions.cs (2)
21 if (type.SpecialType is SpecialType.System_String && !isByRef) 70 return symbol.SpecialType switch {
RequiresAnalyzerBase.cs (1)
332 if (!propertySymbol.IsStatic || propertySymbol.Type.SpecialType != SpecialType.System_Boolean || propertySymbol.SetMethod != null)
RequiresAssemblyFilesAnalyzer.cs (1)
131 attribute.ConstructorArguments.Length >= 1 && attribute.ConstructorArguments is [ { Type.SpecialType: SpecialType.System_String }, ..];
RequiresDynamicCodeAnalyzer.cs (1)
143 attribute.ConstructorArguments.Length >= 1 && attribute.ConstructorArguments is [ { Type.SpecialType: SpecialType.System_String }, ..];
RequiresUnreferencedCodeUtils.cs (1)
37 => attribute.ConstructorArguments.Length >= 1 && attribute.ConstructorArguments is [ { Type.SpecialType: SpecialType.System_String }, ..];
TrimAnalysis\FeatureCheckReturnValuePattern.cs (1)
40 if (!OwningSymbol.IsStatic || OwningSymbol.Type.SpecialType != SpecialType.System_Boolean || OwningSymbol.SetMethod != null) {
TrimAnalysis\GenericParameterProxy.cs (1)
20 if (constraintType.SpecialType == SpecialType.System_Enum)
TrimAnalysis\MethodProxy.cs (1)
55 internal partial bool ReturnsVoid () => Method.ReturnType.SpecialType == SpecialType.System_Void;
TrimAnalysis\SingleValueExtensions.cs (1)
16 if (type.OriginalDefinition.SpecialType == SpecialType.System_Nullable_T) {
TrimAnalysis\TrimAnalysisVisitor.cs (2)
188 (operation.Type?.TypeKind == TypeKind.Enum || operation.Type?.SpecialType == SpecialType.System_Int32)) { 436 switch (operation.Type?.SpecialType) {
Microsoft.Analyzers.Extra (4)
CallAnalysis\Arrays.cs (2)
109|| keyType.SpecialType == SpecialType.System_Byte 110|| keyType.SpecialType == SpecialType.System_SByte)
CoalesceAnalyzer.cs (2)
37&& type.OriginalDefinition.SpecialType != SpecialType.System_Nullable_T) 64&& type.OriginalDefinition.SpecialType != SpecialType.System_Nullable_T)
Microsoft.Analyzers.Local (3)
ApiLifecycle\AssemblyAnalysis.cs (3)
148if (type.EnumUnderlyingType.SpecialType != SpecialType.System_Int32) 155if (baseType != null && baseType.SpecialType != SpecialType.System_Object && baseType.SpecialType != SpecialType.System_ValueType)
Microsoft.AspNetCore.App.Analyzers (10)
Http\HeaderDictionaryIndexerAnalyzer.cs (1)
30property.Parameters[0].Type.SpecialType == SpecialType.System_String &&
RouteHandlers\DisallowNonParsableComplexTypesOnParameters.cs (1)
131if (parameterTypeSymbol!.ConstructedFrom.SpecialType == SpecialType.System_Nullable_T)
src\Shared\Roslyn\MvcFacts.cs (2)
73if (GetDeclaringType(method).SpecialType == SpecialType.System_Object) 136if (method.ExplicitInterfaceImplementations[i].ContainingType.SpecialType == SpecialType.System_IDisposable)
src\Shared\RoslynUtils\ParsabilityHelper.cs (5)
40if (typeSymbol.SpecialType == SpecialType.System_String) 98methodSymbol.ReturnType.SpecialType == SpecialType.System_Boolean && 100methodSymbol.Parameters[0].Type.SpecialType == SpecialType.System_String && 108methodSymbol.ReturnType.SpecialType == SpecialType.System_Boolean && 110methodSymbol.Parameters[0].Type.SpecialType == SpecialType.System_String &&
src\Shared\RoslynUtils\SymbolExtensions.cs (1)
34if (unwrapNullable && unwrappedTypeSymbol?.ConstructedFrom.SpecialType == SpecialType.System_Nullable_T)
Microsoft.AspNetCore.Http.RequestDelegateGenerator (24)
src\Shared\RoslynUtils\ParsabilityHelper.cs (5)
40if (typeSymbol.SpecialType == SpecialType.System_String) 98methodSymbol.ReturnType.SpecialType == SpecialType.System_Boolean && 100methodSymbol.Parameters[0].Type.SpecialType == SpecialType.System_String && 108methodSymbol.ReturnType.SpecialType == SpecialType.System_Boolean && 110methodSymbol.Parameters[0].Type.SpecialType == SpecialType.System_String &&
src\Shared\RoslynUtils\SymbolExtensions.cs (1)
34if (unwrapNullable && unwrappedTypeSymbol?.ConstructedFrom.SpecialType == SpecialType.System_Nullable_T)
StaticRouteHandlerModel\Emitters\EndpointParameterEmitter.cs (1)
232var fallback = endpointParameter.Type.SpecialType == SpecialType.System_String ? endpointParameter.DefaultValue : "null";
StaticRouteHandlerModel\Endpoint.cs (1)
92parameter is { IsArray: true, ElementType.SpecialType: SpecialType.System_String, Source: EndpointParameterSource.Query });
StaticRouteHandlerModel\EndpointParameter.cs (6)
225else if (Type.SpecialType == SpecialType.System_String) 229else if (IsArray && ElementType.SpecialType == SpecialType.System_String) 261|| Type.SpecialType == SpecialType.System_String 262|| (IsArray && ElementType.SpecialType == SpecialType.System_String) 353if (parameterType.SpecialType == SpecialType.System_Char) 357else if (parameterType.SpecialType == SpecialType.System_DateTime)
StaticRouteHandlerModel\EndpointResponse.cs (3)
76ResponseType.SpecialType != SpecialType.System_String && 77ResponseType.SpecialType != SpecialType.System_Object; 98return ResponseType!.SpecialType is SpecialType.System_String ? "text/plain; charset=utf-8" : "application/json";
StaticRouteHandlerModel\Model\EndpointParameterExtensions.cs (2)
44if (handlerParameterType is INamedTypeSymbol { IsGenericType: true, OriginalDefinition: { SpecialType: not SpecialType.System_Nullable_T } }) 58=> typeSymbol?.OriginalDefinition.SpecialType == SpecialType.System_Nullable_T;
StaticRouteHandlerModel\StaticRouteHandlerModel.Emitter.cs (5)
123&& (responseType.SpecialType == SpecialType.System_Object || responseType.SpecialType == SpecialType.System_String)) 148else if (endpointResponse.ResponseType?.SpecialType == SpecialType.System_String) 152else if (endpointResponse.ResponseType?.SpecialType == SpecialType.System_Object) 214if (response.ResponseType?.SpecialType == SpecialType.System_String)
Microsoft.AspNetCore.Mvc.Analyzers (3)
src\Shared\Roslyn\MvcFacts.cs (2)
73if (GetDeclaringType(method).SpecialType == SpecialType.System_Object) 136if (method.ExplicitInterfaceImplementations[i].ContainingType.SpecialType == SpecialType.System_IDisposable)
TopLevelParameterNameAnalyzer.cs (1)
165namedArgumentValue.Type.SpecialType == SpecialType.System_String &&
Microsoft.AspNetCore.Mvc.Api.Analyzers (5)
AddResponseTypeAttributeCodeFixAction.cs (1)
156field.Type.SpecialType == SpecialType.System_Int32 &&
src\Shared\Roslyn\MvcFacts.cs (2)
73if (GetDeclaringType(method).SpecialType == SpecialType.System_Object) 136if (method.ExplicitInterfaceImplementations[i].ContainingType.SpecialType == SpecialType.System_IDisposable)
SymbolApiResponseMetadataProvider.cs (2)
195(namedArgumentValue.Type.SpecialType & SpecialType.System_Int32) == SpecialType.System_Int32 && 212(parameter.Type.SpecialType & SpecialType.System_Int32) == SpecialType.System_Int32)
Microsoft.CodeAnalysis (29)
CodeGen\PermissionSetAttribute.cs (1)
86member => member.Kind == SymbolKind.Property && ((IPropertySymbol)member).Type.SpecialType == SpecialType.System_String));
Compilation\Expression.cs (1)
11switch (type.SpecialType)
Operations\ControlFlowGraphBuilder.cs (5)
3129if (operation.Target?.Type?.OriginalDefinition.SpecialType == SpecialType.System_Nullable_T && 4212Debug.Assert(iDisposable.SpecialType == SpecialType.System_IDisposable || 4957constantValue: ConstantValue.Default(stepValueEnumUnderlyingTypeOrSelf.SpecialType), 5241int bits = stepEnumUnderlyingTypeOrSelf.SpecialType.VBForToShiftBits(); 6825Debug.Assert(outParameterArgument is { Parameter: { RefKind: RefKind.Out, Type.SpecialType: SpecialType.System_Boolean } });
SymbolDisplay\AbstractSymbolDisplayVisitor.cs (5)
148AddLiteralValue(type.SpecialType, constantValue); 165AddLiteralValue(enumType.EnumUnderlyingType.SpecialType, constantValue); 237var underlyingSpecialType = enumType.EnumUnderlyingType.SpecialType; 316var underlyingSpecialType = enumType.EnumUnderlyingType.SpecialType; 336var underlyingSpecialType = enumType.EnumUnderlyingType.SpecialType;
Symbols\Attributes\CommonAttributeData.cs (10)
208Debug.Assert(parameters[0].Type.SpecialType == SpecialType.System_Byte); 209Debug.Assert(parameters[1].Type.SpecialType == SpecialType.System_Byte); 216if (parameters[2].Type.SpecialType == SpecialType.System_Int32) 218Debug.Assert(parameters[2].Type.SpecialType == SpecialType.System_Int32); 219Debug.Assert(parameters[3].Type.SpecialType == SpecialType.System_Int32); 220Debug.Assert(parameters[4].Type.SpecialType == SpecialType.System_Int32); 228Debug.Assert(parameters[2].Type.SpecialType == SpecialType.System_UInt32); 229Debug.Assert(parameters[3].Type.SpecialType == SpecialType.System_UInt32); 230Debug.Assert(parameters[4].Type.SpecialType == SpecialType.System_UInt32); 413if (attribute.AttributeConstructor.Parameters[0].Type.SpecialType == SpecialType.System_Int16)
Symbols\Attributes\MarshalAsAttributeDecoder.cs (1)
102if (attribute.AttributeConstructor.Parameters[0].Type.SpecialType == SpecialType.System_Int16)
Symbols\ITypeSymbol.cs (6)
205return typeOpt?.OriginalDefinition.SpecialType == SpecialType.System_Nullable_T; 221return type?.SpecialType == SpecialType.System_Boolean; 226return type?.SpecialType == SpecialType.System_Object; 231return type?.SpecialType.IsSignedIntegralType() == true; 236return type?.SpecialType.IsUnsignedIntegralType() == true; 241return type?.SpecialType.IsNumericType() == true;
Microsoft.CodeAnalysis.CodeStyle (57)
src\Analyzers\Core\Analyzers\ForEachCast\AbstractForEachCastDiagnosticAnalyzer.cs (7)
99if (collectionElementType.SpecialType == SpecialType.System_Object) 101var ienumerableOfT = collectionType.AllInterfaces.FirstOrDefault(i => i.OriginalDefinition.SpecialType == SpecialType.System_Collections_Generic_IEnumerable_T); 142var isFixable = collectionType.SpecialType == SpecialType.System_Collections_IEnumerable || collectionType.AllInterfaces.Any(static i => i.SpecialType == SpecialType.System_Collections_IEnumerable) && 158=> collectionElementType.SpecialType != SpecialType.System_Object || 159collectionType.OriginalDefinition.SpecialType == SpecialType.System_Collections_Generic_IEnumerable_T || 160collectionType.AllInterfaces.Any(static i => i.OriginalDefinition.SpecialType == SpecialType.System_Collections_Generic_IEnumerable_T);
src\Analyzers\Core\Analyzers\PopulateSwitch\AbstractPopulateSwitchDiagnosticAnalyzer.cs (2)
86if (typeWithoutNullable.SpecialType == SpecialType.System_Boolean) 102if (type.RemoveNullableIfPresent() is not { SpecialType: SpecialType.System_Boolean })
src\Analyzers\Core\Analyzers\PopulateSwitch\PopulateSwitchStatementHelpers.cs (1)
158if (member is not IFieldSymbol fieldSymbol || fieldSymbol.Type.SpecialType != SpecialType.None)
src\Analyzers\Core\Analyzers\RemoveRedundantEquality\AbstractRemoveRedundantEqualityDiagnosticAnalyzer.cs (2)
88if (leftType?.SpecialType != SpecialType.System_Boolean || 89rightType?.SpecialType != SpecialType.System_Boolean)
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (2)
832attribute.AttributeConstructor?.Parameters is [_, { Name: "checkId", Type.SpecialType: SpecialType.System_String }, ..] && 841attribute.AttributeConstructor.Parameters[0].Type.SpecialType == SpecialType.System_String &&
src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (2)
734attribute.ConstructorArguments is [{ Kind: TypedConstantKind.Primitive, Type.SpecialType: SpecialType.System_String, Value: string value }]) 898(IsSpecialMethodWithMatchingProperty("ShouldSerialize") && methodSymbol.ReturnType.SpecialType == SpecialType.System_Boolean ||
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.BlockAnalyzer.cs (1)
177value.Type.SpecialType == SpecialType.System_Void)
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.cs (3)
233method.Parameters is [{ Type.SpecialType: SpecialType.System_Object }, var secondParam] && 273if (method is { MetadataName: "GetInstance", IsStatic: true, Parameters: [{ Type.SpecialType: SpecialType.System_String }] } && 295if (parameter.Type.SpecialType != SpecialType.System_Int32)
src\Analyzers\Core\Analyzers\SimplifyBooleanExpression\AbstractSimplifyConditionalDiagnosticAnalyzer.cs (2)
155typeInfo.Type?.SpecialType == SpecialType.System_Boolean && 156typeInfo.ConvertedType?.SpecialType == SpecialType.System_Boolean;
src\Analyzers\Core\Analyzers\SimplifyInterpolation\AbstractSimplifyInterpolationHelpers.cs (1)
127return method.ContainingType.SpecialType == SpecialType.System_Object
src\Analyzers\Core\Analyzers\UseNullPropagation\AbstractUseNullPropagationDiagnosticAnalyzer.cs (4)
26ContainingType.OriginalDefinition.SpecialType: SpecialType.System_Nullable_T, 162if (type is not INamedTypeSymbol namedType || namedType.ConstructedFrom.SpecialType != SpecialType.System_Nullable_T) 195var whenPartIsNullable = whenPartType?.OriginalDefinition.SpecialType == SpecialType.System_Nullable_T; 377if (typeSymbol?.SpecialType == SpecialType.System_Object)
src\Analyzers\Core\Analyzers\UseNullPropagation\AbstractUseNullPropagationDiagnosticAnalyzer_IfStatement.cs (1)
89var whenPartIsNullable = semanticModel.GetTypeInfo(whenPartMatch).Type?.OriginalDefinition.SpecialType == SpecialType.System_Nullable_T;
src\Analyzers\Core\Analyzers\ValidateFormatString\AbstractValidateFormatStringDiagnosticAnalyzer.cs (1)
303if (containingType.SpecialType != SpecialType.System_String)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\IMethodSymbolExtensions.cs (2)
45method.Parameters is [{ Type.SpecialType: SpecialType.System_Object }, var secondParam] && 106methodSymbol.ReturnType.SpecialType == SpecialType.System_Int32 ||
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\INamedTypeSymbolExtensions.cs (1)
662ContainingType.SpecialType: SpecialType.System_Object,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.cs (2)
683if (!returnType.GetMembers().OfType<IPropertySymbol>().Any(p => p.Name == WellKnownMemberNames.IsCompleted && p.Type.SpecialType == SpecialType.System_Boolean && p.GetMethod != null)) 733ReturnType.SpecialType: SpecialType.System_Boolean,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.cs (10)
23=> type?.SpecialType.IsIntegralType() == true; 26=> type?.SpecialType.IsSignedIntegralType() == true; 59=> symbol?.SpecialType == SpecialType.System_Void; 62=> symbol?.OriginalDefinition.SpecialType == SpecialType.System_Nullable_T; 270switch (typeSymbol.SpecialType) 288switch (type.SpecialType) 376switch (symbol.SpecialType) 406typeSymbol.AllInterfaces.Any(static i => i.SpecialType == SpecialType.System_Collections_IEnumerable) && 654switch (type.SpecialType) 764namedType.OriginalDefinition.GetAttributes().Any(static a => a.AttributeClass?.SpecialType == SpecialType.System_Runtime_CompilerServices_InlineArrayAttribute);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticModelExtensions.cs (2)
170type.OriginalDefinition.SpecialType == SpecialType.System_Nullable_T || 187if (type.SpecialType == SpecialType.System_String)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SemanticFacts\ISemanticFactsExtensions.cs (1)
119=> type?.SpecialType is SpecialType.System_Single or SpecialType.System_Double;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.NamedTypeSymbolKey.cs (1)
27visitor.WriteBoolean(symbol.SpecialType == SpecialType.System_IntPtr);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (5)
492type1.EnumUnderlyingType?.SpecialType == type2.SpecialType; 759&& symbol.ContainingType.SpecialType == SpecialType.System_Object 1021if (newReceiverType.SpecialType != SpecialType.None) 1028return newSymbolContainingType.SpecialType is SpecialType.System_Array or
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EnumValueUtilities.cs (1)
34return CreateOne(enumType.EnumUnderlyingType.SpecialType);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.cs (1)
196=> symbol.IsKind(SymbolKind.NamedType, out ITypeSymbol? typeSymbol) && typeSymbol.SpecialType == SpecialType.System_Object;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.EquivalenceVisitor.cs (2)
351return x.SpecialType == y.SpecialType;
Microsoft.CodeAnalysis.CodeStyle.Fixes (17)
src\Analyzers\Core\CodeFixes\GenerateConstructor\AbstractGenerateConstructorService.State.cs (1)
385switch (type.SpecialType)
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.State.cs (1)
444inferredType = inferredType.SpecialType == SpecialType.System_Void
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator.cs (1)
279var condition3 = typeParameter.HasReferenceTypeConstraint && typeParameter.ConstraintTypes.Any(static ts => ts.IsReferenceType && ts.SpecialType != SpecialType.System_Object);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractFlagsEnumGenerator.cs (3)
81var underlyingSpecialType = enumType.EnumUnderlyingType.SpecialType; 175var underlyingSpecialType = enumType.EnumUnderlyingType.SpecialType; 191var underlyingSpecialType = enumType.EnumUnderlyingType.SpecialType;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationHelpers.cs (2)
84=> type != null && type.SpecialType == specialType; 134=> type?.SpecialType switch
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\INamedTypeSymbolExtensions.cs (1)
30namedType.SpecialType,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationMethodSymbol.cs (1)
80=> this.ReturnType == null || this.ReturnType.SpecialType == SpecialType.System_Void;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (1)
414switch (typeSymbol.SpecialType)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_Negate.cs (5)
186else if (operation is IIsTypeOperation { TypeOperand.SpecialType: SpecialType.System_Object } && generatorInternal.SupportsPatterns(semanticModel.SyntaxTree.Options)) 276var valueType = (operation as IIsPatternOperation)?.Value.Type?.SpecialType; 449if (containingType?.SpecialType == SpecialType.System_Array || 450containingType?.SpecialType == SpecialType.System_String) 458switch (type?.SpecialType)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\TypeInferenceService\AbstractTypeInferenceService.AbstractTypeInferrer.cs (1)
125symbol.ContainingType?.SpecialType == SpecialType.System_Enum;
Microsoft.CodeAnalysis.CSharp (3)
Compilation\CSharpCompilation.cs (1)
805return info.ConvertedType?.SpecialType != SpecialType.System_Void;
SymbolDisplay\SymbolDisplayVisitor.Types.cs (1)
637switch (symbol.SpecialType)
Symbols\TypedConstantExtensions.cs (1)
52SpecialType splType = ((INamedTypeSymbol)constant.Type!).EnumUnderlyingType!.SpecialType;
Microsoft.CodeAnalysis.CSharp.CodeStyle (36)
src\Analyzers\CSharp\Analyzers\ConvertProgram\ConvertProgramAnalysis_TopLevelStatements.cs (1)
94if (containingType.BaseType?.SpecialType != SpecialType.System_Object)
src\Analyzers\CSharp\Analyzers\MakeStructMemberReadOnly\CSharpMakeStructMemberReadOnlyAnalyzer.cs (1)
393if (methodReference.ContainingType.SpecialType is SpecialType.System_Object or SpecialType.System_ValueType)
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryLambdaExpression\CSharpRemoveUnnecessaryLambdaExpressionDiagnosticAnalyzer.cs (1)
123if (lambdaTypeInfo.ConvertedType == null || lambdaTypeInfo.ConvertedType.SpecialType is SpecialType.System_Object)
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForArrayDiagnosticAnalyzer.cs (2)
101var ienumerableType = convertedType.OriginalDefinition.SpecialType is SpecialType.System_Collections_Generic_IEnumerable_T 104i => i.OriginalDefinition.SpecialType == SpecialType.System_Collections_Generic_IEnumerable_T);
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (3)
304return type.OriginalDefinition.SpecialType 312return type.OriginalDefinition.SpecialType 354var capacityConstructor = GetAccessibleInstanceConstructor(constructors, c => c.Parameters is [{ Name: "capacity", Type.SpecialType: SpecialType.System_Int32 }]);
src\Analyzers\CSharp\Analyzers\UseCollectionInitializer\CSharpUseCollectionInitializerAnalyzer.cs (1)
82else if (firstParameter is { Type.SpecialType: SpecialType.System_Int32, Name: "capacity" })
src\Analyzers\CSharp\Analyzers\UseCompoundAssignment\CSharpUseCompoundCoalesceAssignmentDiagnosticAnalyzer.cs (2)
190if (symbol is null || !symbol.IsUserDefinedOperator() || symbol.ContainingType.SpecialType == SpecialType.System_String) 208symbol.ContainingType?.SpecialType == SpecialType.System_Object)
src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\Helpers.cs (5)
16=> method is { ContainingType.SpecialType: SpecialType.System_String, Name: nameof(string.Remove) }; 33p.Type.SpecialType == SpecialType.System_Int32) 80method.OriginalDefinition.Parameters[0].Type.SpecialType == SpecialType.System_Int32; 118=> parameter.Type.SpecialType == SpecialType.System_Int32 && 122=> parameter.Type.SpecialType == SpecialType.System_Int32 &&
src\Analyzers\CSharp\Analyzers\UseIsNullCheck\CSharpUseIsNullCheckForCastAndEqualityOperatorDiagnosticAnalyzer.cs (1)
76if (semanticModel.GetTypeInfo(castExpression.Type).Type?.SpecialType == SpecialType.System_Object)
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpAsAndNullCheckDiagnosticAnalyzer.cs (1)
88if (castType?.SpecialType == SpecialType.System_Object)
src\Analyzers\CSharp\Analyzers\UseSystemThreadingLock\CSharpUseSystemThreadingLockDiagnosticAnalyzer.cs (2)
94Type.SpecialType: SpecialType.System_Object, 248=> value.UnwrapImplicitConversion() is IObjectCreationOperation { Type.SpecialType: SpecialType.System_Object };
src\Analyzers\CSharp\Analyzers\UseUtf8StringLiteral\UseUtf8StringLiteralDiagnosticAnalyzer.cs (1)
78if (arrayCreationOperation.Type is not IArrayTypeSymbol { ElementType.SpecialType: SpecialType.System_Byte })
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ITypeSymbolExtensions.cs (1)
17switch (typeSymbol.SpecialType)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (14)
96while (current is IConversionOperation { Type.SpecialType: SpecialType.System_Delegate or SpecialType.System_MulticastDelegate }) 99if (current is IConversionOperation { Type.SpecialType: SpecialType.System_Object }) 552if (castNode.IsParentKind(SyntaxKind.Interpolation) && originalConversionOperation.Type?.SpecialType is SpecialType.System_Object) 647if (originalNamedConvertedType.OriginalDefinition.SpecialType is SpecialType.System_Collections_Generic_IEnumerable_T && 648namedCastedType.OriginalDefinition.SpecialType is SpecialType.System_Collections_Generic_IReadOnlyCollection_T or SpecialType.System_Collections_Generic_IReadOnlyList_T) 654if (originalNamedConvertedType.OriginalDefinition.SpecialType is SpecialType.System_Collections_Generic_ICollection_T && 655namedCastedType.OriginalDefinition.SpecialType is SpecialType.System_Collections_Generic_IList_T) 661if (originalNamedConvertedType.OriginalDefinition.SpecialType is SpecialType.System_Collections_Generic_ICollection_T or SpecialType.System_Collections_Generic_IList_T && 726if (current.ContainingType.SpecialType == SpecialType.System_Object) 822=> type.IsSignedIntegralType() || type?.SpecialType is SpecialType.System_IntPtr; 916if (binaryOperation.LeftOperand.Type?.SpecialType == SpecialType.System_Object && 923else if (binaryOperation.RightOperand.Type?.SpecialType == SpecialType.System_Object && 1106=> type?.SpecialType is SpecialType.System_Double or SpecialType.System_Single; 1393rewrittenType.SpecialType == SpecialType.System_Enum;
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (14)
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordHelpers.cs (3)
29methodSymbol.ReturnType.SpecialType == SpecialType.System_Boolean && 37methodSymbol.Parameters.First().Type.SpecialType == SpecialType.System_Object && 518else if (parameter.Type.SpecialType == SpecialType.System_Object)
src\Analyzers\CSharp\CodeFixes\FixReturnType\CSharpFixReturnTypeCodeFixProvider.cs (1)
102if (previousReturnType.SpecialType is SpecialType.System_Void ||
src\Analyzers\CSharp\CodeFixes\ReplaceDefaultLiteral\CSharpReplaceDefaultLiteralCodeFixProvider.cs (1)
96else if (type.SpecialType is SpecialType.System_IntPtr or SpecialType.System_UIntPtr)
src\Analyzers\CSharp\CodeFixes\UseUtf8StringLiteral\UseUtf8StringLiteralCodeFixProvider.cs (1)
67namedType.TypeArguments[0].SpecialType == SpecialType.System_Byte;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\ExpressionGenerator.cs (1)
290memberAccess = memberAccess.WithAdditionalAnnotations(SpecialTypeAnnotation.Create(type.SpecialType));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\NamedTypeGenerator.cs (2)
248var baseList = namedType.EnumUnderlyingType != null && namedType.EnumUnderlyingType.SpecialType != SpecialType.System_Int32 319if (namedType.TypeKind == TypeKind.Class && namedType.BaseType != null && namedType.BaseType.SpecialType != Microsoft.CodeAnalysis.SpecialType.System_Object)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\InternalExtensions.cs (1)
36if (typeInfo.Type != null && typeInfo.Type.SpecialType == SpecialType.System_Void)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeParameterSymbolExtensions.cs (1)
66if (type.SpecialType != SpecialType.System_Object)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.TypeSyntaxGeneratorVisitor.cs (2)
122syntax = IdentifierName(symbol.SpecialType == SpecialType.System_IntPtr ? "nint" : "nuint"); 226if (symbol.SpecialType == SpecialType.System_Void)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (1)
1143else if (symbol.OriginalDefinition.SpecialType == SpecialType.System_Nullable_T)
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (2)
CodeGeneration\SyntaxGeneratorTests.cs (2)
91Assert.Equal(SpecialType.System_String, typeInfo.Type.SpecialType); 92Assert.Equal(SpecialType.System_String, typeInfo.ConvertedType.SpecialType);
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (1)
CodeGen\IndexAndRangeTests.cs (1)
1002Assert.Equal(SpecialType.System_Int32, property.Parameters[0].Type.SpecialType);
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (8)
Attributes\AttributeTests_Tuples.cs (1)
647Assert.True(constant.Type.SpecialType == SpecialType.System_String);
Semantics\InlineArrayTests.cs (1)
115Assert.Equal(SpecialType.System_Runtime_CompilerServices_InlineArrayAttribute, t.SpecialType);
Semantics\PatternMatchingTests.cs (2)
11370Assert.Equal(SpecialType.System_String, typeInfo.Type.SpecialType); 11371Assert.Equal(SpecialType.System_String, typeInfo.ConvertedType.SpecialType);
Semantics\PatternMatchingTests2.cs (2)
2028Assert.Equal(SpecialType.System_Boolean, typeInfo.Type.SpecialType); 2069Assert.Equal(SpecialType.System_Boolean, typeInfo.Type.SpecialType);
Semantics\PatternSwitchTests.cs (2)
3288Assert.Equal(SpecialType.System_Boolean, type.Type.SpecialType); 3289Assert.Equal(SpecialType.System_Boolean, type.ConvertedType.SpecialType);
Microsoft.CodeAnalysis.CSharp.EndToEnd.UnitTests (1)
EndToEndTests.cs (1)
619Assert.Equal(SpecialType.System_String, type.SpecialType);
Microsoft.CodeAnalysis.CSharp.Features (44)
CodeRefactorings\UseRecursivePatterns\UseRecursivePatternsCodeRefactoringProvider.cs (1)
525ContainingType: not { SpecialType: SpecialType.System_Nullable_T }
Completion\CompletionProviders\DeclarationName\DeclarationNameRecommender.cs (3)
92if (type.SpecialType == SpecialType.System_Void) 141t => t.OriginalDefinition.SpecialType == SpecialType.System_Collections_Generic_IEnumerable_T || 165originalDefinition.SpecialType == SpecialType.System_Nullable_T)
Completion\CompletionProviders\EnumAndCompletionListTagCompletionProvider.cs (1)
114if (type.OriginalDefinition.SpecialType == SpecialType.System_Nullable_T)
ConvertLinq\CSharpConvertLinqQueryToForEachProvider.cs (5)
304methodSymbol.ReturnType?.SpecialType == SpecialType.System_Int32 && 369=> typeSymbol.SpecialType == SpecialType.System_Int32; 555if (returnTypeInfo.Type.OriginalDefinition?.SpecialType == SpecialType.System_Collections_Generic_IEnumerable_T) 561if (returnTypeInfo.ConvertedType.OriginalDefinition?.SpecialType == SpecialType.System_Collections_Generic_IEnumerable_T) 747if (methodSymbol.ReturnType.OriginalDefinition?.SpecialType != SpecialType.System_Collections_Generic_IEnumerable_T)
ExtractMethod\CSharpMethodExtractor.Analyzer.cs (1)
43return info.Type == null || info.Type.SpecialType == SpecialType.System_Object
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.cs (1)
596Parameters: [{ Type.SpecialType: SpecialType.System_Boolean }],
ExtractMethod\CSharpSelectionResult.ExpressionResult.cs (1)
119if (info.Type?.SpecialType == SpecialType.System_String &&
ExtractMethod\Extensions.cs (1)
258=> type == null || type.SpecialType == SpecialType.System_Object;
ReverseForStatement\CSharpReverseForStatementCodeRefactoringProvider.cs (1)
95return local?.Type.SpecialType switch
SignatureHelp\ElementAccessExpressionSignatureHelpProvider.cs (1)
66if (namedType.ConstructedFrom.SpecialType == SpecialType.System_Nullable_T &&
Snippets\CSharpConsoleSnippetProvider.cs (1)
42if (lambdaSymbol is IMethodSymbol { ReturnType: { SpecialType: SpecialType.System_Void } or { TypeKind: TypeKind.Error } })
src\Analyzers\CSharp\Analyzers\ConvertProgram\ConvertProgramAnalysis_TopLevelStatements.cs (1)
94if (containingType.BaseType?.SpecialType != SpecialType.System_Object)
src\Analyzers\CSharp\Analyzers\MakeStructMemberReadOnly\CSharpMakeStructMemberReadOnlyAnalyzer.cs (1)
393if (methodReference.ContainingType.SpecialType is SpecialType.System_Object or SpecialType.System_ValueType)
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryLambdaExpression\CSharpRemoveUnnecessaryLambdaExpressionDiagnosticAnalyzer.cs (1)
123if (lambdaTypeInfo.ConvertedType == null || lambdaTypeInfo.ConvertedType.SpecialType is SpecialType.System_Object)
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForArrayDiagnosticAnalyzer.cs (2)
101var ienumerableType = convertedType.OriginalDefinition.SpecialType is SpecialType.System_Collections_Generic_IEnumerable_T 104i => i.OriginalDefinition.SpecialType == SpecialType.System_Collections_Generic_IEnumerable_T);
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (3)
304return type.OriginalDefinition.SpecialType 312return type.OriginalDefinition.SpecialType 354var capacityConstructor = GetAccessibleInstanceConstructor(constructors, c => c.Parameters is [{ Name: "capacity", Type.SpecialType: SpecialType.System_Int32 }]);
src\Analyzers\CSharp\Analyzers\UseCollectionInitializer\CSharpUseCollectionInitializerAnalyzer.cs (1)
82else if (firstParameter is { Type.SpecialType: SpecialType.System_Int32, Name: "capacity" })
src\Analyzers\CSharp\Analyzers\UseCompoundAssignment\CSharpUseCompoundCoalesceAssignmentDiagnosticAnalyzer.cs (2)
190if (symbol is null || !symbol.IsUserDefinedOperator() || symbol.ContainingType.SpecialType == SpecialType.System_String) 208symbol.ContainingType?.SpecialType == SpecialType.System_Object)
src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\Helpers.cs (5)
16=> method is { ContainingType.SpecialType: SpecialType.System_String, Name: nameof(string.Remove) }; 33p.Type.SpecialType == SpecialType.System_Int32) 80method.OriginalDefinition.Parameters[0].Type.SpecialType == SpecialType.System_Int32; 118=> parameter.Type.SpecialType == SpecialType.System_Int32 && 122=> parameter.Type.SpecialType == SpecialType.System_Int32 &&
src\Analyzers\CSharp\Analyzers\UseIsNullCheck\CSharpUseIsNullCheckForCastAndEqualityOperatorDiagnosticAnalyzer.cs (1)
76if (semanticModel.GetTypeInfo(castExpression.Type).Type?.SpecialType == SpecialType.System_Object)
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpAsAndNullCheckDiagnosticAnalyzer.cs (1)
88if (castType?.SpecialType == SpecialType.System_Object)
src\Analyzers\CSharp\Analyzers\UseSystemThreadingLock\CSharpUseSystemThreadingLockDiagnosticAnalyzer.cs (2)
94Type.SpecialType: SpecialType.System_Object, 248=> value.UnwrapImplicitConversion() is IObjectCreationOperation { Type.SpecialType: SpecialType.System_Object };
src\Analyzers\CSharp\Analyzers\UseUtf8StringLiteral\UseUtf8StringLiteralDiagnosticAnalyzer.cs (1)
78if (arrayCreationOperation.Type is not IArrayTypeSymbol { ElementType.SpecialType: SpecialType.System_Byte })
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordHelpers.cs (3)
29methodSymbol.ReturnType.SpecialType == SpecialType.System_Boolean && 37methodSymbol.Parameters.First().Type.SpecialType == SpecialType.System_Object && 518else if (parameter.Type.SpecialType == SpecialType.System_Object)
src\Analyzers\CSharp\CodeFixes\FixReturnType\CSharpFixReturnTypeCodeFixProvider.cs (1)
102if (previousReturnType.SpecialType is SpecialType.System_Void ||
src\Analyzers\CSharp\CodeFixes\ReplaceDefaultLiteral\CSharpReplaceDefaultLiteralCodeFixProvider.cs (1)
96else if (type.SpecialType is SpecialType.System_IntPtr or SpecialType.System_UIntPtr)
src\Analyzers\CSharp\CodeFixes\UseUtf8StringLiteral\UseUtf8StringLiteralCodeFixProvider.cs (1)
67namedType.TypeArguments[0].SpecialType == SpecialType.System_Byte;
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (2)
IOperation\FunctionPointerOperations.cs (2)
210Assert.Equal(SpecialType.System_String, signature.Parameters[0].Type.SpecialType); 211Assert.Equal(SpecialType.System_Void, signature.ReturnType.SpecialType);
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (164)
Semantics\ConditionalOperatorTests.cs (1)
1303Assert.Equal(SpecialType.System_Boolean, model.GetTypeInfo(conditionalExpr.Condition).Type!.SpecialType);
Semantics\DeconstructionTests.cs (10)
5988Assert.Equal(SpecialType.System_Void, type.Type.SpecialType); 5989Assert.Equal(SpecialType.System_Void, type.ConvertedType.SpecialType); 6031Assert.Equal(SpecialType.System_Void, type.Type.SpecialType); 6032Assert.Equal(SpecialType.System_Void, type.ConvertedType.SpecialType); 6071Assert.Equal(SpecialType.System_Void, type.Type.SpecialType); 6072Assert.Equal(SpecialType.System_Void, type.ConvertedType.SpecialType); 6113Assert.Equal(SpecialType.System_Int32, type.Type.SpecialType); 6114Assert.Equal(SpecialType.System_Int32, type.ConvertedType.SpecialType); 6153Assert.Equal(SpecialType.System_Void, type.Type.SpecialType); 6154Assert.Equal(SpecialType.System_Void, type.ConvertedType.SpecialType);
Semantics\DelegateTypeTests.cs (21)
752Assert.Equal(SpecialType.System_Delegate, typeInfo.ConvertedType!.SpecialType); 898Assert.Equal(SpecialType.System_Delegate, typeInfo.ConvertedType!.SpecialType); 1214Assert.Equal(SpecialType.System_Delegate, typeInfo.ConvertedType!.SpecialType); 1250Assert.Equal(SpecialType.System_Delegate, typeInfo.ConvertedType!.SpecialType); 1335Assert.Equal(SpecialType.System_Delegate, typeInfo.ConvertedType!.SpecialType); 1375Assert.Equal(SpecialType.System_Delegate, typeInfo.ConvertedType!.SpecialType); 1418Assert.Equal(SpecialType.System_Delegate, typeInfo.ConvertedType!.SpecialType); 1462Assert.Equal(SpecialType.System_Delegate, typeInfo.ConvertedType!.SpecialType); 1557Assert.Equal(SpecialType.System_Delegate, typeInfo.ConvertedType!.SpecialType); 1637Assert.Equal(SpecialType.System_Delegate, typeInfo.ConvertedType!.SpecialType); 1687Assert.Equal(SpecialType.System_Delegate, typeInfo.ConvertedType!.SpecialType); 1737Assert.Equal(SpecialType.System_Delegate, typeInfo.ConvertedType!.SpecialType); 1787Assert.Equal(SpecialType.System_Delegate, typeInfo.ConvertedType!.SpecialType); 1837Assert.Equal(SpecialType.System_Delegate, typeInfo.ConvertedType!.SpecialType); 1887Assert.Equal(SpecialType.System_Delegate, typeInfo.ConvertedType!.SpecialType); 1937Assert.Equal(SpecialType.System_Delegate, typeInfo.ConvertedType!.SpecialType); 1983Assert.Equal(SpecialType.System_Delegate, typeInfo.ConvertedType!.SpecialType); 2031Assert.Equal(SpecialType.System_Delegate, typeInfo.ConvertedType!.SpecialType); 3610Assert.Equal(SpecialType.System_Delegate, typeInfo.ConvertedType!.SpecialType); 8031Assert.Equal(SpecialType.System_Delegate, typeInfo.ConvertedType!.SpecialType); 8054Assert.Equal(SpecialType.System_Delegate, typeInfo.ConvertedType!.SpecialType);
Semantics\ExpressionBodiedMemberTests.cs (9)
75Assert.Equal(SpecialType.System_Int32, semanticInfo.Type.SpecialType); 76Assert.Equal(SpecialType.System_Int32, semanticInfo.ConvertedType.SpecialType); 139Assert.Equal(SpecialType.System_Int32, semanticInfo.Type.SpecialType); 178Assert.Equal(SpecialType.System_String, semanticInfo.Type.SpecialType); 179Assert.Equal(SpecialType.System_Object, semanticInfo.ConvertedType.SpecialType); 226Assert.Equal(SpecialType.System_Int32, semanticInfo.Type.SpecialType); 227Assert.Equal(SpecialType.System_Int32, semanticInfo.ConvertedType.SpecialType); 315Assert.Equal(SpecialType.System_Int32, semanticInfo.Type.SpecialType); 316Assert.Equal(SpecialType.System_Int32, semanticInfo.ConvertedType.SpecialType);
Semantics\ForEachTests.cs (5)
2140Assert.Equal(SpecialType.System_Object, loopInfo.CurrentProperty.Type.SpecialType); 2144Assert.Equal(SpecialType.System_Char, typeInfo.Type.SpecialType); 2189Assert.Equal(SpecialType.System_String, loopInfo0.ElementType.SpecialType); 2198Assert.Equal(SpecialType.System_Object, loopInfo1.ElementType.SpecialType); // No longer string. 2890Assert.Equal(SpecialType.System_String, localSymbolType.SpecialType);
Semantics\FunctionPointerTests.cs (5)
211Assert.True(typeInfo.ConvertedType is IPointerTypeSymbol { PointedAtType: { SpecialType: SpecialType.System_Void } }); 1619Assert.Equal(SpecialType.System_String, methodSymbol.TypeArguments[0].SpecialType); 1621Assert.Equal(SpecialType.System_String, functionPointer.Signature.Parameters[0].Type.SpecialType); 1779Assert.Equal(SpecialType.System_String, methodSymbol.TypeArguments[0].SpecialType); 1781Assert.Equal(SpecialType.System_String, functionPointer.Signature.ReturnType.SpecialType);
Semantics\GenericConstraintsTests.cs (2)
3175Assert.Equal(SpecialType.System_Int32, inferredMethod.TypeArguments.Single().SpecialType); 3230Assert.Equal(SpecialType.System_Int32, inferredMethod.TypeArguments.Single().SpecialType);
Semantics\InteractiveSemanticModelTests.cs (3)
126Assert.Equal(SpecialType.System_Int32, bindInfo.Type.SpecialType); 141Assert.Equal(SpecialType.System_Int32, bindInfo.Type.SpecialType); 268Assert.Equal(SpecialType.System_Char, semanticInfo.Type.SpecialType);
Semantics\InteractiveUsingTests.cs (5)
26Assert.Equal(SpecialType.System_String, GetSpeculativeType(sub, "String").SpecialType); 35Assert.Equal(SpecialType.System_Int32, GetSpeculativeType(sub, "I").SpecialType); 187Assert.Equal(SpecialType.System_Int32, GetSpeculativeType(sub1, "A").SpecialType); 190Assert.Equal(SpecialType.System_Int16, GetSpeculativeType(sub2, "A").SpecialType); 196Assert.Equal(SpecialType.System_Int64, GetSpeculativeType(sub4, "A").SpecialType);
Semantics\InterpolationTests.cs (4)
4607Assert.Equal(SpecialType.System_String, semanticInfo.Type.SpecialType); 4828Assert.Equal(SpecialType.System_Object, semanticInfo.ConvertedType.SpecialType); 4834Assert.Equal(SpecialType.System_String, semanticInfo.Type.SpecialType); 4835Assert.Equal(SpecialType.System_String, semanticInfo.ConvertedType.SpecialType);
Semantics\LocalFunctionTests.cs (7)
458Assert.Equal(SpecialType.System_Int32, argType0.SpecialType); 464Assert.Equal(SpecialType.System_String, argType1.SpecialType); 620Assert.Equal(SpecialType.System_String, model.GetTypeInfo(arg1.Expression).Type.SpecialType); 624Assert.Equal(SpecialType.System_String, model.GetTypeInfo(arg2.Expression).Type.SpecialType); 628Assert.Equal(SpecialType.System_String, model.GetTypeInfo(arg3.Expression).Type.SpecialType); 673Assert.Equal(SpecialType.System_Boolean, model.GetTypeInfo(arg.Expression).Type.SpecialType); 727Assert.Equal(SpecialType.System_Boolean, model.GetTypeInfo(arg.Expression).Type.SpecialType);
Semantics\LockTests.cs (1)
48Assert.Equal(SpecialType.System_Object, localSymbol.Type.SpecialType);
Semantics\MethodTypeInferenceTests.cs (2)
1050Assert.Equal(SpecialType.System_Char, method.TypeArguments.Single().SpecialType); 1080Assert.Equal(SpecialType.System_Char, method.TypeArguments.Single().SpecialType);
Semantics\NativeIntegerTests.cs (4)
237Assert.Equal(signed ? SpecialType.System_IntPtr : SpecialType.System_UIntPtr, type.SpecialType); 737Assert.Equal(specialType, type.SpecialType); 3638Assert.Equal(SpecialType.None, underlyingType.SpecialType); 4124Assert.Equal(SpecialType.None, type.SpecialType);
Semantics\NullCoalesceAssignmentTests.cs (2)
186Assert.Equal(SpecialType.System_Int32, semanticModel.GetTypeInfo(defaultLiteral).Type.SpecialType); 187Assert.Equal(SpecialType.System_Int32, semanticModel.GetTypeInfo(defaultLiteral).ConvertedType.SpecialType);
Semantics\ObjectAndCollectionInitializerTests.cs (7)
3844Assert.Equal(SpecialType.System_String, typeInfo.Type.SpecialType); 3845Assert.Equal(SpecialType.System_Object, typeInfo.ConvertedType.SpecialType); 3868Assert.Equal(SpecialType.System_Int32, typeInfo.Type.SpecialType); 3869Assert.Equal(SpecialType.System_Object, typeInfo.ConvertedType.SpecialType); 4099Assert.Equal(SpecialType.System_Int32, typeInfo.Type.SpecialType); 4100Assert.Equal(SpecialType.System_Int32, typeInfo.ConvertedType.SpecialType); 4171Assert.Equal(SpecialType.System_Int32, typeInfo.Type.SpecialType);
Semantics\OperatorTests.cs (1)
7639symbol1.ContainingType.SpecialType == SpecialType.System_Char);
Semantics\OverloadResolutionTests.cs (1)
7262Assert.Equal(SpecialType.System_Int32, methodSymbol.TypeArguments.Single().SpecialType);
Semantics\QueryTests.cs (6)
2179Assert.Equal(SpecialType.System_Int32, info.Type.SpecialType); 2209Assert.Equal(SpecialType.System_Int32, info.Type.SpecialType); 2236Assert.Equal(SpecialType.System_Int32, info.Type.SpecialType); 2242Assert.Equal(SpecialType.System_Int32, info.Type.SpecialType); 2248Assert.Equal(SpecialType.System_Int32, info2.Type.SpecialType); 2301Assert.Equal(SpecialType.System_Int32, info.Type.SpecialType);
Semantics\RawInterpolationTests_Handler.cs (4)
2908Assert.Equal(SpecialType.System_String, semanticInfo.Type.SpecialType); 3129Assert.Equal(SpecialType.System_Object, semanticInfo.ConvertedType.SpecialType); 3135Assert.Equal(SpecialType.System_String, semanticInfo.Type.SpecialType); 3136Assert.Equal(SpecialType.System_String, semanticInfo.ConvertedType.SpecialType);
Semantics\RefLocalsAndReturnsTests.cs (12)
4755Assert.Equal(SpecialType.System_Int32, ((IArrayTypeSymbol)model.GetTypeInfo(left).Type).ElementType.SpecialType); 4758Assert.Equal(SpecialType.System_Int32, model.GetTypeInfo(right).Type.SpecialType); 4783Assert.Equal(SpecialType.System_Int32, ((IPointerTypeSymbol)model.GetTypeInfo(left).Type).PointedAtType.SpecialType); 4786Assert.Equal(SpecialType.System_Int32, model.GetTypeInfo(right).Type.SpecialType); 4811Assert.Equal(SpecialType.System_Int32, ((IPointerTypeSymbol)model.GetTypeInfo(left).Type).PointedAtType.SpecialType); 4814Assert.Equal(SpecialType.System_Int32, model.GetTypeInfo(right).Type.SpecialType); 4839Assert.Equal(SpecialType.System_Int32, model.GetTypeInfo(left).Type.SpecialType); 4842Assert.Equal(SpecialType.System_Int32, model.GetTypeInfo(right).Type.SpecialType); 4870Assert.Equal(SpecialType.System_Int32, model.GetTypeInfo(right).Type.SpecialType); 4898Assert.Equal(SpecialType.System_Int32, model.GetTypeInfo(right).Type.SpecialType); 4929Assert.Equal(SpecialType.System_Object, model.GetTypeInfo(left).Type.SpecialType); 4932Assert.Equal(SpecialType.System_Int32, model.GetTypeInfo(right).Type.SpecialType);
Semantics\StackAllocInitializerTests.cs (13)
1054Assert.Equal(SpecialType.System_Int32, ((IPointerTypeSymbol)obj1Value.Type).PointedAtType.SpecialType); 1062Assert.Equal(SpecialType.System_Int32, ((IPointerTypeSymbol)obj2Value.Type).PointedAtType.SpecialType); 1063Assert.Equal(SpecialType.System_Int32, ((IPointerTypeSymbol)obj2Value.ConvertedType).PointedAtType.SpecialType); 1078Assert.Equal(SpecialType.System_Int32, ((IPointerTypeSymbol)obj4Value.Type).PointedAtType.SpecialType); 1079Assert.Equal(SpecialType.System_Int32, ((IPointerTypeSymbol)obj4Value.ConvertedType).PointedAtType.SpecialType); 1086Assert.Equal(SpecialType.System_Int32, ((IPointerTypeSymbol)obj5Value.Type).PointedAtType.SpecialType); 1087Assert.Equal(SpecialType.System_Double, ((IPointerTypeSymbol)obj5Value.ConvertedType).PointedAtType.SpecialType); 1165Assert.Equal(SpecialType.System_Int32, ((IPointerTypeSymbol)obj2Value.Type).PointedAtType.SpecialType); 1166Assert.Equal(SpecialType.System_Int32, ((IPointerTypeSymbol)obj2Value.ConvertedType).PointedAtType.SpecialType); 1181Assert.Equal(SpecialType.System_Int32, ((IPointerTypeSymbol)obj4Value.Type).PointedAtType.SpecialType); 1182Assert.Equal(SpecialType.System_Int32, ((IPointerTypeSymbol)obj4Value.ConvertedType).PointedAtType.SpecialType); 1189Assert.Equal(SpecialType.System_Int32, ((IPointerTypeSymbol)obj5Value.Type).PointedAtType.SpecialType); 1190Assert.Equal(SpecialType.System_Double, ((IPointerTypeSymbol)obj5Value.ConvertedType).PointedAtType.SpecialType);
Semantics\StackAllocSpanExpressionsTests.cs (13)
60Assert.Equal(SpecialType.System_Int32, ((IPointerTypeSymbol)obj1Value.Type).PointedAtType.SpecialType); 68Assert.Equal(SpecialType.System_Int32, ((IPointerTypeSymbol)obj2Value.Type).PointedAtType.SpecialType); 69Assert.Equal(SpecialType.System_Int32, ((IPointerTypeSymbol)obj2Value.ConvertedType).PointedAtType.SpecialType); 84Assert.Equal(SpecialType.System_Int32, ((IPointerTypeSymbol)obj4Value.Type).PointedAtType.SpecialType); 85Assert.Equal(SpecialType.System_Int32, ((IPointerTypeSymbol)obj4Value.ConvertedType).PointedAtType.SpecialType); 92Assert.Equal(SpecialType.System_Int32, ((IPointerTypeSymbol)obj5Value.Type).PointedAtType.SpecialType); 93Assert.Equal(SpecialType.System_Double, ((IPointerTypeSymbol)obj5Value.ConvertedType).PointedAtType.SpecialType); 143Assert.Equal(SpecialType.System_Int32, ((IPointerTypeSymbol)obj2Value.Type).PointedAtType.SpecialType); 144Assert.Equal(SpecialType.System_Int32, ((IPointerTypeSymbol)obj2Value.ConvertedType).PointedAtType.SpecialType); 159Assert.Equal(SpecialType.System_Int32, ((IPointerTypeSymbol)obj4Value.Type).PointedAtType.SpecialType); 160Assert.Equal(SpecialType.System_Int32, ((IPointerTypeSymbol)obj4Value.ConvertedType).PointedAtType.SpecialType); 167Assert.Equal(SpecialType.System_Int32, ((IPointerTypeSymbol)obj5Value.Type).PointedAtType.SpecialType); 168Assert.Equal(SpecialType.System_Double, ((IPointerTypeSymbol)obj5Value.ConvertedType).PointedAtType.SpecialType);
Semantics\TargetTypedConditionalOperatorTests.cs (1)
363Assert.Equal(SpecialType.System_Boolean, model.GetTypeInfo(conditionalExpr.Condition).Type!.SpecialType);
Semantics\UnsafeTests.cs (23)
7272Assert.Equal(SpecialType.System_Int32, ((IPointerTypeSymbol)type).PointedAtType.SpecialType); 7549Assert.Equal(SpecialType.System_Int32, type.SpecialType); 7882Assert.Equal(SpecialType.System_Void, callSummary.Type.SpecialType); 7883Assert.Equal(SpecialType.System_Void, callSummary.ConvertedType.SpecialType); 7945Assert.Equal(SpecialType.System_Void, callSummary.Type.SpecialType); 8388Assert.NotEqual(SpecialType.System_Void, ((IPointerTypeSymbol)type).PointedAtType.SpecialType); 8392Assert.Equal(SpecialType.System_Void, ((IPointerTypeSymbol)convertedType).PointedAtType.SpecialType); 8917Assert.Equal(SpecialType.System_Int64, summary.Type.SpecialType); 8918Assert.Equal(SpecialType.System_Int64, summary.ConvertedType.SpecialType); 9344Assert.Equal(SpecialType.System_Boolean, summary.Type.SpecialType); 9345Assert.Equal(SpecialType.System_Boolean, summary.ConvertedType.SpecialType); 10187Assert.Equal(SpecialType.System_Char, ((IPointerTypeSymbol)type).PointedAtType.SpecialType); 10636Assert.NotEqual(SpecialType.None, type.SpecialType); 10649Assert.Equal(SpecialType.System_Int32, sizeOfSummary.Type.SpecialType); 10655Assert.Equal(s_specialTypeSizeOfMap[type.SpecialType], sizeOfSummary.ConstantValue); 10711Assert.Equal(SpecialType.System_Int32, sizeOfSummary.Type.SpecialType); 10758Assert.Equal(SpecialType.None, type.SpecialType); 10771Assert.Equal(SpecialType.System_Int32, sizeOfSummary.Type.SpecialType); 11311Assert.Equal(SpecialType.System_Char, ((IPointerTypeSymbol)stackAllocSummary.Type).PointedAtType.SpecialType); 11312Assert.Equal(SpecialType.System_Void, ((IPointerTypeSymbol)stackAllocSummary.ConvertedType).PointedAtType.SpecialType); 11323Assert.Equal(SpecialType.System_Char, typeSummary.Type.SpecialType); 11335Assert.Equal(SpecialType.System_Int16, countSummary.Type.SpecialType); 11336Assert.Equal(SpecialType.System_Int32, countSummary.ConvertedType.SpecialType);
Semantics\UsingStatementTests.cs (2)
67Assert.Equal(SpecialType.System_IDisposable, declaredLocal.Type.SpecialType); 1855Assert.Equal(SpecialType.System_Int32, model.GetTypeInfo(node).Type.SpecialType);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (105)
Compilation\GetSemanticInfoBrokenCodeTests.cs (1)
271Assert.Equal(SpecialType.System_Int32, info.Type.SpecialType);
Compilation\GetSemanticInfoTests.cs (39)
1143Assert.Equal(SpecialType.System_Boolean, info.Type.SpecialType); 1325Assert.Equal(SpecialType.System_Void, bindInfo.Type.SpecialType); 1352Assert.Equal(SpecialType.System_Void, bindInfo.Type.SpecialType); 1380Assert.Equal(SpecialType.System_Void, bindInfo.Type.SpecialType); 1422Assert.Equal(SpecialType.System_Int32, bindInfo.Type.SpecialType); 1423Assert.Equal(SpecialType.System_Int32, bindInfo.ConvertedType.SpecialType); 1463Assert.Equal(SpecialType.System_Int32, bindInfo.Type.SpecialType); //still have the type since all candidates agree 1464Assert.Equal(SpecialType.System_Int32, bindInfo.ConvertedType.SpecialType); 2458Assert.Equal(SpecialType.System_Double, info.Type.SpecialType); 2459Assert.Equal(SpecialType.System_Double, info.ConvertedType.SpecialType); 2487Assert.Equal(SpecialType.System_Int32, info.Type.SpecialType); 2488Assert.Equal(SpecialType.System_Int32, info.ConvertedType.SpecialType); 2511Assert.Equal(SpecialType.System_Int32, info.Type.SpecialType); 2512Assert.Equal(SpecialType.System_Int32, info.ConvertedType.SpecialType); 3611Assert.Equal(SpecialType.System_Int32, literalTypeInfo.Type.SpecialType); 3612Assert.Equal(SpecialType.System_Object, literalTypeInfo.ConvertedType.SpecialType); 3636Assert.Equal(SpecialType.System_Int32, literalTypeInfo.Type.SpecialType); 3637Assert.Equal(SpecialType.System_Int32, literalTypeInfo.ConvertedType.SpecialType); 3644Assert.Equal(SpecialType.System_Int64, castTypeInfo.Type.SpecialType); 3645Assert.Equal(SpecialType.System_Object, castTypeInfo.ConvertedType.SpecialType); 3669Assert.Equal(SpecialType.System_Int32, literalTypeInfo.Type.SpecialType); 3670Assert.Equal(SpecialType.System_Int32, literalTypeInfo.ConvertedType.SpecialType); 3677Assert.Equal(SpecialType.System_Object, castTypeInfo.Type.SpecialType); 3678Assert.Equal(SpecialType.System_Object, castTypeInfo.ConvertedType.SpecialType); 3705Assert.Equal(SpecialType.System_Int32, literalTypeInfo.Type.SpecialType); 3706Assert.Equal(SpecialType.System_Int32, literalTypeInfo.ConvertedType.SpecialType); 3713Assert.Equal(SpecialType.System_Int64, cast1TypeInfo.Type.SpecialType); 3714Assert.Equal(SpecialType.System_Int64, cast1TypeInfo.ConvertedType.SpecialType); 3725Assert.Equal(SpecialType.System_Object, cast2TypeInfo.Type.SpecialType); 3726Assert.Equal(SpecialType.System_Object, cast2TypeInfo.ConvertedType.SpecialType); 4116Assert.Equal(SpecialType.System_Collections_Generic_IEnumerable_T, ((ITypeSymbol)info0.Symbol.OriginalDefinition).SpecialType); 4117Assert.Equal(SpecialType.System_Int32, ((INamedTypeSymbol)info0.Symbol).TypeArguments.Single().SpecialType); 4120Assert.Equal(SpecialType.System_Int32, ((ITypeSymbol)info1.Symbol).SpecialType); 4124Assert.Equal(SpecialType.System_Collections_Generic_IEnumerable_T, ((ITypeSymbol)info2.Symbol.OriginalDefinition).SpecialType); 4125Assert.Equal(SpecialType.System_Int32, ((INamedTypeSymbol)info2.Symbol).TypeArguments.Single().SpecialType); 4171Assert.Equal(SpecialType.System_Int32, ((ITypeSymbol)info1.Symbol).SpecialType); 4175Assert.Equal(SpecialType.System_Collections_Generic_IEnumerable_T, ((ITypeSymbol)info2.Symbol.OriginalDefinition).SpecialType); 4176Assert.Equal(SpecialType.System_Int32, ((INamedTypeSymbol)info2.Symbol).TypeArguments.Single().SpecialType); 5916Assert.Equal(SpecialType.System_Boolean, model.GetTypeInfo(expr).Type.SpecialType);
Compilation\SemanticModelAPITests.cs (23)
55Assert.Equal(SpecialType.System_Int32, typeInfo.Type.SpecialType); 59Assert.Equal(SpecialType.System_Char, typeInfo.Type.SpecialType); 142Assert.Equal(SpecialType.System_Int32, typeInfo.Type.SpecialType); 152Assert.Equal(SpecialType.System_Char, typeInfo.Type.SpecialType); 3166Assert.Equal(SpecialType.System_Int32, info.Type.SpecialType); 3201Assert.Equal(SpecialType.System_Int32, info.Type.SpecialType); 3202Assert.Equal(SpecialType.System_Int64, info.ConvertedType.SpecialType); 3916Assert.True(typeInfo0.Type != null && typeInfo0.Type.SpecialType == SpecialType.System_Int16); 4190Assert.Equal(SpecialType.System_String, model.GetTypeInfo(actual[0]).Type.SpecialType); 4215Assert.Equal(SpecialType.System_Int32, model.GetTypeInfo(actual[0]).Type.SpecialType); 4219Assert.Equal(SpecialType.System_Boolean, model.GetTypeInfo(actual[1]).Type.SpecialType); 4280Assert.Equal(SpecialType.System_String, model.GetTypeInfo(actual[0]).Type.SpecialType); 4284Assert.Equal(SpecialType.System_String, model.GetTypeInfo(actual[1]).Type.SpecialType); 4287Assert.Equal(SpecialType.System_String, model.GetTypeInfo(actual[2]).Type.SpecialType); 4291Assert.Equal(SpecialType.System_String, model.GetTypeInfo(actual[3]).Type.SpecialType); 4295Assert.Equal(SpecialType.System_String, model.GetTypeInfo(actual[4]).Type.SpecialType); 4299Assert.Equal(SpecialType.System_String, model.GetTypeInfo(actual[5]).Type.SpecialType); 4303Assert.Equal(SpecialType.System_String, model.GetTypeInfo(actual[6]).Type.SpecialType); 4307Assert.Equal(SpecialType.System_String, model.GetTypeInfo(actual[7]).Type.SpecialType); 4433Assert.Equal(SpecialType.System_Boolean, originalTypeInfo.Type.SpecialType); 4436Assert.Equal(SpecialType.System_Boolean, speculativeTypeInfo.Type.SpecialType); 4504Assert.Equal(SpecialType.System_String, type.TupleElements[0].Type.SpecialType); 4505Assert.Equal(SpecialType.System_Int32, type.TupleElements[1].Type.SpecialType);
Compilation\SemanticModelGetDeclaredSymbolAPITests.cs (2)
1387Assert.Equal(9, symbolsInC.Where(s => s.ContainingType == null || s.ContainingType.SpecialType != SpecialType.System_Object).Count()); 3674Assert.Equal(SpecialType.System_Int32, parameter.Type.SpecialType);
Compilation\SemanticModelGetSemanticInfoTests.cs (16)
342Assert.Equal(SpecialType.System_String, semanticInfo.Type.SpecialType); 430Assert.Equal(SpecialType.System_String, semanticInfo.Type.SpecialType); 5356Assert.Equal(SpecialType.System_Int32, semanticInfo.Type.SpecialType); 5381Assert.Equal(SpecialType.System_Int32, semanticInfo.Type.SpecialType); 6090Assert.Equal(SpecialType.System_Void, semanticInfo.Type.SpecialType); 6209Assert.Equal(SpecialType.System_Int32, semanticInfo.Type.SpecialType); 6229Assert.Equal(SpecialType.System_String, ((IArrayTypeSymbol)semanticInfo.Type).ElementType.SpecialType); 6231Assert.Equal(SpecialType.System_Collections_IEnumerable, semanticInfo.ConvertedType.SpecialType); 6251Assert.Equal(SpecialType.System_String, semanticInfo.Type.SpecialType); 6255Assert.Equal(SpecialType.System_String, ((ITypeSymbol)symbol).SpecialType); 8173Assert.Equal(SpecialType.System_Int32, semanticInfo.Type.SpecialType); 8197Assert.Equal(SpecialType.System_Int32, semanticInfo.Type.SpecialType); 8218Assert.Equal(SpecialType.System_Int32, semanticInfo.Type.SpecialType); 8334Assert.Equal(SpecialType.System_Int32, semanticInfo.Type.SpecialType); 9096Assert.Equal(SpecialType.System_Int32, semanticInfo.Type.SpecialType); 10985Assert.Equal(SpecialType.System_Int32, semanticInfo.Type.SpecialType);
Compilation\SemanticModelGetSemanticInfoTests_LateBound.cs (2)
379Assert.Equal(SpecialType.System_Int32, semanticInfo.Type.SpecialType); 380Assert.Equal(SpecialType.System_Int32, semanticInfo.ConvertedType.SpecialType);
DocumentationComments\CrefTests.cs (1)
5720Assert.Equal(SpecialType.System_Decimal, symbol.ContainingType.SpecialType);
Symbols\CompilationCreationTests.cs (1)
103Assert.Equal(SpecialType.None, c2.GlobalNamespace.GetTypeMembers("C107").Single().SpecialType);
Symbols\ConversionTests.cs (2)
2146Assert.Equal(SpecialType.System_Byte, method.Parameters.Single().Type.SpecialType); 2180Assert.Equal(SpecialType.System_Byte, method.Parameters.Single().Type.SpecialType);
Symbols\CorLibrary\CorTypes.cs (2)
199Assert.Equal((SpecialType)i, t.SpecialType); 211Assert.Equal(SpecialType.None, t.SpecialType);
Symbols\ExtensionMethodTests.cs (1)
4095Assert.Equal(SpecialType.System_Void, systemVoidType.SpecialType);
Symbols\Metadata\PE\LoadingFields.cs (1)
152Assert.Equal(SpecialType.None, readOnlySpanType.SpecialType);
Symbols\MissingSpecialMember.cs (4)
159Assert.Equal(SpecialType.System_String, specialType.SpecialType); 164Assert.Equal(SpecialType.None, lookupType.SpecialType); 237Assert.Equal(SpecialType.System_Nullable_T, specialType.SpecialType); 241Assert.Equal(SpecialType.System_Nullable_T, lookupType.SpecialType);
Symbols\Source\BaseClassTests.cs (2)
2033Assert.Equal(SpecialType.System_Int32, typeInfo.Type.SpecialType); 2034Assert.Equal(SpecialType.System_Int64, typeInfo.ConvertedType.SpecialType);
Symbols\Source\EnumTests.cs (1)
986Assert.Equal(SpecialType.System_Int32, type.SpecialType);
Symbols\Source\NullablePublicAPITests.cs (5)
2637Assert.Equal(SpecialType.System_String, symbol.Type.SpecialType); 4218Assert.Equal(SpecialType.System_String, ((IFieldSymbol)symbolInfo.Symbol).Type.SpecialType); 4248Assert.Equal(SpecialType.System_String, symbolInfo.Type.SpecialType); 5200Assert.Equal(SpecialType.System_String, typeInfo.Type.SpecialType); 5235Assert.Equal(SpecialType.System_String, typeInfo.Type.SpecialType);
Symbols\Source\UsingAliasTests.cs (2)
106Assert.Equal(SpecialType.System_Object, usingAliasType.SpecialType); 221Assert.Equal(SpecialType.System_Object, usingAliasType.SpecialType);
Microsoft.CodeAnalysis.CSharp.WinRT.UnitTests (1)
CodeGen\WinMdEventTests.cs (1)
673Assert.Equal(SpecialType.System_Void, type.Type.SpecialType);
Microsoft.CodeAnalysis.CSharp.Workspaces (36)
CodeGeneration\CSharpSyntaxGenerator.cs (1)
3238switch (type.SpecialType)
Recommendations\CSharpRecommendationServiceRunner.cs (1)
872symbol.ContainingType.SpecialType is SpecialType.System_Object or SpecialType.System_ValueType)
Recommendations\CSharpRecommendationServiceRunner_Conversions.cs (1)
211=> container.SpecialType switch
Recommendations\CSharpRecommendationServiceRunner_Operators.cs (2)
55=> container.IsSpecialType() || container.SpecialType is SpecialType.System_IntPtr or SpecialType.System_UIntPtr; 96return symbol.Parameters.Length == 2 && symbol.ReturnType.SpecialType == SpecialType.System_Boolean;
Rename\CSharpRenameRewriterLanguageService.cs (1)
1058if (!method.ReturnsVoid && !method.Parameters.Any() && method.ReturnType.SpecialType == SpecialType.System_Boolean)
Simplification\Simplifiers\AbstractCSharpSimplifier.cs (3)
154var keywordToken = TryGetPredefinedKeywordToken(semanticModel, type.SpecialType); 168var keywordToken = TryGetPredefinedKeywordToken(semanticModel, type.SpecialType); 387semanticModel.GetTypeInfo(invocationExpr).Type.SpecialType == SpecialType.System_String;
Simplification\Simplifiers\ExpressionSimplifier.cs (1)
180var keywordToken = TryGetPredefinedKeywordToken(semanticModel, namedType.SpecialType);
Simplification\Simplifiers\NameSimplifier.cs (2)
253var keywordToken = TryGetPredefinedKeywordToken(semanticModel, type.SpecialType); 262var keywordToken = TryGetPredefinedKeywordToken(semanticModel, namedType.SpecialType);
Simplification\Simplifiers\QualifiedCrefSimplifier.cs (1)
50var keywordToken = TryGetPredefinedKeywordToken(semanticModel, namedSymbol.SpecialType);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ITypeSymbolExtensions.cs (1)
17switch (typeSymbol.SpecialType)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (14)
96while (current is IConversionOperation { Type.SpecialType: SpecialType.System_Delegate or SpecialType.System_MulticastDelegate }) 99if (current is IConversionOperation { Type.SpecialType: SpecialType.System_Object }) 552if (castNode.IsParentKind(SyntaxKind.Interpolation) && originalConversionOperation.Type?.SpecialType is SpecialType.System_Object) 647if (originalNamedConvertedType.OriginalDefinition.SpecialType is SpecialType.System_Collections_Generic_IEnumerable_T && 648namedCastedType.OriginalDefinition.SpecialType is SpecialType.System_Collections_Generic_IReadOnlyCollection_T or SpecialType.System_Collections_Generic_IReadOnlyList_T) 654if (originalNamedConvertedType.OriginalDefinition.SpecialType is SpecialType.System_Collections_Generic_ICollection_T && 655namedCastedType.OriginalDefinition.SpecialType is SpecialType.System_Collections_Generic_IList_T) 661if (originalNamedConvertedType.OriginalDefinition.SpecialType is SpecialType.System_Collections_Generic_ICollection_T or SpecialType.System_Collections_Generic_IList_T && 726if (current.ContainingType.SpecialType == SpecialType.System_Object) 822=> type.IsSignedIntegralType() || type?.SpecialType is SpecialType.System_IntPtr; 916if (binaryOperation.LeftOperand.Type?.SpecialType == SpecialType.System_Object && 923else if (binaryOperation.RightOperand.Type?.SpecialType == SpecialType.System_Object && 1106=> type?.SpecialType is SpecialType.System_Double or SpecialType.System_Single; 1393rewrittenType.SpecialType == SpecialType.System_Enum;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\ExpressionGenerator.cs (1)
290memberAccess = memberAccess.WithAdditionalAnnotations(SpecialTypeAnnotation.Create(type.SpecialType));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\NamedTypeGenerator.cs (2)
248var baseList = namedType.EnumUnderlyingType != null && namedType.EnumUnderlyingType.SpecialType != SpecialType.System_Int32 319if (namedType.TypeKind == TypeKind.Class && namedType.BaseType != null && namedType.BaseType.SpecialType != Microsoft.CodeAnalysis.SpecialType.System_Object)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\InternalExtensions.cs (1)
36if (typeInfo.Type != null && typeInfo.Type.SpecialType == SpecialType.System_Void)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeParameterSymbolExtensions.cs (1)
66if (type.SpecialType != SpecialType.System_Object)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.TypeSyntaxGeneratorVisitor.cs (2)
122syntax = IdentifierName(symbol.SpecialType == SpecialType.System_IntPtr ? "nint" : "nuint"); 226if (symbol.SpecialType == SpecialType.System_Void)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (1)
1143else if (symbol.OriginalDefinition.SpecialType == SpecialType.System_Nullable_T)
Microsoft.CodeAnalysis.Features (64)
Completion\Providers\AbstractObjectInitializerCompletionProvider.cs (1)
140switch (definition.SpecialType)
Completion\Providers\AbstractSymbolCompletionProvider.cs (1)
62if (symbol.ContainingType?.SpecialType == SpecialType.System_Object)
Completion\Providers\ImportCompletionProvider\TypeImportCompletionCacheEntry.cs (1)
194var isEnumBaseType = symbol.SpecialType is >= SpecialType.System_SByte and <= SpecialType.System_UInt64;
ConvertCast\AbstractConvertCastCodeRefactoringProvider.cs (1)
55if (type is { IsReferenceType: true } or { OriginalDefinition.SpecialType: SpecialType.System_Nullable_T })
ConvertForEachToFor\AbstractConvertForEachToForCodeRefactoringProvider.cs (1)
239if (collectionType.SpecialType == SpecialType.System_String)
ConvertForToForEach\AbstractConvertForToForEachCodeRefactoringProvider.cs (1)
534=> property is { IsIndexer: true, Parameters: [{ Type.SpecialType: SpecialType.System_Int32 }] };
ConvertNumericLiteral\AbstractConvertNumericLiteralCodeRefactoringProvider.cs (1)
51if (!symbol.SpecialType.IsIntegralType())
ConvertToInterpolatedString\AbstractConvertConcatenationToInterpolatedStringRefactoringProvider.cs (2)
245if (symbol?.ContainingType.SpecialType == SpecialType.System_Object) 294ContainingType.SpecialType: SpecialType.System_String,
ConvertToInterpolatedString\AbstractConvertPlaceholderToInterpolatedStringRefactoringProvider.cs (1)
103var shouldReplaceInvocation = invocationSymbol is { ContainingType.SpecialType: SpecialType.System_String, Name: nameof(string.Format) };
DesignerAttribute\DesignerAttributeDiscoveryService.cs (1)
321if (attribute is { ConstructorArguments: [{ Type.SpecialType: SpecialType.System_String, Value: string stringValue }] })
EmbeddedLanguages\EmbeddedLanguageDetector.cs (1)
191m => m is IMethodSymbol { Parameters: [{ Type.SpecialType: SpecialType.System_String }, ..] });
ExtractClass\AbstractExtractClassRefactoringProvider.cs (1)
143private static bool HasBaseType(INamedTypeSymbol containingType) => containingType.BaseType?.SpecialType != SpecialType.System_Object;
ExtractMethod\MethodExtractor.AnalyzerResult.cs (1)
70return ReturnType.SpecialType != SpecialType.System_Void && !AwaitTaskReturn;
ExtractMethod\MethodExtractor.cs (1)
254if (type.SpecialType == SpecialType.System_Void)
GenerateType\AbstractGenerateTypeService.State.cs (1)
245if (baseType.SpecialType is
InitializeParameter\AbstractAddParameterCheckCodeRefactoringProvider.cs (4)
108if (parameter.Type.SpecialType == SpecialType.System_String) 160if (parameter.Type.SpecialType == SpecialType.System_String) 234else if (parameter.Type.SpecialType == SpecialType.System_String && 302return targetMethod.ContainingType.SpecialType == SpecialType.System_String;
InlineHints\AbstractInlineParameterNameHintsService.cs (1)
247return parameter.Type.SpecialType == SpecialType.System_Boolean;
IntroduceVariable\AbstractIntroduceLocalForExpressionCodeRefactoringProvider.cs (1)
46type.SpecialType == SpecialType.System_Void)
IntroduceVariable\AbstractIntroduceVariableService.cs (1)
409if (typeInfo.Type?.SpecialType == SpecialType.System_String &&
IntroduceVariable\AbstractIntroduceVariableService.State_Block.cs (1)
32if (type == null || type.SpecialType == SpecialType.System_Void)
IntroduceVariable\AbstractIntroduceVariableService.State_Query.cs (1)
32if (info.Type == null || info.Type.SpecialType == SpecialType.System_Void)
LanguageServices\SymbolDisplayService\AbstractSymbolDisplayService.AbstractSymbolDescriptionBuilder.cs (1)
496if (symbol.IsEnumType() && symbol.EnumUnderlyingType!.SpecialType != SpecialType.System_Int32)
MetadataAsSource\AbstractMetadataAsSourceService.WrappedNamedTypeSymbol.cs (1)
69public SpecialType SpecialType => _symbol.SpecialType;
PreferFrameworkType\PreferFrameworkTypeCodeFixProvider.cs (1)
60var replacementNode = typeSymbol.SpecialType is SpecialType.System_IntPtr or SpecialType.System_UIntPtr
PreferFrameworkType\PreferFrameworkTypeDiagnosticAnalyzerBase.cs (1)
89typeSymbol.SpecialType is SpecialType.None)
QuickInfo\QuickInfoUtilities.cs (1)
45if (symbol is INamedTypeSymbol { SpecialType: SpecialType.System_Void })
ReplaceMethodWithProperty\ReplaceMethodWithPropertyCodeRefactoringProvider.cs (1)
125if (current.ContainingType.SpecialType == SpecialType.System_Object)
RQName\RQNodeBuilder.cs (2)
70if (type != type.ConstructedFrom || type.SpecialType == SpecialType.System_Void) 265if (symbol.SpecialType == SpecialType.System_Void)
Snippets\SnippetProviders\AbstractConditionalBlockSnippetProvider.cs (1)
21=> type.SpecialType == SpecialType.System_Boolean;
src\Analyzers\Core\Analyzers\ForEachCast\AbstractForEachCastDiagnosticAnalyzer.cs (7)
99if (collectionElementType.SpecialType == SpecialType.System_Object) 101var ienumerableOfT = collectionType.AllInterfaces.FirstOrDefault(i => i.OriginalDefinition.SpecialType == SpecialType.System_Collections_Generic_IEnumerable_T); 142var isFixable = collectionType.SpecialType == SpecialType.System_Collections_IEnumerable || collectionType.AllInterfaces.Any(static i => i.SpecialType == SpecialType.System_Collections_IEnumerable) && 158=> collectionElementType.SpecialType != SpecialType.System_Object || 159collectionType.OriginalDefinition.SpecialType == SpecialType.System_Collections_Generic_IEnumerable_T || 160collectionType.AllInterfaces.Any(static i => i.OriginalDefinition.SpecialType == SpecialType.System_Collections_Generic_IEnumerable_T);
src\Analyzers\Core\Analyzers\PopulateSwitch\PopulateSwitchStatementHelpers.cs (1)
158if (member is not IFieldSymbol fieldSymbol || fieldSymbol.Type.SpecialType != SpecialType.None)
src\Analyzers\Core\Analyzers\RemoveRedundantEquality\AbstractRemoveRedundantEqualityDiagnosticAnalyzer.cs (2)
88if (leftType?.SpecialType != SpecialType.System_Boolean || 89rightType?.SpecialType != SpecialType.System_Boolean)
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (2)
832attribute.AttributeConstructor?.Parameters is [_, { Name: "checkId", Type.SpecialType: SpecialType.System_String }, ..] && 841attribute.AttributeConstructor.Parameters[0].Type.SpecialType == SpecialType.System_String &&
src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (2)
734attribute.ConstructorArguments is [{ Kind: TypedConstantKind.Primitive, Type.SpecialType: SpecialType.System_String, Value: string value }]) 898(IsSpecialMethodWithMatchingProperty("ShouldSerialize") && methodSymbol.ReturnType.SpecialType == SpecialType.System_Boolean ||
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.BlockAnalyzer.cs (1)
177value.Type.SpecialType == SpecialType.System_Void)
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.cs (3)
233method.Parameters is [{ Type.SpecialType: SpecialType.System_Object }, var secondParam] && 273if (method is { MetadataName: "GetInstance", IsStatic: true, Parameters: [{ Type.SpecialType: SpecialType.System_String }] } && 295if (parameter.Type.SpecialType != SpecialType.System_Int32)
src\Analyzers\Core\Analyzers\SimplifyBooleanExpression\AbstractSimplifyConditionalDiagnosticAnalyzer.cs (2)
155typeInfo.Type?.SpecialType == SpecialType.System_Boolean && 156typeInfo.ConvertedType?.SpecialType == SpecialType.System_Boolean;
src\Analyzers\Core\Analyzers\SimplifyInterpolation\AbstractSimplifyInterpolationHelpers.cs (1)
127return method.ContainingType.SpecialType == SpecialType.System_Object
src\Analyzers\Core\Analyzers\UseNullPropagation\AbstractUseNullPropagationDiagnosticAnalyzer.cs (4)
26ContainingType.OriginalDefinition.SpecialType: SpecialType.System_Nullable_T, 162if (type is not INamedTypeSymbol namedType || namedType.ConstructedFrom.SpecialType != SpecialType.System_Nullable_T) 195var whenPartIsNullable = whenPartType?.OriginalDefinition.SpecialType == SpecialType.System_Nullable_T; 377if (typeSymbol?.SpecialType == SpecialType.System_Object)
src\Analyzers\Core\Analyzers\UseNullPropagation\AbstractUseNullPropagationDiagnosticAnalyzer_IfStatement.cs (1)
89var whenPartIsNullable = semanticModel.GetTypeInfo(whenPartMatch).Type?.OriginalDefinition.SpecialType == SpecialType.System_Nullable_T;
src\Analyzers\Core\Analyzers\ValidateFormatString\AbstractValidateFormatStringDiagnosticAnalyzer.cs (1)
303if (containingType.SpecialType != SpecialType.System_String)
src\Analyzers\Core\CodeFixes\GenerateConstructor\AbstractGenerateConstructorService.State.cs (1)
385switch (type.SpecialType)
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator.cs (1)
279var condition3 = typeParameter.HasReferenceTypeConstraint && typeParameter.ConstraintTypes.Any(static ts => ts.IsReferenceType && ts.SpecialType != SpecialType.System_Object);
ValueTracking\ValueTracker.cs (1)
246return methodSymbol.ReturnType.SpecialType != SpecialType.System_Void;
Microsoft.CodeAnalysis.Test.Utilities (18)
Compilation\ControlFlowGraphVerifier.cs (2)
916&& arguments[0].Value.Type.SpecialType == SpecialType.System_Int32 917&& arguments[1].Value.Type.SpecialType == SpecialType.System_Int32;
Diagnostics\CouldHaveMoreSpecificTypeAnalyzer.cs (2)
226return baseType.TypeKind == TypeKind.Class && baseType.SpecialType == SpecialType.System_Object; 266(targetTypeKind == TypeKind.Class && (sourceTypeKind == TypeKind.Structure || sourceTypeKind == TypeKind.Interface) && targetType.SpecialType == SpecialType.System_Object))
Diagnostics\LocalCouldBeConstAnalyzer.cs (2)
89if ((!localType.IsReferenceType || localType.SpecialType == SpecialType.System_String) && localType.SpecialType != SpecialType.None)
Diagnostics\OperationTestAnalyzer.cs (12)
159conditionRight.Type.SpecialType == SpecialType.System_Int32 && 176setupAssignment.Value.Type.SpecialType == SpecialType.System_Int32) 241advanceAssignment.Value.Type.SpecialType == SpecialType.System_Int32) 250advanceOperation.RightOperand.Type.SpecialType == SpecialType.System_Int32) 265advanceAssignment.Value.Type.SpecialType == SpecialType.System_Int32) 357singleValueExpression.Type.SpecialType == SpecialType.System_Int32) 377rangeMinExpression.Type.SpecialType == SpecialType.System_Int32 && 380rangeMaxExpression.Type.SpecialType == SpecialType.System_Int32) 400relationalValueExpression.Type.SpecialType == SpecialType.System_Int32) 587if (argumentValue.HasValue && argument.Type.SpecialType == SpecialType.System_Int32) 631if (literal.Type.SpecialType == SpecialType.System_Int32 && 1521if (binary.OperatorKind == BinaryOperatorKind.Multiply && binary.Type.SpecialType == SpecialType.System_Double)
Microsoft.CodeAnalysis.VisualBasic (4)
Compilation\VisualBasicCompilation.vb (2)
847Return info.Type.SpecialType <> SpecialType.System_Void 852Return info.Type.SpecialType <> SpecialType.System_Void
SymbolDisplay\SymbolDisplayVisitor.Types.vb (1)
418Dim type = symbol.SpecialType
Symbols\TypeSymbol.vb (1)
287Public ReadOnly Property SpecialType As SpecialType Implements ITypeSymbol.SpecialType, ITypeSymbolInternal.SpecialType
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (11)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\ExpressionSyntaxExtensions.vb (1)
111If typeInfo.Type IsNot Nothing AndAlso typeInfo.Type.SpecialType = SpecialType.System_Void Then
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Utilities\CastAnalyzer.vb (10)
225If If(castType?.SpecialType = SpecialType.System_Object, False) AndAlso 319DirectCast(castExpressionType.OriginalDefinition, ITypeSymbol).SpecialType = SpecialType.System_Nullable_T 380Select Case destinationType.SpecialType 382Select Case sourceType.SpecialType 397ElseIf castType.SpecialType = SpecialType.System_DateTime Then 398Return Not outerType.SpecialType = SpecialType.System_DateTime 399ElseIf castType.SpecialType = SpecialType.System_Boolean Then 400Return Not (outerType.IsNumericType OrElse outerType.SpecialType = SpecialType.System_Boolean) 403If castType.OriginalDefinition?.SpecialType = SpecialType.System_Nullable_T Then 415If castType.Equals(outerType) OrElse outerType.SpecialType = SpecialType.System_Object Then
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (11)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\MethodGenerator.vb (1)
70Dim isSub = method.ReturnType.SpecialType = SpecialType.System_Void
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\NamedTypeGenerator.vb (2)
149If(namedType.EnumUnderlyingType IsNot Nothing AndAlso namedType.EnumUnderlyingType.SpecialType <> SpecialType.System_Int32, 207namedType.BaseType.SpecialType = SpecialType.System_Object Then
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\ParameterGenerator.vb (1)
48elementType.OriginalDefinition.SpecialType <> SpecialType.System_Nullable_T Then
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ExpressionSyntaxExtensions.vb (1)
105Dim castKeyword = targetType.SpecialType.GetPredefinedCastKeyword()
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ITypeSymbolExtensions.vb (1)
103Select Case this.SpecialType
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\StringExtensions.vb (1)
96Select Case type.SpecialType
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\TypeSyntaxGeneratorVisitor.vb (2)
81If symbol.OriginalDefinition.SpecialType = SpecialType.System_Nullable_T Then 95Select Case symbol.SpecialType
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\VisualBasicTypeInferenceService.TypeInferrer.vb (2)
772If memberType.OriginalDefinition.SpecialType = SpecialType.System_Collections_Generic_IEnumerable_T OrElse 773memberType.OriginalDefinition.SpecialType = SpecialType.System_Collections_Generic_IEnumerator_T Then
Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests (1)
Attributes\AttributeTests_Tuples.vb (1)
443Assert.True(constant.Type.SpecialType = SpecialType.System_String)
Microsoft.CodeAnalysis.VisualBasic.Features (4)
Completion\CompletionProviders\OverrideCompletionProvider.vb (1)
193If overriddenMember.ContainingType.SpecialType = SpecialType.System_Object Then
ExtractMethod\Extensions.vb (1)
474Return type Is Nothing OrElse type.SpecialType = SpecialType.System_Object
ExtractMethod\VisualBasicMethodExtractor.VisualBasicCodeGenerator.vb (1)
374Return method.Parameters(0).Type.SpecialType = SpecialType.System_Boolean
ExtractMethod\VisualBasicSelectionResult.vb (1)
221If If(info.Type?.SpecialType = SpecialType.System_String, False) AndAlso
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (4)
Compilation\CompilationAPITests.vb (3)
326Assert.Equal(SpecialType.Count, ntSmb.SpecialType) 329Assert.Equal(31, CType(ntSmb.SpecialType, Integer)) 405Assert.Equal(SpecialType.System_Array, comp.GetTypeByMetadataName("System.Array").SpecialType)
Semantics\NativeIntegerTests.vb (1)
51Assert.Equal(If(signed, SpecialType.System_IntPtr, SpecialType.System_UIntPtr), type.SpecialType)
Microsoft.CodeAnalysis.VisualBasic.Workspaces (29)
CodeCleanup\AsyncOrIteratorFunctionReturnTypeFixer.vb (1)
132Select Case returnType.OriginalDefinition.SpecialType
Recommendations\VisualBasicRecommendationServiceRunner.vb (1)
158Return typeSymbol.SpecialType <> SpecialType.System_Delegate
Rename\VisualBasicRenameRewriterLanguageService.vb (1)
953If Not method.ReturnsVoid AndAlso Not method.Parameters.Any() AndAlso method.ReturnType.SpecialType = SpecialType.System_Boolean Then
Simplification\Simplifiers\AbstractVisualBasicSimplifier.vb (1)
117Dim keywordKind = GetPredefinedKeywordKind(type.SpecialType)
Simplification\Simplifiers\ExpressionSimplifier.vb (2)
132Dim keywordKind = GetPredefinedKeywordKind(DirectCast(symbol, INamedTypeSymbol).SpecialType) 246If isInCref AndAlso TypeOf rightSymbol Is IMethodSymbol AndAlso Not containingType.SpecialType = SpecialType.None Then
Simplification\Simplifiers\NameSimplifier.vb (1)
161Dim keywordKind = GetPredefinedKeywordKind(type.SpecialType)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\ExpressionSyntaxExtensions.vb (1)
111If typeInfo.Type IsNot Nothing AndAlso typeInfo.Type.SpecialType = SpecialType.System_Void Then
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Utilities\CastAnalyzer.vb (10)
225If If(castType?.SpecialType = SpecialType.System_Object, False) AndAlso 319DirectCast(castExpressionType.OriginalDefinition, ITypeSymbol).SpecialType = SpecialType.System_Nullable_T 380Select Case destinationType.SpecialType 382Select Case sourceType.SpecialType 397ElseIf castType.SpecialType = SpecialType.System_DateTime Then 398Return Not outerType.SpecialType = SpecialType.System_DateTime 399ElseIf castType.SpecialType = SpecialType.System_Boolean Then 400Return Not (outerType.IsNumericType OrElse outerType.SpecialType = SpecialType.System_Boolean) 403If castType.OriginalDefinition?.SpecialType = SpecialType.System_Nullable_T Then 415If castType.Equals(outerType) OrElse outerType.SpecialType = SpecialType.System_Object Then
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\MethodGenerator.vb (1)
70Dim isSub = method.ReturnType.SpecialType = SpecialType.System_Void
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\NamedTypeGenerator.vb (2)
149If(namedType.EnumUnderlyingType IsNot Nothing AndAlso namedType.EnumUnderlyingType.SpecialType <> SpecialType.System_Int32, 207namedType.BaseType.SpecialType = SpecialType.System_Object Then
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\ParameterGenerator.vb (1)
48elementType.OriginalDefinition.SpecialType <> SpecialType.System_Nullable_T Then
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ExpressionSyntaxExtensions.vb (1)
105Dim castKeyword = targetType.SpecialType.GetPredefinedCastKeyword()
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ITypeSymbolExtensions.vb (1)
103Select Case this.SpecialType
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\StringExtensions.vb (1)
96Select Case type.SpecialType
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\TypeSyntaxGeneratorVisitor.vb (2)
81If symbol.OriginalDefinition.SpecialType = SpecialType.System_Nullable_T Then 95Select Case symbol.SpecialType
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\VisualBasicTypeInferenceService.TypeInferrer.vb (2)
772If memberType.OriginalDefinition.SpecialType = SpecialType.System_Collections_Generic_IEnumerable_T OrElse 773memberType.OriginalDefinition.SpecialType = SpecialType.System_Collections_Generic_IEnumerator_T Then
Microsoft.CodeAnalysis.Workspaces (61)
Editing\SyntaxGenerator.cs (3)
134var canUseFieldReference = !LiteralSpecialValues.HasSpecialValues(field.ContainingType.SpecialType); 785underlyingType: type.EnumUnderlyingType is null or { SpecialType: SpecialType.System_Int32 } 787: TypeExpression(type.EnumUnderlyingType.SpecialType),
FindSymbols\FindReferences\DependentProjectsFinder.cs (1)
291typeNameConstant.Type.SpecialType != SpecialType.System_String ||
FindSymbols\FindReferences\DependentTypeFinder.cs (2)
213switch (type.SpecialType) 219predicate: static n => n.BaseType?.SpecialType == SpecialType.System_Object).ConfigureAwait(false);
FindSymbols\FindReferences\Finders\ConstructorSymbolReferenceFinder.cs (2)
59project, documents, containingType.SpecialType.ToPredefinedType(), processResult, processResultData, cancellationToken).ConfigureAwait(false); 178var predefinedType = symbol.ContainingType.SpecialType.ToPredefinedType();
FindSymbols\FindReferences\Finders\ExplicitConversionSymbolReferenceFinder.cs (1)
51await FindDocumentsAsync(project, documents, underlyingNamedType.SpecialType.ToPredefinedType(), StandardCallbacks<Document>.AddToHashSet, result, cancellationToken).ConfigureAwait(false);
FindSymbols\FindReferences\Finders\NamedTypeSymbolReferenceFinder.cs (2)
70project, documents, symbol.SpecialType.ToPredefinedType(), processResult, processResultData, cancellationToken).ConfigureAwait(false); 213var predefinedType = symbol.SpecialType.ToPredefinedType();
ObsoleteSymbol\AbstractObsoleteSymbolService.cs (1)
200if (symbol is INamedTypeSymbol { OriginalDefinition.SpecialType: SpecialType.System_Nullable_T, TypeArguments: [var valueType] })
Recommendations\AbstractRecommendationService.cs (1)
79if (namedType.SpecialType == SpecialType.System_Void)
Recommendations\AbstractRecommendationServiceRunner.cs (1)
321.FirstOrDefault(s => s is INamedTypeSymbol namedType && namedType.SpecialType == specialType);
Shared\Extensions\ITypeSymbolExtensions.cs (2)
178if (type.OriginalDefinition is { SpecialType: SpecialType.System_Collections_Generic_IEnumerable_T or SpecialType.System_Collections_IEnumerable }) 183return type.AllInterfaces.Any(s => s.SpecialType is SpecialType.System_Collections_Generic_IEnumerable_T or SpecialType.System_Collections_IEnumerable);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\IMethodSymbolExtensions.cs (2)
45method.Parameters is [{ Type.SpecialType: SpecialType.System_Object }, var secondParam] && 106methodSymbol.ReturnType.SpecialType == SpecialType.System_Int32 ||
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\INamedTypeSymbolExtensions.cs (1)
662ContainingType.SpecialType: SpecialType.System_Object,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.cs (2)
683if (!returnType.GetMembers().OfType<IPropertySymbol>().Any(p => p.Name == WellKnownMemberNames.IsCompleted && p.Type.SpecialType == SpecialType.System_Boolean && p.GetMethod != null)) 733ReturnType.SpecialType: SpecialType.System_Boolean,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.cs (10)
23=> type?.SpecialType.IsIntegralType() == true; 26=> type?.SpecialType.IsSignedIntegralType() == true; 59=> symbol?.SpecialType == SpecialType.System_Void; 62=> symbol?.OriginalDefinition.SpecialType == SpecialType.System_Nullable_T; 270switch (typeSymbol.SpecialType) 288switch (type.SpecialType) 376switch (symbol.SpecialType) 406typeSymbol.AllInterfaces.Any(static i => i.SpecialType == SpecialType.System_Collections_IEnumerable) && 654switch (type.SpecialType) 764namedType.OriginalDefinition.GetAttributes().Any(static a => a.AttributeClass?.SpecialType == SpecialType.System_Runtime_CompilerServices_InlineArrayAttribute);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticModelExtensions.cs (2)
170type.OriginalDefinition.SpecialType == SpecialType.System_Nullable_T || 187if (type.SpecialType == SpecialType.System_String)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SemanticFacts\ISemanticFactsExtensions.cs (1)
119=> type?.SpecialType is SpecialType.System_Single or SpecialType.System_Double;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.NamedTypeSymbolKey.cs (1)
27visitor.WriteBoolean(symbol.SpecialType == SpecialType.System_IntPtr);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (5)
492type1.EnumUnderlyingType?.SpecialType == type2.SpecialType; 759&& symbol.ContainingType.SpecialType == SpecialType.System_Object 1021if (newReceiverType.SpecialType != SpecialType.None) 1028return newSymbolContainingType.SpecialType is SpecialType.System_Array or
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EnumValueUtilities.cs (1)
34return CreateOne(enumType.EnumUnderlyingType.SpecialType);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.cs (1)
196=> symbol.IsKind(SymbolKind.NamedType, out ITypeSymbol? typeSymbol) && typeSymbol.SpecialType == SpecialType.System_Object;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.EquivalenceVisitor.cs (2)
351return x.SpecialType == y.SpecialType;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractFlagsEnumGenerator.cs (3)
81var underlyingSpecialType = enumType.EnumUnderlyingType.SpecialType; 175var underlyingSpecialType = enumType.EnumUnderlyingType.SpecialType; 191var underlyingSpecialType = enumType.EnumUnderlyingType.SpecialType;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationHelpers.cs (2)
84=> type != null && type.SpecialType == specialType; 134=> type?.SpecialType switch
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\INamedTypeSymbolExtensions.cs (1)
30namedType.SpecialType,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationMethodSymbol.cs (1)
80=> this.ReturnType == null || this.ReturnType.SpecialType == SpecialType.System_Void;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (3)
414switch (typeSymbol.SpecialType) 448method.ReturnType.SpecialType == SpecialType.System_Boolean && 449method.Parameters[0].Type.SpecialType == SpecialType.System_Object &&
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateGetHashCodeMethod.cs (1)
210method.ReturnType.SpecialType == SpecialType.System_Int32 &&
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_Negate.cs (5)
186else if (operation is IIsTypeOperation { TypeOperand.SpecialType: SpecialType.System_Object } && generatorInternal.SupportsPatterns(semanticModel.SyntaxTree.Options)) 276var valueType = (operation as IIsPatternOperation)?.Value.Type?.SpecialType; 449if (containingType?.SpecialType == SpecialType.System_Array || 450containingType?.SpecialType == SpecialType.System_String) 458switch (type?.SpecialType)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\TypeInferenceService\AbstractTypeInferenceService.AbstractTypeInferrer.cs (1)
125symbol.ContainingType?.SpecialType == SpecialType.System_Enum;
Microsoft.DotNet.CodeAnalysis (2)
Analyzers\AppContextDefaultsAnalyzer.cs (2)
147if (methodSym.Parameters[0].Type.SpecialType != SpecialType.System_String) 150if (methodSym.Parameters[1].Type.SpecialType != SpecialType.System_Boolean)
Microsoft.Extensions.Logging.Generators (2)
LoggerMessageGenerator.Parser.cs (2)
154if (items[0].Type.SpecialType == SpecialType.System_String) 647while (currentClassType is { SpecialType: not SpecialType.System_Object })
Microsoft.Extensions.Options.SourceGeneration (23)
OptionsSourceGenContext.cs (1)
47return typeSymbol.SpecialType switch
Parser.cs (16)
204&& m.Parameters[0].Type.SpecialType == SpecialType.System_String 242if (type.OriginalDefinition.SpecialType == SpecialType.System_Nullable_T) 270if (modelType.OriginalDefinition.SpecialType == SpecialType.System_Nullable_T) 279while (baseType is not null && baseType.SpecialType != SpecialType.System_Object 550if (transValidatorTypeName == null && speculate && memberType.SpecialType == SpecialType.None) 563if (enumerationValidatorTypeName == null && speculate && memberType.SpecialType != SpecialType.System_String) 600if (memberType.SpecialType == SpecialType.System_String || ConvertTo(memberType, _symbolHolder.ICollectionSymbol)) 622if (constructorParameters.Length == 1 && constructorParameters[0].Name == "otherProperty" && constructorParameters[0].Type.SpecialType == SpecialType.System_String) 637if (typeSymbol.OriginalDefinition.SpecialType == SpecialType.System_Nullable_T) 664if (OptionsSourceGenContext.IsConvertibleBasicType(namedTypeSymbol) && typeSymbol.SpecialType == namedTypeSymbol.SpecialType) 669(SymbolEqualityComparer.Default.Equals(typeSymbol, _symbolHolder.TimeSpanSymbol) || typeSymbol.SpecialType == SpecialType.System_String)) 687if (mt.OriginalDefinition.SpecialType == SpecialType.System_Nullable_T) 811if (type.SpecialType == SpecialType.System_Boolean) 822if (type.SpecialType == SpecialType.System_String) 827if (type.SpecialType == SpecialType.System_Char)
ParserUtilities.cs (6)
76if (type.OriginalDefinition.SpecialType == SpecialType.System_Nullable_T) 82property.Type.SpecialType == returnType && property.DeclaredAccessibility == Accessibility.Public && 89} while (type is not null && type.SpecialType != SpecialType.System_Object); 96property.Type.SpecialType == returnType && property.Kind == SymbolKind.Property && 108=> type.SpecialType == SpecialType.System_Nullable_T || type.OriginalDefinition.SpecialType == SpecialType.System_Nullable_T;
Microsoft.Gen.Logging (12)
Parsing\AttributeProcessors.cs (1)
51else if (a.Type?.SpecialType == SpecialType.System_Int32)
Parsing\Parser.cs (1)
645while (currentClassType is { SpecialType: not SpecialType.System_Object })
Parsing\Parser.LogProperties.cs (1)
94while (namedType != null && namedType.SpecialType != SpecialType.System_Object)
Parsing\Parser.Records.cs (1)
36while (namedType != null && namedType.SpecialType != SpecialType.System_Object)
Parsing\TypeSymbolExtensions.cs (6)
14&& sym.SpecialType != SpecialType.System_String; 51&& ts.Parameters[0].Type.SpecialType == SpecialType.System_String 71=> typeSymbol.SpecialType != SpecialType.None || 72typeSymbol.OriginalDefinition.SpecialType != SpecialType.None || 80while (current != null && current.SpecialType != SpecialType.System_Object) 95if (sym is INamedTypeSymbol namedTypeSymbol && namedTypeSymbol.IsGenericType && namedTypeSymbol.OriginalDefinition.SpecialType == SpecialType.System_Nullable_T)
src\Generators\Shared\ParserUtilities.cs (2)
78=> type.SpecialType == SpecialType.System_Nullable_T || type.OriginalDefinition.SpecialType == SpecialType.System_Nullable_T;
Microsoft.Gen.Logging.Unit.Tests (5)
LogParserUtilitiesTests.cs (5)
24typeSymbolMock.SetupGet(x => x.SpecialType).Returns(SpecialType.System_Nullable_T); 29anotherTypeSymbolMock.SetupGet(x => x.SpecialType).Returns(SpecialType.None); 39typeSymbolMock.SetupGet(x => x.SpecialType).Returns(SpecialType.None); 98.SetupGet(x => x.SpecialType) 156paramTypeMock.SetupGet(x => x.SpecialType).Returns(SpecialType.None);
Microsoft.Gen.Metrics (7)
Parser.cs (5)
414if (!_allowedGenericAttributeTypeArgs.Contains(genericType.SpecialType)) 573if (returnType.SpecialType != SpecialType.None || 701specialType = propertySymbol.Type.SpecialType; 709specialType = fieldSymbol.Type.SpecialType; 721specialType = typeSymbol.OriginalDefinition.SpecialType;
src\Generators\Shared\ParserUtilities.cs (2)
78=> type.SpecialType == SpecialType.System_Nullable_T || type.OriginalDefinition.SpecialType == SpecialType.System_Nullable_T;
Microsoft.Gen.MetricsReports (7)
src\Generators\Microsoft.Gen.Metrics\Parser.cs (5)
414if (!_allowedGenericAttributeTypeArgs.Contains(genericType.SpecialType)) 573if (returnType.SpecialType != SpecialType.None || 701specialType = propertySymbol.Type.SpecialType; 709specialType = fieldSymbol.Type.SpecialType; 721specialType = typeSymbol.OriginalDefinition.SpecialType;
src\Generators\Shared\ParserUtilities.cs (2)
78=> type.SpecialType == SpecialType.System_Nullable_T || type.OriginalDefinition.SpecialType == SpecialType.System_Nullable_T;
Microsoft.Interop.ComInterfaceGenerator (6)
Analyzers\ConvertComImportToGeneratedComInterfaceAnalyzer.cs (2)
215public bool CanProvideMarshallingInfoForType(ITypeSymbol type) => type.SpecialType == SpecialType.System_String; 222public bool CanProvideMarshallingInfoForType(ITypeSymbol type) => type is { TypeKind: TypeKind.Array or TypeKind.Delegate } or { SpecialType: SpecialType.System_Array or SpecialType.System_Object };
Analyzers\RuntimeComApiUsageWithSourceGeneratedComAnalyzer.cs (2)
146if (operand is IConversionOperation { Type.SpecialType: SpecialType.System_Object } objConversion) 174if (operand is IConversionOperation { Type.SpecialType: SpecialType.System_Object } objConversion)
src\libraries\System.Runtime.InteropServices\gen\Common\ConvertToSourceGeneratedInteropFixer.cs (2)
244if (parameter.Type.SpecialType == SpecialType.System_Boolean 253if (methodSymbol.ReturnType.SpecialType == SpecialType.System_Boolean
Microsoft.Interop.JavaScript.JSImportGenerator (15)
JSManagedTypeInfo.cs (15)
19case { SpecialType: SpecialType.System_Void }: 24case { SpecialType: SpecialType.System_Boolean }: 29case { SpecialType: SpecialType.System_Byte }: 34case { SpecialType: SpecialType.System_Char }: 39case { SpecialType: SpecialType.System_Int16 }: 44case { SpecialType: SpecialType.System_Int32 }: 49case { SpecialType: SpecialType.System_Int64 }: 54case { SpecialType: SpecialType.System_Single }: 59case { SpecialType: SpecialType.System_Double }: 64case { SpecialType: SpecialType.System_IntPtr }: 65case IPointerTypeSymbol { PointedAtType.SpecialType: SpecialType.System_Void }: 70case { SpecialType: SpecialType.System_DateTime }: 85case { SpecialType: SpecialType.System_Object }: 90case { SpecialType: SpecialType.System_String }: 102case INamedTypeSymbol { ConstructedFrom.SpecialType: SpecialType.System_Nullable_T } nullable:
Microsoft.Interop.LibraryImportGenerator (4)
Analyzers\ConvertToLibraryImportFixer.cs (2)
683if (param.Type.SpecialType is SpecialType.System_String or SpecialType.System_Char) 689return method.ReturnType.SpecialType is SpecialType.System_String or SpecialType.System_Char;
src\libraries\System.Runtime.InteropServices\gen\Common\ConvertToSourceGeneratedInteropFixer.cs (2)
244if (parameter.Type.SpecialType == SpecialType.System_Boolean 253if (methodSymbol.ReturnType.SpecialType == SpecialType.System_Boolean
Microsoft.Interop.LibraryImportGenerator.Downlevel (1)
DownlevelStringMarshallingInfoProvider.cs (1)
26public bool CanProvideMarshallingInfoForType(ITypeSymbol type) => type.SpecialType == SpecialType.System_String;
Microsoft.Interop.SourceGeneration (20)
BlittableTypeMarshallingInfoProvider.cs (1)
28|| type.SpecialType.IsAlwaysBlittable())
BooleanMarshallingInfoProvider.cs (1)
16public bool CanProvideMarshallingInfoForType(ITypeSymbol type) => type.SpecialType == SpecialType.System_Boolean;
CharMarshallingInfoProvider.cs (1)
23public bool CanProvideMarshallingInfoForType(ITypeSymbol type) => type.SpecialType == SpecialType.System_Char;
ManagedTypeInfo.cs (3)
44if (type.SpecialType != SpecialType.None) 46return new SpecialTypeInfo(typeName, diagnosticFormattedName, type.SpecialType); 50return new EnumTypeInfo(typeName, diagnosticFormattedName, ((INamedTypeSymbol)type).EnumUnderlyingType!.SpecialType);
MarshalAsWithCustomMarshallersParser.cs (3)
62if (elementType.SpecialType == SpecialType.System_String) 83if (type.SpecialType == SpecialType.System_String) 88if (type.SpecialType == SpecialType.System_Object && marshalAsInfo is MarshalAsScalarInfo(UnmanagedType.Struct, _))
MarshallerShape.cs (8)
316&& m.Parameters[1].Type.SpecialType == SpecialType.System_Int32 327&& m.Parameters[2].Type.SpecialType == SpecialType.System_Int32 357&& m.Parameters[1].Type.SpecialType == SpecialType.System_Int32 367&& m.Parameters[1].Type.SpecialType == SpecialType.System_Int32 377&& m.Parameters[1].Type.SpecialType == SpecialType.System_Int32 397&& m.Parameters[1].Type.SpecialType == SpecialType.System_Int32 709&& m.Parameters[0].Type.SpecialType == SpecialType.System_Int32 719&& m.Parameters[0].Type.SpecialType == SpecialType.System_Int32
StringMarshallingInfoProvider.cs (1)
28public bool CanProvideMarshallingInfoForType(ITypeSymbol type) => type.SpecialType == SpecialType.System_String;
TypeSymbolExtensions.cs (2)
64if (t.SpecialType is not SpecialType.None) 66return t.SpecialType.IsAlwaysBlittable();
Microsoft.Maui.Controls.BindingSourceGen (1)
ITypeSymbolExtensions.cs (1)
30 && namedTypeSymbol.ConstructedFrom.SpecialType == SpecialType.System_Nullable_T;
Microsoft.VisualStudio.LanguageServices (11)
ChangeSignature\AddParameterDialogViewModel.cs (1)
201if (TypeSymbol is { SpecialType: SpecialType.System_Void })
Library\ObjectBrowser\AbstractDescriptionBuilder.cs (1)
91typeSymbol.SpecialType == SpecialType.System_Void)
Library\ObjectBrowser\AbstractListItemFactory.cs (5)
61return namedTypeSymbol.SpecialType.ToPredefinedType() != PredefinedType.None 102var fullNameText = namedTypeSymbol.SpecialType.ToPredefinedType() != PredefinedType.None 113var displayText = namedTypeSymbol.SpecialType.ToPredefinedType() != PredefinedType.None 208if (namedTypeSymbol.SpecialType == SpecialType.System_Object) 276typeSymbol.SpecialType != SpecialType.System_Object)
Library\ObjectBrowser\ObjectList.cs (1)
435if (typeSymbol.SpecialType == SpecialType.System_Object)
Library\VsNavInfo\NavInfoFactory.cs (1)
77if (typeSymbol.SpecialType == SpecialType.System_Nullable_T)
ProjectSystem\AbstractEntryPointFinder.cs (2)
37symbol.Parameters is [{ Type: IArrayTypeSymbol { ElementType.SpecialType: SpecialType.System_String } }] or []) 52if (returnType.SpecialType == SpecialType.System_Int32)
Microsoft.VisualStudio.LanguageServices.CSharp (4)
CodeModel\CSharpCodeModelService.cs (1)
711switch (typeSymbol.SpecialType)
LanguageService\CSharpHelpContextService.cs (1)
545if (symbol is ITypeSymbol type && type.OriginalDefinition.SpecialType == SpecialType.System_Nullable_T)
ObjectBrowser\DescriptionBuilder.cs (2)
99if (underlyingType.SpecialType != SpecialType.System_Int32) 111if (baseType.SpecialType is not SpecialType.System_Object and
Microsoft.VisualStudio.LanguageServices.VisualBasic (7)
CodeModel\VisualBasicCodeModelService.vb (3)
753If typeSymbol.SpecialType = SpecialType.System_Void Then 766If typeSymbol.SpecialType = SpecialType.System_Object Then 774Select Case typeSymbol.SpecialType
CodeModel\VisualBasicCodeModelService_Prototype.vb (1)
98Not methodSymbol.ReturnType.SpecialType = SpecialType.System_Void Then
Help\VisualBasicHelpContextService.vb (1)
107If type.SpecialType <> SpecialType.None Then
Help\VisualBasicHelpContextService.Visitor.vb (1)
454ElseIf TypeOf symbol Is ITypeSymbol AndAlso DirectCast(symbol, ITypeSymbol).SpecialType <> SpecialType.None Then
ObjectBrowser\DescriptionBuilder.vb (1)
113If underlyingType IsNot Nothing AndAlso underlyingType.SpecialType <> SpecialType.System_Int32 Then
System.Private.CoreLib.Generators (1)
IntrinsicsInSystemPrivateCoreLibAnalyzer.cs (1)
455if (symbol == null || symbol is ITypeSymbol type && type.SpecialType != SpecialType.None)
System.Text.Json.SourceGeneration (8)
Helpers\RoslynExtensions.cs (3)
192return type.SpecialType is 199=> !type.IsValueType || type.OriginalDefinition.SpecialType is SpecialType.System_Nullable_T; 203if (type.IsValueType && type is INamedTypeSymbol { OriginalDefinition.SpecialType: SpecialType.System_Nullable_T })
JsonSourceGenerator.Parser.cs (4)
1658if (type.SpecialType is SpecialType.System_Boolean) 1663if (type.SpecialType is SpecialType.System_Char) 1670if (type.SpecialType is SpecialType.System_String or SpecialType.System_DateTime || 1797return type.SpecialType is
src\libraries\Common\src\SourceGenerators\TypeRef.cs (1)
22SpecialType = type.OriginalDefinition.SpecialType;
System.Text.RegularExpressions.Generator (1)
RegexGenerator.Parser.cs (1)
96if (items[2].Type?.SpecialType == SpecialType.System_Int32)
System.Windows.Forms.Analyzers.CSharp (1)
System\Windows\Forms\CSharp\Analyzers\MissingPropertySerializationConfiguration\MissingPropertySerializationConfigurationAnalyzer.cs (1)
68|| shouldSerializeMethod.ReturnType.SpecialType != SpecialType.System_Boolean
System.Windows.Forms.Analyzers.VisualBasic (1)
Analyzers\MissingPropertySerializationConfiguration\MissingPropertySerializationConfigurationDiagnosticAnalyzer.vb (1)
70shouldSerializeMethod.ReturnType.SpecialType <> SpecialType.System_Boolean OrElse