5 implementations of SpecialType
Microsoft.CodeAnalysis.CodeStyle.Fixes (1)
CodeGenerationTypeSymbol.cs (1)
19public SpecialType SpecialType { get; protected set; }
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)
276Public Overridable ReadOnly Property SpecialType As SpecialType Implements ITypeSymbol.SpecialType, ITypeSymbolInternal.SpecialType
Microsoft.CodeAnalysis.Workspaces (1)
CodeGenerationTypeSymbol.cs (1)
19public SpecialType SpecialType { get; protected set; }
729 references to SpecialType
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)
3112if (operation.Target?.Type?.OriginalDefinition.SpecialType == SpecialType.System_Nullable_T && 4182Debug.Assert(iDisposable.SpecialType == SpecialType.System_IDisposable || 4860constantValue: ConstantValue.Default(stepValueEnumUnderlyingTypeOrSelf.SpecialType), 5144int bits = stepEnumUnderlyingTypeOrSelf.SpecialType.VBForToShiftBits(); 6587Debug.Assert(outParameterArgument is { Parameter: { RefKind: RefKind.Out, Type.SpecialType: SpecialType.System_Boolean } });
SymbolDisplay\AbstractSymbolDisplayVisitor.cs (5)
104AddLiteralValue(type.SpecialType, constantValue); 119AddLiteralValue(enumType.EnumUnderlyingType.SpecialType, constantValue); 190var underlyingSpecialType = enumType.EnumUnderlyingType.SpecialType; 267var underlyingSpecialType = enumType.EnumUnderlyingType.SpecialType; 286var underlyingSpecialType = enumType.EnumUnderlyingType.SpecialType;
Symbols\Attributes\CommonAttributeData.cs (10)
203Debug.Assert(parameters[0].Type.SpecialType == SpecialType.System_Byte); 204Debug.Assert(parameters[1].Type.SpecialType == SpecialType.System_Byte); 211if (parameters[2].Type.SpecialType == SpecialType.System_Int32) 213Debug.Assert(parameters[2].Type.SpecialType == SpecialType.System_Int32); 214Debug.Assert(parameters[3].Type.SpecialType == SpecialType.System_Int32); 215Debug.Assert(parameters[4].Type.SpecialType == SpecialType.System_Int32); 223Debug.Assert(parameters[2].Type.SpecialType == SpecialType.System_UInt32); 224Debug.Assert(parameters[3].Type.SpecialType == SpecialType.System_UInt32); 225Debug.Assert(parameters[4].Type.SpecialType == SpecialType.System_UInt32); 371if (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)
201return typeOpt?.OriginalDefinition.SpecialType == SpecialType.System_Nullable_T; 217return type?.SpecialType == SpecialType.System_Boolean; 222return type?.SpecialType == SpecialType.System_Object; 227return type?.SpecialType.IsSignedIntegralType() == true; 232return type?.SpecialType.IsUnsignedIntegralType() == true; 237return type?.SpecialType.IsNumericType() == true;
Microsoft.CodeAnalysis.CodeStyle (43)
AbstractForEachCastDiagnosticAnalyzer.cs (1)
141=> collectionElementType.SpecialType != SpecialType.System_Object ||
AbstractPopulateSwitchDiagnosticAnalyzer.cs (1)
97if (type is not { SpecialType: SpecialType.System_Boolean })
AbstractRemoveRedundantEqualityDiagnosticAnalyzer.cs (2)
60if (rightOperand.Type.SpecialType != SpecialType.System_Boolean || 61leftOperand.Type.SpecialType != SpecialType.System_Boolean)
AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (2)
827attribute.AttributeConstructor?.Parameters is [_, { Name: "checkId", Type.SpecialType: SpecialType.System_String }, ..] && 836attribute.AttributeConstructor.Parameters[0].Type.SpecialType == SpecialType.System_String &&
AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (2)
590attribute.ConstructorArguments is [{ Kind: TypedConstantKind.Primitive, Type.SpecialType: SpecialType.System_String, Value: string value }]) 728(IsSpecialMethodWithMatchingProperty("ShouldSerialize") && methodSymbol.ReturnType.SpecialType == SpecialType.System_Boolean ||
AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.BlockAnalyzer.cs (1)
144value.Type.SpecialType == SpecialType.System_Void)
AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.cs (2)
241method.Parameters is [{ Type.SpecialType: SpecialType.System_Object }, var secondParam] && 280methodSymbol.Parameters[0].Type.SpecialType == SpecialType.System_String &&
AbstractSimplifyConditionalDiagnosticAnalyzer.cs (2)
154typeInfo.Type?.SpecialType == SpecialType.System_Boolean && 155typeInfo.ConvertedType?.SpecialType == SpecialType.System_Boolean;
AbstractSimplifyInterpolationHelpers.cs (1)
127return method.ContainingType.SpecialType == SpecialType.System_Object
AbstractSpeculationAnalyzer.cs (5)
448type1.EnumUnderlyingType?.SpecialType == type2.SpecialType; 707&& symbol.ContainingType.SpecialType == SpecialType.System_Object 983if (newReceiverType.SpecialType != SpecialType.None) 990return newSymbolContainingType.SpecialType is SpecialType.System_Array or
AbstractUseNullPropagationDiagnosticAnalyzer.cs (3)
154if (type is not INamedTypeSymbol namedType || namedType.ConstructedFrom.SpecialType != SpecialType.System_Nullable_T) 182var whenPartIsNullable = whenPartType?.OriginalDefinition.SpecialType == SpecialType.System_Nullable_T; 360if (typeSymbol?.SpecialType == SpecialType.System_Object)
AbstractUseNullPropagationDiagnosticAnalyzer_IfStatement.cs (1)
89var whenPartIsNullable = semanticModel.GetTypeInfo(whenPartMatch).Type?.OriginalDefinition.SpecialType == SpecialType.System_Nullable_T;
AbstractValidateFormatStringDiagnosticAnalyzer.cs (1)
303if (containingType.SpecialType != SpecialType.System_String)
IMethodSymbolExtensions.cs (2)
44method.Parameters is [{ Type.SpecialType: SpecialType.System_Object }, var secondParam] && 105methodSymbol.ReturnType.SpecialType == SpecialType.System_Int32 ||
INamedTypeSymbolExtensions.cs (1)
615ContainingType.SpecialType: SpecialType.System_Object,
ISemanticFactsExtensions.cs (1)
119=> type?.SpecialType is SpecialType.System_Single or SpecialType.System_Double;
ISymbolExtensions.cs (2)
619if (!returnType.GetMembers().OfType<IPropertySymbol>().Any(p => p.Name == WellKnownMemberNames.IsCompleted && p.Type.SpecialType == SpecialType.System_Boolean && p.GetMethod != null)) 669ReturnType.SpecialType: SpecialType.System_Boolean,
ITypeSymbolExtensions.cs (9)
23=> type?.SpecialType.IsIntegralType() == true; 26=> type?.SpecialType.IsSignedIntegralType() == true; 57=> symbol?.SpecialType == SpecialType.System_Void; 60=> symbol?.OriginalDefinition.SpecialType == SpecialType.System_Nullable_T; 268switch (typeSymbol.SpecialType) 286switch (type.SpecialType) 374switch (symbol.SpecialType) 404typeSymbol.AllInterfaces.Any(static i => i.SpecialType == SpecialType.System_Collections_IEnumerable) && 644switch (type.SpecialType)
PopulateSwitchStatementHelpers.cs (1)
139if (member is not IFieldSymbol fieldSymbol || fieldSymbol.Type.SpecialType != SpecialType.None)
SemanticModelExtensions.cs (2)
173type.OriginalDefinition.SpecialType == SpecialType.System_Nullable_T || 190if (type.SpecialType == SpecialType.System_String)
SymbolEquivalenceComparer.cs (1)
180=> symbol.IsKind(SymbolKind.NamedType, out ITypeSymbol? typeSymbol) && typeSymbol.SpecialType == SpecialType.System_Object;
Microsoft.CodeAnalysis.CodeStyle.Fixes (13)
AbstractFlagsEnumGenerator.cs (3)
81var underlyingSpecialType = enumType.EnumUnderlyingType.SpecialType; 175var underlyingSpecialType = enumType.EnumUnderlyingType.SpecialType; 191var underlyingSpecialType = enumType.EnumUnderlyingType.SpecialType;
AbstractTypeInferenceService.AbstractTypeInferrer.cs (1)
127symbol.ContainingType?.SpecialType == SpecialType.System_Enum;
CodeGenerationHelpers.cs (2)
85=> type != null && type.SpecialType == specialType; 135=> type?.SpecialType switch
CodeGenerationMethodSymbol.cs (1)
80=> this.ReturnType == null || this.ReturnType.SpecialType == SpecialType.System_Void;
INamedTypeSymbolExtensions.cs (1)
30namedType.SpecialType,
SyntaxGeneratorExtensions_CreateGetHashCodeMethod.cs (1)
210method.ReturnType.SpecialType == SpecialType.System_Int32 &&
SyntaxGeneratorExtensions_Negate.cs (4)
248var valueType = (operation as IIsPatternOperation)?.Value.Type?.SpecialType; 421if (containingType?.SpecialType == SpecialType.System_Array || 422containingType?.SpecialType == SpecialType.System_String) 430switch (type?.SpecialType)
Microsoft.CodeAnalysis.CSharp (3)
Compilation\CSharpCompilation.cs (1)
788return info.ConvertedType?.SpecialType != SpecialType.System_Void;
SymbolDisplay\SymbolDisplayVisitor.Types.cs (1)
631switch (symbol.SpecialType)
Symbols\TypedConstantExtensions.cs (1)
52SpecialType splType = ((INamedTypeSymbol)constant.Type!).EnumUnderlyingType!.SpecialType;
Microsoft.CodeAnalysis.CSharp.CodeStyle (21)
CastSimplifier.cs (8)
92Parent.Parent: IConversionOperation { Type.SpecialType: SpecialType.System_Object } conversionOperation 470if (castNode.IsParentKind(SyntaxKind.Interpolation) && originalConversionOperation.Type?.SpecialType is SpecialType.System_Object) 579if (current.ContainingType.SpecialType == SpecialType.System_Object) 675=> type.IsSignedIntegralType() || type?.SpecialType is SpecialType.System_IntPtr; 769if (binaryOperation.LeftOperand.Type?.SpecialType == SpecialType.System_Object && 776else if (binaryOperation.RightOperand.Type?.SpecialType == SpecialType.System_Object && 959=> type?.SpecialType is SpecialType.System_Double or SpecialType.System_Single; 1217rewrittenType.SpecialType == SpecialType.System_Enum;
ConvertProgramAnalysis_TopLevelStatements.cs (1)
94if (containingType.BaseType?.SpecialType != SpecialType.System_Object)
CSharpAsAndNullCheckDiagnosticAnalyzer.cs (1)
86if (castType?.SpecialType == SpecialType.System_Object)
CSharpMakeStructMemberReadOnlyAnalyzer.cs (1)
253if (methodReference.ContainingType.SpecialType is SpecialType.System_Object or SpecialType.System_ValueType)
CSharpRemoveUnnecessaryLambdaExpressionDiagnosticAnalyzer.cs (1)
127if (lambdaTypeInfo.ConvertedType == null || lambdaTypeInfo.ConvertedType.SpecialType is SpecialType.System_Object)
CSharpUseCompoundCoalesceAssignmentDiagnosticAnalyzer.cs (2)
197if (symbol is null || !symbol.IsUserDefinedOperator() || symbol.ContainingType.SpecialType == SpecialType.System_String) 215symbol.ContainingType?.SpecialType == SpecialType.System_Object)
CSharpUseIsNullCheckForCastAndEqualityOperatorDiagnosticAnalyzer.cs (1)
77if (semanticModel.GetTypeInfo(castExpression.Type).Type?.SpecialType == SpecialType.System_Object)
Helpers.cs (4)
30p.Type.SpecialType == SpecialType.System_Int32) 77method.OriginalDefinition.Parameters[0].Type.SpecialType == SpecialType.System_Int32; 115=> parameter.Type.SpecialType == SpecialType.System_Int32 && 119=> parameter.Type.SpecialType == SpecialType.System_Int32 &&
ITypeSymbolExtensions.cs (1)
11switch (typeSymbol.SpecialType)
UseUtf8StringLiteralDiagnosticAnalyzer.cs (1)
78if (arrayCreationOperation.Type is not IArrayTypeSymbol { ElementType.SpecialType: SpecialType.System_Byte })
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (19)
ConvertToRecordHelpers.cs (3)
29methodSymbol.ReturnType.SpecialType == SpecialType.System_Boolean && 37methodSymbol.Parameters.First().Type.SpecialType == SpecialType.System_Object && 516else if (parameter.Type.SpecialType == SpecialType.System_Object)
CSharpFixReturnTypeCodeFixProvider.cs (1)
107if (previousReturnType.SpecialType is SpecialType.System_Void ||
CSharpReplaceDefaultLiteralCodeFixProvider.cs (1)
101else if (type.SpecialType is SpecialType.System_IntPtr or SpecialType.System_UIntPtr)
CSharpTypeInferenceService.TypeInferrer.cs (6)
1037if (parentTypes.Any(static parentType => parentType.InferredType.SpecialType == SpecialType.System_String || parentType.InferredType.TypeKind == TypeKind.Delegate)) 1039return parentTypes.Where(parentType => parentType.InferredType.SpecialType == SpecialType.System_String || parentType.InferredType.TypeKind == TypeKind.Delegate); 1155else if (symbol.OriginalDefinition.SpecialType == SpecialType.System_Nullable_T) 2019return types.Select(t => t.InferredType.SpecialType == SpecialType.System_Void ? new TypeInferenceInfo(task) : new TypeInferenceInfo(taskOfT.Construct(t.InferredType))); 2253if (laterUsageInference is not [] and not [{ InferredType.SpecialType: SpecialType.System_Object }]) 2282if (inferredDescendantTypes is not [] and not [{ InferredType.SpecialType: SpecialType.System_Object }])
ExpressionGenerator.cs (1)
289memberAccess = memberAccess.WithAdditionalAnnotations(SpecialTypeAnnotation.Create(type.SpecialType));
InternalExtensions.cs (1)
36if (typeInfo.Type != null && typeInfo.Type.SpecialType == SpecialType.System_Void)
ITypeParameterSymbolExtensions.cs (1)
64if (type.SpecialType != SpecialType.System_Object)
ITypeSymbolExtensions.TypeSyntaxGeneratorVisitor.cs (2)
117syntax = SyntaxFactory.IdentifierName(symbol.SpecialType == SpecialType.System_IntPtr ? "nint" : "nuint"); 221if (symbol.SpecialType == SpecialType.System_Void)
NamedTypeGenerator.cs (2)
245var baseList = namedType.EnumUnderlyingType != null && namedType.EnumUnderlyingType.SpecialType != SpecialType.System_Int32 324if (namedType.TypeKind == TypeKind.Class && namedType.BaseType != null && namedType.BaseType.SpecialType != Microsoft.CodeAnalysis.SpecialType.System_Object)
UseUtf8StringLiteralCodeFixProvider.cs (1)
70namedType.TypeArguments[0].SpecialType == SpecialType.System_Byte;
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (2)
CodeGeneration\SyntaxGeneratorTests.cs (2)
92Assert.Equal(SpecialType.System_String, typeInfo.Type.SpecialType); 93Assert.Equal(SpecialType.System_String, typeInfo.ConvertedType.SpecialType);
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (5)
CodeGen\CodeGenDeconstructTests.cs (3)
7236Assert.Equal(SpecialType.System_Int32, symbolInfo.Symbol.GetTypeOrReturnType().SpecialType); 7511Assert.Equal(SpecialType.System_Int32, xSymbolInfo.Symbol.GetTypeOrReturnType().SpecialType); 7518Assert.Equal(SpecialType.System_Boolean, zSymbolInfo.Symbol.GetTypeOrReturnType().SpecialType);
CodeGen\CodeGenFunctionPointersTests.cs (1)
870Assert.Equal(SpecialType.System_Object, returnTypeWithAnnotations.CustomModifiers[0].Modifier.SpecialType);
CodeGen\IndexAndRangeTests.cs (1)
1002Assert.Equal(SpecialType.System_Int32, property.Parameters[0].Type.SpecialType);
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (7)
Attributes\AttributeTests_Tuples.cs (1)
647Assert.True(constant.Type.SpecialType == SpecialType.System_String);
Semantics\PatternMatchingTests.cs (2)
11366Assert.Equal(SpecialType.System_String, typeInfo.Type.SpecialType); 11367Assert.Equal(SpecialType.System_String, typeInfo.ConvertedType.SpecialType);
Semantics\PatternMatchingTests2.cs (2)
2032Assert.Equal(SpecialType.System_Boolean, typeInfo.Type.SpecialType); 2073Assert.Equal(SpecialType.System_Boolean, typeInfo.Type.SpecialType);
Semantics\PatternSwitchTests.cs (2)
3286Assert.Equal(SpecialType.System_Boolean, type.Type.SpecialType); 3287Assert.Equal(SpecialType.System_Boolean, type.ConvertedType.SpecialType);
Microsoft.CodeAnalysis.CSharp.Features (40)
CodeRefactorings\UseRecursivePatterns\UseRecursivePatternsCodeRefactoringProvider.cs (1)
465ContainingType: not { SpecialType: SpecialType.System_Nullable_T }
Completion\CompletionProviders\DeclarationName\DeclarationNameRecommender.cs (3)
96if (type.SpecialType == SpecialType.System_Void) 145t => t.OriginalDefinition.SpecialType == SpecialType.System_Collections_Generic_IEnumerable_T || 169originalDefinition.SpecialType == SpecialType.System_Nullable_T)
Completion\CompletionProviders\EnumAndCompletionListTagCompletionProvider.cs (1)
114if (type.OriginalDefinition.SpecialType == SpecialType.System_Nullable_T)
Completion\CompletionProviders\ObjectCreationCompletionProvider.cs (1)
131if (namedTypeSymbol?.SpecialType == SpecialType.System_Object)
Completion\KeywordRecommenders\AbstractSpecialTypePreselectingKeywordRecommender.cs (1)
33=> context.InferredTypes.Any(static (t, self) => t.SpecialType == self.SpecialType, this);
Completion\Providers\DefaultArgumentProvider.cs (1)
37context.DefaultValue = context.Parameter.Type.SpecialType switch
ConvertLinq\CSharpConvertLinqQueryToForEachProvider.cs (5)
310methodSymbol.ReturnType?.SpecialType == SpecialType.System_Int32 && 375=> typeSymbol.SpecialType == SpecialType.System_Int32; 562if (returnTypeInfo.Type.OriginalDefinition?.SpecialType == SpecialType.System_Collections_Generic_IEnumerable_T) 568if (returnTypeInfo.ConvertedType.OriginalDefinition?.SpecialType == SpecialType.System_Collections_Generic_IEnumerable_T) 755if (methodSymbol.ReturnType.OriginalDefinition?.SpecialType != SpecialType.System_Collections_Generic_IEnumerable_T)
ConvertProgramAnalysis_TopLevelStatements.cs (1)
94if (containingType.BaseType?.SpecialType != SpecialType.System_Object)
ConvertToRecordHelpers.cs (3)
29methodSymbol.ReturnType.SpecialType == SpecialType.System_Boolean && 37methodSymbol.Parameters.First().Type.SpecialType == SpecialType.System_Object && 516else if (parameter.Type.SpecialType == SpecialType.System_Object)
CSharpAsAndNullCheckDiagnosticAnalyzer.cs (1)
86if (castType?.SpecialType == SpecialType.System_Object)
CSharpFixReturnTypeCodeFixProvider.cs (1)
107if (previousReturnType.SpecialType is SpecialType.System_Void ||
CSharpMakeStructMemberReadOnlyAnalyzer.cs (1)
253if (methodReference.ContainingType.SpecialType is SpecialType.System_Object or SpecialType.System_ValueType)
CSharpRemoveUnnecessaryLambdaExpressionDiagnosticAnalyzer.cs (1)
127if (lambdaTypeInfo.ConvertedType == null || lambdaTypeInfo.ConvertedType.SpecialType is SpecialType.System_Object)
CSharpReplaceDefaultLiteralCodeFixProvider.cs (1)
101else if (type.SpecialType is SpecialType.System_IntPtr or SpecialType.System_UIntPtr)
CSharpUseCompoundCoalesceAssignmentDiagnosticAnalyzer.cs (2)
197if (symbol is null || !symbol.IsUserDefinedOperator() || symbol.ContainingType.SpecialType == SpecialType.System_String) 215symbol.ContainingType?.SpecialType == SpecialType.System_Object)
CSharpUseIsNullCheckForCastAndEqualityOperatorDiagnosticAnalyzer.cs (1)
77if (semanticModel.GetTypeInfo(castExpression.Type).Type?.SpecialType == SpecialType.System_Object)
ExtractMethod\CSharpMethodExtractor.Analyzer.cs (1)
101return info.Type == null || info.Type.SpecialType == Microsoft.CodeAnalysis.SpecialType.System_Object
ExtractMethod\CSharpMethodExtractor.cs (1)
177if (type.SpecialType == SpecialType.System_Void)
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.cs (1)
637} && parameters[0].Type.SpecialType == SpecialType.System_Boolean))
ExtractMethod\CSharpSelectionResult.ExpressionResult.cs (1)
122if (info.Type?.SpecialType == SpecialType.System_String &&
ExtractMethod\Extensions.cs (1)
264=> type == null || type.SpecialType == SpecialType.System_Object;
IntroduceVariable\CSharpIntroduceLocalForExpressionCodeRefactoringProvider.cs (1)
144var isIntrinsic = tupleType.TupleElements.All(f => f.Type?.SpecialType != SpecialType.None);
J\s\src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\Helpers.cs\Helpers.cs (4)
30p.Type.SpecialType == SpecialType.System_Int32) 77method.OriginalDefinition.Parameters[0].Type.SpecialType == SpecialType.System_Int32; 115=> parameter.Type.SpecialType == SpecialType.System_Int32 && 119=> parameter.Type.SpecialType == SpecialType.System_Int32 &&
ReverseForStatement\CSharpReverseForStatementCodeRefactoringProvider.cs (1)
93return local?.Type.SpecialType switch
SignatureHelp\ElementAccessExpressionSignatureHelpProvider.cs (1)
65if (namedType.ConstructedFrom.SpecialType == SpecialType.System_Nullable_T &&
Snippets\CSharpForEachLoopSnippetProvider.cs (1)
44namedSymbol => namedSymbol.SpecialType is SpecialType.System_Collections_Generic_IEnumerable_T or SpecialType.System_Collections_IEnumerable) &&
UseUtf8StringLiteralCodeFixProvider.cs (1)
70namedType.TypeArguments[0].SpecialType == SpecialType.System_Byte;
UseUtf8StringLiteralDiagnosticAnalyzer.cs (1)
78if (arrayCreationOperation.Type is not IArrayTypeSymbol { ElementType.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 (151)
Semantics\ConditionalOperatorTests.cs (1)
1276Assert.Equal(SpecialType.System_Boolean, model.GetTypeInfo(conditionalExpr.Condition).Type!.SpecialType);
Semantics\DeconstructionTests.cs (10)
5991Assert.Equal(SpecialType.System_Void, type.Type.SpecialType); 5992Assert.Equal(SpecialType.System_Void, type.ConvertedType.SpecialType); 6034Assert.Equal(SpecialType.System_Void, type.Type.SpecialType); 6035Assert.Equal(SpecialType.System_Void, type.ConvertedType.SpecialType); 6074Assert.Equal(SpecialType.System_Void, type.Type.SpecialType); 6075Assert.Equal(SpecialType.System_Void, type.ConvertedType.SpecialType); 6116Assert.Equal(SpecialType.System_Int32, type.Type.SpecialType); 6117Assert.Equal(SpecialType.System_Int32, type.ConvertedType.SpecialType); 6156Assert.Equal(SpecialType.System_Void, type.Type.SpecialType); 6157Assert.Equal(SpecialType.System_Void, type.ConvertedType.SpecialType);
Semantics\DelegateTypeTests.cs (8)
752Assert.Equal(SpecialType.System_Delegate, typeInfo.ConvertedType!.SpecialType); 898Assert.Equal(SpecialType.System_Delegate, typeInfo.ConvertedType!.SpecialType); 1222Assert.Equal(SpecialType.System_Delegate, typeInfo.ConvertedType!.SpecialType); 1317Assert.Equal(SpecialType.System_Delegate, typeInfo.ConvertedType!.SpecialType); 1412Assert.Equal(SpecialType.System_Delegate, typeInfo.ConvertedType!.SpecialType); 1830Assert.Equal(SpecialType.System_Delegate, typeInfo.ConvertedType!.SpecialType); 5316Assert.Equal(SpecialType.System_Delegate, typeInfo.ConvertedType!.SpecialType); 5339Assert.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)
2139Assert.Equal(SpecialType.System_Object, loopInfo.CurrentProperty.Type.SpecialType); 2143Assert.Equal(SpecialType.System_Char, typeInfo.Type.SpecialType); 2188Assert.Equal(SpecialType.System_String, loopInfo0.ElementType.SpecialType); 2197Assert.Equal(SpecialType.System_Object, loopInfo1.ElementType.SpecialType); // No longer string. 2889Assert.Equal(SpecialType.System_String, localSymbolType.SpecialType);
Semantics\FunctionPointerTests.cs (5)
189Assert.True(typeInfo.ConvertedType is IPointerTypeSymbol { PointedAtType: { SpecialType: SpecialType.System_Void } }); 1597Assert.Equal(SpecialType.System_String, methodSymbol.TypeArguments[0].SpecialType); 1599Assert.Equal(SpecialType.System_String, functionPointer.Signature.Parameters[0].Type.SpecialType); 1757Assert.Equal(SpecialType.System_String, methodSymbol.TypeArguments[0].SpecialType); 1759Assert.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)
4580Assert.Equal(SpecialType.System_String, semanticInfo.Type.SpecialType); 4801Assert.Equal(SpecialType.System_Object, semanticInfo.ConvertedType.SpecialType); 4807Assert.Equal(SpecialType.System_String, semanticInfo.Type.SpecialType); 4808Assert.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)
1049Assert.Equal(SpecialType.System_Char, method.TypeArguments.Single().SpecialType); 1079Assert.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 (3)
4009Assert.Equal(SpecialType.System_Int32, typeInfo.Type.SpecialType); 4010Assert.Equal(SpecialType.System_Int32, typeInfo.ConvertedType.SpecialType); 4081Assert.Equal(SpecialType.System_Int32, typeInfo.Type.SpecialType);
Semantics\OperatorTests.cs (4)
7629expectChecked = (type.IsDynamic() || symbol1.ContainingType.EnumUnderlyingTypeOrSelf().SpecialType.IsIntegralType()); 7637symbol1.ContainingType.EnumUnderlyingTypeOrSelf().SpecialType.IsIntegralType() || 7638symbol1.ContainingType.SpecialType == SpecialType.System_Char); 8407isChecked = isDynamic || symbol1.ContainingSymbol.Kind == SymbolKind.PointerType || symbol1.ContainingType.EnumUnderlyingTypeOrSelf().SpecialType.IsIntegralType();
Semantics\OverloadResolutionTests.cs (1)
7264Assert.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)
2907Assert.Equal(SpecialType.System_String, semanticInfo.Type.SpecialType); 3128Assert.Equal(SpecialType.System_Object, semanticInfo.ConvertedType.SpecialType); 3134Assert.Equal(SpecialType.System_String, semanticInfo.Type.SpecialType); 3135Assert.Equal(SpecialType.System_String, semanticInfo.ConvertedType.SpecialType);
Semantics\RefLocalsAndReturnsTests.cs (12)
4360Assert.Equal(SpecialType.System_Int32, ((IArrayTypeSymbol)model.GetTypeInfo(left).Type).ElementType.SpecialType); 4363Assert.Equal(SpecialType.System_Int32, model.GetTypeInfo(right).Type.SpecialType); 4388Assert.Equal(SpecialType.System_Int32, ((IPointerTypeSymbol)model.GetTypeInfo(left).Type).PointedAtType.SpecialType); 4391Assert.Equal(SpecialType.System_Int32, model.GetTypeInfo(right).Type.SpecialType); 4416Assert.Equal(SpecialType.System_Int32, ((IPointerTypeSymbol)model.GetTypeInfo(left).Type).PointedAtType.SpecialType); 4419Assert.Equal(SpecialType.System_Int32, model.GetTypeInfo(right).Type.SpecialType); 4444Assert.Equal(SpecialType.System_Int32, model.GetTypeInfo(left).Type.SpecialType); 4447Assert.Equal(SpecialType.System_Int32, model.GetTypeInfo(right).Type.SpecialType); 4475Assert.Equal(SpecialType.System_Int32, model.GetTypeInfo(right).Type.SpecialType); 4503Assert.Equal(SpecialType.System_Int32, model.GetTypeInfo(right).Type.SpecialType); 4534Assert.Equal(SpecialType.System_Object, model.GetTypeInfo(left).Type.SpecialType); 4537Assert.Equal(SpecialType.System_Int32, model.GetTypeInfo(right).Type.SpecialType);
Semantics\StackAllocInitializerTests.cs (13)
1038Assert.Equal(SpecialType.System_Int32, ((IPointerTypeSymbol)obj1Value.Type).PointedAtType.SpecialType); 1046Assert.Equal(SpecialType.System_Int32, ((IPointerTypeSymbol)obj2Value.Type).PointedAtType.SpecialType); 1047Assert.Equal(SpecialType.System_Int32, ((IPointerTypeSymbol)obj2Value.ConvertedType).PointedAtType.SpecialType); 1062Assert.Equal(SpecialType.System_Int32, ((IPointerTypeSymbol)obj4Value.Type).PointedAtType.SpecialType); 1063Assert.Equal(SpecialType.System_Int32, ((IPointerTypeSymbol)obj4Value.ConvertedType).PointedAtType.SpecialType); 1070Assert.Equal(SpecialType.System_Int32, ((IPointerTypeSymbol)obj5Value.Type).PointedAtType.SpecialType); 1071Assert.Equal(SpecialType.System_Double, ((IPointerTypeSymbol)obj5Value.ConvertedType).PointedAtType.SpecialType); 1149Assert.Equal(SpecialType.System_Int32, ((IPointerTypeSymbol)obj2Value.Type).PointedAtType.SpecialType); 1150Assert.Equal(SpecialType.System_Int32, ((IPointerTypeSymbol)obj2Value.ConvertedType).PointedAtType.SpecialType); 1165Assert.Equal(SpecialType.System_Int32, ((IPointerTypeSymbol)obj4Value.Type).PointedAtType.SpecialType); 1166Assert.Equal(SpecialType.System_Int32, ((IPointerTypeSymbol)obj4Value.ConvertedType).PointedAtType.SpecialType); 1173Assert.Equal(SpecialType.System_Int32, ((IPointerTypeSymbol)obj5Value.Type).PointedAtType.SpecialType); 1174Assert.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 (24)
4434Assert.Equal(SpecialType.System_Int32, ((IPointerTypeSymbol)type).PointedAtType.SpecialType); 4711Assert.Equal(SpecialType.System_Int32, type.SpecialType); 5044Assert.Equal(SpecialType.System_Void, callSummary.Type.SpecialType); 5045Assert.Equal(SpecialType.System_Void, callSummary.ConvertedType.SpecialType); 5107Assert.Equal(SpecialType.System_Void, callSummary.Type.SpecialType); 5550Assert.NotEqual(SpecialType.System_Void, ((IPointerTypeSymbol)type).PointedAtType.SpecialType); 5554Assert.Equal(SpecialType.System_Void, ((IPointerTypeSymbol)convertedType).PointedAtType.SpecialType); 6079Assert.Equal(SpecialType.System_Int64, summary.Type.SpecialType); 6080Assert.Equal(SpecialType.System_Int64, summary.ConvertedType.SpecialType); 6506Assert.Equal(SpecialType.System_Boolean, summary.Type.SpecialType); 6507Assert.Equal(SpecialType.System_Boolean, summary.ConvertedType.SpecialType); 7349Assert.Equal(SpecialType.System_Char, ((IPointerTypeSymbol)type).PointedAtType.SpecialType); 7791Assert.NotEqual(SpecialType.None, type.SpecialType); 7804Assert.Equal(SpecialType.System_Int32, sizeOfSummary.Type.SpecialType); 7810Assert.Equal(s_specialTypeSizeOfMap[type.SpecialType], sizeOfSummary.ConstantValue); 7866Assert.Equal(SpecialType.System_Int32, sizeOfSummary.Type.SpecialType); 7872Assert.Equal(s_specialTypeSizeOfMap[type.GetEnumUnderlyingType().SpecialType], sizeOfSummary.ConstantValue); 7913Assert.Equal(SpecialType.None, type.SpecialType); 7926Assert.Equal(SpecialType.System_Int32, sizeOfSummary.Type.SpecialType); 8459Assert.Equal(SpecialType.System_Char, ((IPointerTypeSymbol)stackAllocSummary.Type).PointedAtType.SpecialType); 8460Assert.Equal(SpecialType.System_Void, ((IPointerTypeSymbol)stackAllocSummary.ConvertedType).PointedAtType.SpecialType); 8471Assert.Equal(SpecialType.System_Char, typeSummary.Type.SpecialType); 8483Assert.Equal(SpecialType.System_Int16, countSummary.Type.SpecialType); 8484Assert.Equal(SpecialType.System_Int32, countSummary.ConvertedType.SpecialType);
Semantics\UsingStatementTests.cs (2)
67Assert.Equal(SpecialType.System_IDisposable, declaredLocal.Type.SpecialType); 1854Assert.Equal(SpecialType.System_Int32, model.GetTypeInfo(node).Type.SpecialType);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (95)
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 (3)
347Assert.Equal(SpecialType.System_Int32, paramSymbol.Type.SpecialType); 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)
299Assert.Equal(SpecialType.System_Int32, semanticInfo.Type.SpecialType); 300Assert.Equal(SpecialType.System_Int32, semanticInfo.ConvertedType.SpecialType);
DocumentationComments\CrefTests.cs (1)
5720Assert.Equal(SpecialType.System_Decimal, symbol.ContainingType.SpecialType);
Symbols\ConversionTests.cs (2)
1804Assert.Equal(SpecialType.System_Byte, method.Parameters.Single().Type.SpecialType); 1838Assert.Equal(SpecialType.System_Byte, method.Parameters.Single().Type.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 (3)
2638Assert.Equal(SpecialType.System_String, symbol.Type.SpecialType); 4219Assert.Equal(SpecialType.System_String, ((IFieldSymbol)symbolInfo.Symbol).Type.SpecialType); 4249Assert.Equal(SpecialType.System_String, symbolInfo.Type.SpecialType);
Symbols\Source\UsingAliasTests.cs (2)
105Assert.Equal(SpecialType.System_Object, usingAliasType.SpecialType); 220Assert.Equal(SpecialType.System_Object, usingAliasType.SpecialType);
Microsoft.CodeAnalysis.CSharp.WinRT.UnitTests (1)
CodeGen\WinMdEventTests.cs (1)
672Assert.Equal(SpecialType.System_Void, type.Type.SpecialType);
Microsoft.CodeAnalysis.CSharp.Workspaces (35)
CastSimplifier.cs (8)
92Parent.Parent: IConversionOperation { Type.SpecialType: SpecialType.System_Object } conversionOperation 470if (castNode.IsParentKind(SyntaxKind.Interpolation) && originalConversionOperation.Type?.SpecialType is SpecialType.System_Object) 579if (current.ContainingType.SpecialType == SpecialType.System_Object) 675=> type.IsSignedIntegralType() || type?.SpecialType is SpecialType.System_IntPtr; 769if (binaryOperation.LeftOperand.Type?.SpecialType == SpecialType.System_Object && 776else if (binaryOperation.RightOperand.Type?.SpecialType == SpecialType.System_Object && 959=> type?.SpecialType is SpecialType.System_Double or SpecialType.System_Single; 1217rewrittenType.SpecialType == SpecialType.System_Enum;
CodeGeneration\CSharpSyntaxGenerator.cs (1)
3256switch (type.SpecialType)
CSharpTypeInferenceService.TypeInferrer.cs (6)
1037if (parentTypes.Any(static parentType => parentType.InferredType.SpecialType == SpecialType.System_String || parentType.InferredType.TypeKind == TypeKind.Delegate)) 1039return parentTypes.Where(parentType => parentType.InferredType.SpecialType == SpecialType.System_String || parentType.InferredType.TypeKind == TypeKind.Delegate); 1155else if (symbol.OriginalDefinition.SpecialType == SpecialType.System_Nullable_T) 2019return types.Select(t => t.InferredType.SpecialType == SpecialType.System_Void ? new TypeInferenceInfo(task) : new TypeInferenceInfo(taskOfT.Construct(t.InferredType))); 2253if (laterUsageInference is not [] and not [{ InferredType.SpecialType: SpecialType.System_Object }]) 2282if (inferredDescendantTypes is not [] and not [{ InferredType.SpecialType: SpecialType.System_Object }])
ExpressionGenerator.cs (1)
289memberAccess = memberAccess.WithAdditionalAnnotations(SpecialTypeAnnotation.Create(type.SpecialType));
InternalExtensions.cs (1)
36if (typeInfo.Type != null && typeInfo.Type.SpecialType == SpecialType.System_Void)
ITypeParameterSymbolExtensions.cs (1)
64if (type.SpecialType != SpecialType.System_Object)
ITypeSymbolExtensions.TypeSyntaxGeneratorVisitor.cs (2)
117syntax = SyntaxFactory.IdentifierName(symbol.SpecialType == SpecialType.System_IntPtr ? "nint" : "nuint"); 221if (symbol.SpecialType == SpecialType.System_Void)
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ITypeSymbolExtensions.cs\ITypeSymbolExtensions.cs (1)
11switch (typeSymbol.SpecialType)
NamedTypeGenerator.cs (2)
245var baseList = namedType.EnumUnderlyingType != null && namedType.EnumUnderlyingType.SpecialType != SpecialType.System_Int32 324if (namedType.TypeKind == TypeKind.Class && namedType.BaseType != null && namedType.BaseType.SpecialType != Microsoft.CodeAnalysis.SpecialType.System_Object)
Recommendations\CSharpRecommendationServiceRunner.cs (1)
526namedSymbols = namedSymbols.RemoveAll(s => s.ContainingType.SpecialType is SpecialType.System_Object or SpecialType.System_ValueType);
Recommendations\CSharpRecommendationServiceRunner_Conversions.cs (1)
202=> 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)
1066if (!method.ReturnsVoid && !method.Parameters.Any() && method.ReturnType.SpecialType == SpecialType.System_Boolean)
Simplification\Simplifiers\AbstractCSharpSimplifier.cs (3)
160var keywordToken = TryGetPredefinedKeywordToken(semanticModel, type.SpecialType); 174var keywordToken = TryGetPredefinedKeywordToken(semanticModel, type.SpecialType); 393semanticModel.GetTypeInfo(invocationExpr).Type.SpecialType == SpecialType.System_String;
Simplification\Simplifiers\ExpressionSimplifier.cs (1)
183var 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)
52var keywordToken = TryGetPredefinedKeywordToken(semanticModel, namedSymbol.SpecialType);
Microsoft.CodeAnalysis.Features (60)
AbstractForEachCastDiagnosticAnalyzer.cs (1)
141=> collectionElementType.SpecialType != SpecialType.System_Object ||
AbstractPopulateSwitchDiagnosticAnalyzer.cs (1)
97if (type is not { SpecialType: SpecialType.System_Boolean })
AbstractRemoveRedundantEqualityDiagnosticAnalyzer.cs (2)
60if (rightOperand.Type.SpecialType != SpecialType.System_Boolean || 61leftOperand.Type.SpecialType != SpecialType.System_Boolean)
AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (2)
827attribute.AttributeConstructor?.Parameters is [_, { Name: "checkId", Type.SpecialType: SpecialType.System_String }, ..] && 836attribute.AttributeConstructor.Parameters[0].Type.SpecialType == SpecialType.System_String &&
AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (2)
590attribute.ConstructorArguments is [{ Kind: TypedConstantKind.Primitive, Type.SpecialType: SpecialType.System_String, Value: string value }]) 728(IsSpecialMethodWithMatchingProperty("ShouldSerialize") && methodSymbol.ReturnType.SpecialType == SpecialType.System_Boolean ||
AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.BlockAnalyzer.cs (1)
144value.Type.SpecialType == SpecialType.System_Void)
AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.cs (2)
241method.Parameters is [{ Type.SpecialType: SpecialType.System_Object }, var secondParam] && 280methodSymbol.Parameters[0].Type.SpecialType == SpecialType.System_String &&
AbstractSimplifyConditionalDiagnosticAnalyzer.cs (2)
154typeInfo.Type?.SpecialType == SpecialType.System_Boolean && 155typeInfo.ConvertedType?.SpecialType == SpecialType.System_Boolean;
AbstractSimplifyInterpolationHelpers.cs (1)
127return method.ContainingType.SpecialType == SpecialType.System_Object
AbstractUseNullPropagationDiagnosticAnalyzer.cs (3)
154if (type is not INamedTypeSymbol namedType || namedType.ConstructedFrom.SpecialType != SpecialType.System_Nullable_T) 182var whenPartIsNullable = whenPartType?.OriginalDefinition.SpecialType == SpecialType.System_Nullable_T; 360if (typeSymbol?.SpecialType == SpecialType.System_Object)
AbstractUseNullPropagationDiagnosticAnalyzer_IfStatement.cs (1)
89var whenPartIsNullable = semanticModel.GetTypeInfo(whenPartMatch).Type?.OriginalDefinition.SpecialType == SpecialType.System_Nullable_T;
AbstractValidateFormatStringDiagnosticAnalyzer.cs (1)
303if (containingType.SpecialType != SpecialType.System_String)
Completion\Providers\AbstractObjectCreationCompletionProvider.cs (2)
68if (type.OriginalDefinition.SpecialType == SpecialType.System_Nullable_T) 71if (type.SpecialType == SpecialType.System_Void)
Completion\Providers\AbstractRecommendationServiceBasedCompletionProvider.cs (1)
58var inferredTypes = context.InferredTypes.Where(t => t.SpecialType != SpecialType.System_Void).ToSet();
Completion\Providers\AbstractSymbolCompletionProvider.cs (1)
65if (symbol.ContainingType?.SpecialType == SpecialType.System_Object)
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)
40if (!IsIntegral(symbol.SpecialType))
ConvertToInterpolatedString\AbstractConvertConcatenationToInterpolatedStringRefactoringProvider.cs (1)
251method.ContainingType?.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)
262if (attribute is { ConstructorArguments: [{ Type.SpecialType: SpecialType.System_String, Value: string stringValue }] })
EmbeddedLanguages\EmbeddedLanguageDetector.cs (1)
170m => m is IMethodSymbol { Parameters: [{ Type.SpecialType: SpecialType.System_String }, ..] });
ExtractClass\AbstractExtractClassRefactoringProvider.cs (1)
147private static bool HasBaseType(INamedTypeSymbol containingType) => containingType.BaseType?.SpecialType != SpecialType.System_Object;
ExtractMethod\MethodExtractor.Analyzer.cs (1)
621return type.OriginalDefinition.SpecialType == SpecialType.None && !WellKnownFrameworkValueType(compilation, type);
ExtractMethod\MethodExtractor.AnalyzerResult.cs (1)
144return ReturnType.SpecialType != SpecialType.System_Void && !AwaitTaskReturn;
ExtractMethod\MethodExtractor.CodeGenerator.cs (1)
207if (type != null && type.SpecialType != SpecialType.System_Void)
GenerateMember\GenerateConstructor\AbstractGenerateConstructorService.State.cs (1)
376switch (type.SpecialType)
GenerateMember\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.cs (1)
65if (typeParameters.Length == 0 && returnType.SpecialType != SpecialType.System_Void)
GenerateMember\GenerateVariable\AbstractGenerateVariableService.State.cs (1)
450inferredType = inferredType.SpecialType == SpecialType.System_Void
GenerateType\AbstractGenerateTypeService.State.cs (1)
250if (baseType.SpecialType is
ImplementInterface\AbstractImplementInterfaceService.CodeAction.cs (1)
387var condition3 = typeParameter.HasReferenceTypeConstraint && typeParameter.ConstraintTypes.Any(static ts => ts.IsReferenceType && ts.SpecialType != SpecialType.System_Object);
InheritanceMargin\AbstractInheritanceMarginService_Helpers.cs (1)
288.WhereAsArray(symbol => !symbol.IsErrorType() && symbol.SpecialType is not (SpecialType.System_Object or SpecialType.System_ValueType or SpecialType.System_Enum));
InitializeParameter\AbstractAddParameterCheckCodeRefactoringProvider.cs (4)
108if (parameter.Type.SpecialType == SpecialType.System_String) 161if (parameter.Type.SpecialType == SpecialType.System_String) 235else if (parameter.Type.SpecialType == SpecialType.System_String && 303return targetMethod.ContainingType.SpecialType == SpecialType.System_String;
InlineHints\AbstractInlineParameterNameHintsService.cs (1)
239return parameter.Type.SpecialType == SpecialType.System_Boolean;
IntroduceVariable\AbstractIntroduceLocalForExpressionCodeRefactoringProvider.cs (1)
46type.SpecialType == SpecialType.System_Void)
IntroduceVariable\AbstractIntroduceVariableService.cs (1)
413if (typeInfo.Type?.SpecialType == SpecialType.System_String &&
IntroduceVariable\AbstractIntroduceVariableService.State_Block.cs (1)
33if (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)
512if (symbol.IsEnumType() && symbol.EnumUnderlyingType.SpecialType != SpecialType.System_Int32)
MetadataAsSource\AbstractMetadataAsSourceService.WrappedNamedTypeSymbol.cs (1)
69public SpecialType SpecialType => _symbol.SpecialType;
PopulateSwitchStatementHelpers.cs (1)
139if (member is not IFieldSymbol fieldSymbol || fieldSymbol.Type.SpecialType != SpecialType.None)
PreferFrameworkType\PreferFrameworkTypeCodeFixProvider.cs (1)
61var replacementNode = typeSymbol.SpecialType is SpecialType.System_IntPtr or SpecialType.System_UIntPtr
PreferFrameworkType\PreferFrameworkTypeDiagnosticAnalyzerBase.cs (1)
90typeSymbol.SpecialType is SpecialType.None)
QuickInfo\QuickInfoUtilities.cs (1)
47if (symbol is INamedTypeSymbol { SpecialType: SpecialType.System_Void })
ReplaceMethodWithProperty\ReplaceMethodWithPropertyCodeRefactoringProvider.cs (1)
132if (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)
ValueTracking\ValueTracker.cs (1)
247return methodSymbol.ReturnType.SpecialType != SpecialType.System_Void;
Microsoft.CodeAnalysis.Test.Utilities (18)
Compilation\ControlFlowGraphVerifier.cs (2)
954&& arguments[0].Value.Type.SpecialType == SpecialType.System_Int32 955&& 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)
846Return info.Type.SpecialType <> SpecialType.System_Void 851Return info.Type.SpecialType <> SpecialType.System_Void
SymbolDisplay\SymbolDisplayVisitor.Types.vb (1)
418Dim type = symbol.SpecialType
Symbols\TypeSymbol.vb (1)
276Public Overridable ReadOnly Property SpecialType As SpecialType Implements ITypeSymbol.SpecialType, ITypeSymbolInternal.SpecialType
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (11)
CastAnalyzer.vb (10)
228If If(castType?.SpecialType = SpecialType.System_Object, False) AndAlso 322DirectCast(castExpressionType.OriginalDefinition, ITypeSymbol).SpecialType = SpecialType.System_Nullable_T 383Select Case destinationType.SpecialType 385Select Case sourceType.SpecialType 400ElseIf castType.SpecialType = SpecialType.System_DateTime 401Return Not outerType.SpecialType = SpecialType.System_DateTime 402ElseIf castType.SpecialType = SpecialType.System_Boolean 403Return Not (outerType.IsNumericType OrElse outerType.SpecialType = SpecialType.System_Boolean) 406If castType.OriginalDefinition?.SpecialType = SpecialType.System_Nullable_T Then 418If castType.Equals(outerType) OrElse outerType.SpecialType = SpecialType.System_Object Then
ExpressionSyntaxExtensions.vb (1)
111If typeInfo.Type IsNot Nothing AndAlso typeInfo.Type.SpecialType = SpecialType.System_Void Then
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (10)
ExpressionSyntaxExtensions.vb (1)
105Dim castKeyword = targetType.SpecialType.GetPredefinedCastKeyword()
ITypeSymbolExtensions.vb (1)
103Select Case this.SpecialType
StringExtensions.vb (1)
96Select Case type.SpecialType
TypeSyntaxGeneratorVisitor.vb (2)
81If symbol.OriginalDefinition.SpecialType = SpecialType.System_Nullable_T Then 95Select Case symbol.SpecialType
VisualBasicTypeInferenceService.TypeInferrer.vb (5)
486Return types.Select(Function(t) New TypeInferenceInfo(If(t.InferredType.SpecialType = SpecialType.System_Void, task, taskOfT.Construct(t.InferredType)))) 511If t.InferredType.OriginalDefinition.SpecialType = SpecialType.System_Nullable_T Then 544If otherSideTypes.Any(Function(t) t.InferredType.SpecialType <> SpecialType.System_Object AndAlso Not t.InferredType.IsErrorType()) Then 773If memberType.OriginalDefinition.SpecialType = SpecialType.System_Collections_Generic_IEnumerable_T OrElse 774memberType.OriginalDefinition.SpecialType = SpecialType.System_Collections_Generic_IEnumerator_T Then
Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests (2)
Attributes\AttributeTests_Tuples.vb (1)
443Assert.True(constant.Type.SpecialType = SpecialType.System_String)
Emit\NoPiaEmbedTypes.vb (1)
1881Assert.Equal(expr.Type.SpecialType, SpecialType.System_String)
Microsoft.CodeAnalysis.VisualBasic.Features (8)
Completion\CompletionProviders\OverrideCompletionProvider.vb (1)
193If overriddenMember.ContainingType.SpecialType = SpecialType.System_Object Then
Completion\KeywordRecommenders\Expressions\TrueFalseKeywordRecommender.vb (1)
37Return types.Any(Function(t) t.SpecialType = SpecialType.System_Boolean)
Completion\KeywordRecommenders\Types\BuiltInTypesKeywordRecommender.vb (1)
109Dim inferredSpecialTypes = context.InferredTypes.Select(Function(t) t.SpecialType).ToSet()
Completion\Providers\DefaultArgumentProvider.vb (1)
25Select Case context.Parameter.Type.SpecialType
ExtractMethod\Extensions.vb (1)
474Return type Is Nothing OrElse type.SpecialType = SpecialType.System_Object
ExtractMethod\VisualBasicMethodExtractor.vb (1)
91If type.SpecialType = SpecialType.System_Void Then
ExtractMethod\VisualBasicMethodExtractor.VisualBasicCodeGenerator.vb (1)
357Return method.Parameters(0).Type.SpecialType = SpecialType.System_Boolean
ExtractMethod\VisualBasicSelectionResult.vb (1)
198If If(info.Type?.SpecialType = SpecialType.System_String, False) AndAlso
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (39)
Semantics\ForeachTest.vb (6)
1168Assert.Equal(SpecialType.System_Object, loopInfo.CurrentProperty.Type.SpecialType) 1172Assert.Equal(SpecialType.System_Char, typeInfo.Type.SpecialType) 1208Assert.Equal(SpecialType.System_Object, loopInfo.CurrentProperty.Type.SpecialType) 1212Assert.Equal(SpecialType.System_Char, typeInfo.Type.SpecialType) 1260Assert.Equal(SpecialType.System_String, loopInfo0.ElementType.SpecialType) 1269Assert.Equal(SpecialType.System_Object, loopInfo1.ElementType.SpecialType) ' No longer string.
Semantics\GetExtendedSemanticInfoTests.vb (20)
1960Assert.Equal(SpecialType.System_Void, semanticInfo.Type.SpecialType) 1961Assert.Equal(SpecialType.System_Void, semanticInfo.ConvertedType.SpecialType) 2929Assert.Equal(System_Int32, semanticInfo.Type.SpecialType) 2948Assert.Equal(System_DateTime, semanticInfo.Type.SpecialType) 2967Assert.Equal(System_Int32, semanticInfo.Type.SpecialType) 2987Assert.Equal(System_Int32, semanticInfo.Type.SpecialType) 3028Assert.Equal(System_Int32, semanticInfo.Type.SpecialType) 3317Assert.Equal(System_Int32, semanticInfo.Type.SpecialType) 3339Assert.Equal(System_Int32, semanticInfo.Type.SpecialType) 3361Assert.Equal(System_Int32, semanticInfo.Type.SpecialType) 3384Assert.Equal(System_Int32, semanticInfo.Type.SpecialType) 3432Assert.Equal(System_Int32, semanticInfo.Type.SpecialType) 3433Assert.Equal(System_Int16, semanticInfo.ConvertedType.SpecialType) 3923Assert.Equal(semanticInfo.Type.SpecialType, System_Int32) 3964Assert.Equal(semanticInfo.Type.SpecialType, System_Int32) 3984Assert.Equal(semanticInfo.Type.SpecialType, System_String) 5622Assert.Equal(System_Int32, semanticInfo.Type.SpecialType) 5627Assert.Equal(System_Int64, semanticInfo.ConvertedType.SpecialType) 5680Assert.Equal(System_Int64, semanticInfo.Type.SpecialType) 5683Assert.Equal(System_Int32, semanticInfo.ConvertedType.SpecialType)
Semantics\GetSemanticInfoTests.vb (11)
3785Assert.Equal(info.Type.SpecialType, SpecialType.System_Object) 3796Assert.Equal(info.Type.SpecialType, SpecialType.System_Object) 6151Assert.Equal(SpecialType.System_Boolean, model.GetTypeInfo(expr).Type.SpecialType) 6156Assert.Equal(SpecialType.System_Boolean, model.GetTypeInfo(expr).Type.SpecialType) 6213Assert.Equal(SpecialType.System_Boolean, model.GetTypeInfo(expr).Type.SpecialType) 6218Assert.Equal(SpecialType.System_Boolean, model.GetTypeInfo(expr).Type.SpecialType) 6223Assert.Equal(SpecialType.System_Object, model.GetTypeInfo(expr).Type.SpecialType) 6253Assert.Equal(SpecialType.System_Boolean, model.GetTypeInfo(expr).Type.SpecialType) 6283Assert.Equal(SpecialType.System_Boolean, model.GetTypeInfo(expr).Type.SpecialType) 6313Assert.Equal(SpecialType.System_Boolean, model.GetTypeInfo(expr).Type.SpecialType) 6351Assert.Equal(SpecialType.System_Boolean, model.GetTypeInfo(expr).Type.SpecialType)
Semantics\NativeIntegerTests.vb (1)
51Assert.Equal(If(signed, SpecialType.System_IntPtr, SpecialType.System_UIntPtr), type.SpecialType)
Semantics\TypeOfTests.vb (1)
763Assert.Equal(SpecialType.System_Object, typeInfo.ConvertedType.SpecialType)
Microsoft.CodeAnalysis.VisualBasic.Symbol.UnitTests (7)
SymbolsTests\Source\EnumTests.vb (1)
1212Assert.Equal(type.SpecialType, SpecialType.System_Int32)
SymbolsTests\Source\PropertyTests.vb (6)
3796Assert.Equal(SpecialType.System_Int32, bindings.GetSpeculativeSemanticInfoSummary(position, SyntaxFactory.ParseExpression("Goo().Items(1)"), SpeculativeBindingOption.BindAsExpression).Type.SpecialType) 3797Assert.Equal(SpecialType.System_Int32, bindings.GetSpeculativeSemanticInfoSummary(position, SyntaxFactory.ParseExpression("Goo.Items(1)"), SpeculativeBindingOption.BindAsExpression).Type.SpecialType) 3798Assert.Equal(SpecialType.System_Int32, bindings.GetSpeculativeSemanticInfoSummary(position, SyntaxFactory.ParseExpression("Goo()(1)"), SpeculativeBindingOption.BindAsExpression).Type.SpecialType) 3799Assert.Equal(SpecialType.System_Int32, bindings.GetSpeculativeSemanticInfoSummary(position, SyntaxFactory.ParseExpression("Goo(1)"), SpeculativeBindingOption.BindAsExpression).Type.SpecialType) 3800Assert.Equal(SpecialType.System_Int32, bindings.GetSpeculativeSemanticInfoSummary(position, SyntaxFactory.ParseExpression("dd.Item(1)"), SpeculativeBindingOption.BindAsExpression).Type.SpecialType) 3801Assert.Equal(SpecialType.System_Int32, bindings.GetSpeculativeSemanticInfoSummary(position, SyntaxFactory.ParseExpression("Bar(1)"), SpeculativeBindingOption.BindAsExpression).Type.SpecialType)
Microsoft.CodeAnalysis.VisualBasic.Workspaces (32)
CastAnalyzer.vb (10)
228If If(castType?.SpecialType = SpecialType.System_Object, False) AndAlso 322DirectCast(castExpressionType.OriginalDefinition, ITypeSymbol).SpecialType = SpecialType.System_Nullable_T 383Select Case destinationType.SpecialType 385Select Case sourceType.SpecialType 400ElseIf castType.SpecialType = SpecialType.System_DateTime 401Return Not outerType.SpecialType = SpecialType.System_DateTime 402ElseIf castType.SpecialType = SpecialType.System_Boolean 403Return Not (outerType.IsNumericType OrElse outerType.SpecialType = SpecialType.System_Boolean) 406If castType.OriginalDefinition?.SpecialType = SpecialType.System_Nullable_T Then 418If castType.Equals(outerType) OrElse outerType.SpecialType = SpecialType.System_Object Then
CodeCleanup\AsyncOrIteratorFunctionReturnTypeFixer.vb (1)
132Select Case returnType.OriginalDefinition.SpecialType
CodeGeneration\MethodGenerator.vb (1)
70Dim isSub = method.ReturnType.SpecialType = SpecialType.System_Void
CodeGeneration\NamedTypeGenerator.vb (2)
149If(namedType.EnumUnderlyingType IsNot Nothing AndAlso namedType.EnumUnderlyingType.SpecialType <> SpecialType.System_Int32, 207namedType.BaseType.SpecialType = SpecialType.System_Object Then
CodeGeneration\ParameterGenerator.vb (1)
48elementType.OriginalDefinition.SpecialType <> SpecialType.System_Nullable_T Then
ITypeSymbolExtensions.vb (1)
103Select Case this.SpecialType
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\ExpressionSyntaxExtensions.vb\ExpressionSyntaxExtensions.vb (1)
111If typeInfo.Type IsNot Nothing AndAlso typeInfo.Type.SpecialType = SpecialType.System_Void Then
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ExpressionSyntaxExtensions.vb\ExpressionSyntaxExtensions.vb (1)
105Dim castKeyword = targetType.SpecialType.GetPredefinedCastKeyword()
Recommendations\VisualBasicRecommendationServiceRunner.vb (1)
156Return typeSymbol.SpecialType <> SpecialType.System_Delegate
Rename\VisualBasicRenameRewriterLanguageService.vb (1)
945If 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)
StringExtensions.vb (1)
96Select Case type.SpecialType
TypeSyntaxGeneratorVisitor.vb (2)
81If symbol.OriginalDefinition.SpecialType = SpecialType.System_Nullable_T Then 95Select Case symbol.SpecialType
VisualBasicTypeInferenceService.TypeInferrer.vb (5)
486Return types.Select(Function(t) New TypeInferenceInfo(If(t.InferredType.SpecialType = SpecialType.System_Void, task, taskOfT.Construct(t.InferredType)))) 511If t.InferredType.OriginalDefinition.SpecialType = SpecialType.System_Nullable_T Then 544If otherSideTypes.Any(Function(t) t.InferredType.SpecialType <> SpecialType.System_Object AndAlso Not t.InferredType.IsErrorType()) Then 773If memberType.OriginalDefinition.SpecialType = SpecialType.System_Collections_Generic_IEnumerable_T OrElse 774memberType.OriginalDefinition.SpecialType = SpecialType.System_Collections_Generic_IEnumerator_T Then
Microsoft.CodeAnalysis.Workspaces (51)
AbstractFlagsEnumGenerator.cs (3)
81var underlyingSpecialType = enumType.EnumUnderlyingType.SpecialType; 175var underlyingSpecialType = enumType.EnumUnderlyingType.SpecialType; 191var underlyingSpecialType = enumType.EnumUnderlyingType.SpecialType;
AbstractSpeculationAnalyzer.cs (5)
448type1.EnumUnderlyingType?.SpecialType == type2.SpecialType; 707&& symbol.ContainingType.SpecialType == SpecialType.System_Object 983if (newReceiverType.SpecialType != SpecialType.None) 990return newSymbolContainingType.SpecialType is SpecialType.System_Array or
AbstractTypeInferenceService.AbstractTypeInferrer.cs (1)
127symbol.ContainingType?.SpecialType == SpecialType.System_Enum;
CodeGenerationHelpers.cs (2)
85=> type != null && type.SpecialType == specialType; 135=> type?.SpecialType switch
CodeGenerationMethodSymbol.cs (1)
80=> this.ReturnType == null || this.ReturnType.SpecialType == SpecialType.System_Void;
Editing\SyntaxGenerator.cs (2)
797underlyingType: type.EnumUnderlyingType is null or { SpecialType: SpecialType.System_Int32 } 799: TypeExpression(type.EnumUnderlyingType.SpecialType),
FindSymbols\FindReferences\DependentProjectsFinder.cs (1)
243typeNameConstant.Type.SpecialType != SpecialType.System_String ||
FindSymbols\FindReferences\DependentTypeFinder.cs (2)
213switch (type.SpecialType) 219predicateOpt: n => n.BaseType?.SpecialType == SpecialType.System_Object).ConfigureAwait(false);
FindSymbols\FindReferences\Finders\ConstructorSymbolReferenceFinder.cs (2)
61project, documents, containingType.SpecialType.ToPredefinedType(), cancellationToken).ConfigureAwait(false)); 178var predefinedType = symbol.ContainingType.SpecialType.ToPredefinedType();
FindSymbols\FindReferences\Finders\ExplicitConversionSymbolReferenceFinder.cs (1)
47var documentsWithType = await FindDocumentsAsync(project, documents, underlyingNamedType.SpecialType.ToPredefinedType(), cancellationToken).ConfigureAwait(false);
FindSymbols\FindReferences\Finders\NamedTypeSymbolReferenceFinder.cs (2)
70project, documents, symbol.SpecialType.ToPredefinedType(), cancellationToken).ConfigureAwait(false)); 201var predefinedType = symbol.SpecialType.ToPredefinedType();
IMethodSymbolExtensions.cs (2)
44method.Parameters is [{ Type.SpecialType: SpecialType.System_Object }, var secondParam] && 105methodSymbol.ReturnType.SpecialType == SpecialType.System_Int32 ||
ISemanticFactsExtensions.cs (1)
119=> type?.SpecialType is SpecialType.System_Single or SpecialType.System_Double;
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\INamedTypeSymbolExtensions.cs\INamedTypeSymbolExtensions.cs (1)
615ContainingType.SpecialType: SpecialType.System_Object,
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.cs\ISymbolExtensions.cs (2)
619if (!returnType.GetMembers().OfType<IPropertySymbol>().Any(p => p.Name == WellKnownMemberNames.IsCompleted && p.Type.SpecialType == SpecialType.System_Boolean && p.GetMethod != null)) 669ReturnType.SpecialType: SpecialType.System_Boolean,
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.cs\ITypeSymbolExtensions.cs (9)
23=> type?.SpecialType.IsIntegralType() == true; 26=> type?.SpecialType.IsSignedIntegralType() == true; 57=> symbol?.SpecialType == SpecialType.System_Void; 60=> symbol?.OriginalDefinition.SpecialType == SpecialType.System_Nullable_T; 268switch (typeSymbol.SpecialType) 286switch (type.SpecialType) 374switch (symbol.SpecialType) 404typeSymbol.AllInterfaces.Any(static i => i.SpecialType == SpecialType.System_Collections_IEnumerable) && 644switch (type.SpecialType)
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\INamedTypeSymbolExtensions.cs\INamedTypeSymbolExtensions.cs (1)
30namedType.SpecialType,
Recommendations\AbstractRecommendationService.cs (1)
79if (namedType.SpecialType == SpecialType.System_Void)
SemanticModelExtensions.cs (2)
173type.OriginalDefinition.SpecialType == SpecialType.System_Nullable_T || 190if (type.SpecialType == SpecialType.System_String)
Shared\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (3)
407switch (typeSymbol.SpecialType) 441method.ReturnType.SpecialType == SpecialType.System_Boolean && 442method.Parameters[0].Type.SpecialType == SpecialType.System_Object &&
Shared\Utilities\EnumValueUtilities.cs (1)
34return CreateOne(enumType.EnumUnderlyingType.SpecialType);
SymbolEquivalenceComparer.cs (1)
180=> symbol.IsKind(SymbolKind.NamedType, out ITypeSymbol? typeSymbol) && typeSymbol.SpecialType == SpecialType.System_Object;
SyntaxGeneratorExtensions_CreateGetHashCodeMethod.cs (1)
210method.ReturnType.SpecialType == SpecialType.System_Int32 &&
SyntaxGeneratorExtensions_Negate.cs (4)
248var valueType = (operation as IIsPatternOperation)?.Value.Type?.SpecialType; 421if (containingType?.SpecialType == SpecialType.System_Array || 422containingType?.SpecialType == SpecialType.System_String) 430switch (type?.SpecialType)
Microsoft.VisualStudio.LanguageServices (10)
Library\ObjectBrowser\AbstractDescriptionBuilder.cs (1)
94typeSymbol.SpecialType == SpecialType.System_Void)
Library\ObjectBrowser\AbstractListItemFactory.cs (5)
60return namedTypeSymbol.SpecialType.ToPredefinedType() != PredefinedType.None 101var fullNameText = namedTypeSymbol.SpecialType.ToPredefinedType() != PredefinedType.None 112var displayText = namedTypeSymbol.SpecialType.ToPredefinedType() != PredefinedType.None 208if (namedTypeSymbol.SpecialType == SpecialType.System_Object) 276typeSymbol.SpecialType != SpecialType.System_Object)
Library\ObjectBrowser\ObjectList.cs (1)
439if (typeSymbol.SpecialType == SpecialType.System_Object)
Library\VsNavInfo\NavInfoFactory.cs (1)
78if (typeSymbol.SpecialType == SpecialType.System_Nullable_T)
ProjectSystem\AbstractEntryPointFinder.cs (2)
51if (!symbol.ReturnsVoid && symbol.ReturnType.SpecialType != SpecialType.System_Int32) 63var specialType = elementType.SpecialType;
Microsoft.VisualStudio.LanguageServices.CSharp (4)
CodeModel\CSharpCodeModelService.cs (1)
714switch (typeSymbol.SpecialType)
LanguageService\CSharpHelpContextService.cs (1)
534if (symbol is ITypeSymbol type && type.OriginalDefinition.SpecialType == SpecialType.System_Nullable_T)
ObjectBrowser\DescriptionBuilder.cs (2)
102if (underlyingType.SpecialType != SpecialType.System_Int32) 114if (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)
450ElseIf TypeOf symbol Is ITypeSymbol AndAlso DirectCast(symbol, ITypeSymbol).SpecialType <> SpecialType.None Then
ObjectBrowser\DescriptionBuilder.vb (1)
107If underlyingType IsNot Nothing AndAlso underlyingType.SpecialType <> SpecialType.System_Int32 Then