6 interfaces inheriting from ITypeSymbol
Microsoft.CodeAnalysis (6)
Symbols\IArrayTypeSymbol.cs (1)
17public interface IArrayTypeSymbol : ITypeSymbol
Symbols\IDynamicTypeSymbol.cs (1)
16public interface IDynamicTypeSymbol : ITypeSymbol
Symbols\IFunctionPointerTypeSymbol.cs (1)
14public interface IFunctionPointerTypeSymbol : ITypeSymbol
Symbols\INamedTypeSymbol.cs (1)
19public interface INamedTypeSymbol : ITypeSymbol
Symbols\IPointerTypeSymbol.cs (1)
18public interface IPointerTypeSymbol : ITypeSymbol
Symbols\ITypeParameterSymbol.cs (1)
16public interface ITypeParameterSymbol : ITypeSymbol
4 implementations of ITypeSymbol
Microsoft.CodeAnalysis.CodeStyle.Fixes (1)
CodeGenerationTypeSymbol.cs (1)
17internal abstract class CodeGenerationTypeSymbol : CodeGenerationNamespaceOrTypeSymbol, ITypeSymbol
Microsoft.CodeAnalysis.CSharp (1)
Symbols\PublicModel\TypeSymbol.cs (1)
12internal abstract class TypeSymbol : NamespaceOrTypeSymbol, ISymbol, ITypeSymbol
Microsoft.CodeAnalysis.VisualBasic (1)
Symbols\TypeSymbol.vb (1)
23Implements ITypeSymbol, ITypeSymbolInternal
Microsoft.CodeAnalysis.Workspaces (1)
CodeGenerationTypeSymbol.cs (1)
17internal abstract class CodeGenerationTypeSymbol : CodeGenerationNamespaceOrTypeSymbol, ITypeSymbol
3742 references to ITypeSymbol
Microsoft.CodeAnalysis (433)
Compilation\Compilation.cs (39)
979internal abstract bool IsAttributeType(ITypeSymbol type); 992public ITypeSymbol DynamicType { get { return CommonDynamicType; } } 993protected abstract ITypeSymbol CommonDynamicType { get; } 998internal ITypeSymbol? ScriptGlobalsType => CommonScriptGlobalsType; 999protected abstract ITypeSymbol? CommonScriptGlobalsType { get; } 1057public IArrayTypeSymbol CreateArrayTypeSymbol(ITypeSymbol elementType, int rank = 1, NullableAnnotation elementNullableAnnotation = NullableAnnotation.None) 1067public IArrayTypeSymbol CreateArrayTypeSymbol(ITypeSymbol elementType, int rank) 1072protected abstract IArrayTypeSymbol CommonCreateArrayTypeSymbol(ITypeSymbol elementType, int rank, NullableAnnotation elementNullableAnnotation); 1079public IPointerTypeSymbol CreatePointerTypeSymbol(ITypeSymbol pointedAtType) 1084protected abstract IPointerTypeSymbol CommonCreatePointerTypeSymbol(ITypeSymbol elementType); 1100ITypeSymbol returnType, 1102ImmutableArray<ITypeSymbol> parameterTypes, 1111ITypeSymbol returnType, 1113ImmutableArray<ITypeSymbol> parameterTypes, 1265ImmutableArray<ITypeSymbol> elementTypes, 1306ImmutableArray<ITypeSymbol> elementTypes, 1370ImmutableArray<ITypeSymbol> elementTypes, 1422ImmutableArray<ITypeSymbol> memberTypes, 1491ImmutableArray<ITypeSymbol> memberTypes, 1500ImmutableArray<ITypeSymbol> memberTypes, 1516public IMethodSymbol CreateBuiltinOperator(string name, ITypeSymbol returnType, ITypeSymbol leftType, ITypeSymbol rightType) 1532protected abstract IMethodSymbol CommonCreateBuiltinOperator(string name, ITypeSymbol returnType, ITypeSymbol leftType, ITypeSymbol rightType); 1543public IMethodSymbol CreateBuiltinOperator(string name, ITypeSymbol returnType, ITypeSymbol operandType) 1556protected abstract IMethodSymbol CommonCreateBuiltinOperator(string name, ITypeSymbol returnType, ITypeSymbol operandType); 1566public abstract CommonConversion ClassifyCommonConversion(ITypeSymbol source, ITypeSymbol destination); 1574public bool HasImplicitConversion(ITypeSymbol? fromType, ITypeSymbol? toType) 1597ITypeSymbol? throughType = null) 1726ITypeSymbol? throughType); 1728internal abstract IConvertibleConversion ClassifyConvertibleConversion(IOperation source, ITypeSymbol destination, out ConstantValue? constantValue); 3576internal string GetMessage(ITypeSymbol source, ITypeSymbol destination)
Compilation\Expression.cs (1)
9public static ConstantValue SynthesizeNumeric(ITypeSymbol type, int value)
Compilation\TypeInfo.cs (4)
20public ITypeSymbol? Type { get; } 31public ITypeSymbol? ConvertedType { get; } 40internal TypeInfo(ITypeSymbol? type, ITypeSymbol? convertedType, NullabilityInfo nullability, NullabilityInfo convertedNullability)
Diagnostic\CommonMessageProvider.cs (2)
270protected abstract void ReportInvalidNamedArgument(DiagnosticBag diagnostics, SyntaxNode attributeSyntax, int namedArgumentIndex, ITypeSymbol attributeClass, string parameterName); 272public void ReportInvalidNamedArgument(BindingDiagnosticBag diagnostics, SyntaxNode attributeSyntax, int namedArgumentIndex, ITypeSymbol attributeClass, string parameterName)
DiagnosticAnalyzer\SuppressMessageAttributeState.TargetSymbolResolver.cs (9)
407var typeSymbol = result.Value.Type; 696private ITypeSymbol ParseArrayType(ITypeSymbol typeSymbol) 764var boundReturnType = BindParameterOrReturnType(methodSymbol, returnType.Value); 801var parameterType = BindParameterOrReturnType(symbol.ContainingSymbol, parameterInfo.Type); 806private ITypeSymbol BindParameterOrReturnType(ISymbol bindingContext, TypeInfo type) 868public readonly ITypeSymbol Type; 876private TypeInfo(ITypeSymbol type, int startIndex) 882public static TypeInfo Create(ITypeSymbol type)
DocumentationCommentId.cs (14)
822private static ITypeSymbol? ParseTypeSymbol(string id, ref int index, Compilation compilation, ISymbol? typeParameterContext) 834return (ITypeSymbol)results[0]; 876results.AddRange(contexts.OfType<ITypeSymbol>()); 902var typeSymbol = (ITypeSymbol)results[i]; 980List<ITypeSymbol>? typeArguments = null; 986typeArguments = new List<ITypeSymbol>(); 1079private static bool ParseTypeArguments(string id, ref int index, Compilation compilation, ISymbol? typeParameterContext, List<ITypeSymbol> typeArguments) 1085var type = ParseTypeSymbol(id, ref index, compilation, typeParameterContext); 1219ITypeSymbol? returnType = ParseTypeSymbol(id, ref index, compilation, methodSymbol); 1363var parameterType = parameterInfo.Type; 1399internal readonly ITypeSymbol Type; 1402public ParameterInfo(ITypeSymbol type, bool isRefOrOut) 1456var type = ParseTypeSymbol(id, ref index, compilation, typeParameterContext);
Generated\Operations.Generated.cs (265)
672ITypeSymbol? ConstrainedToType { get; } 725ITypeSymbol? ConstrainedToType { get; } 847ITypeSymbol? ConstrainedToType { get; } 1007ITypeSymbol? ConstrainedToType { get; } 1064ITypeSymbol? ConstrainedToType { get; } 1302ITypeSymbol TypeOperand { get; } 1426ITypeSymbol? ConstrainedToType { get; } 1704ITypeSymbol? NaturalType { get; } 1762ImmutableArray<ITypeSymbol> TypeArguments { get; } 1766ITypeSymbol? ContainingType { get; } 1918ITypeSymbol TypeOperand { get; } 1940ITypeSymbol TypeOperand { get; } 2037ITypeSymbol? ConstrainedToType { get; } 2412ITypeSymbol ExceptionType { get; } 2669ITypeSymbol InputType { get; } 2673ITypeSymbol NarrowedType { get; } 2717ITypeSymbol? MatchedType { get; } 2976ITypeSymbol MatchedType { get; } 3301ITypeSymbol MatchedType { get; } 3677public override ITypeSymbol? Type => null; 3732public override ITypeSymbol? Type => null; 3802public override ITypeSymbol? Type => null; 3908public override ITypeSymbol? Type => null; 4000public override ITypeSymbol? Type => null; 4112public override ITypeSymbol? Type => null; 4136public override ITypeSymbol? Type => null; 4189public override ITypeSymbol? Type => null; 4209public override ITypeSymbol? Type => null; 4223public override ITypeSymbol? Type => null; 4275public override ITypeSymbol? Type => null; 4339public override ITypeSymbol? Type => null; 4418public override ITypeSymbol? Type => null; 4486public override ITypeSymbol? Type => null; 4537public override ITypeSymbol? Type => null; 4601public override ITypeSymbol? Type => null; 4615public override ITypeSymbol? Type => null; 4629public override ITypeSymbol? Type => null; 4695public override ITypeSymbol? Type => null; 4703internal LiteralOperation(SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, ConstantValue? constantValue, bool isImplicit) 4713public override ITypeSymbol? Type { get; } 4721internal ConversionOperation(IOperation operand, IConvertibleConversion conversion, bool isTryCast, bool isChecked, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, ConstantValue? constantValue, bool isImplicit) 4773public override ITypeSymbol? Type { get; } 4781internal InvocationOperation(IMethodSymbol targetMethod, ITypeSymbol? constrainedToType, IOperation? instance, bool isVirtual, ImmutableArray<IArgumentOperation> arguments, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 4792public ITypeSymbol? ConstrainedToType { get; } 4846public override ITypeSymbol? Type { get; } 4854internal ArrayElementReferenceOperation(IOperation arrayReference, ImmutableArray<IOperation> indices, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 4913public override ITypeSymbol? Type { get; } 4921internal LocalReferenceOperation(ILocalSymbol local, bool isDeclaration, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, ConstantValue? constantValue, bool isImplicit) 4935public override ITypeSymbol? Type { get; } 4943internal ParameterReferenceOperation(IParameterSymbol parameter, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 4954public override ITypeSymbol? Type { get; } 4968public abstract ITypeSymbol? ConstrainedToType { get; } 4972internal FieldReferenceOperation(IFieldSymbol field, bool isDeclaration, IOperation? instance, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, ConstantValue? constantValue, bool isImplicit) 5019public override ITypeSymbol? Type { get; } 5027internal MethodReferenceOperation(IMethodSymbol method, ITypeSymbol? constrainedToType, bool isVirtual, IOperation? instance, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 5036public override ITypeSymbol? ConstrainedToType { get; } 5075public override ITypeSymbol? Type { get; } 5083internal PropertyReferenceOperation(IPropertySymbol property, ITypeSymbol? constrainedToType, ImmutableArray<IArgumentOperation> arguments, IOperation? instance, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 5092public override ITypeSymbol? ConstrainedToType { get; } 5144public override ITypeSymbol? Type { get; } 5152internal EventReferenceOperation(IEventSymbol @event, ITypeSymbol? constrainedToType, IOperation? instance, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 5160public override ITypeSymbol? ConstrainedToType { get; } 5198public override ITypeSymbol? Type { get; } 5206internal UnaryOperation(UnaryOperatorKind operatorKind, IOperation operand, bool isLifted, bool isChecked, IMethodSymbol? operatorMethod, ITypeSymbol? constrainedToType, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, ConstantValue? constantValue, bool isImplicit) 5223public ITypeSymbol? ConstrainedToType { get; } 5261public override ITypeSymbol? Type { get; } 5269internal BinaryOperation(BinaryOperatorKind operatorKind, IOperation leftOperand, IOperation rightOperand, bool isLifted, bool isChecked, bool isCompareText, IMethodSymbol? operatorMethod, ITypeSymbol? constrainedToType, IMethodSymbol? unaryOperatorMethod, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, ConstantValue? constantValue, bool isImplicit) 5291public ITypeSymbol? ConstrainedToType { get; } 5339public override ITypeSymbol? Type { get; } 5347internal ConditionalOperation(IOperation condition, IOperation whenTrue, IOperation? whenFalse, bool isRef, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, ConstantValue? constantValue, bool isImplicit) 5416public override ITypeSymbol? Type { get; } 5424internal CoalesceOperation(IOperation value, IOperation whenNull, IConvertibleConversion valueConversion, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, ConstantValue? constantValue, bool isImplicit) 5483public override ITypeSymbol? Type { get; } 5536public override ITypeSymbol? Type => null; 5544internal ObjectCreationOperation(IMethodSymbol? constructor, IObjectOrCollectionInitializerOperation? initializer, ImmutableArray<IArgumentOperation> arguments, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, ConstantValue? constantValue, bool isImplicit) 5606public override ITypeSymbol? Type { get; } 5614internal TypeParameterObjectCreationOperation(IObjectOrCollectionInitializerOperation? initializer, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 5658public override ITypeSymbol? Type { get; } 5666internal ArrayCreationOperation(ImmutableArray<IOperation> dimensionSizes, IArrayInitializerOperation? initializer, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 5725public override ITypeSymbol? Type { get; } 5733internal InstanceReferenceOperation(InstanceReferenceKind referenceKind, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 5744public override ITypeSymbol? Type { get; } 5752internal IsTypeOperation(IOperation valueOperand, ITypeSymbol typeOperand, bool isNegated, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 5761public ITypeSymbol TypeOperand { get; } 5800public override ITypeSymbol? Type { get; } 5808internal AwaitOperation(IOperation operation, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 5852public override ITypeSymbol? Type { get; } 5871internal SimpleAssignmentOperation(bool isRef, IOperation target, IOperation value, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, ConstantValue? constantValue, bool isImplicit) 5925public override ITypeSymbol? Type { get; } 5933internal CompoundAssignmentOperation(IConvertibleConversion inConversion, IConvertibleConversion outConversion, BinaryOperatorKind operatorKind, bool isLifted, bool isChecked, IMethodSymbol? operatorMethod, ITypeSymbol? constrainedToType, IOperation target, IOperation value, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 5953public ITypeSymbol? ConstrainedToType { get; } 6000public override ITypeSymbol? Type { get; } 6008internal ParenthesizedOperation(IOperation operand, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, ConstantValue? constantValue, bool isImplicit) 6053public override ITypeSymbol? Type { get; } 6061internal EventAssignmentOperation(IOperation eventReference, IOperation handlerValue, bool adds, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 6118public override ITypeSymbol? Type { get; } 6126internal ConditionalAccessOperation(IOperation operation, IOperation whenNotNull, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 6181public override ITypeSymbol? Type { get; } 6189internal ConditionalAccessInstanceOperation(SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 6198public override ITypeSymbol? Type { get; } 6206internal InterpolatedStringOperation(ImmutableArray<IInterpolatedStringContentOperation> parts, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, ConstantValue? constantValue, bool isImplicit) 6255public override ITypeSymbol? Type { get; } 6263internal AnonymousObjectCreationOperation(ImmutableArray<IOperation> initializers, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 6311public override ITypeSymbol? Type { get; } 6319internal ObjectOrCollectionInitializerOperation(ImmutableArray<IOperation> initializers, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 6367public override ITypeSymbol? Type { get; } 6375internal MemberInitializerOperation(IOperation initializedMember, IObjectOrCollectionInitializerOperation initializer, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 6430public override ITypeSymbol? Type { get; } 6438internal NameOfOperation(IOperation argument, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, ConstantValue? constantValue, bool isImplicit) 6483public override ITypeSymbol? Type { get; } 6491internal TupleOperation(ImmutableArray<IOperation> elements, ITypeSymbol? naturalType, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 6499public ITypeSymbol? NaturalType { get; } 6541public override ITypeSymbol? Type { get; } 6549internal DynamicMemberReferenceOperation(IOperation? instance, string memberName, ImmutableArray<ITypeSymbol> typeArguments, ITypeSymbol? containingType, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 6560public ImmutableArray<ITypeSymbol> TypeArguments { get; } 6561public ITypeSymbol? ContainingType { get; } 6599public override ITypeSymbol? Type { get; } 6607internal TranslatedQueryOperation(IOperation operation, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 6651public override ITypeSymbol? Type { get; } 6659internal DelegateCreationOperation(IOperation target, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 6703public override ITypeSymbol? Type { get; } 6711internal DefaultValueOperation(SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, ConstantValue? constantValue, bool isImplicit) 6721public override ITypeSymbol? Type { get; } 6729internal TypeOfOperation(ITypeSymbol typeOperand, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 6735public ITypeSymbol TypeOperand { get; } 6740public override ITypeSymbol? Type { get; } 6748internal SizeOfOperation(ITypeSymbol typeOperand, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, ConstantValue? constantValue, bool isImplicit) 6755public ITypeSymbol TypeOperand { get; } 6760public override ITypeSymbol? Type { get; } 6768internal AddressOfOperation(IOperation reference, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 6812public override ITypeSymbol? Type { get; } 6820internal IsPatternOperation(IOperation value, IPatternOperation pattern, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 6875public override ITypeSymbol? Type { get; } 6883internal IncrementOrDecrementOperation(bool isPostfix, bool isLifted, bool isChecked, IOperation target, IMethodSymbol? operatorMethod, ITypeSymbol? constrainedToType, OperationKind kind, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 6900public ITypeSymbol? ConstrainedToType { get; } 6938public override ITypeSymbol? Type { get; } 6946internal ThrowOperation(IOperation? exception, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 6990public override ITypeSymbol? Type { get; } 6998internal DeconstructionAssignmentOperation(IOperation target, IOperation value, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 7049public override ITypeSymbol? Type { get; } 7057internal DeclarationExpressionOperation(IOperation expression, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 7101public override ITypeSymbol? Type { get; } 7109internal OmittedArgumentOperation(SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 7118public override ITypeSymbol? Type { get; } 7180public override ITypeSymbol? Type => null; 7227public override ITypeSymbol? Type => null; 7278public override ITypeSymbol? Type => null; 7329public override ITypeSymbol? Type => null; 7384public override ITypeSymbol? Type => null; 7452public override ITypeSymbol? Type => null; 7533public override ITypeSymbol? Type => null; 7594public override ITypeSymbol? Type => null; 7602internal CatchClauseOperation(IOperation? exceptionDeclarationOrExpression, ITypeSymbol exceptionType, ImmutableArray<ILocalSymbol> locals, IOperation? filter, IBlockOperation handler, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 7612public ITypeSymbol ExceptionType { get; } 7671public override ITypeSymbol? Type => null; 7745public override ITypeSymbol? Type => null; 7769public override ITypeSymbol? Type => null; 7832public override ITypeSymbol? Type => null; 7894public override ITypeSymbol? Type => null; 7947public override ITypeSymbol? Type => null; 7998public override ITypeSymbol? Type => null; 8054public override ITypeSymbol? Type => null; 8127public override ITypeSymbol? Type => null; 8135protected BasePatternOperation(ITypeSymbol inputType, ITypeSymbol narrowedType, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 8141public ITypeSymbol InputType { get; } 8142public ITypeSymbol NarrowedType { get; } 8146internal ConstantPatternOperation(IOperation value, ITypeSymbol inputType, ITypeSymbol narrowedType, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 8189public override ITypeSymbol? Type => null; 8197internal DeclarationPatternOperation(ITypeSymbol? matchedType, bool matchesNull, ISymbol? declaredSymbol, ITypeSymbol inputType, ITypeSymbol narrowedType, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 8204public ITypeSymbol? MatchedType { get; } 8211public override ITypeSymbol? Type => null; 8219internal TupleBinaryOperation(BinaryOperatorKind operatorKind, IOperation leftOperand, IOperation rightOperand, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 8276public override ITypeSymbol? Type { get; } 8343public override ITypeSymbol? Type => null; 8414public override ITypeSymbol? Type => null; 8422internal DiscardOperation(IDiscardSymbol discardSymbol, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 8433public override ITypeSymbol? Type { get; } 8486public override ITypeSymbol? Type => null; 8494internal FlowCaptureReferenceOperation(CaptureId id, bool isInitialization, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, ConstantValue? constantValue, bool isImplicit) 8508public override ITypeSymbol? Type { get; } 8516internal IsNullOperation(IOperation operand, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, ConstantValue? constantValue, bool isImplicit) 8561public override ITypeSymbol? Type { get; } 8569internal CaughtExceptionOperation(SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 8578public override ITypeSymbol? Type { get; } 8586internal StaticLocalInitializationSemaphoreOperation(ILocalSymbol local, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 8597public override ITypeSymbol? Type { get; } 8605internal CoalesceAssignmentOperation(IOperation target, IOperation value, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 8656public override ITypeSymbol? Type { get; } 8664internal RangeOperation(IOperation? leftOperand, IOperation? rightOperand, bool isLifted, IMethodSymbol? method, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 8723public override ITypeSymbol? Type { get; } 8780public override ITypeSymbol? Type => null; 8846public override ITypeSymbol? Type => null; 8854internal RecursivePatternOperation(ITypeSymbol matchedType, ISymbol? deconstructSymbol, ImmutableArray<IPatternOperation> deconstructionSubpatterns, ImmutableArray<IPropertySubpatternOperation> propertySubpatterns, ISymbol? declaredSymbol, ITypeSymbol inputType, ITypeSymbol narrowedType, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 8863public ITypeSymbol MatchedType { get; } 8922public override ITypeSymbol? Type => null; 8930internal DiscardPatternOperation(ITypeSymbol inputType, ITypeSymbol narrowedType, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 8936public override ITypeSymbol? Type => null; 8944internal SwitchExpressionOperation(IOperation value, ImmutableArray<ISwitchExpressionArmOperation> arms, bool isExhaustive, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 9005public override ITypeSymbol? Type { get; } 9080public override ITypeSymbol? Type => null; 9142public override ITypeSymbol? Type => null; 9150internal AggregateQueryOperation(IOperation group, IOperation aggregation, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 9205public override ITypeSymbol? Type { get; } 9269public override ITypeSymbol? Type => null; 9277internal NoPiaObjectCreationOperation(IObjectOrCollectionInitializerOperation? initializer, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 9321public override ITypeSymbol? Type { get; } 9329internal PlaceholderOperation(PlaceholderKind placeholderKind, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 9340public override ITypeSymbol? Type { get; } 9402public override ITypeSymbol? Type => null; 9457public override ITypeSymbol? Type => null; 9465internal NegatedPatternOperation(IPatternOperation pattern, ITypeSymbol inputType, ITypeSymbol narrowedType, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 9508public override ITypeSymbol? Type => null; 9516internal BinaryPatternOperation(BinaryOperatorKind operatorKind, IPatternOperation leftPattern, IPatternOperation rightPattern, ITypeSymbol inputType, ITypeSymbol narrowedType, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 9572public override ITypeSymbol? Type => null; 9580internal TypePatternOperation(ITypeSymbol matchedType, ITypeSymbol inputType, ITypeSymbol narrowedType, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 9585public ITypeSymbol MatchedType { get; } 9590public override ITypeSymbol? Type => null; 9598internal RelationalPatternOperation(BinaryOperatorKind operatorKind, IOperation value, ITypeSymbol inputType, ITypeSymbol narrowedType, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 9643public override ITypeSymbol? Type => null; 9651internal WithOperation(IOperation operand, IMethodSymbol? cloneMethod, IObjectOrCollectionInitializerOperation initializer, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 9708public override ITypeSymbol? Type { get; } 9716internal InterpolatedStringHandlerCreationOperation(IOperation handlerCreation, bool handlerCreationHasSuccessParameter, bool handlerAppendCallsReturnBool, IOperation content, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 9775public override ITypeSymbol? Type { get; } 9837public override ITypeSymbol? Type => null; 9889public override ITypeSymbol? Type => null; 9909public override ITypeSymbol? Type => null; 9917internal FunctionPointerInvocationOperation(IOperation target, ImmutableArray<IArgumentOperation> arguments, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 9976public override ITypeSymbol? Type { get; } 9984internal ListPatternOperation(ISymbol? lengthSymbol, ISymbol? indexerSymbol, ImmutableArray<IPatternOperation> patterns, ISymbol? declaredSymbol, ITypeSymbol inputType, ITypeSymbol narrowedType, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 10037public override ITypeSymbol? Type => null; 10045internal SlicePatternOperation(ISymbol? sliceSymbol, IPatternOperation? pattern, ITypeSymbol inputType, ITypeSymbol narrowedType, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 10090public override ITypeSymbol? Type => null; 10098internal ImplicitIndexerReferenceOperation(IOperation instance, IOperation argument, ISymbol lengthSymbol, ISymbol indexerSymbol, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 10157public override ITypeSymbol? Type { get; } 10165internal Utf8StringOperation(string value, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 10176public override ITypeSymbol? Type { get; } 10227public override ITypeSymbol? Type => null;
Operations\CommonConversion.cs (2)
32internal CommonConversion(bool exists, bool isIdentity, bool isNumeric, bool isReference, bool isImplicit, bool isNullable, IMethodSymbol? methodSymbol, ITypeSymbol? constrainedToType) 86public ITypeSymbol? ConstrainedToType { get; }
Operations\ControlFlowGraphBuilder.cs (21)
2439private IOperation CreateConversion(IOperation operand, ITypeSymbol type) 2971ITypeSymbol? valueTypeOpt = operationValue.Type; 3271private static IOperation MakeInvalidOperation(ITypeSymbol? type, IOperation child) 3278private static IOperation MakeInvalidOperation(SyntaxNode syntax, ITypeSymbol? type, IOperation child1, IOperation child2) 3283private static IOperation MakeInvalidOperation(SyntaxNode syntax, ITypeSymbol? type, ImmutableArray<IOperation> children) 3295private static IsNullOperation MakeIsNullOperation(IOperation operand, ITypeSymbol booleanType) 3313ITypeSymbol? valueType = value.Type; 3514ITypeSymbol? testExpressionType = testExpression.Type; 3768private void AddExceptionStore(ITypeSymbol exceptionType, IOperation? exceptionDeclarationOrExpression) 3943ITypeSymbol iDisposable = isAsynchronous 4092private void AddDisposingFinally(IOperation resource, bool requiresRuntimeConversion, ITypeSymbol iDisposable, IMethodSymbol? disposeMethod, ImmutableArray<IArgumentOperation> disposeArguments, bool isAsynchronous) 4174bool isNotNullableValueType([NotNullWhen(true)] ITypeSymbol? type) 4180private IOperation ConvertToIDisposable(IOperation operand, ITypeSymbol iDisposable, bool isTryCast = false) 4192ITypeSymbol objectType = _compilation.GetSpecialType(SpecialType.System_Object); 4456var iDisposable = isAsynchronous 4478IOperation applyConversion(IConvertibleConversion? conversionOpt, IOperation operand, ITypeSymbol? targetType) 4645ITypeSymbol booleanType = _compilation.GetSpecialType(SpecialType.System_Boolean); 4658ITypeSymbol? stepEnumUnderlyingTypeOrSelf = ITypeSymbolHelpers.GetEnumUnderlyingTypeOrSelf(operation.StepValue.Type); 4829ITypeSymbol? stepValueEnumUnderlyingTypeOrSelf = ITypeSymbolHelpers.GetEnumUnderlyingTypeOrSelf(stepValue.Type); 5565private IOperation MakeNullable(IOperation operand, ITypeSymbol type) 5735ITypeSymbol booleanType = _compilation.GetSpecialType(SpecialType.System_Boolean);
Operations\ControlFlowGraphBuilder.RegionBuilder.cs (2)
19public readonly ITypeSymbol? ExceptionType; 31public RegionBuilder(ControlFlowRegionKind kind, ITypeSymbol? exceptionType = null, ImmutableArray<ILocalSymbol> locals = default, bool isStackSpillRegion = false)
Operations\ControlFlowRegion.cs (2)
31public ITypeSymbol? ExceptionType { get; } 68ITypeSymbol? exceptionType,
Operations\IOperation.cs (1)
40ITypeSymbol? Type { get; }
Operations\Loops\ForEachLoopOperationInfo.cs (2)
14public readonly ITypeSymbol ElementType; 41ITypeSymbol elementType,
Operations\Operation.cs (1)
76public abstract ITypeSymbol? Type { get; }
Operations\OperationNodes.cs (16)
18public NoneOperation(ImmutableArray<IOperation> children, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, ConstantValue? constantValue, bool isImplicit) : 64public override ITypeSymbol? Type { get; } 82public ITypeSymbol? ConstrainedToType => Conversion.ConstrainedToType; 87public InvalidOperation(ImmutableArray<IOperation> children, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, ConstantValue? constantValue, bool isImplicit) : 135public override ITypeSymbol? Type { get; } 169public override ITypeSymbol? Type => null; 205public override ITypeSymbol? ConstrainedToType => null; 235protected HasDynamicArgumentsExpression(ImmutableArray<IOperation> arguments, ImmutableArray<string> argumentNames, ImmutableArray<RefKind> argumentRefKinds, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) : 247public override ITypeSymbol? Type { get; } 252public DynamicObjectCreationOperation(IObjectOrCollectionInitializerOperation? initializer, ImmutableArray<IOperation> arguments, ImmutableArray<string> argumentNames, ImmutableArray<RefKind> argumentRefKinds, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) : 334public DynamicInvocationOperation(IOperation operation, ImmutableArray<IOperation> arguments, ImmutableArray<string> argumentNames, ImmutableArray<RefKind> argumentRefKinds, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) : 416public DynamicIndexerAccessOperation(IOperation operation, ImmutableArray<IOperation> arguments, ImmutableArray<string> argumentNames, ImmutableArray<RefKind> argumentRefKinds, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) : 641public FlowCaptureReferenceOperation(int id, SyntaxNode syntax, ITypeSymbol? type, ConstantValue? constantValue, bool isInitialization = false) : 658public IsNullOperation(SyntaxNode syntax, IOperation operand, ITypeSymbol type, ConstantValue? constantValue) : 667public CaughtExceptionOperation(SyntaxNode syntax, ITypeSymbol type) : 675public StaticLocalInitializationSemaphoreOperation(ILocalSymbol local, SyntaxNode syntax, ITypeSymbol type) :
SymbolDisplay\AbstractSymbolDisplayVisitor.cs (2)
89protected void AddNonNullConstantValue(ITypeSymbol type, object constantValue, bool preferNumericValueOrExpandedFlagsForEnum = false) 135private static bool IsFlagsEnum(ITypeSymbol typeSymbol)
SymbolDisplay\AbstractSymbolDisplayVisitor_Minimal.cs (5)
51var type1 = GetSymbolType(normalSymbol); 52var type2 = GetSymbolType(typeOnlySymbol); 96protected static ITypeSymbol GetSymbolType(ISymbol symbol) 125return aliasSymbol.Target as ITypeSymbol; 128return symbol as ITypeSymbol;
SymbolDisplay\SymbolDisplayPart.cs (1)
29/// For example, the <see cref="ITypeSymbol"/> associated with a class name.
Symbols\IArrayTypeSymbol.cs (1)
50ITypeSymbol ElementType { get; }
Symbols\IDiscardSymbol.cs (1)
18ITypeSymbol Type { get; }
Symbols\IEventSymbol.cs (1)
22ITypeSymbol Type { get; }
Symbols\IFieldSymbol.cs (1)
77ITypeSymbol Type { get; }
Symbols\ILocalSymbol.cs (1)
19ITypeSymbol Type { get; }
Symbols\IMethodSymbol.cs (7)
94ITypeSymbol ReturnType { get; } 106ImmutableArray<ITypeSymbol> TypeArguments { get; } 164ITypeSymbol? ReceiverType { get; } 185ITypeSymbol? GetTypeInferredDuringReduction(ITypeParameterSymbol reducedFromTypeParameter); 191IMethodSymbol? ReduceExtensionMethod(ITypeSymbol receiverType); 247IMethodSymbol Construct(params ITypeSymbol[] typeArguments); 252IMethodSymbol Construct(ImmutableArray<ITypeSymbol> typeArguments, ImmutableArray<NullableAnnotation> typeArgumentNullableAnnotations);
Symbols\INamedTypeSymbol.cs (3)
80ImmutableArray<ITypeSymbol> TypeArguments { get; } 130INamedTypeSymbol Construct(params ITypeSymbol[] typeArguments); 135INamedTypeSymbol Construct(ImmutableArray<ITypeSymbol> typeArguments, ImmutableArray<NullableAnnotation> typeArgumentNullableAnnotations);
Symbols\IParameterSymbol.cs (1)
53ITypeSymbol Type { get; }
Symbols\IPointerTypeSymbol.cs (1)
23ITypeSymbol PointedAtType { get; }
Symbols\IPropertySymbol.cs (1)
63ITypeSymbol Type { get; }
Symbols\ISymbolExtensions.cs (3)
31var typeArgs = new ITypeSymbol[reducedFrom.TypeParameters.Length]; 36var arg = method.TypeArguments[i]; 52var inferredType = method.GetTypeInferredDuringReduction(reducedFrom.TypeParameters[i]);
Symbols\ITypeParameterSymbol.cs (1)
80ImmutableArray<ITypeSymbol> ConstraintTypes { get; }
Symbols\ITypeSymbol.cs (16)
89new ITypeSymbol OriginalDefinition { get; } 192ITypeSymbol WithNullableAnnotation(NullableAnnotation nullableAnnotation); 199internal static bool IsNullableType([NotNullWhen(returnValue: true)] ITypeSymbol? typeOpt) 204internal static bool IsNullableOfBoolean([NotNullWhen(returnValue: true)] ITypeSymbol? type) 209internal static ITypeSymbol GetNullableUnderlyingType(ITypeSymbol type) 215internal static bool IsBooleanType([NotNullWhen(returnValue: true)] ITypeSymbol? type) 220internal static bool IsObjectType([NotNullWhen(returnValue: true)] ITypeSymbol? type) 225internal static bool IsSignedIntegralType([NotNullWhen(returnValue: true)] ITypeSymbol? type) 230internal static bool IsUnsignedIntegralType([NotNullWhen(returnValue: true)] ITypeSymbol? type) 235internal static bool IsNumericType([NotNullWhen(returnValue: true)] ITypeSymbol? type) 240internal static ITypeSymbol? GetEnumUnderlyingType(ITypeSymbol? type) 246internal static ITypeSymbol? GetEnumUnderlyingTypeOrSelf(ITypeSymbol? type) 251internal static bool IsDynamicType([NotNullWhen(returnValue: true)] ITypeSymbol? type)
Symbols\ITypeSymbolInternal.cs (2)
37/// Returns an <see cref="ITypeSymbol"/> instance associated with this symbol. 40ITypeSymbol GetITypeSymbol();
Symbols\NullableFlowState.cs (1)
31/// ignoring the <see cref="ITypeSymbol"/> to which it is attached. It should only be used when converting
Symbols\TypedConstant.cs (2)
48/// Returns the <see cref="ITypeSymbol"/> of the constant, 51public ITypeSymbol? Type
Symbols\TypedConstantValue.cs (1)
25Debug.Assert(value == null || value is string || value.GetType().GetTypeInfo().IsEnum || (value.GetType().GetTypeInfo().IsPrimitive && !(value is System.IntPtr) && !(value is System.UIntPtr)) || value is ITypeSymbol);
Microsoft.CodeAnalysis.CodeStyle (218)
AbstractForEachCastDiagnosticAnalyzer.cs (5)
41protected abstract (CommonConversion conversion, ITypeSymbol? collectionElementType) GetForEachInfo(SemanticModel semanticModel, TForEachStatementSyntax node); 73variableDeclarator.Symbol.Type is not ITypeSymbol iterationType) 79var collectionType = semanticModel.GetTypeInfo(syntaxFacts.GetExpressionOfForeachStatement(node), cancellationToken).Type; 140private static bool IsStronglyTyped(INamedTypeSymbol ienumerableOfTType, ITypeSymbol collectionType, ITypeSymbol collectionElementType)
AbstractMatchFolderAndNamespaceDiagnosticAnalyzer.cs (1)
180if (symbol is ITypeSymbol typeSymbol && typeSymbol.DeclaringSyntaxReferences.Length > 1)
AbstractPopulateSwitchDiagnosticAnalyzer.cs (1)
96var type = value.Type.RemoveNullableIfPresent();
AbstractSpeculationAnalyzer.cs (25)
266private bool ImplicitConversionsAreCompatible(TExpressionSyntax originalExpression, ITypeSymbol originalTargetType, TExpressionSyntax newExpression, ITypeSymbol newTargetType) 279protected abstract bool ConversionsAreCompatible(TExpressionSyntax originalExpression, ITypeSymbol originalTargetType, TExpressionSyntax newExpression, ITypeSymbol newTargetType); 688var previousOriginalType = this.OriginalSemanticModel.GetTypeInfo(previousOriginalNode).Type; 689var previousReplacedType = this.SpeculativeSemanticModel.GetTypeInfo(previousReplacedNode).Type; 743GetForEachSymbols(this.OriginalSemanticModel, forEachStatement, out var originalGetEnumerator, out var originalElementType); 744GetForEachSymbols(this.SpeculativeSemanticModel, newForEachStatement, out var newGetEnumerator, out var newElementType); 760protected abstract void GetForEachSymbols(SemanticModel model, TForEachStatementSyntax forEach, out IMethodSymbol getEnumeratorMethod, out ITypeSymbol elementType); 780var expressionType = this.SpeculativeSemanticModel.GetTypeInfo(newForEachStatementExpression, _cancellationToken).ConvertedType; 805var originalThrowExpressionType = this.OriginalSemanticModel.GetTypeInfo(originalThrowExpression).Type; 807var newThrowExpressionType = this.SpeculativeSemanticModel.GetTypeInfo(newThrowExpression).Type; 924var originalTargetType = this.OriginalSemanticModel.GetTypeInfo(originalLeft).Type; 927var newTargetType = this.SpeculativeSemanticModel.GetTypeInfo(newLeft).Type; 935protected abstract bool IsReferenceConversion(Compilation model, ITypeSymbol sourceType, ITypeSymbol targetType); 962var newReceiverType = newReceiver != null 1001var receiverType = semanticModel.GetTypeInfo(receiver).Type; 1167ITypeSymbol originalTargetType, 1169ITypeSymbol newTargetType, 1184var originalConvertedTypeSymbol = this.OriginalSemanticModel.GetTypeInfo(originalExpression).ConvertedType; 1190var newConvertedTypeSymbol = this.SpeculativeSemanticModel.GetTypeInfo(newExpression).ConvertedType; 1198protected abstract TConversion ClassifyConversion(SemanticModel model, TExpressionSyntax expression, ITypeSymbol targetType); 1199protected abstract TConversion ClassifyConversion(SemanticModel model, ITypeSymbol originalType, ITypeSymbol targetType);
AbstractUseCoalesceExpressionForIfNullCheckDiagnosticAnalyzer.cs (1)
165var exprType = semanticModel.GetTypeInfo(initializer, cancellationToken).Type;
AbstractUseCoalesceExpressionForTernaryConditionalCheckDiagnosticAnalyzer.cs (1)
104var conditionType = semanticModel.GetTypeInfo(
AbstractUseIsNullForReferenceEqualsDiagnosticAnalyzer.cs (1)
154var parameterType = semanticModel.GetTypeInfo(argumentExpression, cancellationToken).Type;
AbstractUseNullPropagationDiagnosticAnalyzer.cs (3)
147var whenPartType = semanticModel.GetTypeInfo(whenPartMatch, cancellationToken).Type; 151var type = semanticModel.GetTypeInfo(conditionalExpression, cancellationToken).Type; 358var typeSymbol = semanticModel.GetTypeInfo(type, cancellationToken).Type;
AbstractUseNullPropagationDiagnosticAnalyzer_IfStatement.cs (1)
85var whenPartType = semanticModel.GetTypeInfo(whenPartMatch, cancellationToken).Type;
AbstractValidateFormatStringDiagnosticAnalyzer.cs (2)
186var argsArgumentType = TryGetArgsArgumentType(semanticModel, arguments, parameters, syntaxFacts); 190private ITypeSymbol? TryGetArgsArgumentType(
ForEachSymbols.cs (2)
15public readonly ITypeSymbol ElementType; 21ITypeSymbol elementType)
INamedTypeSymbolExtensions.cs (2)
35public static IEnumerable<ITypeSymbol> GetAllTypeArguments(this INamedTypeSymbol? symbol) 620public static INamedTypeSymbol TryConstruct(this INamedTypeSymbol type, ITypeSymbol[] typeArguments)
ISemanticFacts.cs (1)
88bool IsPartial(ITypeSymbol typeSymbol, CancellationToken cancellationToken);
ISemanticFactsExtensions.cs (1)
118private static bool IsFloatingPoint([NotNullWhen(returnValue: true)] ITypeSymbol? type)
ISymbolExtensions.cs (22)
163=> symbol is ITypeSymbol { TypeKind: TypeKind.Error }; 166=> symbol is ITypeSymbol { TypeKind: TypeKind.Module }; 169=> symbol is ITypeSymbol { TypeKind: TypeKind.Interface }; 175=> symbol is ITypeSymbol { IsTupleType: true }; 244=> symbol is ITypeSymbol { TypeKind: TypeKind.Delegate }; 275public static ITypeSymbol? GetMemberType(this ISymbol? symbol) 386public static ImmutableArray<ITypeSymbol> GetTypeArguments(this ISymbol? symbol) 391_ => ImmutableArray.Create<ITypeSymbol>(), 394public static ImmutableArray<ITypeSymbol> GetAllTypeArguments(this ISymbol symbol) 396var results = ArrayBuilder<ITypeSymbol>.GetInstance(); 410=> (symbol as ITypeSymbol)?.IsAttribute() == true; 424public static ITypeSymbol ConvertToType( 429if (symbol is ITypeSymbol type) 501public static Accessibility ComputeResultantAccessibility(this ISymbol? symbol, ITypeSymbol finalDestination) 560public static ITypeSymbol? GetSymbolType(this ISymbol? symbol) 567IAliasSymbol aliasSymbol => aliasSymbol.Target as ITypeSymbol, 568_ => symbol as ITypeSymbol, 579ITypeSymbol? typeSymbol = null; 583typeSymbol = symbol as ITypeSymbol; 612var returnType = getAwaiter.ReturnType; 646var returnType = getEnumerator.ReturnType; 686var returnType = getAsyncEnumerator.ReturnType;
ISymbolExtensions_Accessibility.cs (9)
19ITypeSymbol? throughType = null) 41ITypeSymbol? throughType = null) 53ITypeSymbol? throughType = null) 66ITypeSymbol? throughType, 85ITypeSymbol? throughType, 194foreach (var typeArg in type.TypeArguments) 254ITypeSymbol? throughType, 339ITypeSymbol? throughType, 379var originalThroughType = throughType?.OriginalDefinition;
ITypeSymbolExtensions.cs (75)
22public static bool IsIntegralType([NotNullWhen(returnValue: true)] this ITypeSymbol? type) 25public static bool IsSignedIntegralType([NotNullWhen(returnValue: true)] this ITypeSymbol? type) 28public static bool CanAddNullCheck([NotNullWhen(returnValue: true)] this ITypeSymbol? type) 39public static IList<INamedTypeSymbol> GetAllInterfacesIncludingThis(this ITypeSymbol type) 53public static bool IsAbstractClass([NotNullWhen(returnValue: true)] this ITypeSymbol? symbol) 56public static bool IsSystemVoid([NotNullWhen(returnValue: true)] this ITypeSymbol? symbol) 59public static bool IsNullable([NotNullWhen(returnValue: true)] this ITypeSymbol? symbol) 62public static bool IsNonNullableValueType([NotNullWhen(returnValue: true)] this ITypeSymbol? symbol) 66[NotNullWhen(true)] this ITypeSymbol? symbol, 67[NotNullWhen(true)] out ITypeSymbol? underlyingType) 79public static bool IsModuleType([NotNullWhen(returnValue: true)] this ITypeSymbol? symbol) 82public static bool IsInterfaceType([NotNullWhen(returnValue: true)] this ITypeSymbol? symbol) 85public static bool IsDelegateType([NotNullWhen(returnValue: true)] this ITypeSymbol? symbol) 88public static bool IsFunctionPointerType([NotNullWhen(returnValue: true)] this ITypeSymbol? symbol) 91public static bool IsStructType([NotNullWhen(returnValue: true)] this ITypeSymbol? symbol) 98this ITypeSymbol type, 112public static IEnumerable<ITypeSymbol> GetBaseTypesAndThis(this ITypeSymbol? type) 114var current = type; 122public static IEnumerable<INamedTypeSymbol> GetBaseTypes(this ITypeSymbol type) 132public static IEnumerable<ITypeSymbol> GetContainingTypesAndThis(this ITypeSymbol? type) 134var current = type; 142public static IEnumerable<INamedTypeSymbol> GetContainingTypes(this ITypeSymbol type) 155this ITypeSymbol type, ITypeSymbol baseType, bool includeInterfaces) 168this ITypeSymbol type, ITypeSymbol baseType) 176this ITypeSymbol type, ITypeSymbol baseType) 178var originalBaseType = baseType.OriginalDefinition; 186IEnumerable<ITypeSymbol> baseTypes = (baseType.TypeKind == TypeKind.Interface) ? type.AllInterfaces : type.GetBaseTypes(); 193this ITypeSymbol type, ITypeSymbol baseType) 195var originalBaseType = baseType.OriginalDefinition; 215this ITypeSymbol type, ITypeSymbol interfaceType) 217var originalInterfaceType = interfaceType.OriginalDefinition; 222this ITypeSymbol type, ITypeSymbol interfaceType) 227public static bool IsAttribute(this ITypeSymbol symbol) 245public static bool IsFormattableStringOrIFormattable([NotNullWhen(returnValue: true)] this ITypeSymbol? symbol) 254this ITypeSymbol typeSymbol, bool allowDelegateAndEnumConstraints = false) 282public static bool IsNumericType([NotNullWhen(returnValue: true)] this ITypeSymbol? type) 308public static Accessibility DetermineMinimalAccessibility(this ITypeSymbol typeSymbol) 311public static bool ContainsAnonymousType([NotNullWhen(returnValue: true)] this ITypeSymbol? symbol) 327foreach (var typeArg in type.GetAllTypeArguments()) 336public static string CreateParameterName(this ITypeSymbol type, bool capitalize = false) 357private static string GetParameterName(ITypeSymbol? type) 370public static bool IsSpecialType([NotNullWhen(returnValue: true)] this ITypeSymbol? symbol) 401public static bool CanSupportCollectionInitializer(this ITypeSymbol typeSymbol, ISymbol within) 412public static INamedTypeSymbol? GetDelegateType(this ITypeSymbol? typeSymbol, Compilation compilation) 419var typeArgument = ((INamedTypeSymbol)typeSymbol).TypeArguments[0]; 432public static IEnumerable<T> GetAccessibleMembersInBaseTypes<T>(this ITypeSymbol containingType, ISymbol within) where T : class, ISymbol 443public static ImmutableArray<T> GetAccessibleMembersInThisAndBaseTypes<T>(this ITypeSymbol? containingType, ISymbol within) where T : class, ISymbol 453public static bool? AreMoreSpecificThan(this IList<ITypeSymbol> t1, IList<ITypeSymbol> t2) 488public static IEnumerable<T> SelectAccessibleMembers<T>(this IEnumerable<ITypeSymbol>? types, ISymbol within) where T : class, ISymbol 498private static IEnumerable<T> SelectAccessibleMembers<T>(this IEnumerable<ITypeSymbol>? types, string memberName, ISymbol within) where T : class, ISymbol 508private static bool? IsMoreSpecificThan(this ITypeSymbol t1, ITypeSymbol t2) 587public static bool IsOrDerivesFromExceptionType([NotNullWhen(returnValue: true)] this ITypeSymbol? type, Compilation compilation) 594foreach (var baseType in type.GetBaseTypesAndThis()) 605foreach (var constraint in ((ITypeParameterSymbol)type).ConstraintTypes) 620public static bool IsEnumType([NotNullWhen(true)] this ITypeSymbol? type) 623public static bool IsEnumType([NotNullWhen(true)] this ITypeSymbol? type, [NotNullWhen(true)] out INamedTypeSymbol? enumType) 635public static bool? IsMutableValueType(this ITypeSymbol type) 637if (type.IsNullable(out var underlyingType)) 714public static bool IsDisposable([NotNullWhen(returnValue: true)] this ITypeSymbol? type, [NotNullWhen(returnValue: true)] ITypeSymbol? iDisposableType) 719public static ITypeSymbol WithNullableAnnotationFrom(this ITypeSymbol type, ITypeSymbol symbolForNullableAnnotation) 723public static ITypeSymbol? RemoveNullableIfPresent(this ITypeSymbol? symbol)
ITypeSymbolExtensions.MinimalAccessibilityVisitor.cs (1)
52foreach (var arg in symbol.TypeArguments)
PopulateSwitchExpressionHelpers.cs (2)
20var switchExpressionType = switchExpression?.Type; 26switchExpressionType = switchExpressionType.IsNullable(out var underlyingType) ? underlyingType : switchExpressionType;
PopulateSwitchStatementHelpers.cs (3)
47var switchExpressionType = switchExpression?.Type; 55switchExpressionType = switchExpressionType.IsNullable(out var underlyingType) ? underlyingType : switchExpressionType; 133ITypeSymbol enumType,
SemanticModelExtensions.cs (4)
153public static string GenerateNameFromType(this SemanticModel semanticModel, ITypeSymbol type, ISyntaxFacts syntaxFacts, bool capitalize) 184private static bool ShouldPluralize(this SemanticModel semanticModel, ITypeSymbol type) 199ImmutableArray<ITypeSymbol> typeArguments, 234public static ITypeSymbol GetType(
SuppressMessageAttributeState.TargetSymbolResolver.cs (9)
407var typeSymbol = result.Value.Type; 696private ITypeSymbol ParseArrayType(ITypeSymbol typeSymbol) 764var boundReturnType = BindParameterOrReturnType(methodSymbol, returnType.Value); 801var parameterType = BindParameterOrReturnType(symbol.ContainingSymbol, parameterInfo.Type); 806private ITypeSymbol BindParameterOrReturnType(ISymbol bindingContext, TypeInfo type) 868public readonly ITypeSymbol Type; 876private TypeInfo(ITypeSymbol type, int startIndex) 882public static TypeInfo Create(ITypeSymbol type)
SymbolEquivalenceComparer.cs (1)
180=> symbol.IsKind(SymbolKind.NamedType, out ITypeSymbol? typeSymbol) && typeSymbol.SpecialType == SpecialType.System_Object;
SymbolEquivalenceComparer.EquivalenceVisitor.cs (4)
110private bool NullableAnnotationsEquivalent(ITypeSymbol x, ITypeSymbol y) 479private bool TypeArgumentsAreEquivalent(ImmutableArray<ITypeSymbol> xTypeArguments, ImmutableArray<ITypeSymbol> yTypeArguments, Dictionary<INamedTypeSymbol, INamedTypeSymbol>? equivalentTypesWithDifferingAssemblies)
SymbolEquivalenceComparer.GetHashCodeVisitor.cs (2)
50return Hash.Combine(GetNullableAnnotationsHashCode((ITypeSymbol)x), Hash.Combine(typeof(IDynamicTypeSymbol), currentHash)); 56private int GetNullableAnnotationsHashCode(ITypeSymbol type)
SymbolEquivalenceComparer.SignatureTypeSymbolEquivalenceComparer.cs (6)
11internal class SignatureTypeSymbolEquivalenceComparer : IEqualityComparer<ITypeSymbol?> 18public bool Equals(ITypeSymbol? x, ITypeSymbol? y) 21public bool Equals(ITypeSymbol? x, ITypeSymbol? y, Dictionary<INamedTypeSymbol, INamedTypeSymbol>? equivalentTypesWithDifferingAssemblies) 24public int GetHashCode(ITypeSymbol? x)
SymbolKey.AnonymousTypeSymbolKey.cs (1)
41using var propertyTypes = reader.ReadSymbolKeyArray<INamedTypeSymbol, ITypeSymbol>(
SymbolKey.ArrayTypeSymbolKey.cs (2)
32foreach (var typeSymbol in elementTypeResolution.OfType<ITypeSymbol>())
SymbolKey.BuiltinOperatorSymbolKey.cs (3)
30using var parameterTypes = reader.ReadSymbolKeyArray<IMethodSymbol, ITypeSymbol>( 47var returnTypeSymbol = (ITypeSymbol?)returnType.GetAnySymbol();
SymbolKey.ErrorTypeSymbolKey.cs (2)
45visitor.WriteSymbolKeyArray(ImmutableArray<ITypeSymbol>.Empty); 73using var typeArguments = reader.ReadSymbolKeyArray<INamedTypeSymbol, ITypeSymbol>(
SymbolKey.FunctionPointerTypeSymbolKey.cs (2)
58using var parameterTypes = reader.ReadSymbolKeyArray<IFunctionPointerTypeSymbol, ITypeSymbol>( 78if (returnType.GetAnySymbol() is not ITypeSymbol returnTypeSymbol)
SymbolKey.MethodSymbolKey.cs (6)
45foreach (var receiverType in receiverTypeResolution.OfType<ITypeSymbol>()) 71using var typeArguments = reader.ReadSymbolKeyArray<IMethodSymbol, ITypeSymbol>( 224_ = reader.ReadSymbolKeyArray<IMethodSymbol, ITypeSymbol>( 247var returnType = (ITypeSymbol?)reader.ReadSymbolKey(contextualSymbol: method.ReturnType, out _).GetAnySymbol();
SymbolKey.NamedTypeSymbolKey.cs (7)
34visitor.WriteSymbolKeyArray(ImmutableArray<ITypeSymbol>.Empty); 47using var typeArguments = reader.ReadSymbolKeyArray<INamedTypeSymbol, ITypeSymbol>( 63? Array.Empty<ITypeSymbol>() 88ITypeSymbol[] typeArgumentsArray, 138ITypeSymbol[] typeArgumentsArray, 165ITypeSymbol[] typeArguments) 189private static INamedTypeSymbol Construct(INamedTypeSymbol type, bool isUnboundGenericType, ITypeSymbol[] typeArguments)
SymbolKey.PointerTypeSymbolKey.cs (2)
34foreach (var typeSymbol in pointedAtTypeResolution.OfType<ITypeSymbol>())
SymbolKey.PropertySymbolKey.cs (1)
67_ = reader.ReadSymbolKeyArray<IPropertySymbol, ITypeSymbol>(
SymbolKey.SymbolKeyReader.cs (2)
383Func<TOwningSymbol, int, ITypeSymbol?> getContextualType, 387using var originalParameterTypes = this.ReadSymbolKeyArray<TOwningSymbol, ITypeSymbol>(owningSymbol, getContextualType, out _);
SymbolKey.TupleTypeSymbolKey.cs (1)
98using var elementTypes = reader.ReadSymbolKeyArray<INamedTypeSymbol, ITypeSymbol>(
SymbolSpecification.cs (1)
400SymbolCategory.Type => symbol is ITypeSymbol type && type.TypeKind == (TypeKind)_kind,
UseCollectionInitializerAnalyzer.cs (1)
127var type = _semanticModel.GetTypeInfo(_objectCreationExpression, _cancellationToken).Type;
UseNamedMemberInitializerAnalyzer.cs (2)
135var type = _semanticModel.GetTypeInfo(_objectCreationExpression, _cancellationToken).Type; 186ITypeSymbol classOrStructType,
Microsoft.CodeAnalysis.CodeStyle.Fixes (179)
AbstractAddExplicitCastCodeFixProvider.cs (10)
31protected abstract TExpressionSyntax Cast(TExpressionSyntax expression, ITypeSymbol type); 54out ImmutableArray<(TExpressionSyntax node, ITypeSymbol type)> potentialConversionTypes); 88var conversionType = potentialConversionTypes[i].type; 108ITypeSymbol conversionType, 119var castType = semanticModel.GetTypeInfo(castTypeNode, cancellationToken).Type; 142private static string GetSubItemName(SemanticModel semanticModel, int position, ITypeSymbol conversionType) 149protected static ImmutableArray<(TExpressionSyntax, ITypeSymbol)> FilterValidPotentialConversionTypes( 152ArrayBuilder<(TExpressionSyntax node, ITypeSymbol type)> mutablePotentialConversionTypes) 157using var _ = ArrayBuilder<(TExpressionSyntax, ITypeSymbol)>.GetInstance(out var validPotentialConversionTypes); 161var targetNodeConversionType = conversionTuple.type;
AbstractAddParameterCodeFixProvider.cs (4)
37protected abstract ITypeSymbol GetArgumentType(SyntaxNode argumentNode, SemanticModel semanticModel, CancellationToken cancellationToken); 391private async Task<(ITypeSymbol, RefKind)> GetArgumentTypeAndRefKindAsync(Document invocationDocument, TArgumentSyntax argument, CancellationToken cancellationToken) 395var argumentType = GetArgumentType(argument, semanticModel, cancellationToken); 533Compilation compilation, TypeInfo argumentTypeInfo, ITypeSymbol parameterType,
AbstractAliasAmbiguousTypeCodeFixProvider.cs (7)
26protected abstract string GetTextPreviewOfChange(string aliasName, ITypeSymbol typeSymbol); 54foreach (var symbol in Sort(symbolInfo.CandidateSymbols.Cast<ITypeSymbol>(), placementOption.PlaceSystemNamespaceFirst)) 78private static IEnumerable<ITypeSymbol> Sort(IEnumerable<ITypeSymbol> types, bool sortSystemFirst) 82var typeToNameSegments = new Dictionary<ITypeSymbol, ImmutableArray<string>>(); 108ImmutableArray<string> GetNameSegments(ITypeSymbol symbol)
AbstractCodeGenerationService.cs (2)
113public TDeclarationNode UpdateDeclarationType<TDeclarationNode>(TDeclarationNode declaration, ITypeSymbol newType, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode 140public abstract TDeclarationNode UpdateDeclarationType<TDeclarationNode>(TDeclarationNode declaration, ITypeSymbol newType, TCodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode;
AbstractForEachCastCodeFixProvider.cs (3)
25protected abstract ITypeSymbol GetForEachElementType(SemanticModel semanticModel, TForEachStatementSyntax forEachStatement); 73var elementType = GetForEachElementType(semanticModel, forEachStatement); 88ITypeSymbol iterationVariableType,
AbstractMakeMethodAsynchronousCodeFixProvider.cs (2)
26protected abstract bool IsAsyncReturnType(ITypeSymbol type, KnownTypes knownTypes); 201protected static bool IsTaskLike(ITypeSymbol returnType, KnownTypes knownTypes)
AbstractPopulateSwitchCodeFixProvider.cs (3)
39protected abstract ITypeSymbol GetSwitchType(TSwitchOperation switchStatement); 164var enumType = GetSwitchType(switchOperation); 167if (enumType.IsNullable(out var underlyingType))
AbstractPopulateSwitchExpressionCodeFixProvider.cs (1)
43protected sealed override ITypeSymbol GetSwitchType(ISwitchExpressionOperation switchExpression)
AbstractPopulateSwitchStatementCodeFixProvider.cs (1)
59protected sealed override ITypeSymbol GetSwitchType(ISwitchOperation switchOperation)
AbstractRemoveAsyncModifierCodeFixProvider.cs (7)
108private static bool ShouldOfferFix(ITypeSymbol returnType, KnownTypes knownTypes) 113private static bool IsTaskType(ITypeSymbol returnType, KnownTypes knownTypes) 122ITypeSymbol returnType, 185ITypeSymbol returnType, 214private static SyntaxNode GetReturnTaskCompletedTaskStatement(SyntaxGenerator generator, ITypeSymbol returnType, KnownTypes knownTypes) 231private static SyntaxNode WrapExpressionWithTaskFromResult(SyntaxGenerator generator, SyntaxNode expression, ITypeSymbol returnType, KnownTypes knownTypes) 236var unwrappedReturnType = returnType.GetTypeArguments()[0];
AbstractRemoveUnusedValuesCodeFixProvider.cs (2)
590var type = semanticModel.GetTypeInfo(node, cancellationToken).Type; 675TLocalDeclarationStatementSyntax CreateLocalDeclarationStatement(ITypeSymbol type, string name)
AbstractSemanticFactsService.cs (2)
102protected static IMethodSymbol? FindDisposeMethod(Compilation compilation, ITypeSymbol? type, bool isAsync) 178public bool IsPartial(ITypeSymbol typeSymbol, CancellationToken cancellationToken)
AbstractTypeInferenceService.AbstractTypeInferrer.cs (5)
39protected abstract bool IsUnusableType(ITypeSymbol arg); 86protected static IEnumerable<TypeInferenceInfo> CreateResult(ITypeSymbol type) 91protected static IEnumerable<ITypeSymbol> ExpandParamsParameter(IParameterSymbol parameterSymbol) 93var result = new List<ITypeSymbol>(); 113var elementType = parameters.ElementAtOrDefault(0);
AbstractTypeInferenceService.cs (7)
17private static ImmutableArray<ITypeSymbol> InferTypeBasedOnNameIfEmpty( 18SemanticModel semanticModel, ImmutableArray<ITypeSymbol> result, string nameOpt) 43private static ImmutableArray<ITypeSymbol> InferTypeBasedOnName( 48? ImmutableArray.Create<ITypeSymbol>(semanticModel.Compilation.GetSpecialType(SpecialType.System_Boolean)) 49: ImmutableArray<ITypeSymbol>.Empty; 81public ImmutableArray<ITypeSymbol> InferTypes( 93public ImmutableArray<ITypeSymbol> InferTypes(
AddParameterService.cs (2)
76ITypeSymbol newParameterType, 161ITypeSymbol parameterType,
CodeGenerationAbstractMethodSymbol.cs (7)
46public abstract ITypeSymbol ReturnType { get; } 47public abstract ImmutableArray<ITypeSymbol> TypeArguments { get; } 55public abstract ITypeSymbol GetTypeInferredDuringReduction(ITypeParameterSymbol reducedFromTypeParameter); 56public abstract IMethodSymbol ReduceExtensionMethod(ITypeSymbol receiverType); 66public virtual ITypeSymbol ReceiverType => this.ContainingType; 111public IMethodSymbol Construct(params ITypeSymbol[] typeArguments) 114public IMethodSymbol Construct(ImmutableArray<ITypeSymbol> typeArguments, ImmutableArray<CodeAnalysis.NullableAnnotation> typeArgumentNullableAnnotations)
CodeGenerationAbstractNamedTypeSymbol.cs (3)
58public INamedTypeSymbol Construct(params ITypeSymbol[] typeArguments) 69public INamedTypeSymbol Construct(ImmutableArray<ITypeSymbol> typeArguments, ImmutableArray<NullableAnnotation> typeArgumentNullableAnnotations) 89public abstract ImmutableArray<ITypeSymbol> TypeArguments { get; }
CodeGenerationArrayTypeSymbol.cs (2)
12public CodeGenerationArrayTypeSymbol(ITypeSymbol elementType, int rank, NullableAnnotation nullableAnnotation) 19public ITypeSymbol ElementType { get; }
CodeGenerationConstructedMethodSymbol.cs (6)
14private readonly ImmutableArray<ITypeSymbol> _typeArguments; 18ImmutableArray<ITypeSymbol> typeArguments) 47public override ITypeSymbol ReturnType 56public override ImmutableArray<ITypeSymbol> TypeArguments => _typeArguments; 84public override ITypeSymbol GetTypeInferredDuringReduction(ITypeParameterSymbol reducedFromTypeParameter) 87public override IMethodSymbol ReduceExtensionMethod(ITypeSymbol receiverType)
CodeGenerationConstructedNamedTypeSymbol.cs (3)
16private readonly ImmutableArray<ITypeSymbol> _typeArguments; 20ImmutableArray<ITypeSymbol> typeArguments, 31public override ImmutableArray<ITypeSymbol> TypeArguments => _typeArguments;
CodeGenerationConversionSymbol.cs (1)
24ITypeSymbol toType,
CodeGenerationEventSymbol.cs (2)
17public ITypeSymbol Type { get; } 31ITypeSymbol type,
CodeGenerationFieldSymbol.cs (2)
19public ITypeSymbol Type { get; } 29ITypeSymbol type,
CodeGenerationHelpers.cs (2)
84public static bool IsSpecialType([NotNullWhen(true)] ITypeSymbol? type, SpecialType specialType) 134public static bool TypesMatch(ITypeSymbol? type, object value)
CodeGenerationMethodSymbol.cs (6)
21public override ITypeSymbol ReturnType { get; } 32ITypeSymbol returnType, 100public override ImmutableArray<ITypeSymbol> TypeArguments 101=> this.TypeParameters.As<ITypeSymbol>(); 114public override ITypeSymbol GetTypeInferredDuringReduction(ITypeParameterSymbol reducedFromTypeParameter) 117public override IMethodSymbol ReduceExtensionMethod(ITypeSymbol receiverType)
CodeGenerationNamedTypeSymbol.cs (2)
127public override ImmutableArray<ITypeSymbol> TypeArguments 131return this.TypeParameters.As<ITypeSymbol>();
CodeGenerationOperatorSymbol.cs (1)
25ITypeSymbol returnType,
CodeGenerationParameterSymbol.cs (2)
21public ITypeSymbol Type { get; } 34ITypeSymbol type,
CodeGenerationPointerTypeSymbol.cs (2)
11public ITypeSymbol PointedAtType { get; } 13public CodeGenerationPointerTypeSymbol(ITypeSymbol pointedAtType)
CodeGenerationPropertySymbol.cs (2)
20public ITypeSymbol Type { get; } 35ITypeSymbol type,
CodeGenerationSymbolFactory.cs (19)
35DeclarationModifiers modifiers, ITypeSymbol type, 52ITypeSymbol type, 84ITypeSymbol type, RefKind refKind, ImmutableArray<IPropertySymbol> explicitInterfaceImplementations, string name, 110ITypeSymbol type, string name, 156ITypeSymbol? returnType, 178ITypeSymbol? returnType, 199ITypeSymbol returnType, 224ITypeSymbol toType, 252ITypeSymbol toType, 268public static IParameterSymbol CreateParameterSymbol(ITypeSymbol type, string name) 271public static IParameterSymbol CreateParameterSymbol(RefKind refKind, ITypeSymbol type, string name) 281ImmutableArray<AttributeData> attributes, RefKind refKind, bool isParams, ITypeSymbol type, string name, bool isOptional = false, bool hasDefaultValue = false, object? defaultValue = null) 294ITypeSymbol? type = null, 323name: name, constraintTypes: ImmutableArray.Create<ITypeSymbol>(), 334ImmutableArray<ITypeSymbol> constraintTypes, 349public static IPointerTypeSymbol CreatePointerTypeSymbol(ITypeSymbol pointedAtType) 355public static IArrayTypeSymbol CreateArrayTypeSymbol(ITypeSymbol elementType, int rank = 1, NullableAnnotation nullableAnnotation = NullableAnnotation.None) 465ITypeSymbol returnType, 522ITypeSymbol? returnType = null,
CodeGenerationTypeParameterSymbol.cs (2)
14public ImmutableArray<ITypeSymbol> ConstraintTypes { get; internal set; } 28ImmutableArray<ITypeSymbol> constraintTypes,
CodeGenerationTypeSymbol.cs (6)
56public static ImmutableArray<ITypeSymbol> TupleElementTypes => default; 60public new ITypeSymbol OriginalDefinition => this; 80bool ITypeSymbol.IsRefLikeType => throw new System.NotImplementedException(); 82bool ITypeSymbol.IsUnmanagedType => throw new System.NotImplementedException(); 84bool ITypeSymbol.IsReadOnly => Modifiers.IsReadOnly; 90public ITypeSymbol WithNullableAnnotation(NullableAnnotation nullableAnnotation)
Fixer.cs (7)
24protected abstract TArgumentSyntax GenerateNewArgument(TArgumentSyntax oldArgument, ITypeSymbol conversionType); 38public ImmutableArray<(TExpressionSyntax, ITypeSymbol)> GetPotentialConversionTypes( 60using var __ = ArrayBuilder<(TExpressionSyntax, ITypeSymbol)>.GetInstance(out var mutablePotentialConversionTypes); 65targetArgument, cancellationToken, out var targetArgumentConversionType) 116[NotNullWhen(true)] out ITypeSymbol? targetArgumentConversionType) 153var parameterType = parameters[parameterIndex].Type; 169&& semanticModel.GetTypeInfo(argumentExpression, cancellationToken).Type is ITypeSymbol argumentType
ICodeGenerationService.cs (1)
119TDeclarationNode UpdateDeclarationType<TDeclarationNode>(TDeclarationNode declaration, ITypeSymbol newType, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode;
InheritanceDistanceComparer.cs (8)
34: IComparer<(TExpressionSyntax syntax, ITypeSymbol symbol)> 44public int Compare((TExpressionSyntax syntax, ITypeSymbol symbol) x, 45(TExpressionSyntax syntax, ITypeSymbol symbol) y) 54var baseType = _semanticModel.GetTypeInfo(x.syntax).Type; 64private int GetInheritanceDistanceRecursive(ITypeSymbol baseType, ITypeSymbol? derivedType) 88private int GetInheritanceDistance(ITypeSymbol? baseType, ITypeSymbol castType)
ISemanticFactsService.cs (1)
47CommonConversion ClassifyConversion(SemanticModel semanticModel, SyntaxNode expression, ITypeSymbol destination);
ITypeGenerator.cs (6)
9ITypeSymbol CreateArrayTypeSymbol(ITypeSymbol elementType, int rank); 10ITypeSymbol CreatePointerTypeSymbol(ITypeSymbol pointedAtType); 11ITypeSymbol Construct(INamedTypeSymbol namedType, ITypeSymbol[] typeArguments);
ITypeInferenceService.cs (4)
29ImmutableArray<ITypeSymbol> InferTypes(SemanticModel semanticModel, SyntaxNode expression, string nameOpt, CancellationToken cancellationToken); 30ImmutableArray<ITypeSymbol> InferTypes(SemanticModel semanticModel, int position, string nameOpt, CancellationToken cancellationToken); 36internal readonly record struct TypeInferenceInfo(ITypeSymbol InferredType, bool IsParams) 38public TypeInferenceInfo(ITypeSymbol type) : this(type, IsParams: false)
ITypeInferenceServiceExtensions.cs (7)
15public static ImmutableArray<ITypeSymbol> InferTypes(this ITypeInferenceService service, SemanticModel semanticModel, SyntaxNode expression, CancellationToken cancellationToken) 18public static ImmutableArray<ITypeSymbol> InferTypes(this ITypeInferenceService service, SemanticModel semanticModel, int position, CancellationToken cancellationToken) 47private static INamedTypeSymbol? GetFirstDelegateType(SemanticModel semanticModel, ImmutableArray<ITypeSymbol> types) 53public static ITypeSymbol? InferType( 65public static ITypeSymbol? InferType( 83public static ITypeSymbol? InferType( 95public static ITypeSymbol? InferType(
ITypeSymbolExtensions.CollectTypeParameterSymbolsVisitor.cs (2)
64foreach (var child in symbol.GetAllTypeArguments()) 93foreach (var constraint in symbol.ConstraintTypes)
ITypeSymbolExtensions.cs (2)
12this ITypeSymbol? type, IList<ITypeParameterSymbol>? result = null) 20this ITypeSymbol? type, IList<ITypeParameterSymbol>? result = null)
NullableSyntaxAnnotation.cs (1)
10/// Annotation placed on <see cref="ITypeSymbol"/>s that the <see cref="SyntaxGenerator"/> converts to a node. This
SyntaxContext.cs (1)
54public ImmutableArray<ITypeSymbol> InferredTypes { get; }
SyntaxGeneratorExtensions.cs (2)
62ITypeSymbol type) 72private static ITypeSymbol GetType(Compilation compilation, ISymbol symbol)
SyntaxGeneratorExtensions_Negate.cs (1)
429var type = variableExpression.Type;
SyntaxGeneratorInternal.cs (2)
77/// Produces an appropriate TypeSyntax for the given <see cref="ITypeSymbol"/>. The <paramref name="typeContext"/> 91public abstract SyntaxNode Type(ITypeSymbol typeSymbol, bool typeContext);
TypeGenerator.cs (6)
15public ITypeSymbol CreateArrayTypeSymbol(ITypeSymbol elementType, int rank) 18public ITypeSymbol CreatePointerTypeSymbol(ITypeSymbol pointedAtType) 21public ITypeSymbol Construct(INamedTypeSymbol namedType, ITypeSymbol[] typeArguments)
Microsoft.CodeAnalysis.CSharp (251)
Binder\Semantics\Conversions\Conversion.cs (1)
922public ITypeSymbol? ConstrainedToType
BoundTree\BoundExpression.cs (1)
124public CodeAnalysis.ITypeSymbol? GetPublicTypeSymbol()
Compilation\CSharpCompilation.cs (22)
1605protected override ITypeSymbol? CommonScriptGlobalsType 2113public Conversion ClassifyConversion(ITypeSymbol source, ITypeSymbol destination) 2147public override CommonConversion ClassifyCommonConversion(ITypeSymbol source, ITypeSymbol destination) 2153internal override IConvertibleConversion ClassifyConvertibleConversion(IOperation source, ITypeSymbol? destination, out ConstantValue? constantValue) 2162ITypeSymbol? sourceType = source.Type; 2221ITypeSymbol? throughType) 2237ITypeSymbol? throughType = null) 3715protected override IArrayTypeSymbol CommonCreateArrayTypeSymbol(ITypeSymbol elementType, int rank, CodeAnalysis.NullableAnnotation elementNullableAnnotation) 3720protected override IPointerTypeSymbol CommonCreatePointerTypeSymbol(ITypeSymbol elementType) 3726ITypeSymbol returnType, 3728ImmutableArray<ITypeSymbol> parameterTypes, 3823ImmutableArray<ITypeSymbol> elementTypes, 3831ITypeSymbol typeSymbol = elementTypes[i]; 3878ImmutableArray<ITypeSymbol> memberTypes, 3912ITypeSymbol returnType, 3913ITypeSymbol leftType, 3914ITypeSymbol rightType) 4138ITypeSymbol returnType, 4139ITypeSymbol operandType) 4212protected override ITypeSymbol CommonDynamicType
Compilation\CSharpSemanticModel.cs (5)
575private static SymbolInfo GetSymbolInfoFromSymbolOrNone(ITypeSymbol type) 589private (ITypeSymbol Type, CodeAnalysis.NullableAnnotation Annotation) TypeFromVariable(SingleVariableDesignationSyntax variableDesignation, CancellationToken cancellationToken) 963var (declarationType, annotation) = ((ITypeSymbol, CodeAnalysis.NullableAnnotation))TypeFromVariable((SingleVariableDesignationSyntax)parent.Designation, cancellationToken); 2801public abstract Conversion ClassifyConversion(ExpressionSyntax expression, ITypeSymbol destination, bool isExplicitInSource = false); 2819public Conversion ClassifyConversion(int position, ExpressionSyntax expression, ITypeSymbol destination, bool isExplicitInSource = false)
Compilation\ForEachStatementInfo.cs (2)
47public ITypeSymbol? ElementType { get; } 70ITypeSymbol elementType,
Compilation\MemberSemanticModel.cs (1)
421ITypeSymbol destination,
Compilation\SpeculativeSemanticModelWithMemberModel.cs (1)
218ITypeSymbol destination,
Compilation\SyntaxTreeSemanticModel.cs (1)
516public override Conversion ClassifyConversion(ExpressionSyntax expression, ITypeSymbol destination, bool isExplicitInSource = false)
CSharpExtensions.cs (4)
438public static Conversion ClassifyConversion(this Compilation? compilation, ITypeSymbol source, ITypeSymbol destination) 1283public static Conversion ClassifyConversion(this SemanticModel? semanticModel, ExpressionSyntax expression, ITypeSymbol destination, bool isExplicitInSource = false) 1303public static Conversion ClassifyConversion(this SemanticModel? semanticModel, int position, ExpressionSyntax expression, ITypeSymbol destination, bool isExplicitInSource = false)
Errors\MessageProvider.cs (1)
273protected override void ReportInvalidNamedArgument(DiagnosticBag diagnostics, SyntaxNode attributeSyntax, int namedArgumentIndex, ITypeSymbol attributeClass, string parameterName)
Operations\CSharpOperationFactory.cs (90)
317ITypeSymbol? type = boundNode switch 420ITypeSymbol? type = boundDeconstructValuePlaceholder.GetPublicTypeSymbol(); 432ITypeSymbol? type = boundDeconstructionAssignmentOperator.GetPublicTypeSymbol(); 441ITypeSymbol? type = boundCall.GetPublicTypeSymbol(); 471ITypeSymbol? type = boundFunctionPointerInvocation.GetPublicTypeSymbol(); 554ITypeSymbol? type = boundLocal.GetPublicTypeSymbol(); 574ITypeSymbol? type = boundFieldAccess.GetPublicTypeSymbol(); 615ITypeSymbol? type = boundPropertyAccess.GetPublicTypeSymbol(); 625ITypeSymbol? type = boundIndexerAccess.GetPublicTypeSymbol(); 645ITypeSymbol? type = boundEventAccess.GetPublicTypeSymbol(); 657ITypeSymbol? type = boundEventAssignmentOperator.GetPublicTypeSymbol(); 666ITypeSymbol? type = boundParameter.GetPublicTypeSymbol(); 674ITypeSymbol? type = boundLiteral.GetPublicTypeSymbol(); 683ITypeSymbol? type = boundNode.GetPublicTypeSymbol(); 691ITypeSymbol? type = boundAnonymousObjectCreationExpression.GetPublicTypeSymbol(); 702ITypeSymbol? type = boundObjectCreationExpression.GetPublicTypeSymbol(); 739ITypeSymbol? type = boundWithExpression.GetPublicTypeSymbol(); 751ITypeSymbol? type = boundDynamicObjectCreationExpression.GetPublicTypeSymbol(); 780ITypeSymbol? type = boundDynamicInvocation.GetPublicTypeSymbol(); 822ITypeSymbol? type = boundDynamicIndexerAccess.GetPublicTypeSymbol(); 831ITypeSymbol? type = boundObjectInitializerExpression.GetPublicTypeSymbol(); 840ITypeSymbol? type = boundCollectionInitializerExpression.GetPublicTypeSymbol(); 849ITypeSymbol? type = boundObjectInitializerMember.GetPublicTypeSymbol(); 908ImmutableArray<ITypeSymbol> typeArguments = ImmutableArray<ITypeSymbol>.Empty; 909ITypeSymbol containingType = boundDynamicObjectInitializerMember.ReceiverType.GetPublicSymbol(); 911ITypeSymbol? type = boundDynamicObjectInitializerMember.GetPublicTypeSymbol(); 923ITypeSymbol? type = boundCollectionElementInitializer.GetPublicTypeSymbol(); 948ITypeSymbol? type, 951ITypeSymbol? containingType = null; 958ImmutableArray<ITypeSymbol> typeArguments = ImmutableArray<ITypeSymbol>.Empty; 973ITypeSymbol? type = boundCollectionElementInitializer.GetPublicTypeSymbol(); 1025ITypeSymbol? type = boundConversion.GetPublicTypeSymbol(); 1108ITypeSymbol? type = boundConversion.GetPublicTypeSymbol(); 1140ITypeSymbol? type = boundAsOperator.GetPublicTypeSymbol(); 1149ITypeSymbol? type = boundDelegateCreationExpression.GetPublicTypeSymbol(); 1160ITypeSymbol? bindingType = null; 1168ITypeSymbol? typeOperand = boundIsOperator.TargetType.GetPublicTypeSymbol(); 1171ITypeSymbol? type = boundIsOperator.GetPublicTypeSymbol(); 1179ITypeSymbol? typeOperand = boundSizeOfOperator.SourceType.GetPublicTypeSymbol(); 1182ITypeSymbol? type = boundSizeOfOperator.GetPublicTypeSymbol(); 1190ITypeSymbol? typeOperand = boundTypeOfOperator.SourceType.GetPublicTypeSymbol(); 1193ITypeSymbol? type = boundTypeOfOperator.GetPublicTypeSymbol(); 1203ITypeSymbol? type = boundArrayCreation.GetPublicTypeSymbol(); 1228ITypeSymbol? type = boundDefaultExpression.GetPublicTypeSymbol(); 1238ITypeSymbol? type = boundBaseReference.GetPublicTypeSymbol(); 1247ITypeSymbol? type = boundThisReference.GetPublicTypeSymbol(); 1271ITypeSymbol? type = boundAssignmentOperator.GetPublicTypeSymbol(); 1283ITypeSymbol? type = boundAssignmentOperator.GetPublicTypeSymbol(); 1300ITypeSymbol? type = boundCompoundAssignmentOperator.GetPublicTypeSymbol(); 1327ITypeSymbol? type = boundIncrementOperator.GetPublicTypeSymbol(); 1338ITypeSymbol? type = syntax.IsMissing ? null : boundBadExpression.GetPublicTypeSymbol(); 1350ITypeSymbol? type = boundNewT.GetPublicTypeSymbol(); 1359ITypeSymbol? type = creation.GetPublicTypeSymbol(); 1370ITypeSymbol? type = boundUnaryOperator.GetPublicTypeSymbol(); 1424ITypeSymbol? type = boundBinaryOperator.GetPublicTypeSymbol(); 1456ITypeSymbol? type = boundBinaryOperator.GetPublicTypeSymbol(); 1500ITypeSymbol? type = boundTupleBinaryOperator.GetPublicTypeSymbol(); 1512ITypeSymbol? type = boundConditionalOperator.GetPublicTypeSymbol(); 1523ITypeSymbol? type = boundNullCoalescingOperator.GetPublicTypeSymbol(); 1542ITypeSymbol? type = boundNode.GetPublicTypeSymbol(); 1552ITypeSymbol? type = boundAwaitExpression.GetPublicTypeSymbol(); 1562ITypeSymbol? type = boundArrayAccess.GetPublicTypeSymbol(); 1573ITypeSymbol? type = boundIndexerAccess.GetPublicTypeSymbol(); 1594ITypeSymbol? type = boundNameOfOperator.GetPublicTypeSymbol(); 1604ITypeSymbol? type = boundThrowExpression.GetPublicTypeSymbol(); 1613ITypeSymbol? type = boundAddressOfOperator.GetPublicTypeSymbol(); 1622ITypeSymbol? type = boundImplicitReceiver.GetPublicTypeSymbol(); 1632ITypeSymbol? type = boundConditionalAccess.GetPublicTypeSymbol(); 1641ITypeSymbol? type = boundConditionalReceiver.GetPublicTypeSymbol(); 1731ITypeSymbol? type = null; 1901ITypeSymbol exceptionType = boundCatchBlock.ExceptionTypeOpt.GetPublicSymbol() ?? _semanticModel.Compilation.ObjectType; 1940ITypeSymbol? statementType = null; 2119ITypeSymbol? type = boundTupleExpression.GetPublicTypeSymbol(); 2148ITypeSymbol? type = boundInterpolatedString.GetPublicTypeSymbol(); 2368ITypeSymbol? type = placeholder.GetPublicTypeSymbol(); 2427ITypeSymbol inputType = boundDeclarationPattern.InputType.GetPublicSymbol(); 2428ITypeSymbol narrowedType = boundDeclarationPattern.NarrowedType.GetPublicSymbol(); 2430ITypeSymbol? matchedType = acceptsNull ? null : boundDeclarationPattern.DeclaredType.GetPublicTypeSymbol(); 2438ITypeSymbol matchedType = (boundRecursivePattern.DeclaredType?.Type ?? boundRecursivePattern.InputType.StrippedType()).GetPublicSymbol(); 2631ITypeSymbol? type = boundIsPatternExpression.GetPublicTypeSymbol(); 2646ITypeSymbol? type = boundQueryClause.GetPublicTypeSymbol(); 2707internal IPropertySubpatternOperation CreatePropertySubpattern(BoundPropertySubpattern subpattern, ITypeSymbol matchedType) 2725var inputType = getInputType(member, matchedType); 2732ITypeSymbol previousType = inputType; 2747IPropertySubpatternOperation createPropertySubpattern(Symbol? symbol, IPatternOperation pattern, ITypeSymbol receiverType, SyntaxNode nameSyntax, bool isSingle) 2782static ITypeSymbol getInputType(BoundPropertySubpatternMember member, ITypeSymbol matchedType) 2790ITypeSymbol? type = placeholder.GetPublicTypeSymbol();
Operations\CSharpOperationFactory_Methods.cs (2)
331ITypeSymbol type, 385ITypeSymbol? assignmentType = target.Type;
SymbolDisplay\SymbolDisplay.cs (9)
39ITypeSymbol symbol, 47ITypeSymbol symbol, 79ITypeSymbol symbol, 89ITypeSymbol symbol, 122ITypeSymbol symbol, 133ITypeSymbol symbol, 169ITypeSymbol symbol, 180ITypeSymbol symbol, 192ITypeSymbol symbol,
SymbolDisplay\SymbolDisplayVisitor.cs (2)
259ITypeSymbol type = GetRangeVariableType(symbol); 313Debug.Assert((object)containingType != null || (symbol.ContainingSymbol is ITypeSymbol));
SymbolDisplay\SymbolDisplayVisitor.Members.cs (5)
313if ((object)symbol.ContainingType != null || (symbol.ContainingSymbol is ITypeSymbol)) 385ITypeSymbol containingType; 409containingType = (ITypeSymbol)symbol.ContainingSymbol; 881private static bool CanAddConstant(ITypeSymbol type, object value) 928Debug.Assert(containingType != null || (symbol.ContainingSymbol is ITypeSymbol));
SymbolDisplay\SymbolDisplayVisitor.Types.cs (9)
52ITypeSymbol underlyingType = symbol; 74private void AddNullableAnnotations(ITypeSymbol type) 82private bool ShouldAddNullableAnnotation(ITypeSymbol type) 220var typeArg = symbol.TypeArguments[0]; 776ImmutableArray<ITypeSymbol> typeArguments; 794var typeArg = typeArguments[i]; 837private void AddTypeParameterConstraints(ImmutableArray<ITypeSymbol> typeArguments) 841foreach (var typeArg in typeArguments) 903ITypeSymbol baseType = typeParam.ConstraintTypes[i];
SymbolDisplay\SymbolDisplayVisitor_Constants.cs (1)
14private void AddConstantValue(ITypeSymbol type, object constantValue, bool preferNumericValueOrExpandedFlagsForEnum = false)
SymbolDisplay\SymbolDisplayVisitor_Minimal.cs (2)
219private ITypeSymbol GetRangeVariableType(IRangeVariableSymbol symbol) 221ITypeSymbol type = null;
Symbols\ArrayTypeSymbol.cs (1)
476protected sealed override ITypeSymbol CreateITypeSymbol(CodeAnalysis.NullableAnnotation nullableAnnotation)
Symbols\Compilation_WellKnownMembers.cs (1)
198internal override bool IsAttributeType(ITypeSymbol type)
Symbols\DynamicTypeSymbol.cs (1)
242protected sealed override ITypeSymbol CreateITypeSymbol(CodeAnalysis.NullableAnnotation nullableAnnotation)
Symbols\ErrorTypeSymbol.cs (1)
544protected sealed override ITypeSymbol CreateITypeSymbol(CodeAnalysis.NullableAnnotation nullableAnnotation)
Symbols\FunctionPointers\FunctionPointerTypeSymbol.cs (1)
124protected override ITypeSymbol CreateITypeSymbol(CodeAnalysis.NullableAnnotation nullableAnnotation)
Symbols\FunctionTypeSymbol.cs (1)
146protected override ITypeSymbol CreateITypeSymbol(CodeAnalysis.NullableAnnotation nullableAnnotation) => throw ExceptionUtilities.Unreachable();
Symbols\NamedTypeSymbol.cs (1)
1701protected override ITypeSymbol CreateITypeSymbol(CodeAnalysis.NullableAnnotation nullableAnnotation)
Symbols\NullableAnnotationExtensions.cs (2)
108internal static ITypeSymbol GetPublicSymbol(this TypeWithAnnotations type) 113internal static ImmutableArray<ITypeSymbol> GetPublicSymbols(this ImmutableArray<TypeWithAnnotations> types)
Symbols\PointerTypeSymbol.cs (1)
304protected override ITypeSymbol CreateITypeSymbol(CodeAnalysis.NullableAnnotation nullableAnnotation)
Symbols\PublicModel\ArrayTypeSymbol.cs (3)
15private ITypeSymbol? _lazyElementType; 24protected override ITypeSymbol WithNullableAnnotation(CodeAnalysis.NullableAnnotation nullableAnnotation) 43ITypeSymbol IArrayTypeSymbol.ElementType
Symbols\PublicModel\DiscardSymbol.cs (2)
13private ITypeSymbol? _lazyType; 23ITypeSymbol IDiscardSymbol.Type
Symbols\PublicModel\DynamicTypeSymbol.cs (1)
21protected override ITypeSymbol WithNullableAnnotation(CodeAnalysis.NullableAnnotation nullableAnnotation)
Symbols\PublicModel\ErrorTypeSymbol.cs (1)
22protected override ITypeSymbol WithNullableAnnotation(CodeAnalysis.NullableAnnotation nullableAnnotation)
Symbols\PublicModel\EventSymbol.cs (2)
14private ITypeSymbol? _lazyType; 25ITypeSymbol IEventSymbol.Type
Symbols\PublicModel\FieldSymbol.cs (2)
16private ITypeSymbol _lazyType; 38ITypeSymbol IFieldSymbol.Type
Symbols\PublicModel\FunctionPointerTypeSymbol.cs (1)
40protected override ITypeSymbol WithNullableAnnotation(CodeAnalysis.NullableAnnotation nullableAnnotation)
Symbols\PublicModel\LocalSymbol.cs (2)
15private ITypeSymbol _lazyType; 25ITypeSymbol ILocalSymbol.Type
Symbols\PublicModel\MethodSymbol.cs (10)
19private ITypeSymbol _lazyReturnType; 20private ImmutableArray<ITypeSymbol> _lazyTypeArguments; 21private ITypeSymbol _lazyReceiverType; 78ITypeSymbol IMethodSymbol.ReturnType 99ImmutableArray<ITypeSymbol> IMethodSymbol.TypeArguments 172ITypeSymbol IMethodSymbol.ReceiverType 195ITypeSymbol IMethodSymbol.GetTypeInferredDuringReduction(ITypeParameterSymbol reducedFromTypeParameter) 202IMethodSymbol IMethodSymbol.ReduceExtensionMethod(ITypeSymbol receiverType) 274IMethodSymbol IMethodSymbol.Construct(params ITypeSymbol[] typeArguments) 279IMethodSymbol IMethodSymbol.Construct(ImmutableArray<ITypeSymbol> typeArguments, ImmutableArray<CodeAnalysis.NullableAnnotation> typeArgumentNullableAnnotations)
Symbols\PublicModel\NamedTypeSymbol.cs (4)
15private ImmutableArray<ITypeSymbol> _lazyTypeArguments; 72ImmutableArray<ITypeSymbol> INamedTypeSymbol.TypeArguments 131INamedTypeSymbol INamedTypeSymbol.Construct(params ITypeSymbol[] typeArguments) 136INamedTypeSymbol INamedTypeSymbol.Construct(ImmutableArray<ITypeSymbol> typeArguments, ImmutableArray<CodeAnalysis.NullableAnnotation> typeArgumentNullableAnnotations)
Symbols\PublicModel\NonErrorNamedTypeSymbol.cs (1)
23protected override ITypeSymbol WithNullableAnnotation(CodeAnalysis.NullableAnnotation nullableAnnotation)
Symbols\PublicModel\ParameterSymbol.cs (2)
16private ITypeSymbol _lazyType; 26ITypeSymbol IParameterSymbol.Type
Symbols\PublicModel\PointerTypeSymbol.cs (3)
14private ITypeSymbol? _lazyPointedAtType; 23protected override ITypeSymbol WithNullableAnnotation(CodeAnalysis.NullableAnnotation nullableAnnotation) 34ITypeSymbol IPointerTypeSymbol.PointedAtType
Symbols\PublicModel\PropertySymbol.cs (2)
16private ITypeSymbol _lazyType; 31ITypeSymbol IPropertySymbol.Type
Symbols\PublicModel\Symbol.cs (3)
19protected static ImmutableArray<TypeWithAnnotations> ConstructTypeArguments(ITypeSymbol[] typeArguments) 22foreach (var typeArg in typeArguments) 31protected static ImmutableArray<TypeWithAnnotations> ConstructTypeArguments(ImmutableArray<ITypeSymbol> typeArguments, ImmutableArray<CodeAnalysis.NullableAnnotation> typeArgumentNullableAnnotations)
Symbols\PublicModel\TypeParameterSymbol.cs (2)
23protected override ITypeSymbol WithNullableAnnotation(CodeAnalysis.NullableAnnotation nullableAnnotation) 62ImmutableArray<ITypeSymbol> ITypeParameterSymbol.ConstraintTypes
Symbols\PublicModel\TypeSymbol.cs (26)
21protected abstract ITypeSymbol WithNullableAnnotation(CodeAnalysis.NullableAnnotation nullableAnnotation); 25CodeAnalysis.NullableAnnotation ITypeSymbol.NullableAnnotation => NullableAnnotation; 27ITypeSymbol ITypeSymbol.WithNullableAnnotation(CodeAnalysis.NullableAnnotation nullableAnnotation) 35return (ITypeSymbol)UnderlyingSymbol.ISymbol; 78ITypeSymbol ITypeSymbol.OriginalDefinition 86INamedTypeSymbol ITypeSymbol.BaseType 94ImmutableArray<INamedTypeSymbol> ITypeSymbol.Interfaces 102ImmutableArray<INamedTypeSymbol> ITypeSymbol.AllInterfaces 110ISymbol ITypeSymbol.FindImplementationForInterfaceMember(ISymbol interfaceMember) 117bool ITypeSymbol.IsUnmanagedType => !UnderlyingTypeSymbol.IsManagedTypeNoUseSiteDiagnostics; 119bool ITypeSymbol.IsReferenceType 127bool ITypeSymbol.IsValueType 135TypeKind ITypeSymbol.TypeKind 143bool ITypeSymbol.IsTupleType => UnderlyingTypeSymbol.IsTupleType; 145bool ITypeSymbol.IsNativeIntegerType => UnderlyingTypeSymbol.IsNativeIntegerType; 147string ITypeSymbol.ToDisplayString(CodeAnalysis.NullableFlowState topLevelNullability, SymbolDisplayFormat format) 152ImmutableArray<SymbolDisplayPart> ITypeSymbol.ToDisplayParts(CodeAnalysis.NullableFlowState topLevelNullability, SymbolDisplayFormat format) 157string ITypeSymbol.ToMinimalDisplayString(SemanticModel semanticModel, CodeAnalysis.NullableFlowState topLevelNullability, int position, SymbolDisplayFormat format) 162ImmutableArray<SymbolDisplayPart> ITypeSymbol.ToMinimalDisplayParts(SemanticModel semanticModel, CodeAnalysis.NullableFlowState topLevelNullability, int position, SymbolDisplayFormat format) 167bool ITypeSymbol.IsAnonymousType => UnderlyingTypeSymbol.IsAnonymousType; 169SpecialType ITypeSymbol.SpecialType => UnderlyingTypeSymbol.SpecialType; 171bool ITypeSymbol.IsRefLikeType => UnderlyingTypeSymbol.IsRefLikeType; 173bool ITypeSymbol.IsReadOnly => UnderlyingTypeSymbol.IsReadOnly; 175bool ITypeSymbol.IsRecord => UnderlyingTypeSymbol.IsRecord || UnderlyingTypeSymbol.IsRecordStruct;
Symbols\SymbolExtensions.cs (6)
414internal static TypeSymbol? EnsureCSharpSymbolOrNull(this ITypeSymbol? symbol, string paramName) 587internal static ITypeSymbol? GetPublicSymbol(this TypeSymbol? symbol) 589return symbol.GetPublicSymbol<ITypeSymbol>(); 708internal static ImmutableArray<ITypeSymbol> GetPublicSymbols(this ImmutableArray<TypeSymbol> symbols) 710return GetPublicSymbols<ITypeSymbol>(StaticCast<Symbol>.From(symbols)); 772internal static TypeSymbol? GetSymbol(this ITypeSymbol? symbol)
Symbols\TypeParameterSymbol.cs (1)
700protected sealed override ITypeSymbol CreateITypeSymbol(CodeAnalysis.NullableAnnotation nullableAnnotation)
Symbols\TypeSymbol.cs (8)
663return SymbolDisplay.ToDisplayString((ITypeSymbol)ISymbol, topLevelNullability, format); 668return SymbolDisplay.ToDisplayParts((ITypeSymbol)ISymbol, topLevelNullability, format); 677return SymbolDisplay.ToMinimalDisplayString((ITypeSymbol)ISymbol, topLevelNullability, semanticModel, position, format); 686return SymbolDisplay.ToMinimalDisplayParts((ITypeSymbol)ISymbol, topLevelNullability, semanticModel, position, format); 2439internal ITypeSymbol GetITypeSymbol(CodeAnalysis.NullableAnnotation nullableAnnotation) 2443return (ITypeSymbol)this.ISymbol; 2451protected abstract ITypeSymbol CreateITypeSymbol(CodeAnalysis.NullableAnnotation nullableAnnotation); 2461ITypeSymbol ITypeSymbolInternal.GetITypeSymbol()
Microsoft.CodeAnalysis.CSharp.CodeStyle (96)
CastSimplifier.cs (28)
121var castedType = semanticModel.GetTypeInfo(castExpression.Type, cancellationToken).Type; 156var castedType = semanticModel.GetTypeInfo(castExpression.Type, cancellationToken).Type; 160var parentCastType = semanticModel.GetTypeInfo(parentCast.Type, cancellationToken).Type; 296var originalConvertedType = originalSemanticModel.GetTypeInfo(castNode.WalkUpParentheses(), cancellationToken).ConvertedType; 455var castedExpressionType = originalSemanticModel.GetTypeInfo(castedExpressionNode, cancellationToken).Type; 456var isType = originalSemanticModel.GetTypeInfo(isExpression.Right, cancellationToken).Type; 540var castType = semanticModel.GetTypeInfo(castNode, cancellationToken).Type; 660var originalConvertedType = originalConversionOperation.Type; 661var rewrittenBitwiseNotConversionType = rewrittenBitwiseNotConversionOperation.Type; 674private static bool IsSignedIntegralOrIntPtrType(ITypeSymbol? type) 731var castType = originalSemanticModel.GetTypeInfo(castExpression, cancellationToken).Type; 754private static bool IsNullOrErrorType([NotNullWhen(false)] ITypeSymbol? type) 877var castSideType = semanticModel.GetTypeInfo(castSide, cancellationToken).Type; 878var castedExpressionType = semanticModel.GetTypeInfo(castExpression.Expression, cancellationToken).Type; 880if (castSideType.IsNullable(out var underlyingType) && Equals(underlyingType, castedExpressionType)) 882var otherSideType = semanticModel.GetTypeInfo(otherSide, cancellationToken).Type; 900var castType = semanticModel.GetTypeInfo(castNode, cancellationToken).Type; 901var castedExpressionType = semanticModel.GetTypeInfo(castedExpressionNode, cancellationToken).Type; 958private static bool IsFloatingPointType(ITypeSymbol? type) 1099var rewrittenType = rewrittenSemanticModel.GetTypeInfo(rewrittenExpression, cancellationToken).Type; 1214private static bool IsIntrinsicOrEnum(ITypeSymbol rewrittenType) 1222ITypeSymbol rewrittenType, 1261var originalMemberType = originalMemberSymbol.GetMemberType(); 1262var rewrittenMemberType = rewrittenMemberSymbol.GetMemberType(); 1312private static (ITypeSymbol? rewrittenConvertedType, Conversion rewrittenConversion) GetRewrittenInfo( 1315Conversion originalConversion, ITypeSymbol originalConvertedType, 1326var convertedType = originalConversion.IsIdentity ? originalConvertedType : originalSemanticModel.Compilation.ObjectType; 1330var rewrittenConvertedType = rewrittenSemanticModel.GetTypeInfo(rewrittenExpression, cancellationToken).ConvertedType;
CSharpAsAndNullCheckDiagnosticAnalyzer.cs (2)
85var castType = semanticModel.GetTypeInfo(castExpression.Type).Type; 121var asType = semanticModel.GetTypeInfo(typeNode, cancellationToken).Type;
CSharpForEachCastDiagnosticAnalyzer.cs (1)
26protected override (CommonConversion conversion, ITypeSymbol? collectionElementType) GetForEachInfo(
CSharpIsAndCastCheckDiagnosticAnalyzer.cs (1)
103var isType = semanticModel.GetTypeInfo(castExpression.Type).Type;
CSharpRemoveUnnecessaryLambdaExpressionDiagnosticAnalyzer.cs (3)
194var rewrittenConvertedType = rewrittenSemanticModel.GetTypeInfo(rewrittenExpression, cancellationToken).ConvertedType; 245private static bool IsIdentityOrImplicitConversion(Compilation compilation, ITypeSymbol type1, ITypeSymbol type2)
CSharpSemanticFacts.cs (2)
237public bool IsPartial(ITypeSymbol typeSymbol, CancellationToken cancellationToken) 353var type = semanticModel.GetTypeInfo(node, cancellationToken).Type;
CSharpTypeStyleHelper.State.cs (2)
78var declaredTypeSymbol = semanticModel.GetTypeInfo(variableDeclaration.Type.StripRefIfNeeded(), cancellationToken).Type; 103private static bool IsMadeOfSpecialTypes([NotNullWhen(true)] ITypeSymbol? type)
CSharpUseDeconstructionDiagnosticAnalyzer.cs (1)
165var type = semanticModel.GetTypeInfo(typeNode, cancellationToken).Type;
CSharpUseExplicitTypeHelper.cs (1)
149var declaredType = semanticModel.GetTypeInfo(typeName.StripRefIfNeeded(), cancellationToken).Type;
CSharpUseImplicitObjectCreationDiagnosticAnalyzer.cs (2)
110var leftType = semanticModel.GetTypeInfo(typeNode, cancellationToken).Type; 111var rightType = semanticModel.GetTypeInfo(objectCreation, cancellationToken).Type;
CSharpUseImplicitTypeHelper.cs (4)
195var declarationType = semanticModel.GetTypeInfo(declarationTypeNode, cancellationToken).Type; 205var newDeclarationType = newSemanticModel.GetTypeInfo(newDeclarationTypeNode, cancellationToken).Type; 293var declaredType = semanticModel.GetTypeInfo(typeName.StripRefIfNeeded(), cancellationToken).Type; 332var initializerType = semanticModel.GetTypeInfo(expression, cancellationToken).Type;
CSharpUseIsNullCheckForCastAndEqualityOperatorDiagnosticAnalyzer.cs (1)
79var expressionType = semanticModel.GetTypeInfo(castExpression.Expression).Type;
CSharpUseLocalFunctionDiagnosticAnalyzer.cs (1)
262var convertedType = semanticModel.GetTypeInfo(nodeToCheck, cancellationToken).ConvertedType;
DefaultExpressionSyntaxExtensions.cs (2)
52var entityType = semanticModel.GetTypeInfo(typeSyntax, cancellationToken).Type; 53var defaultType = semanticModel.GetTypeInfo(defaultExpression.Type, cancellationToken).Type;
ExpressionSyntaxExtensions.cs (2)
649var instanceType = instanceSymbol.GetSymbolType(); 655var staticType = speculativeSymbolInfo.GetAnySymbol().GetSymbolType();
Helpers.cs (6)
18public static IPropertySymbol? TryGetLengthOrCountProperty(ITypeSymbol namedType) 26public static IPropertySymbol? TryGetNoArgInt32Property(ITypeSymbol type, string name) 127public static IPropertySymbol? GetIndexer(ITypeSymbol type, ITypeSymbol parameterType, ITypeSymbol returnType) 142public static IMethodSymbol? GetOverload(IMethodSymbol method, ITypeSymbol parameterType)
ITypeSymbolExtensions.cs (1)
9public static bool IsIntrinsicType(this ITypeSymbol typeSymbol)
ParenthesizedExpressionSyntaxExtensions.cs (1)
316var potentialType = semanticModel.GetSpeculativeTypeInfo(expression.SpanStart, expression, SpeculativeBindingOption.BindAsTypeOrNamespace).Type;
SemanticModelExtensions.cs (3)
22public static IEnumerable<ITypeSymbol> LookupTypeRegardlessOfArity( 32return results.OfType<ITypeSymbol>(); 36return SpecializedCollections.EmptyEnumerable<ITypeSymbol>();
SpeculationAnalyzer.cs (18)
254var originalParamType = this.OriginalSemanticModel.GetDeclaredSymbol(originalParam).Type; 255var replacedParamType = this.SpeculativeSemanticModel.GetDeclaredSymbol(replacedParam).Type; 373var originalExpressionType = originalExpressionTypeInfo.Type; 374var newExpressionType = newExpressionTypeInfo.Type; 422var originalCaseType = this.OriginalSemanticModel.GetTypeInfo(previousOriginalNode, this.CancellationToken).Type; 423var newCaseType = this.SpeculativeSemanticModel.GetTypeInfo(previousReplacedNode, this.CancellationToken).Type; 548var originalExpressionType = this.OriginalSemanticModel.GetTypeInfo(originalAnonymousObjectMemberDeclarator.Expression, this.CancellationToken).Type; 549var newExpressionType = this.SpeculativeSemanticModel.GetTypeInfo(replacedAnonymousObjectMemberDeclarator.Expression, this.CancellationToken).Type; 685var originalConvertedType = this.OriginalSemanticModel.GetTypeInfo(originalIsOrAsExpression.Right).Type; 686var newConvertedType = this.SpeculativeSemanticModel.GetTypeInfo(newIsOrAsExpression.Right).Type; 768protected override bool ConversionsAreCompatible(ExpressionSyntax originalExpression, ITypeSymbol originalTargetType, ExpressionSyntax newExpression, ITypeSymbol newTargetType) 812protected override void GetForEachSymbols(SemanticModel model, CommonForEachStatementSyntax forEach, out IMethodSymbol getEnumeratorMethod, out ITypeSymbol elementType) 819protected override bool IsReferenceConversion(Compilation compilation, ITypeSymbol sourceType, ITypeSymbol targetType) 822protected override Conversion ClassifyConversion(SemanticModel model, ExpressionSyntax expression, ITypeSymbol targetType) 825protected override Conversion ClassifyConversion(SemanticModel model, ITypeSymbol originalType, ITypeSymbol targetType)
TypeStyleHelper.cs (13)
18public static bool IsBuiltInType(ITypeSymbol type) 33ITypeSymbol? typeInDeclaration, 53var tupleElementType = tupleType.TupleElements[i].Type; 119ITypeSymbol? typeInDeclaration, 129var containingType = semanticModel.GetTypeInfo(containingTypeName, cancellationToken).Type; 144ITypeSymbol? typeInDeclaration, 145ITypeSymbol containingType) 161var returnType = methodSymbol.ReturnType; 176ITypeSymbol? typeInDeclaration, 177ITypeSymbol containingType) 179var returnType = UnwrapTupleType(methodSymbol.ReturnType); 193private static ITypeSymbol? UnwrapTupleType(ITypeSymbol? symbol)
TypeSyntaxExtensions.cs (1)
38var type = semanticModel.GetTypeInfo(typeSyntax).Type;
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (140)
ArgumentFixer.cs (1)
20protected override ArgumentSyntax GenerateNewArgument(ArgumentSyntax oldArgument, ITypeSymbol conversionType)
AttributeArgumentFixer.cs (1)
20protected override AttributeArgumentSyntax GenerateNewArgument(AttributeArgumentSyntax oldArgument, ITypeSymbol conversionType)
ConvertSwitchStatementToExpressionCodeFixProvider.cs (1)
81ITypeSymbol? declaratorToRemoveType = null;
ConvertSwitchStatementToExpressionCodeFixProvider.Rewriter.cs (5)
39ITypeSymbol? declaratorToRemoveType, 66ITypeSymbol? declaratorToRemoveType, 103private StatementSyntax GenerateVariableDeclaration(ExpressionSyntax switchExpression, ITypeSymbol? declaratorToRemoveType) 262var expressionType = _semanticModel.GetSymbolInfo(node.Expression).Symbol.GetSymbolType(); 263var expressionConvertedType = _semanticModel.GetTypeInfo(node.Expression).ConvertedType;
ConvertToRecordHelpers.cs (1)
989ITypeSymbol? testType = null;
CSharpAddExplicitCastCodeFixProvider.cs (5)
53protected override ExpressionSyntax Cast(ExpressionSyntax expression, ITypeSymbol type) 63out ImmutableArray<(ExpressionSyntax, ITypeSymbol)> potentialConversionTypes) 65potentialConversionTypes = ImmutableArray<(ExpressionSyntax, ITypeSymbol)>.Empty; 66using var _ = ArrayBuilder<(ExpressionSyntax, ITypeSymbol)>.GetInstance(out var mutablePotentialConversionTypes); 71var conversionType = inferenceService.InferType(semanticModel, spanNode, objectAsDefault: false, cancellationToken);
CSharpAddParameterCodeFixProvider.cs (1)
53protected override ITypeSymbol GetArgumentType(SyntaxNode argumentNode, SemanticModel semanticModel, CancellationToken cancellationToken)
CSharpAddYieldCodeFixProvider.cs (10)
57if (!TryGetMethodReturnType(node, model, cancellationToken, out var methodReturnType)) 62if (!TryGetExpressionType(model, returnStatement.Expression, out var returnExpressionType)) 92SemanticModel model, ExpressionSyntax? expression, [NotNullWhen(true)] out ITypeSymbol? returnExpressionType) 107[NotNullWhen(true)] out ITypeSymbol? methodReturnType) 120private bool IsCorrectTypeForYieldReturn(ITypeSymbol typeArgument, ITypeSymbol returnExpressionType, ITypeSymbol methodReturnType, SemanticModel model) 154private bool CanConvertTypes(ITypeSymbol typeArgument, ITypeSymbol returnExpressionType, SemanticModel model) 193private static bool IsCorrectTypeForYieldReturn(ITypeSymbol methodReturnType, SemanticModel model)
CSharpAliasAmbiguousTypeCodeFixProvider.cs (1)
32protected override string GetTextPreviewOfChange(string alias, ITypeSymbol typeSymbol)
CSharpAsAndNullCheckCodeFixProvider.cs (2)
144var localType = local.Type.WithNullableAnnotation(NullableAnnotation.NotAnnotated); 145var asType = asExpressionTypeInfo.Type.WithNullableAnnotation(NullableAnnotation.NotAnnotated);
CSharpChangeToIEnumerableCodeFixProvider.cs (2)
52var type = methodSymbol.ReturnType; 63var typeArg = type.GetTypeArguments().First();
CSharpCodeGenerationService.cs (1)
756public override TDeclarationNode UpdateDeclarationType<TDeclarationNode>(TDeclarationNode declaration, ITypeSymbol newType, CSharpCodeGenerationContextInfo info, CancellationToken cancellationToken)
CSharpConvertTypeOfToNameOfCodeFixProvider.cs (1)
34var typeSymbol = model.GetSymbolInfo(typeOfExpression.Type, cancellationToken).Symbol.GetSymbolType();
CSharpFixReturnTypeCodeFixProvider.cs (5)
81var returnedType = semanticModel.GetTypeInfo(returnedValue, cancellationToken).Type; 96var previousReturnType = semanticModel.GetTypeInfo(declarationTypeToFix, cancellationToken).Type; 159private static ITypeSymbol? InferTupleType(TupleExpressionSyntax tuple, SemanticModel semanticModel, CancellationToken cancellationToken) 168var inferredTupleTypes = new ITypeSymbol[argCount]; 173var type = semanticModel.GetTypeInfo(argumentExpression, cancellationToken).Type;
CSharpForEachCastCodeFixProvider.cs (2)
26protected override ITypeSymbol GetForEachElementType( 30var result = forEachInfo.ElementType;
CSharpInlineDeclarationCodeFixProvider.cs (2)
254ITypeSymbol symbol, CSharpCodeFixOptionsProvider options) 267private static bool IsVarDesired(ITypeSymbol type, CSharpCodeFixOptionsProvider options)
CSharpMakeMethodAsynchronousCodeFixProvider.cs (6)
67protected override bool IsAsyncReturnType(ITypeSymbol type, KnownTypes knownTypes) 129var returnType = methodSymbol.ReturnType; 156static TypeSyntax MakeGenericType(string type, ITypeSymbol typeArgumentFrom) 169private static bool IsIAsyncEnumerableOrEnumerator(ITypeSymbol returnType, KnownTypes knownTypes) 173private static bool IsIEnumerable(ITypeSymbol returnType, KnownTypes knownTypes) 176private static bool IsIEnumerator(ITypeSymbol returnType, KnownTypes knownTypes)
CSharpMakeMethodSynchronousCodeFixProvider.cs (1)
62var returnType = methodSymbol.ReturnType;
CSharpReplaceDefaultLiteralCodeFixProvider.cs (2)
89var type = semanticModel.GetTypeInfo(defaultLiteral, cancellationToken).ConvertedType; 126private static bool IsFlagsEnum(ITypeSymbol type, Compilation compilation)
CSharpSemanticFactsService.cs (2)
117public CommonConversion ClassifyConversion(SemanticModel semanticModel, SyntaxNode expression, ITypeSymbol destination) 141var type = semanticModel.GetTypeInfo(expression, cancellationToken).Type;
CSharpSyntaxGeneratorInternal.cs (1)
134public override SyntaxNode Type(ITypeSymbol typeSymbol, bool typeContext)
CSharpTypeInferenceService.TypeInferrer.cs (37)
35protected override bool IsUnusableType(ITypeSymbol otherSideType) 612private IMethodSymbol Instantiate(IMethodSymbol method, IList<ITypeSymbol> invocationTypes) 636IDictionary<ITypeParameterSymbol, ITypeSymbol> bestMap = null; 637foreach (var type in invocationTypes) 658private Dictionary<ITypeParameterSymbol, ITypeSymbol> DetermineTypeParameterMapping(ITypeSymbol inferredType, ITypeSymbol returnType) 660var result = new Dictionary<ITypeParameterSymbol, ITypeSymbol>(); 665private void DetermineTypeParameterMapping(ITypeSymbol inferredType, ITypeSymbol returnType, Dictionary<ITypeParameterSymbol, ITypeSymbol> result) 1134return leftTypes.Select(x => x.InferredType.IsNullable(out var underlying) 1146static ITypeSymbol MakeNullable(ITypeSymbol symbol, Compilation compilation) 1474var type = this.SemanticModel.GetTypeInfo(recursivePattern).ConvertedType; 1593var elementTypesBuilder = ArrayBuilder<ITypeSymbol>.GetInstance(subPatternCount); 1620private static ImmutableArray<NullableAnnotation> GetNullableAnnotations(ImmutableArray<ITypeSymbol> elementTypes) 1800var typeArg = delegateType?.TypeArguments.Length > 0 1818private ITypeSymbol InferTypeForFirstParameterOfLambda( 1833private ITypeSymbol InferTypeForFirstParameterOfParenthesizedLambda( 1842private ITypeSymbol InferTypeForFirstParameterOfSimpleLambda( 1849private ITypeSymbol InferTypeForFirstParameterOfLambda( 1856private ITypeSymbol InferTypeForFirstParameterOfLambda( 1874var type = InferTypeForFirstParameterOfLambda(parameterName, child.AsNode()); 2033var memberType = memberSymbol.GetMemberType(); 2045private ITypeSymbol UnwrapTaskLike(ITypeSymbol type, bool isAsync) 2088var type = symbol.GetMemberType(); 2235var type = symbol.GetSymbolType(); 2301using var _1 = ArrayBuilder<ITypeSymbol>.GetInstance(out var tupleTypes); 2327var tupleType = GetTupleType(tupleExpression); 2338private ITypeSymbol GetTupleType( 2352out ImmutableArray<ITypeSymbol> elementTypes, 2358using var _1 = ArrayBuilder<ITypeSymbol>.GetInstance(out var elementTypesBuilder); 2396ArrayBuilder<ITypeSymbol> elementTypesBuilder, 2418ArrayBuilder<ITypeSymbol> elementTypesBuilder, 2421var tupleType = GetTupleType(tuple);
CSharpUseCompoundCoalesceAssignmentCodeFixProvider.cs (1)
101var type = semanticModel.GetTypeInfo(coalesce, cancellationToken).Type;
CSharpUsePatternCombinatorsCodeFixProvider.cs (2)
119var type = semanticModel.GetTypeInfo(expr).Type; 133var governingType = semanticModel.GetTypeInfo(p.Target.Syntax).Type.RemoveNullableIfPresent();
ExpressionGenerator.cs (11)
34return typedConstant.Value is ITypeSymbol 35? SyntaxFactory.TypeOfExpression(((ITypeSymbol)typedConstant.Value).GenerateTypeSyntax()) 55ITypeSymbol? type, 64if (type.IsNullable(out var underlyingType)) 76internal static ExpressionSyntax GenerateNonEnumValueExpression(SyntaxGenerator generator, ITypeSymbol? type, object? value, bool canUseFieldReference) 119private static string DetermineSuffix(ITypeSymbol? type, object value) 173private static ExpressionSyntax GenerateDoubleLiteralExpression(ITypeSymbol? type, double value, bool canUseFieldReference) 202private static ExpressionSyntax GenerateSingleLiteralExpression(ITypeSymbol? type, float value, bool canUseFieldReference) 232ITypeSymbol? type, T value, IEnumerable<KeyValuePair<T, string>> constants, 243ITypeSymbol? type, T value, IEnumerable<KeyValuePair<T, string>> constants, 279private static ExpressionSyntax? GenerateFieldReference<T>(ITypeSymbol? type, T value, IEnumerable<KeyValuePair<T, string>> constants)
ExpressionSyntaxExtensions.cs (4)
86ITypeSymbol targetType) 101ITypeSymbol targetType, 118var type = semanticModel.GetSpeculativeTypeInfo( 168out ITypeSymbol? container)
InternalExtensions.cs (2)
16public static ITypeSymbol DetermineParameterType( 24public static ITypeSymbol DetermineParameterType(ExpressionSyntax expression, SemanticModel semanticModel, CancellationToken cancellationToken)
ITypeParameterSymbolExtensions.cs (1)
62foreach (var type in constraintTypes)
ITypeSymbolExtensions.cs (5)
26public static ExpressionSyntax GenerateExpressionSyntax(this ITypeSymbol typeSymbol, bool nameSyntax = false) 38var type = symbol as ITypeSymbol; 94public static bool ContainingTypesOrSelfHasUnsafeKeyword(this ITypeSymbol containingType) 112public static async Task<ISymbol?> FindApplicableAliasAsync(this ITypeSymbol type, int position, SemanticModel semanticModel, CancellationToken cancellationToken)
ITypeSymbolExtensions.TypeSyntaxGeneratorVisitor.cs (2)
62ITypeSymbol underlyingType = symbol; 234var innerType = symbol.TypeArguments.First();
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs\SyntaxTreeExtensions.cs (2)
2509if (semanticModel.GetSymbolInfo(objectCreation.Type, cancellationToken).Symbol is ITypeSymbol type && !type.CanSupportCollectionInitializer(containingSymbol)) 3052return target.IsType && ((ITypeSymbol)target).TypeKind == TypeKind.Enum;
MakeLocalFunctionStaticCodeFixHelper.cs (1)
218var symbolType = capture.GetSymbolType();
NamespaceGenerator.cs (1)
175return symbol is ITypeSymbol type
NullableExtensions.cs (2)
9public static ITypeSymbol? GetConvertedTypeWithAnnotatedNullability(this TypeInfo typeInfo) 12public static ITypeSymbol? GetTypeWithAnnotatedNullability(this TypeInfo typeInfo)
PropertyGenerator.cs (1)
137var returnType = property.Type;
TypeSyntaxExtensions.cs (2)
49: firstSymbol as ITypeSymbol; 57var returnType = method.ReturnType;
UseExplicitTypeCodeFixProvider.cs (10)
96var tupleTypeSymbol = GetConvertedType(semanticModel, typeSyntax.Parent, cancellationToken); 107var typeSymbol = GetConvertedType(semanticModel, typeSyntax, cancellationToken); 136var typeSymbol = GetConvertedType(semanticModel, typeSyntax, cancellationToken); 147private static ITypeSymbol AdjustNullabilityOfTypeSymbol( 148ITypeSymbol typeSymbol, 168private static ExpressionSyntax GenerateTupleDeclaration(ITypeSymbol typeSymbol, ParenthesizedVariableDesignationSyntax parensDesignation) 178var type = elements[i].Type; 210private static SyntaxNode GenerateTypeDeclaration(TypeSyntax typeSyntax, ITypeSymbol newTypeSymbol) 221private static ITypeSymbol GetConvertedType(SemanticModel semanticModel, SyntaxNode typeSyntax, CancellationToken cancellationToken) 223var typeSymbol = semanticModel.GetTypeInfo(typeSyntax, cancellationToken).ConvertedType;
UseExplicitTypeForConstCodeFixProvider.cs (2)
51var type = semanticModel.GetTypeInfo(variableDeclaration.Type, cancellationToken).ConvertedType; 67Document document, TextSpan span, ITypeSymbol type, CancellationToken cancellationToken)
UseExpressionBodyForLambdaCodeActionHelpers.cs (1)
86var returnType = lambdaType.DelegateInvokeMethod.ReturnType;
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (11)
SymbolKey\SymbolKeyMetadataVsSourceTests.cs (8)
73var member01 = (typesym.GetMembers("myEvent").Single() as IEventSymbol).Type; 76var member02 = (typesym.GetMembers("Prop").Single() as IPropertySymbol).Type; 82var member04 = (typesym.GetMembers("M").Single() as IMethodSymbol).Parameters[0].Type; 85var member05 = (typesym.GetMembers(WellKnownMemberNames.Indexer).Single() as IPropertySymbol).Type; 239var mtsym20_1 = mem20_1.ReturnType; 243var mtsym20_2 = mem20_2.Parameters[0].Type; 246var mtsym20_3 = mem20_2.Parameters[1].Type; 259var localType = ((ILocalSymbol)local).Type;
SymbolKey\SymbolKeyTestBase.cs (1)
54internal static void ResolveAndVerifyTypeSymbol(ExpressionSyntax node, ITypeSymbol sourceSymbol, SemanticModel model, CSharpCompilation sourceComp)
SymbolKey\SymbolKeyTests.cs (1)
171var parameterType = callbackParamater.Type;
TypeInferrer\TypeInferrerTests.cs (1)
31ITypeSymbol inferredType;
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (74)
CodeGen\CodeGenAsyncIteratorTests.cs (1)
860Assert.Equal("C.<M>d__0", ((ITypeSymbol)argument.Value).ToTestDisplayString());
CodeGen\CodeGenDeconstructTests.cs (16)
1471var tuple1 = model.GetTypeInfo(xy).Type; 1475var tuple2 = model.GetTypeInfo(ab).Type; 1512var tupleType1 = model.GetTypeInfo(tuple1).Type; 1517var tupleType2 = model.GetTypeInfo(tuple1).Type; 1565var tupleType = model.GetTypeInfo(tuple).Type; 5404var xType = ((IFieldSymbol)xSymbol).Type; 5411var yType = ((IFieldSymbol)ySymbol).Type; 5437var xType = ((IFieldSymbol)xSymbol).Type; 5444var yType = ((IFieldSymbol)ySymbol).Type; 5569var xType = ((IFieldSymbol)xSymbol).Type; 5611var xTypeISymbol = xType.Type.GetPublicSymbol(); 5617var yType = ((IFieldSymbol)ySymbol).Type; 5648var x1Type = ((IFieldSymbol)x1Symbol).Type; 5657var x2Type = ((IFieldSymbol)x2Symbol).Type; 5692var x1Type = ((IFieldSymbol)x1Symbol).Type; 5701var x2Type = ((IFieldSymbol)x2Symbol).Type;
CodeGen\CodeGenReadonlyStructTests.cs (4)
897INamedTypeSymbol iNamedType = comp.CreateAnonymousTypeSymbol(ImmutableArray.Create<ITypeSymbol>(comp.ObjectType.GetPublicSymbol()), ImmutableArray.Create("qq")); 905iNamedType = comp.CreateTupleTypeSymbol(ImmutableArray.Create<ITypeSymbol>(comp.ObjectType.GetPublicSymbol(), comp.ObjectType.GetPublicSymbol())); 1061INamedTypeSymbol iNamedType = comp.CreateAnonymousTypeSymbol(ImmutableArray.Create<ITypeSymbol>(comp.ObjectType.GetPublicSymbol()), ImmutableArray.Create("qq")); 1069iNamedType = comp.CreateTupleTypeSymbol(ImmutableArray.Create<ITypeSymbol>(comp.ObjectType.GetPublicSymbol(), comp.ObjectType.GetPublicSymbol()));
CodeGen\CodeGenTupleEqualityTests.cs (1)
1738static void verifyType(string expectedType, ITypeSymbol type, bool inferDelegate)
CodeGen\CodeGenTupleTest.cs (52)
6205ITypeSymbol intType = comp.GetSpecialType(SpecialType.System_Int32); 6323var vbType = (ITypeSymbol)vbComp.GlobalNamespace.GetMembers("C").Single(); 6336Assert.Throws<ArgumentNullException>(() => comp.CreateTupleTypeSymbol(default(ImmutableArray<ITypeSymbol>), default(ImmutableArray<string>))); 6339Assert.Throws<ArgumentException>(() => comp.CreateTupleTypeSymbol(ImmutableArray<ITypeSymbol>.Empty, default(ImmutableArray<string>))); 6576ITypeSymbol vbType = (ITypeSymbol)vbComp.GlobalNamespace.GetMembers("C").Single(); 6605var tuple3 = comp.CreateTupleTypeSymbol(ImmutableArray.Create<ITypeSymbol>(intType, intType, intType, intType, intType, intType, intType, stringType, stringType), 6922private static bool TypeEquals(ITypeSymbol a, ITypeSymbol b, TypeCompareKind compareKind) => 13983Assert.True(((ITypeSymbol)nameofArgSymbolInfo.Symbol).IsTupleType); 14339var m5Tuple = ((IMethodSymbol)symbolInfo.Symbol).TypeParameters[0].ConstraintTypes.Single(); 14349var m6Tuple = m6Method.ReturnType; 14462var v1Type = ((ILocalSymbol)symbolInfo.Symbol).Type; 14472var v2Type = ((ILocalSymbol)symbolInfo.Symbol).Type; 18867ITypeSymbol intType = comp.GetSpecialType(SpecialType.System_Int32); 18868ITypeSymbol stringType = comp.GetSpecialType(SpecialType.System_String); 18887ITypeSymbol intType = comp.GetSpecialType(SpecialType.System_Int32); 18888ITypeSymbol stringType = comp.GetSpecialType(SpecialType.System_String); 18927ITypeSymbol intType = comp.GetSpecialType(SpecialType.System_Int32); 18928ITypeSymbol stringType = comp.GetSpecialType(SpecialType.System_String); 18929ITypeSymbol objectType = comp.GetSpecialType(SpecialType.System_Object); 18953ITypeSymbol intType = comp.GetSpecialType(SpecialType.System_Int32); 18954ITypeSymbol stringType = comp.GetSpecialType(SpecialType.System_String); 18955ITypeSymbol objectType = comp.GetSpecialType(SpecialType.System_Object); 18978ITypeSymbol intType = comp.GetSpecialType(SpecialType.System_Int32); 18979ITypeSymbol stringType = comp.GetSpecialType(SpecialType.System_String); 18980ITypeSymbol objectType = comp.GetSpecialType(SpecialType.System_Object); 19003ITypeSymbol intType = comp.GetSpecialType(SpecialType.System_Int32); 19004ITypeSymbol stringType = comp.GetSpecialType(SpecialType.System_String); 19005ITypeSymbol objectType = comp.GetSpecialType(SpecialType.System_Object); 19029ITypeSymbol intType = comp.GetSpecialType(SpecialType.System_Int32); 19030ITypeSymbol stringType = comp.GetSpecialType(SpecialType.System_String); 19031ITypeSymbol objectType = comp.GetSpecialType(SpecialType.System_Object); 19071ITypeSymbol intType = comp.GetSpecialType(SpecialType.System_Int32); 19072ITypeSymbol stringType = comp.GetSpecialType(SpecialType.System_String); 19073ITypeSymbol objectType = comp.GetSpecialType(SpecialType.System_Object); 19110ITypeSymbol intType = comp.GetSpecialType(SpecialType.System_Int32); 19111ITypeSymbol stringType = comp.GetSpecialType(SpecialType.System_String); 19112ITypeSymbol objectType = comp.GetSpecialType(SpecialType.System_Object); 19149ITypeSymbol intType = comp.GetSpecialType(SpecialType.System_Int32); 19150ITypeSymbol stringType = comp.GetSpecialType(SpecialType.System_String); 19151ITypeSymbol objectType = comp.GetSpecialType(SpecialType.System_Object); 19188ITypeSymbol intType = comp.GetSpecialType(SpecialType.System_Int32); 19189ITypeSymbol stringType = comp.GetSpecialType(SpecialType.System_String); 19190ITypeSymbol objectType = comp.GetSpecialType(SpecialType.System_Object); 22890var xSymbol = ((ILocalSymbol)model.GetDeclaredSymbol(x)).Type; 24435var collectionSymbol = (model.GetDeclaredSymbol(collection) as ILocalSymbol)?.Type; 24508var collectionSymbol = (model.GetDeclaredSymbol(collection) as ILocalSymbol)?.Type; 24581var collectionSymbol = (model.GetDeclaredSymbol(collection) as ILocalSymbol)?.Type; 24655var collectionSymbol = (model.GetDeclaredSymbol(collection) as ILocalSymbol)?.Type; 25064var xSymbol = ((ILocalSymbol)model.GetDeclaredSymbol(x)).Type;
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (9)
Emit\NumericIntPtrTests.cs (2)
5980var destTypeSymbol = ((MethodSymbol)comp.GetMember("Program.Convert")).ReturnType.GetPublicSymbol(); 10656var returnType = model.GetDeclaredSymbol(method).ReturnType;
Semantics\PatternMatchingTestBase.cs (5)
108var type = local.Type; 131private static void AssertTypeInfo(SemanticModel model, TypeSyntax typeSyntax, ITypeSymbol expectedType) 150var type = ((ILocalSymbol)symbol).Type; 274var type = local.Type; 385var type = symbol.GetTypeOrReturnType();
Semantics\PatternMatchingTests.cs (2)
3482Assert.True(((ITypeSymbol)compilation.GetSemanticModel(tree).GetTypeInfo(x1Ref).Type).IsErrorType()); 3488Assert.True(((ITypeSymbol)compilation.GetSemanticModel(tree).GetTypeInfo(x2Ref).Type).IsErrorType());
Microsoft.CodeAnalysis.CSharp.Features (231)
AddImport\CSharpAddImportFeatureService.cs (3)
240protected override ITypeSymbol GetDeconstructInfo( 246protected override ITypeSymbol GetQueryClauseInfo( 624var leftExpressionType = semanticInfo.Type;
ArgumentFixer.cs (1)
20protected override ArgumentSyntax GenerateNewArgument(ArgumentSyntax oldArgument, ITypeSymbol conversionType)
AttributeArgumentFixer.cs (1)
20protected override AttributeArgumentSyntax GenerateNewArgument(AttributeArgumentSyntax oldArgument, ITypeSymbol conversionType)
ChangeSignature\CSharpChangeSignatureService.cs (1)
156if (typeSymbol != null && typeSymbol.IsKind(SymbolKind.NamedType) && ((ITypeSymbol)typeSymbol).TypeKind == TypeKind.Delegate)
CodeFixes\GenerateMethod\GenerateDeconstructMethodCodeFixProvider.cs (1)
67ITypeSymbol type;
CodeRefactorings\InlineMethod\CSharpInlineMethodRefactoringProvider.cs (2)
62protected override SyntaxNode GenerateTypeSyntax(ITypeSymbol symbol, bool allowVar) 65protected override ExpressionSyntax GenerateLiteralExpression(ITypeSymbol typeSymbol, object? value)
Completion\CompletionProviders\AwaitCompletionProvider.cs (3)
98protected override ITypeSymbol? GetTypeSymbolOfExpression(SemanticModel semanticModel, SyntaxNode potentialAwaitableExpression, CancellationToken cancellationToken) 107return symbol is ITypeSymbol ? null : semanticModel.GetTypeInfo(memberAccessExpression, cancellationToken).Type; 110expression.ShouldNameExpressionBeTreatedAsExpressionInsteadOfType(semanticModel, out _, out var container))
Completion\CompletionProviders\CrefCompletionProvider.cs (3)
217var leftType = semanticModel.GetTypeInfo(parent.Container, cancellationToken).Type; 271var typeSymbol = symbol as ITypeSymbol;
Completion\CompletionProviders\CSharpSuggestionModeCompletionProvider.cs (2)
193private static ITypeSymbol? GetDelegateType(TypeInferenceInfo typeInferenceInfo, Compilation compilation) 195var typeSymbol = typeInferenceInfo.InferredType;
Completion\CompletionProviders\DeclarationName\DeclarationNameInfo.cs (5)
32public readonly ITypeSymbol? Type; 42ITypeSymbol? type = null, 157var type = typeInferenceService.InferType(semanticModel, argument.SpanStart, objectAsDefault: false, cancellationToken: cancellationToken); 199return symbol is ITypeSymbol; 383if (symbolInfo.GetAnySymbol() is ITypeSymbol type)
Completion\CompletionProviders\DeclarationName\DeclarationNameRecommender.cs (7)
78var (type, plural) = UnwrapType(nameInfo.Type, semanticModel.Compilation, wasPlural: false, seenTypes: new HashSet<ITypeSymbol>()); 84private static bool IsValidType([NotNullWhen(true)] ITypeSymbol? type) 104private (ITypeSymbol, bool plural) UnwrapType(ITypeSymbol type, Compilation compilation, bool wasPlural, HashSet<ITypeSymbol> seenTypes) 137var collectionType = namedType.GetMembers() 295var methodParameterType = semanticModel.GetTypeInfo(parameterType, cancellationToken).Type;
Completion\CompletionProviders\DeclarationName\DeclarationNameRecommender.NameGenerator.cs (2)
22internal static ImmutableArray<Words> GetBaseNames(ITypeSymbol type, bool pluralize) 100private static string TryRemoveKnownPrefixes(ITypeSymbol type)
Completion\CompletionProviders\EnumAndCompletionListTagCompletionProvider.cs (8)
108CompletionContext context, SemanticModel semanticModel, SyntaxToken token, ITypeSymbol type, bool isParams, CancellationToken cancellationToken) 116var typeArg = type.GetTypeArguments().FirstOrDefault(); 131var enumType = TryGetEnumTypeInEnumInitializer(semanticModel, token, type, cancellationToken) ?? 220ITypeSymbol symbolType; 269private static ITypeSymbol? TryGetEnumTypeInEnumInitializer( 271ITypeSymbol type, CancellationToken cancellationToken) 316private static INamedTypeSymbol? TryGetCompletionListType(ITypeSymbol type, INamedTypeSymbol? within, Compilation compilation) 342private static INamedTypeSymbol? TryGetTypeWithStaticMembers(ITypeSymbol type)
Completion\CompletionProviders\ExplicitInterfaceMemberCompletionProvider.CompletionSymbolDisplay.cs (1)
119private static void AddType(ITypeSymbol symbol, StringBuilder builder)
Completion\CompletionProviders\ExplicitInterfaceMemberCompletionProvider.cs (2)
74var symbol = semanticModel.GetSymbolInfo(name, cancellationToken).Symbol as ITypeSymbol;
Completion\CompletionProviders\NamedParameterCompletionProvider.cs (1)
191var expressionType = semanticModel.GetTypeInfo(elementAccessExpression.Expression, cancellationToken).Type;
Completion\CompletionProviders\ObjectAndWithInitializerCompletionProvider.cs (4)
86var initializedType = semanticModel.GetTypeInfo(expression, cancellationToken).Type; 108protected override Tuple<ITypeSymbol, Location>? GetInitializedType( 137var type = GetInitializedType(token, document, semanticModel, cancellationToken); 146private static ITypeSymbol? GetInitializedType(SyntaxToken token, Document document, SemanticModel semanticModel, CancellationToken cancellationToken)
Completion\CompletionProviders\ObjectCreationCompletionProvider.cs (3)
71var type = (ITypeSymbol)result.Single().Symbol; 93if (symbol is ITypeSymbol typeSymbol)
Completion\CompletionProviders\OperatorsAndIndexer\UnnamedSymbolCompletionProvider_Conversions.cs (2)
144if (symbols is [INamedTypeSymbol containingType, ITypeSymbol fromType, ITypeSymbol toType])
Completion\CompletionProviders\OverrideCompletionProvider.cs (2)
55public override bool TryDetermineReturnType(SyntaxToken startToken, SemanticModel semanticModel, CancellationToken cancellationToken, out ITypeSymbol? returnType, out SyntaxToken nextToken) 197public override ImmutableArray<ISymbol> FilterOverrides(ImmutableArray<ISymbol> members, ITypeSymbol? returnType)
Completion\CompletionProviders\PropertySubPatternCompletionProvider.cs (7)
60var propertyPatternType = semanticModel.GetTypeInfo((PatternSyntax)propertyPatternClause.Parent!, cancellationToken).ConvertedType; 64var type = GetMemberAccessType(propertyPatternType, memberAccess, document, semanticModel, position); 100static ITypeSymbol? GetMemberAccessType(ITypeSymbol? type, ExpressionSyntax? expression, Document document, SemanticModel semanticModel, int position) 119static ITypeSymbol? GetMemberType(ITypeSymbol? type, string name, Document document, SemanticModel semanticModel, int position) 136static ImmutableArray<ISymbol> GetCandidatePropertiesAndFields(Document document, SemanticModel semanticModel, int position, ITypeSymbol? type)
Completion\CompletionProviders\SymbolCompletionProvider.cs (1)
106=> s is ITypeSymbol ts && ts.IsIntrinsicType();
ConvertForEachToFor\CSharpConvertForEachToForCodeRefactoringProvider.cs (1)
67var typeSymbol = foreachInfo.ExplicitCastInterface ??
ConvertForToForEach\CSharpConvertForToForEachCodeRefactoringProvider.cs (1)
115ITypeSymbol iterationVariableType)
ConvertIfToSwitch\CSharpConvertIfToSwitchCodeRefactoringProvider.Analyzer.cs (1)
39public override bool CanImplicitlyConvert(SemanticModel semanticModel, SyntaxNode syntax, ITypeSymbol targetType)
ConvertLinq\ConvertForEachToLinqQuery\CSharpConvertForEachToLinqQueryProvider.cs (1)
353internal static bool TypeSymbolIsList(ITypeSymbol typeSymbol, SemanticModel semanticModel)
ConvertLinq\ConvertForEachToLinqQuery\ToToListConverter.cs (1)
36ForEachInfo.SemanticModel.GetSymbolInfo(objectCreationExpression.Type, cancellationToken).Symbol is ITypeSymbol typeSymbol &&
ConvertLinq\CSharpConvertLinqQueryToForEachProvider.cs (6)
374private bool IsInt(ITypeSymbol typeSymbol) 377private bool IsList(ITypeSymbol typeSymbol) 383Func<ITypeSymbol, bool> typeCheckMethod, 418Func<ITypeSymbol, bool> typeCheckMethod, 560ITypeSymbol returnedType; 672var forEachStatementTypeSymbolType = _semanticModel.GetTypeInfo(forEachStatement.Type, _cancellationToken).Type;
ConvertSwitchStatementToExpressionCodeFixProvider.cs (1)
81ITypeSymbol? declaratorToRemoveType = null;
ConvertSwitchStatementToExpressionCodeFixProvider.Rewriter.cs (5)
39ITypeSymbol? declaratorToRemoveType, 66ITypeSymbol? declaratorToRemoveType, 103private StatementSyntax GenerateVariableDeclaration(ExpressionSyntax switchExpression, ITypeSymbol? declaratorToRemoveType) 262var expressionType = _semanticModel.GetSymbolInfo(node.Expression).Symbol.GetSymbolType(); 263var expressionConvertedType = _semanticModel.GetTypeInfo(node.Expression).ConvertedType;
ConvertToRecordHelpers.cs (1)
989ITypeSymbol? testType = null;
CSharpAddExplicitCastCodeFixProvider.cs (5)
53protected override ExpressionSyntax Cast(ExpressionSyntax expression, ITypeSymbol type) 63out ImmutableArray<(ExpressionSyntax, ITypeSymbol)> potentialConversionTypes) 65potentialConversionTypes = ImmutableArray<(ExpressionSyntax, ITypeSymbol)>.Empty; 66using var _ = ArrayBuilder<(ExpressionSyntax, ITypeSymbol)>.GetInstance(out var mutablePotentialConversionTypes); 71var conversionType = inferenceService.InferType(semanticModel, spanNode, objectAsDefault: false, cancellationToken);
CSharpAddParameterCodeFixProvider.cs (1)
53protected override ITypeSymbol GetArgumentType(SyntaxNode argumentNode, SemanticModel semanticModel, CancellationToken cancellationToken)
CSharpAddYieldCodeFixProvider.cs (10)
57if (!TryGetMethodReturnType(node, model, cancellationToken, out var methodReturnType)) 62if (!TryGetExpressionType(model, returnStatement.Expression, out var returnExpressionType)) 92SemanticModel model, ExpressionSyntax? expression, [NotNullWhen(true)] out ITypeSymbol? returnExpressionType) 107[NotNullWhen(true)] out ITypeSymbol? methodReturnType) 120private bool IsCorrectTypeForYieldReturn(ITypeSymbol typeArgument, ITypeSymbol returnExpressionType, ITypeSymbol methodReturnType, SemanticModel model) 154private bool CanConvertTypes(ITypeSymbol typeArgument, ITypeSymbol returnExpressionType, SemanticModel model) 193private static bool IsCorrectTypeForYieldReturn(ITypeSymbol methodReturnType, SemanticModel model)
CSharpAliasAmbiguousTypeCodeFixProvider.cs (1)
32protected override string GetTextPreviewOfChange(string alias, ITypeSymbol typeSymbol)
CSharpAsAndNullCheckCodeFixProvider.cs (2)
144var localType = local.Type.WithNullableAnnotation(NullableAnnotation.NotAnnotated); 145var asType = asExpressionTypeInfo.Type.WithNullableAnnotation(NullableAnnotation.NotAnnotated);
CSharpAsAndNullCheckDiagnosticAnalyzer.cs (2)
85var castType = semanticModel.GetTypeInfo(castExpression.Type).Type; 121var asType = semanticModel.GetTypeInfo(typeNode, cancellationToken).Type;
CSharpChangeToIEnumerableCodeFixProvider.cs (2)
52var type = methodSymbol.ReturnType; 63var typeArg = type.GetTypeArguments().First();
CSharpConvertTypeOfToNameOfCodeFixProvider.cs (1)
34var typeSymbol = model.GetSymbolInfo(typeOfExpression.Type, cancellationToken).Symbol.GetSymbolType();
CSharpFixReturnTypeCodeFixProvider.cs (5)
81var returnedType = semanticModel.GetTypeInfo(returnedValue, cancellationToken).Type; 96var previousReturnType = semanticModel.GetTypeInfo(declarationTypeToFix, cancellationToken).Type; 159private static ITypeSymbol? InferTupleType(TupleExpressionSyntax tuple, SemanticModel semanticModel, CancellationToken cancellationToken) 168var inferredTupleTypes = new ITypeSymbol[argCount]; 173var type = semanticModel.GetTypeInfo(argumentExpression, cancellationToken).Type;
CSharpForEachCastCodeFixProvider.cs (2)
26protected override ITypeSymbol GetForEachElementType( 30var result = forEachInfo.ElementType;
CSharpForEachCastDiagnosticAnalyzer.cs (1)
26protected override (CommonConversion conversion, ITypeSymbol? collectionElementType) GetForEachInfo(
CSharpInlineDeclarationCodeFixProvider.cs (2)
254ITypeSymbol symbol, CSharpCodeFixOptionsProvider options) 267private static bool IsVarDesired(ITypeSymbol type, CSharpCodeFixOptionsProvider options)
CSharpIsAndCastCheckDiagnosticAnalyzer.cs (1)
103var isType = semanticModel.GetTypeInfo(castExpression.Type).Type;
CSharpMakeMethodAsynchronousCodeFixProvider.cs (6)
67protected override bool IsAsyncReturnType(ITypeSymbol type, KnownTypes knownTypes) 129var returnType = methodSymbol.ReturnType; 156static TypeSyntax MakeGenericType(string type, ITypeSymbol typeArgumentFrom) 169private static bool IsIAsyncEnumerableOrEnumerator(ITypeSymbol returnType, KnownTypes knownTypes) 173private static bool IsIEnumerable(ITypeSymbol returnType, KnownTypes knownTypes) 176private static bool IsIEnumerator(ITypeSymbol returnType, KnownTypes knownTypes)
CSharpMakeMethodSynchronousCodeFixProvider.cs (1)
62var returnType = methodSymbol.ReturnType;
CSharpRemoveUnnecessaryLambdaExpressionDiagnosticAnalyzer.cs (3)
194var rewrittenConvertedType = rewrittenSemanticModel.GetTypeInfo(rewrittenExpression, cancellationToken).ConvertedType; 245private static bool IsIdentityOrImplicitConversion(Compilation compilation, ITypeSymbol type1, ITypeSymbol type2)
CSharpReplaceDefaultLiteralCodeFixProvider.cs (2)
89var type = semanticModel.GetTypeInfo(defaultLiteral, cancellationToken).ConvertedType; 126private static bool IsFlagsEnum(ITypeSymbol type, Compilation compilation)
CSharpUseCompoundCoalesceAssignmentCodeFixProvider.cs (1)
101var type = semanticModel.GetTypeInfo(coalesce, cancellationToken).Type;
CSharpUseDeconstructionDiagnosticAnalyzer.cs (1)
165var type = semanticModel.GetTypeInfo(typeNode, cancellationToken).Type;
CSharpUseImplicitObjectCreationDiagnosticAnalyzer.cs (2)
110var leftType = semanticModel.GetTypeInfo(typeNode, cancellationToken).Type; 111var rightType = semanticModel.GetTypeInfo(objectCreation, cancellationToken).Type;
CSharpUseIsNullCheckForCastAndEqualityOperatorDiagnosticAnalyzer.cs (1)
79var expressionType = semanticModel.GetTypeInfo(castExpression.Expression).Type;
CSharpUseLocalFunctionDiagnosticAnalyzer.cs (1)
262var convertedType = semanticModel.GetTypeInfo(nodeToCheck, cancellationToken).ConvertedType;
CSharpUsePatternCombinatorsCodeFixProvider.cs (2)
119var type = semanticModel.GetTypeInfo(expr).Type; 133var governingType = semanticModel.GetTypeInfo(p.Target.Syntax).Type.RemoveNullableIfPresent();
Debugging\DataTipInfoGetter.cs (2)
48var type = semanticModel.GetTypeInfo(expression, cancellationToken).Type; 81var type = semanticModel.GetTypeInfo(typeSyntax, cancellationToken).Type;
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (2)
1540private static bool GroupBySignatureComparer(ImmutableArray<IParameterSymbol> oldParameters, ITypeSymbol oldReturnType, ImmutableArray<IParameterSymbol> newParameters, ITypeSymbol newReturnType)
ExtractMethod\CSharpMethodExtractor.Analyzer.cs (3)
39ITypeSymbol type, 93protected override ITypeSymbol GetRangeVariableType(SemanticModel model, IRangeVariableSymbol symbol) 135protected override ITypeSymbol GetSymbolType(SemanticModel semanticModel, ISymbol symbol)
ExtractMethod\CSharpMethodExtractor.cs (2)
171ITypeSymbol type, 194var currentType = semanticModel.GetSpeculativeTypeInfo(contextNode.SpanStart, typeName, SpeculativeBindingOption.BindAsTypeOrNamespace).Type;
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.cs (2)
660var type = variable.GetVariableType(); 828var newType = methodSymbolResult.Data.ReturnType.WithNullableAnnotation(NullableAnnotation.NotAnnotated);
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.ExpressionCodeGenerator.cs (1)
104var returnType = AnalyzerResult.ReturnType;
ExtractMethod\CSharpMethodExtractor.PostProcessor.cs (5)
92var map = new Dictionary<ITypeSymbol, List<LocalDeclarationStatementSyntax>>(); 114Dictionary<ITypeSymbol, List<LocalDeclarationStatementSyntax>> map) 118var type = _semanticModel.GetSpeculativeTypeInfo(_contextPosition, statement.Declaration.Type, SpeculativeBindingOption.BindAsTypeOrNamespace).Type; 125Dictionary<ITypeSymbol, List<LocalDeclarationStatementSyntax>> map) 183var semanticInfo = _semanticModel.GetSpeculativeTypeInfo(_contextPosition, declarationStatement.Declaration.Type, SpeculativeBindingOption.BindAsTypeOrNamespace).Type;
ExtractMethod\CSharpSelectionResult.ExpressionResult.cs (3)
53public override ITypeSymbol? GetContainingScopeType() 79var regularType = GetRegularExpressionType(model, node); 94private static ITypeSymbol? GetRegularExpressionType(SemanticModel semanticModel, ExpressionSyntax node)
ExtractMethod\CSharpSelectionResult.StatementResult.cs (1)
69public override ITypeSymbol GetContainingScopeType()
ExtractMethod\Extensions.cs (1)
263public static bool IsObjectType(this ITypeSymbol? type)
GenerateConstructor\CSharpGenerateConstructorService.cs (3)
179protected override ITypeSymbol GetArgumentType(SemanticModel semanticModel, Argument argument, CancellationToken cancellationToken) 182protected override bool IsConversionImplicit(Compilation compilation, ITypeSymbol sourceType, ITypeSymbol targetType)
GenerateMember\GenerateParameterizedMember\CSharpGenerateDeconstructMethodService.cs (1)
64var targetType = semanticModel.GetTypeInfo(target, cancellationToken: cancellationToken).Type;
GenerateMember\GenerateParameterizedMember\CSharpGenerateMethodService.cs (1)
154protected override ITypeSymbol DetermineReturnTypeForSimpleNameOrMemberAccessExpression(
GenerateMember\GenerateParameterizedMember\CSharpGenerateParameterizedMemberService.cs (9)
47protected override ITypeSymbol DetermineReturnTypeWorker(CancellationToken cancellationToken) 52var inferredType = typeInference.InferType( 64var type = argument.DetermineParameterType(semanticModel, cancellationToken); 136protected override ImmutableArray<ITypeSymbol> DetermineParameterTypes(CancellationToken cancellationToken) 139private ITypeSymbol DetermineParameterType(ArgumentSyntax argument, CancellationToken cancellationToken) 148protected override bool IsImplicitReferenceConversion(Compilation compilation, ITypeSymbol sourceType, ITypeSymbol targetType) 154protected override ImmutableArray<ITypeSymbol> DetermineTypeArguments(CancellationToken cancellationToken) 156using var _ = ArrayBuilder<ITypeSymbol>.GetInstance(out var result);
GenerateMember\GenerateVariable\CSharpGenerateVariableService.cs (1)
196protected override bool TryConvertToLocalDeclaration(ITypeSymbol type, SyntaxToken identifierToken, SemanticModel semanticModel, CancellationToken cancellationToken, out SyntaxNode newRoot)
GenerateType\CSharpGenerateTypeService.cs (7)
459var expressionType = semanticModel.GetTypeInfo(expression, cancellationToken).Type; 561protected override ITypeSymbol DetermineArgumentType(SemanticModel semanticModel, ArgumentSyntax argument, CancellationToken cancellationToken) 564protected override bool IsConversionImplicit(Compilation compilation, ITypeSymbol sourceType, ITypeSymbol targetType) 811private static ITypeSymbol GetPropertyType( 833SimpleNameSyntax propertyName, ITypeSymbol propertyType) 861var propertyType = GetPropertyType(propertyName, semanticModel, typeInference, cancellationToken);
InitializeParameter\CSharpAddParameterCheckCodeRefactoringProvider.cs (2)
43protected override bool IsImplicitConversion(Compilation compilation, ITypeSymbol source, ITypeSymbol destination)
InitializeParameter\CSharpInitializeMemberFromParameterCodeRefactoringProvider.cs (2)
44protected override bool IsImplicitConversion(Compilation compilation, ITypeSymbol source, ITypeSymbol destination)
InitializeParameter\InitializeParameterHelpers.cs (2)
44public static bool IsImplicitConversion(Compilation compilation, ITypeSymbol source, ITypeSymbol destination)
InlineHints\CSharpInlineTypeHintsService.cs (7)
42var type = semanticModel.GetTypeInfo(variableDeclaration.Type, cancellationToken).Type; 52var type = semanticModel.GetTypeInfo(declarationExpression.Type, cancellationToken).Type; 59var type = local?.Type; 70var type = info.ElementType; 96var type = semanticModel.GetTypeInfo(implicitNew, cancellationToken).Type; 109ITypeSymbol type, 139private static bool IsValidType([NotNullWhen(true)] ITypeSymbol? type)
IntroduceVariable\CSharpIntroduceVariableService_IntroduceLocal.cs (2)
142var delegateReturnType = delegateType.DelegateInvokeMethod.ReturnType; 211var typeSymbol = GetTypeSymbol(document, expression, cancellationToken);
J\s\src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\Helpers.cs\Helpers.cs (6)
18public static IPropertySymbol? TryGetLengthOrCountProperty(ITypeSymbol namedType) 26public static IPropertySymbol? TryGetNoArgInt32Property(ITypeSymbol type, string name) 127public static IPropertySymbol? GetIndexer(ITypeSymbol type, ITypeSymbol parameterType, ITypeSymbol returnType) 142public static IMethodSymbol? GetOverload(IMethodSymbol method, ITypeSymbol parameterType)
MakeLocalFunctionStaticCodeFixHelper.cs (1)
218var symbolType = capture.GetSymbolType();
SignatureHelp\AbstractCSharpSignatureHelpProvider.LightweightOverloadResolution.cs (2)
162var type = parameter.Type; 188bool HasImplicitConversion(SyntaxNode expression, ITypeSymbol destination)
SignatureHelp\AttributeSignatureHelpProvider.cs (1)
176var type = namedParameter is IFieldSymbol ? ((IFieldSymbol)namedParameter).Type : ((IPropertySymbol)namedParameter).Type;
SignatureHelp\ElementAccessExpressionSignatureHelpProvider.cs (3)
82if (!TryGetIndexers(position, semanticModel, expression, cancellationToken, out var indexers, out var expressionType) && 182out ImmutableArray<IPropertySymbol> indexers, out ITypeSymbol? expressionType) 200out ImmutableArray<IPropertySymbol> indexers, out ITypeSymbol? expressionType)
SignatureHelp\GenericNameSignatureHelpProvider.cs (1)
263foreach (var baseType in typeParam.ConstraintTypes)
SignatureHelp\GenericNameSignatureHelpProvider_Method.cs (3)
48var containingType = GetContainingType(method); 61private static ITypeSymbol? GetContainingType(IMethodSymbol method) 63var result = method.ReceiverType;
SignatureHelp\InvocationExpressionSignatureHelpProvider.cs (2)
85var invokedType = semanticModel.GetTypeInfo(invocationExpression.Expression, cancellationToken).Type; 138var invokedType = semanticModel.GetTypeInfo(invocationExpression.Expression, cancellationToken).Type;
SignatureHelp\InvocationExpressionSignatureHelpProviderBase_MethodGroup.cs (1)
42ITypeSymbol? throughType = null;
Snippets\CSharpSnippetFunctionService.cs (2)
34protected override async Task<ITypeSymbol?> GetEnumSymbolAsync(Document document, TextSpan switchExpressionSpan, CancellationToken cancellationToken) 46var typeSymbol = model.GetTypeInfo(expressionNode, cancellationToken).Type;
UseExplicitTypeCodeFixProvider.cs (10)
96var tupleTypeSymbol = GetConvertedType(semanticModel, typeSyntax.Parent, cancellationToken); 107var typeSymbol = GetConvertedType(semanticModel, typeSyntax, cancellationToken); 136var typeSymbol = GetConvertedType(semanticModel, typeSyntax, cancellationToken); 147private static ITypeSymbol AdjustNullabilityOfTypeSymbol( 148ITypeSymbol typeSymbol, 168private static ExpressionSyntax GenerateTupleDeclaration(ITypeSymbol typeSymbol, ParenthesizedVariableDesignationSyntax parensDesignation) 178var type = elements[i].Type; 210private static SyntaxNode GenerateTypeDeclaration(TypeSyntax typeSyntax, ITypeSymbol newTypeSymbol) 221private static ITypeSymbol GetConvertedType(SemanticModel semanticModel, SyntaxNode typeSyntax, CancellationToken cancellationToken) 223var typeSymbol = semanticModel.GetTypeInfo(typeSyntax, cancellationToken).ConvertedType;
UseExplicitTypeForConstCodeFixProvider.cs (2)
51var type = semanticModel.GetTypeInfo(variableDeclaration.Type, cancellationToken).ConvertedType; 67Document document, TextSpan span, ITypeSymbol type, CancellationToken cancellationToken)
UseExpressionBodyForLambdaCodeActionHelpers.cs (1)
86var returnType = lambdaType.DelegateInvokeMethod.ReturnType;
UseNamedArguments\CSharpUseNamedArgumentsCodeRefactoringProvider.cs (1)
43var argType = semanticModel.GetTypeInfo(GetArgumentExpression(argument)).Type;
UsePatternMatching\CSharpIsAndCastCheckWithoutNameDiagnosticAnalyzer.cs (1)
125var typeSymbol = semanticModel.GetTypeInfo(type, cancellationToken).Type;
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (75)
Semantics\AccessCheckTests.cs (13)
751ITypeSymbol karrayType = (classA.GetMembers("karray").Single() as IFieldSymbol).Type; 752ITypeSymbol aarrayType = (classA.GetMembers("aarray").Single() as IFieldSymbol).Type; 753ITypeSymbol kptrType = (classA.GetMembers("kptr").Single() as IFieldSymbol).Type; 754ITypeSymbol aptrType = (classA.GetMembers("aptr").Single() as IFieldSymbol).Type; 755ITypeSymbol kinreturnfuncptrType = (classA.GetMembers("kinreturnfuncptr").Single() as IFieldSymbol).Type; 756ITypeSymbol kinparamfuncptr1Type = (classA.GetMembers("kinparamfuncptr1").Single() as IFieldSymbol).Type; 757ITypeSymbol kinparamfuncptr2Type = (classA.GetMembers("kinparamfuncptr2").Single() as IFieldSymbol).Type; 758ITypeSymbol afuncptrType = (classA.GetMembers("afuncptr").Single() as IFieldSymbol).Type; 759ITypeSymbol kenumType = (classA.GetMembers("kenum").Single() as IFieldSymbol).Type; 760ITypeSymbol aenumType = (classA.GetMembers("aenum").Single() as IFieldSymbol).Type; 764ITypeSymbol unknownType = (classA.GetMembers("unknowntype").Single() as IFieldSymbol).Type; 1518var ptr1 = comp.GetMember<FieldSymbol>("A.ptr1").Type.GetPublicSymbol(); 1519var ptr2 = comp.GetMember<FieldSymbol>("A.ptr2").Type.GetPublicSymbol();
Semantics\DelegateTypeTests.cs (4)
9382var type = model!.GetTypeInfo(expr).Type; 11448static ITypeSymbol getFunctionType(NamedTypeSymbol delegateType) 11453static void verifyConversions(SemanticModel model, ExpressionSyntax expr, ITypeSymbol destination, ConversionKind expectedImplicitKind, ConversionKind expectedExplicitKind) 11477protected override ITypeSymbol WithNullableAnnotation(CodeAnalysis.NullableAnnotation nullableAnnotation) => this;
Semantics\ForEachTests.cs (1)
2888var localSymbolType = localSymbol.Type;
Semantics\InteractiveUsingTests.cs (1)
590private static ITypeSymbol GetSpeculativeType(Compilation comp, string name)
Semantics\LambdaTests.cs (2)
1036Assert.NotNull(((ITypeSymbol)typeInfo.Type).GetMember("String")); 1090Assert.NotNull(((ITypeSymbol)typeInfo.Type).GetMember("SomeProperty"));
Semantics\LocalFunctionTests.cs (2)
457var argType0 = model.GetTypeInfo(attrArg0).Type; 463var argType1 = model.GetTypeInfo(attrArg1).Type;
Semantics\MethodTypeInferenceTests.cs (4)
1119var bookType = model.GetTypeInfo(book).Type; 1160var authorType = model.GetTypeInfo(author).Type; 1201var bookResultType = model.GetTypeInfo(bookResult).Type; 1205var authorResultType = model.GetTypeInfo(authorResult).Type;
Semantics\MultiDimensionalArrayTests.cs (2)
1691Assert.True(((ITypeSymbol)p.GetMember<MethodSymbol>("Test3").GetAttributes().Single().ConstructorArguments.Single().Value).IsErrorType()); 1692Assert.True(((ITypeSymbol)p.GetMember<MethodSymbol>("Test4").GetAttributes().Single().ConstructorArguments.Single().Value).IsErrorType());
Semantics\NativeIntegerTests.cs (7)
290var underlyingTypeArgument = underlyingInterface.TypeArguments[i]; 291var nativeIntegerTypeArgument = nativeIntegerInterface.TypeArguments[i]; 4077var type = model.GetSpeculativeTypeInfo(spanStart, typeSyntax, SpeculativeBindingOption.BindAsTypeOrNamespace).Type; 4122var type = model.GetTypeInfo(node).Type; 9474var destTypeSymbol = ((MethodSymbol)comp.GetMember("Program.Convert")).ReturnType.GetPublicSymbol(); 15420var symbol = (ITypeSymbol)model.GetSymbolInfo(cref).Symbol;
Semantics\NullCoalesceAssignmentTests.cs (1)
161var coalesceType = semanticModel.GetTypeInfo(coalesceAssignment).Type;
Semantics\OperatorTests.cs (9)
2987var type1 = model.GetTypeInfo(negOne).Type; 2993var type2 = model.GetTypeInfo(boolPlusPlus).Type; 2999var type3 = model.GetTypeInfo(errorPlusPlus).Type; 8642Assert.True(((ITypeSymbol)symbol1.ContainingSymbol).IsDynamic()); 8653Assert.True(((ITypeSymbol)symbol2.ContainingSymbol).IsDynamic()); 8692Assert.True(((ITypeSymbol)symbol1.ContainingSymbol).IsDynamic()); 8703Assert.True(((ITypeSymbol)symbol2.ContainingSymbol).IsDynamic()); 11339var type = (ITypeSymbol)compilation.GetSemanticModel(tree).GetTypeInfo(negNode).Type;
Semantics\OutVarTests.cs (5)
1007ITypeSymbol expectedType = null 1041ITypeSymbol expected = expectedSymbol?.GetTypeOrReturnType(); 1071private static void AssertTypeFromOperation(SemanticModel model, ITypeSymbol expectedType, DeclarationExpressionSyntax decl) 21407Assert.True(((ITypeSymbol)model.GetTypeInfo(zRef).Type).IsErrorType()); 22662Assert.True(((ITypeSymbol)model.GetTypeInfo(reference).Type).IsErrorType());
Semantics\RecordStructTests.cs (4)
535var type = model.GetTypeInfo(creation).Type!; 555var type = model.GetDeclaredSymbol(method)!.ReturnType; 575var type = model.GetDeclaredSymbol(method)!.ReturnType; 597var type = model.GetDeclaredSymbol(method)!.GetParameterType(0);
Semantics\RefEscapingTests.cs (1)
67ITypeSymbol getLocalType(string name)
Semantics\SemanticErrorTests.cs (2)
3345var typeArgSymbol = constructedMethodSymbol.TypeArguments.Single(); 3349var paramTypeSymbol = constructedMethodSymbol.Parameters.Single().Type;
Semantics\TargetTypedConditionalOperatorTests.cs (1)
346var actualType = model.GetTypeInfo(conditionalExpr).Type;
Semantics\UnsafeTests.cs (16)
3489ITypeSymbol getLocalType(string name) 3548ITypeSymbol getLocalType(string name) 4428var type = typeInfo.Type; 4495var type = typeInfo.Type; 4533var type = typeInfo.Type; 4575var type = typeInfo.Type; 4706var type = typeInfo.Type; 5548var type = typeInfo.Type; 5552var convertedType = typeInfo.ConvertedType; 7347ITypeSymbol type = symbol.Type; 7786var type = typeSummary.Symbol as ITypeSymbol; 7848var type = typeSummary.Symbol as ITypeSymbol; 7908var type = typeSummary.Symbol as ITypeSymbol;
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (211)
Compilation\CompilationAPITests.cs (28)
2511ImmutableArray.Create((ITypeSymbol)null), 2521ImmutableArray.Create((ITypeSymbol)compilation.GetSpecialType(SpecialType.System_Int32), 2522(ITypeSymbol)compilation.GetSpecialType(SpecialType.System_Int32)), 2533ImmutableArray.Create((ITypeSymbol)compilation.GetSpecialType(SpecialType.System_Int32), 2534(ITypeSymbol)compilation.GetSpecialType(SpecialType.System_Int32)), 2545ImmutableArray.Create((ITypeSymbol)compilation.GetSpecialType(SpecialType.System_Int32), 2546(ITypeSymbol)compilation.GetSpecialType(SpecialType.System_Int32)), 2557ImmutableArray.Create((ITypeSymbol)compilation.GetSpecialType(SpecialType.System_Int32), 2558(ITypeSymbol)compilation.GetSpecialType(SpecialType.System_Int32)), 2569default(ImmutableArray<ITypeSymbol>), 2579ImmutableArray.Create((ITypeSymbol)null), 2589ImmutableArray.Create((ITypeSymbol)null), 2599ImmutableArray.Create((ITypeSymbol)compilation.GetSpecialType(SpecialType.System_Int32)), 2608ImmutableArray.Create<ITypeSymbol>(compilation.GetSpecialType(SpecialType.System_Int32)), 2627ImmutableArray.Create<ITypeSymbol>(compilation.GetSpecialType(SpecialType.System_Int32), 2644ImmutableArray.Create<ITypeSymbol>(compilation.GetSpecialType(SpecialType.System_Int32), compilation.GetSpecialType(SpecialType.System_Boolean)), 2659var memberTypes = ImmutableArray.Create<ITypeSymbol>(comp.GetSpecialType(SpecialType.System_Object), comp.GetSpecialType(SpecialType.System_String)); 2689var type = comp.CreateAnonymousTypeSymbol(ImmutableArray<ITypeSymbol>.Empty, ImmutableArray<string>.Empty, memberNullableAnnotations: ImmutableArray<CodeAnalysis.NullableAnnotation>.Empty); 2699var memberTypes = ImmutableArray.Create<ITypeSymbol>(comp.GetSpecialType(SpecialType.System_Object), comp.GetSpecialType(SpecialType.System_String)); 2713private static ImmutableArray<CodeAnalysis.NullableAnnotation> GetAnonymousTypeNullableAnnotations(ITypeSymbol type) 3033var typeArguments = ImmutableArray.Create<ITypeSymbol>(comp.GetSpecialType(SpecialType.System_Object), comp.GetSpecialType(SpecialType.System_String)); 3035Assert.Throws<ArgumentException>(() => genericType.Construct(default(ImmutableArray<ITypeSymbol>), default(ImmutableArray<CodeAnalysis.NullableAnnotation>))); 3044Assert.Throws<ArgumentException>(() => genericType.Construct(ImmutableArray.Create<ITypeSymbol>(null, null), default)); 3053typeArguments = ImmutableArray.Create<ITypeSymbol>(comp.GetSpecialType(SpecialType.System_Object), comp.GetSpecialType(SpecialType.System_String)); 3068var typeArguments = ImmutableArray.Create<ITypeSymbol>(comp.GetSpecialType(SpecialType.System_Object), comp.GetSpecialType(SpecialType.System_String)); 3070Assert.Throws<ArgumentException>(() => genericMethod.Construct(default(ImmutableArray<ITypeSymbol>), default(ImmutableArray<CodeAnalysis.NullableAnnotation>))); 3079Assert.Throws<ArgumentException>(() => genericMethod.Construct(ImmutableArray.Create<ITypeSymbol>(null, null), default)); 3088typeArguments = ImmutableArray.Create<ITypeSymbol>(comp.GetSpecialType(SpecialType.System_Object), comp.GetSpecialType(SpecialType.System_String));
Compilation\ForEachStatementInfoTests.cs (4)
37var e1 = (ITypeSymbol)c.GlobalNamespace.GetMembers("E1").Single(); 44var e2 = (ITypeSymbol)c.GlobalNamespace.GetMembers("E2").Single();
Compilation\GetSemanticInfoTests.cs (16)
869private void ConversionTestHelper(SemanticModel semanticModel, ExpressionSyntax expr, ITypeSymbol expsym, ConversionKind expkind) 1027ITypeSymbol returnType = methodSymbol.ReturnType; 2800var returnType = method.ReturnType; 3329var gNullableType = mngMethod.GetParameterType(0); 3395var gNullableType = mngMethod.GetParameterType(0); 4116Assert.Equal(SpecialType.System_Collections_Generic_IEnumerable_T, ((ITypeSymbol)info0.Symbol.OriginalDefinition).SpecialType); 4120Assert.Equal(SpecialType.System_Int32, ((ITypeSymbol)info1.Symbol).SpecialType); 4124Assert.Equal(SpecialType.System_Collections_Generic_IEnumerable_T, ((ITypeSymbol)info2.Symbol.OriginalDefinition).SpecialType); 4171Assert.Equal(SpecialType.System_Int32, ((ITypeSymbol)info1.Symbol).SpecialType); 4175Assert.Equal(SpecialType.System_Collections_Generic_IEnumerable_T, ((ITypeSymbol)info2.Symbol.OriginalDefinition).SpecialType); 4682var paramType0 = methodBar.GetParameterType(0); 4684var paramType1 = methodBar.GetParameterType(1); 4727var paramType0 = methodBar.GetParameterType(0); 4729var paramType1 = methodBar.GetParameterType(1); 5420Assert.Throws<ArgumentException>(() => type.Construct(new ITypeSymbol[] { null })); // null type arg 5428Assert.Throws<ArgumentException>(() => type.Construct(new ITypeSymbol[] { null })); // null type arg
Compilation\SemanticModelAPITests.cs (5)
731var lookup = symbolInfo.Symbol as ITypeSymbol; 2718var typeSymbol = speculativeModel.GetTypeInfo(speculatedTypeSyntax).Type; 3754var firstParamType = ((ISymbol)exprInfo.CandidateSymbols.Single()).GetParameters().First().Type; 4649var type = model.GetTypeInfo(exprSyn).Type;
Compilation\SemanticModelGetDeclaredSymbolAPITests.cs (19)
1633var symbols = model.LookupSymbols(position).Where(s => !s.IsStatic && !((s is ITypeSymbol))); 1636var symbols2 = model.LookupSymbols(position, container: symbolC).Where(s => !s.IsStatic && !((s is ITypeSymbol))); 1877var typeA = ((IParameterSymbol)symbols[0]).Type; 1881var typeB = ((IParameterSymbol)symbols[0]).Type; 2014var type = ((IParameterSymbol)symbols[0]).Type; 4003ITypeSymbol boundType; 4007boundType = symbolInfo.Symbol as ITypeSymbol; 4013boundType = symbolInfo.Symbol as ITypeSymbol; 4019boundType = symbolInfo.Symbol as ITypeSymbol; 4025boundType = symbolInfo.Symbol as ITypeSymbol; 4031boundType = symbolInfo.Symbol as ITypeSymbol; 4037boundType = symbolInfo.Symbol as ITypeSymbol; 4043boundType = symbolInfo.Symbol as ITypeSymbol; 4049boundType = symbolInfo.Symbol as ITypeSymbol; 4054boundType = symbolInfo.Symbol as ITypeSymbol; 4060boundType = symbolInfo.Symbol as ITypeSymbol; 4659var declaringType = compilation.GlobalNamespace.GetMember<ITypeSymbol>("Enclosing").GetMember<ITypeSymbol>("Declaring");
Compilation\SemanticModelGetSemanticInfoTests.cs (6)
6255Assert.Equal(SpecialType.System_String, ((ITypeSymbol)symbol).SpecialType); 9159var type = semanticInfo.Type; 9183var type = semanticInfo.Type; 9211var type = semanticInfo.Type; 9235var type = semanticInfo.Type; 14578Assert.True(((ITypeSymbol)semanticInfo.Type).IsErrorType());
DocumentationComments\CrefTests.cs (2)
5563var crefTypeParam = referencedType.TypeArguments.Single(); 6053var members = model.LookupSymbols(typeParameterSyntax.SpanStart, (ITypeSymbol)typeParameterSymbol);
SymbolDisplay\SymbolDisplayTests.cs (6)
4538var a = (ITypeSymbol)comp.GlobalNamespace.GetMembers("A").Single(); 5078Assert.True(((ITypeSymbol)firstPart.Symbol).IsTupleType); 8092var type = semanticModel.GetTypeInfo(declaration.Declaration.Type).Type; 8143var type = semanticModel.GetTypeInfo(declaration.Declaration.Type).Type; 8177var type = ((ILocalSymbol)model.GetDeclaredSymbol(name.Names[0])).Type;
Symbols\AnonymousTypesSemanticsTests.cs (7)
720var type = info0.Type; 739var type = info0.Type; 1072private static void CheckAnonymousType(ITypeSymbol type, string name, string metadataName) 1887ITypeSymbol[] args = new ITypeSymbol[namedType.Arity]; 1899var type = info.Type; 1918private void CheckFieldNameAndLocation(TestData data, ITypeSymbol type, SyntaxNode identifier)
Symbols\AnonymousTypesSymbolTests.cs (3)
1691var typeA3 = localA3.Type; 1692var typeA4 = localA4.Type; 1925ImmutableArray.Create<ITypeSymbol>(compilation.GetSpecialType(SpecialType.System_Int32).GetPublicSymbol(), compilation.GetSpecialType(SpecialType.System_Boolean).GetPublicSymbol()),
Symbols\CheckedUserDefinedOperatorsTests.cs (3)
7216var int64 = ((IMethodSymbol)model.GetSymbolInfo(xNode.Parent).Symbol).ReturnType; 7288var int64 = ((IMethodSymbol)model.GetSymbolInfo(xNode.Parent).Symbol).ReturnType; 7359var int64 = ((IMethodSymbol)model.GetSymbolInfo(xNode.Parent).Symbol).ReturnType;
Symbols\ConversionTests.cs (1)
395ITypeSymbol targetType = ((ILocalSymbol)model.GetDeclaredSymbol(variableDeclarator)).Type;
Symbols\CustomModifiersTests.cs (1)
154var i = type.TypeArguments.First();
Symbols\ExtensionMethodTests.cs (5)
3787var type = model.GetTypeInfo(member.Expression).Type; 3874var baseClass = model.GetTypeInfo(instance).Type; 3921var baseClass = model.GetTypeInfo(instance).Type; 3966var baseClass = model.GetTypeInfo(instance).Type; 4016var baseClass = model.GetTypeInfo(instance).Type;
Symbols\FunctionPointerTypeSymbolTests.cs (23)
1538Assert.Throws<ArgumentNullException>("returnType", () => comp.CreateFunctionPointerTypeSymbol(returnType: null!, returnRefKind: RefKind.None, parameterTypes: ImmutableArray<ITypeSymbol>.Empty, parameterRefKinds: ImmutableArray<RefKind>.Empty)); 1540Assert.Throws<ArgumentNullException>("parameterTypes[0]", () => comp.CreateFunctionPointerTypeSymbol(returnType: @string, returnRefKind: RefKind.None, parameterTypes: ImmutableArray.Create((ITypeSymbol?)null)!, parameterRefKinds: ImmutableArray.Create(RefKind.None))); 1541Assert.Throws<ArgumentNullException>("parameterRefKinds", () => comp.CreateFunctionPointerTypeSymbol(returnType: @string, returnRefKind: RefKind.None, parameterTypes: ImmutableArray<ITypeSymbol>.Empty, parameterRefKinds: default)); 1542Assert.Throws<ArgumentNullException>("callingConventionTypes[0]", () => comp.CreateFunctionPointerTypeSymbol(returnType: @string, returnRefKind: RefKind.None, parameterTypes: ImmutableArray<ITypeSymbol>.Empty, parameterRefKinds: ImmutableArray<RefKind>.Empty, callingConvention: SignatureCallingConvention.Unmanaged, ImmutableArray.Create((INamedTypeSymbol)null!))); 1543Assert.Throws<ArgumentException>(() => comp.CreateFunctionPointerTypeSymbol(returnType: @string, returnRefKind: RefKind.None, parameterTypes: ImmutableArray<ITypeSymbol>.Empty, parameterRefKinds: ImmutableArray.Create(RefKind.None))); 1544Assert.Throws<ArgumentException>(() => comp.CreateFunctionPointerTypeSymbol(returnType: @string, returnRefKind: RefKind.Out, parameterTypes: ImmutableArray<ITypeSymbol>.Empty, parameterRefKinds: ImmutableArray<RefKind>.Empty)); 1545Assert.Throws<ArgumentOutOfRangeException>(() => comp.CreateFunctionPointerTypeSymbol(returnType: @string, returnRefKind: RefKind.None, parameterTypes: ImmutableArray<ITypeSymbol>.Empty, parameterRefKinds: ImmutableArray<RefKind>.Empty, callingConvention: (SignatureCallingConvention)10)); 1546Assert.Throws<ArgumentException>(() => comp.CreateFunctionPointerTypeSymbol(returnType: @string, returnRefKind: RefKind.None, parameterTypes: ImmutableArray<ITypeSymbol>.Empty, parameterRefKinds: ImmutableArray<RefKind>.Empty, callingConvention: SignatureCallingConvention.Default, callingConventionTypes: ImmutableArray.Create(cdeclType)!)); 1547Assert.Throws<ArgumentException>(() => comp.CreateFunctionPointerTypeSymbol(returnType: @string, returnRefKind: RefKind.None, parameterTypes: ImmutableArray<ITypeSymbol>.Empty, parameterRefKinds: ImmutableArray<RefKind>.Empty, callingConvention: SignatureCallingConvention.StdCall, callingConventionTypes: ImmutableArray.Create(cdeclType)!)); 1548Assert.Throws<ArgumentException>(() => comp.CreateFunctionPointerTypeSymbol(returnType: @string, returnRefKind: RefKind.None, parameterTypes: ImmutableArray<ITypeSymbol>.Empty, parameterRefKinds: ImmutableArray<RefKind>.Empty, callingConvention: SignatureCallingConvention.FastCall, callingConventionTypes: ImmutableArray.Create(cdeclType)!)); 1549Assert.Throws<ArgumentException>(() => comp.CreateFunctionPointerTypeSymbol(returnType: @string, returnRefKind: RefKind.None, parameterTypes: ImmutableArray<ITypeSymbol>.Empty, parameterRefKinds: ImmutableArray<RefKind>.Empty, callingConvention: SignatureCallingConvention.CDecl, callingConventionTypes: ImmutableArray.Create(cdeclType)!)); 1550Assert.Throws<ArgumentException>(() => comp.CreateFunctionPointerTypeSymbol(returnType: @string, returnRefKind: RefKind.None, parameterTypes: ImmutableArray<ITypeSymbol>.Empty, parameterRefKinds: ImmutableArray<RefKind>.Empty, callingConvention: SignatureCallingConvention.ThisCall, callingConventionTypes: ImmutableArray.Create(cdeclType)!)); 1551Assert.Throws<ArgumentException>(() => comp.CreateFunctionPointerTypeSymbol(returnType: @string, returnRefKind: RefKind.None, parameterTypes: ImmutableArray<ITypeSymbol>.Empty, parameterRefKinds: ImmutableArray<RefKind>.Empty, callingConvention: SignatureCallingConvention.Unmanaged, callingConventionTypes: ImmutableArray.Create(@string)!)); 1559var ptr = comp.CreateFunctionPointerTypeSymbol(returnType: @string, returnRefKind: RefKind.None, parameterTypes: ImmutableArray<ITypeSymbol>.Empty, parameterRefKinds: ImmutableArray<RefKind>.Empty, callingConvention: SignatureCallingConvention.VarArgs); 1591ImmutableArray.Create((ITypeSymbol)@string), 1608ImmutableArray.Create((ITypeSymbol)@string), 1626ImmutableArray.Create((ITypeSymbol)@string), 1644var ptr = comp.CreateFunctionPointerTypeSymbol(@string, returnRefKind: RefKind.None, parameterTypes: ImmutableArray<ITypeSymbol>.Empty, parameterRefKinds: ImmutableArray<RefKind>.Empty, convention); 1646ptr = comp.CreateFunctionPointerTypeSymbol(@string, returnRefKind: RefKind.RefReadOnly, parameterTypes: ImmutableArray<ITypeSymbol>.Empty, parameterRefKinds: ImmutableArray<RefKind>.Empty, convention); 1659var ptr = comp.CreateFunctionPointerTypeSymbol(@string, returnRefKind: RefKind.None, parameterTypes: ImmutableArray<ITypeSymbol>.Empty, parameterRefKinds: ImmutableArray<RefKind>.Empty, SignatureCallingConvention.Unmanaged, ImmutableArray.Create(cdeclType, stdcallType)!); 1661ptr = comp.CreateFunctionPointerTypeSymbol(@string, returnRefKind: RefKind.RefReadOnly, parameterTypes: ImmutableArray<ITypeSymbol>.Empty, parameterRefKinds: ImmutableArray<RefKind>.Empty, SignatureCallingConvention.Unmanaged, ImmutableArray.Create(cdeclType, stdcallType)!); 1664ptr = comp.CreateFunctionPointerTypeSymbol(@string, returnRefKind: RefKind.None, parameterTypes: ImmutableArray<ITypeSymbol>.Empty, parameterRefKinds: ImmutableArray<RefKind>.Empty, SignatureCallingConvention.Unmanaged, ImmutableArray.Create(cdeclType)!); 1971parameterTypes: ImmutableArray<ITypeSymbol>.Empty,
Symbols\Metadata\PE\LoadingAttributes.cs (3)
496var t = field.GetAttributes().First().CommonConstructorArguments.Single().Type; 1211Assert.Equal("System.Linq.Expressions.Expression.BinaryExpressionProxy", ((ITypeSymbol)attr1.CommonConstructorArguments[0].Value).ToDisplayString(SymbolDisplayFormat.TestFormat)); 1216Assert.Equal("System.Linq.Expressions.Expression.TypeBinaryExpressionProxy", ((ITypeSymbol)attr1.CommonConstructorArguments[0].Value).ToDisplayString(SymbolDisplayFormat.TestFormat));
Symbols\Source\BaseClassTests.cs (1)
277Assert.False(((ITypeSymbol)members[0]).IsErrorType());
Symbols\Source\DeclaringSyntaxNodeTests.cs (3)
265var localA1Type = localA1.Type; 329var localType = local.Type; 553var constructedC1 = fieldT.Type;
Symbols\Source\NullablePublicAPITests.cs (11)
4373Assert.Equal(PublicNullableAnnotation.NotAnnotated, ((ITypeSymbol)symbol2.Symbol).NullableAnnotation); 4401Assert.Equal(PublicNullableAnnotation.None, ((ITypeSymbol)symbol2.Symbol).NullableAnnotation); 4431Assert.Equal(PublicNullableAnnotation.None, ((ITypeSymbol)symbol2.Symbol).NullableAnnotation); 4461Assert.Equal(PublicNullableAnnotation.NotAnnotated, ((ITypeSymbol)symbol2.Symbol).NullableAnnotation); 4491Assert.Equal(PublicNullableAnnotation.NotAnnotated, ((ITypeSymbol)symbol2.Symbol).NullableAnnotation); 4523Assert.Equal(PublicNullableAnnotation.NotAnnotated, ((ITypeSymbol)symbol2.Symbol).NullableAnnotation); 4556Assert.Equal(PublicNullableAnnotation.None, ((ITypeSymbol)symbol2.Symbol).NullableAnnotation); 4584Assert.Equal(PublicNullableAnnotation.NotAnnotated, ((ITypeSymbol)symbol2.Symbol).NullableAnnotation); 4614Assert.Equal(PublicNullableAnnotation.None, ((ITypeSymbol)symbol2.Symbol).NullableAnnotation); 4645Assert.Equal(PublicNullableAnnotation.NotAnnotated, ((ITypeSymbol)symbol2.Symbol).NullableAnnotation); 4678Assert.Equal(PublicNullableAnnotation.None, ((ITypeSymbol)symbol2.Symbol).NullableAnnotation);
Symbols\Source\UsingAliasTests.cs (15)
104var usingAliasType = model.GetTypeInfo(usingAlias.NamespaceOrType).Type; 219var usingAliasType = model.GetTypeInfo(usingAlias.NamespaceOrType).Type; 274var usingAliasType = model.GetTypeInfo(usingAlias.NamespaceOrType).Type; 312var info2 = symbolInfo.Symbol as ITypeSymbol; 318var info3 = symbolInfo.Symbol as ITypeSymbol; 324var info4 = symbolInfo.Symbol as ITypeSymbol; 358var info2 = symbolInfo.Symbol as ITypeSymbol; 364var info3 = symbolInfo.Symbol as ITypeSymbol; 370var info4 = symbolInfo.Symbol as ITypeSymbol;
Symbols\SymbolEqualityTests.cs (40)
225var type1 = ((IFieldSymbol)comp.GetMember("A.field1")).Type; 226var type2 = ((IFieldSymbol)comp.GetMember("A.field2")).Type; 249var type1 = ((IFieldSymbol)comp.GetMember("A.field1")).Type; 250var type2 = ((IFieldSymbol)comp.GetMember("A.field2")).Type; 285var type1 = ((IFieldSymbol)comp.GetMember("A.field1")).Type; 286var type2 = ((IFieldSymbol)comp.GetMember("A.field2")).Type; 309var type1 = ((IFieldSymbol)comp.GetMember("A.field1")).Type; 310var type2 = ((IFieldSymbol)comp.GetMember("A.field2")).Type; 344var type1comp1 = ((IFieldSymbol)comp1.GetMember("A.field1")).Type; 345var type1comp2 = ((IFieldSymbol)comp2.GetMember("A.field1")).Type; 346var type2 = ((IFieldSymbol)comp2.GetMember("B.field2")).Type; 376var symbol1 = ((IFieldSymbol)comp.GetMember("A.field1")).Type; 454var type1 = ((IFieldSymbol)model.GetDeclaredSymbol(member1Syntax.Declaration.Variables[0])).Type; 455var type2 = ((IFieldSymbol)model.GetDeclaredSymbol(member2Syntax.Declaration.Variables[0])).Type; 485var type1 = ((IFieldSymbol)model.GetDeclaredSymbol(member1Syntax.Declaration.Variables[0])).Type; 486var type2 = ((IFieldSymbol)model.GetDeclaredSymbol(member2Syntax.Declaration.Variables[0])).Type; 528var type1 = ((IFieldSymbol)model.GetDeclaredSymbol(member1Syntax.Declaration.Variables[0])).Type; 529var type2 = ((IFieldSymbol)model.GetDeclaredSymbol(member2Syntax.Declaration.Variables[0])).Type; 559var type1 = ((IFieldSymbol)model.GetDeclaredSymbol(member1Syntax.Declaration.Variables[0])).Type; 560var type2 = ((IFieldSymbol)model.GetDeclaredSymbol(member2Syntax.Declaration.Variables[0])).Type; 630var type1 = ((IFieldSymbol)model.GetDeclaredSymbol(member1Syntax.Declaration.Variables[0])).Type; 631var type2 = ((IFieldSymbol)model.GetDeclaredSymbol(member2Syntax.Declaration.Variables[0])).Type; 644var prop1Type = property1.Type; 645var prop2Type = property2.Type; 679var type1 = ((IFieldSymbol)model.GetDeclaredSymbol(member1Syntax.Declaration.Variables[0])).Type; 680var type2 = ((IFieldSymbol)model.GetDeclaredSymbol(member2Syntax.Declaration.Variables[0])).Type; 693var prop1Type = field1.Type; 694var prop2Type = field2.Type; 731var type1 = ((IFieldSymbol)model.GetDeclaredSymbol(member1Syntax.Declaration.Variables[0])).Type; 732var type2 = ((IFieldSymbol)model.GetDeclaredSymbol(member2Syntax.Declaration.Variables[0])).Type; 745var prop1Type = event1.Type; 746var prop2Type = event2.Type; 788var field1Type = field1.Type; // A<T!> 789var field2Type = field2.Type; // A<T!> 839var method1ReturnType = method1.ReturnType; // A<T!> 840var method2ReturnType = method2.ReturnType; // A<T!> 846var method1ParamType = method1.Parameters.First().Type; // A<T!> 847var method2ParamType = method2.Parameters.First().Type; // A<T!> 900var event1Type = event1.Type; // System.EventHandler<T!> 901var event2Type = event2.Type; // System.EventHandler<T!>
Symbols\TypeTests.cs (9)
1682var anonymousType = (locals[3] as ILocalSymbol).Type; 1687var memType = anonymousType.GetMember<IPropertySymbol>("p0").Type; 1692var nestedType = anonymousType.GetMember<IPropertySymbol>("p1").Type; 1718var compType = (model.GetDeclaredSymbol(mnode) as IMethodSymbol).Parameters[0].Type; 1765var memType = sym.Type; 1773Assert.Equal(TypeKind.Interface, ((ITypeSymbol)tinfo.Type).TypeKind); 1777Assert.True(((ITypeSymbol)tinfo.Type).IsNullableType()); 1781Assert.True(((ITypeSymbol)tinfo.ConvertedType).IsNullableType()); 1782Assert.Same(comp.GetSpecialType(SpecialType.System_Decimal), ((ITypeSymbol)tinfo.ConvertedType).GetNullableUnderlyingType());
Microsoft.CodeAnalysis.CSharp.Test.Utilities (22)
CompilationTestUtils.cs (2)
210public ITypeSymbol Type; 212public ITypeSymbol ConvertedType;
Extensions.cs (17)
659public static ITypeSymbol GetParameterType(this IMethodSymbol method, int index) => method.Parameters[index].Type; 661public static bool IsNullableType(this ITypeSymbol typeOpt) 666public static ITypeSymbol GetNullableUnderlyingType(this ITypeSymbol type) 671public static bool IsDynamic(this ITypeSymbol type) 676public static bool IsDelegateType(this ITypeSymbol type) 681public static bool IsErrorType(this ITypeSymbol type) 686public static ITypeSymbol StrippedType(this ITypeSymbol type) 726public static bool IsUnboundGenericType(this ITypeSymbol type) 765public static bool Equals(this ITypeSymbol first, ITypeSymbol second, TypeCompareKind typeCompareKind) 770public static ITypeSymbol GetTypeOrReturnType(this ISymbol symbol) 787return (ITypeSymbol)symbol; 793public static ITypeSymbol EnumUnderlyingTypeOrSelf(this ITypeSymbol type) 798public static INamedTypeSymbol GetEnumUnderlyingType(this ITypeSymbol type)
FunctionPointerUtilities.cs (3)
145ITypeSymbol? exprType; 242ITypeSymbol signatureParamType = signature.Parameters[i].Type; 250static void assertEqualSemanticInformation(SemanticModel model, TypeSyntax typeSyntax, ITypeSymbol signatureType)
Microsoft.CodeAnalysis.CSharp.WinRT.UnitTests (1)
CodeGen\WinRTCollectionTests.cs (1)
7429var jsonObjType = model.GetTypeInfo(jsonObj).Type;
Microsoft.CodeAnalysis.CSharp.Workspaces (203)
CastSimplifier.cs (28)
121var castedType = semanticModel.GetTypeInfo(castExpression.Type, cancellationToken).Type; 156var castedType = semanticModel.GetTypeInfo(castExpression.Type, cancellationToken).Type; 160var parentCastType = semanticModel.GetTypeInfo(parentCast.Type, cancellationToken).Type; 296var originalConvertedType = originalSemanticModel.GetTypeInfo(castNode.WalkUpParentheses(), cancellationToken).ConvertedType; 455var castedExpressionType = originalSemanticModel.GetTypeInfo(castedExpressionNode, cancellationToken).Type; 456var isType = originalSemanticModel.GetTypeInfo(isExpression.Right, cancellationToken).Type; 540var castType = semanticModel.GetTypeInfo(castNode, cancellationToken).Type; 660var originalConvertedType = originalConversionOperation.Type; 661var rewrittenBitwiseNotConversionType = rewrittenBitwiseNotConversionOperation.Type; 674private static bool IsSignedIntegralOrIntPtrType(ITypeSymbol? type) 731var castType = originalSemanticModel.GetTypeInfo(castExpression, cancellationToken).Type; 754private static bool IsNullOrErrorType([NotNullWhen(false)] ITypeSymbol? type) 877var castSideType = semanticModel.GetTypeInfo(castSide, cancellationToken).Type; 878var castedExpressionType = semanticModel.GetTypeInfo(castExpression.Expression, cancellationToken).Type; 880if (castSideType.IsNullable(out var underlyingType) && Equals(underlyingType, castedExpressionType)) 882var otherSideType = semanticModel.GetTypeInfo(otherSide, cancellationToken).Type; 900var castType = semanticModel.GetTypeInfo(castNode, cancellationToken).Type; 901var castedExpressionType = semanticModel.GetTypeInfo(castedExpressionNode, cancellationToken).Type; 958private static bool IsFloatingPointType(ITypeSymbol? type) 1099var rewrittenType = rewrittenSemanticModel.GetTypeInfo(rewrittenExpression, cancellationToken).Type; 1214private static bool IsIntrinsicOrEnum(ITypeSymbol rewrittenType) 1222ITypeSymbol rewrittenType, 1261var originalMemberType = originalMemberSymbol.GetMemberType(); 1262var rewrittenMemberType = rewrittenMemberSymbol.GetMemberType(); 1312private static (ITypeSymbol? rewrittenConvertedType, Conversion rewrittenConversion) GetRewrittenInfo( 1315Conversion originalConversion, ITypeSymbol originalConvertedType, 1326var convertedType = originalConversion.IsIdentity ? originalConvertedType : originalSemanticModel.Compilation.ObjectType; 1330var rewrittenConvertedType = rewrittenSemanticModel.GetTypeInfo(rewrittenExpression, cancellationToken).ConvertedType;
Classification\SyntaxClassification\NameSyntaxClassifier.cs (2)
188if (symbol is ITypeSymbol type && type.IsNativeIntegerType) 216case ITypeSymbol typeSymbol:
Classification\SyntaxClassification\SyntaxTokenClassifier.cs (1)
23private static readonly Func<ITypeSymbol, bool> s_shouldInclude = t => t.TypeKind != TypeKind.Error && t.GetArity() > 0;
Classification\SyntaxClassification\UsingDirectiveSyntaxClassifier.cs (1)
45if (symbolInfo.Symbol is ITypeSymbol typeSymbol)
CodeGeneration\CSharpSyntaxGenerator.cs (3)
3244public override SyntaxNode DefaultExpression(ITypeSymbol type) 3378private protected override SyntaxNode GenerateExpression(ITypeSymbol? type, object? value, bool canUseFieldReference) 3432private protected override SyntaxNode TypeExpression(ITypeSymbol typeSymbol, RefKind refKind)
CSharpCodeGenerationService.cs (1)
756public override TDeclarationNode UpdateDeclarationType<TDeclarationNode>(TDeclarationNode declaration, ITypeSymbol newType, CSharpCodeGenerationContextInfo info, CancellationToken cancellationToken)
CSharpSemanticFacts.cs (2)
237public bool IsPartial(ITypeSymbol typeSymbol, CancellationToken cancellationToken) 353var type = semanticModel.GetTypeInfo(node, cancellationToken).Type;
CSharpSemanticFactsService.cs (2)
117public CommonConversion ClassifyConversion(SemanticModel semanticModel, SyntaxNode expression, ITypeSymbol destination) 141var type = semanticModel.GetTypeInfo(expression, cancellationToken).Type;
CSharpSyntaxGeneratorInternal.cs (1)
134public override SyntaxNode Type(ITypeSymbol typeSymbol, bool typeContext)
CSharpTypeInferenceService.TypeInferrer.cs (37)
35protected override bool IsUnusableType(ITypeSymbol otherSideType) 612private IMethodSymbol Instantiate(IMethodSymbol method, IList<ITypeSymbol> invocationTypes) 636IDictionary<ITypeParameterSymbol, ITypeSymbol> bestMap = null; 637foreach (var type in invocationTypes) 658private Dictionary<ITypeParameterSymbol, ITypeSymbol> DetermineTypeParameterMapping(ITypeSymbol inferredType, ITypeSymbol returnType) 660var result = new Dictionary<ITypeParameterSymbol, ITypeSymbol>(); 665private void DetermineTypeParameterMapping(ITypeSymbol inferredType, ITypeSymbol returnType, Dictionary<ITypeParameterSymbol, ITypeSymbol> result) 1134return leftTypes.Select(x => x.InferredType.IsNullable(out var underlying) 1146static ITypeSymbol MakeNullable(ITypeSymbol symbol, Compilation compilation) 1474var type = this.SemanticModel.GetTypeInfo(recursivePattern).ConvertedType; 1593var elementTypesBuilder = ArrayBuilder<ITypeSymbol>.GetInstance(subPatternCount); 1620private static ImmutableArray<NullableAnnotation> GetNullableAnnotations(ImmutableArray<ITypeSymbol> elementTypes) 1800var typeArg = delegateType?.TypeArguments.Length > 0 1818private ITypeSymbol InferTypeForFirstParameterOfLambda( 1833private ITypeSymbol InferTypeForFirstParameterOfParenthesizedLambda( 1842private ITypeSymbol InferTypeForFirstParameterOfSimpleLambda( 1849private ITypeSymbol InferTypeForFirstParameterOfLambda( 1856private ITypeSymbol InferTypeForFirstParameterOfLambda( 1874var type = InferTypeForFirstParameterOfLambda(parameterName, child.AsNode()); 2033var memberType = memberSymbol.GetMemberType(); 2045private ITypeSymbol UnwrapTaskLike(ITypeSymbol type, bool isAsync) 2088var type = symbol.GetMemberType(); 2235var type = symbol.GetSymbolType(); 2301using var _1 = ArrayBuilder<ITypeSymbol>.GetInstance(out var tupleTypes); 2327var tupleType = GetTupleType(tupleExpression); 2338private ITypeSymbol GetTupleType( 2352out ImmutableArray<ITypeSymbol> elementTypes, 2358using var _1 = ArrayBuilder<ITypeSymbol>.GetInstance(out var elementTypesBuilder); 2396ArrayBuilder<ITypeSymbol> elementTypesBuilder, 2418ArrayBuilder<ITypeSymbol> elementTypesBuilder, 2421var tupleType = GetTupleType(tuple);
CSharpTypeStyleHelper.State.cs (2)
78var declaredTypeSymbol = semanticModel.GetTypeInfo(variableDeclaration.Type.StripRefIfNeeded(), cancellationToken).Type; 103private static bool IsMadeOfSpecialTypes([NotNullWhen(true)] ITypeSymbol? type)
CSharpUseExplicitTypeHelper.cs (1)
149var declaredType = semanticModel.GetTypeInfo(typeName.StripRefIfNeeded(), cancellationToken).Type;
CSharpUseImplicitTypeHelper.cs (4)
195var declarationType = semanticModel.GetTypeInfo(declarationTypeNode, cancellationToken).Type; 205var newDeclarationType = newSemanticModel.GetTypeInfo(newDeclarationTypeNode, cancellationToken).Type; 293var declaredType = semanticModel.GetTypeInfo(typeName.StripRefIfNeeded(), cancellationToken).Type; 332var initializerType = semanticModel.GetTypeInfo(expression, cancellationToken).Type;
DefaultExpressionSyntaxExtensions.cs (2)
52var entityType = semanticModel.GetTypeInfo(typeSyntax, cancellationToken).Type; 53var defaultType = semanticModel.GetTypeInfo(defaultExpression.Type, cancellationToken).Type;
ExpressionGenerator.cs (11)
34return typedConstant.Value is ITypeSymbol 35? SyntaxFactory.TypeOfExpression(((ITypeSymbol)typedConstant.Value).GenerateTypeSyntax()) 55ITypeSymbol? type, 64if (type.IsNullable(out var underlyingType)) 76internal static ExpressionSyntax GenerateNonEnumValueExpression(SyntaxGenerator generator, ITypeSymbol? type, object? value, bool canUseFieldReference) 119private static string DetermineSuffix(ITypeSymbol? type, object value) 173private static ExpressionSyntax GenerateDoubleLiteralExpression(ITypeSymbol? type, double value, bool canUseFieldReference) 202private static ExpressionSyntax GenerateSingleLiteralExpression(ITypeSymbol? type, float value, bool canUseFieldReference) 232ITypeSymbol? type, T value, IEnumerable<KeyValuePair<T, string>> constants, 243ITypeSymbol? type, T value, IEnumerable<KeyValuePair<T, string>> constants, 279private static ExpressionSyntax? GenerateFieldReference<T>(ITypeSymbol? type, T value, IEnumerable<KeyValuePair<T, string>> constants)
ExternalAccess\Pythia\Api\PythiaSymbolExtensions.cs (3)
14public static ITypeSymbol? GetMemberType(this ISymbol symbol) 17public static ITypeSymbol? GetSymbolType(this ISymbol? symbol) 26public static bool IsAccessibleWithin(this ISymbol symbol, ISymbol within, ITypeSymbol? throughType = null)
InternalExtensions.cs (2)
16public static ITypeSymbol DetermineParameterType( 24public static ITypeSymbol DetermineParameterType(ExpressionSyntax expression, SemanticModel semanticModel, CancellationToken cancellationToken)
ITypeParameterSymbolExtensions.cs (1)
62foreach (var type in constraintTypes)
ITypeSymbolExtensions.TypeSyntaxGeneratorVisitor.cs (2)
62ITypeSymbol underlyingType = symbol; 234var innerType = symbol.TypeArguments.First();
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ExpressionSyntaxExtensions.cs\ExpressionSyntaxExtensions.cs (2)
649var instanceType = instanceSymbol.GetSymbolType(); 655var staticType = speculativeSymbolInfo.GetAnySymbol().GetSymbolType();
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ITypeSymbolExtensions.cs\ITypeSymbolExtensions.cs (1)
9public static bool IsIntrinsicType(this ITypeSymbol typeSymbol)
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\TypeSyntaxExtensions.cs\TypeSyntaxExtensions.cs (1)
38var type = semanticModel.GetTypeInfo(typeSyntax).Type;
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs\SyntaxTreeExtensions.cs (2)
2509if (semanticModel.GetSymbolInfo(objectCreation.Type, cancellationToken).Symbol is ITypeSymbol type && !type.CanSupportCollectionInitializer(containingSymbol)) 3052return target.IsType && ((ITypeSymbol)target).TypeKind == TypeKind.Enum;
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ExpressionSyntaxExtensions.cs\ExpressionSyntaxExtensions.cs (4)
86ITypeSymbol targetType) 101ITypeSymbol targetType, 118var type = semanticModel.GetSpeculativeTypeInfo( 168out ITypeSymbol? container)
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.cs\ITypeSymbolExtensions.cs (5)
26public static ExpressionSyntax GenerateExpressionSyntax(this ITypeSymbol typeSymbol, bool nameSyntax = false) 38var type = symbol as ITypeSymbol; 94public static bool ContainingTypesOrSelfHasUnsafeKeyword(this ITypeSymbol containingType) 112public static async Task<ISymbol?> FindApplicableAliasAsync(this ITypeSymbol type, int position, SemanticModel semanticModel, CancellationToken cancellationToken)
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\TypeSyntaxExtensions.cs\TypeSyntaxExtensions.cs (2)
49: firstSymbol as ITypeSymbol; 57var returnType = method.ReturnType;
NamespaceGenerator.cs (1)
175return symbol is ITypeSymbol type
NullableExtensions.cs (2)
9public static ITypeSymbol? GetConvertedTypeWithAnnotatedNullability(this TypeInfo typeInfo) 12public static ITypeSymbol? GetTypeWithAnnotatedNullability(this TypeInfo typeInfo)
ParenthesizedExpressionSyntaxExtensions.cs (1)
316var potentialType = semanticModel.GetSpeculativeTypeInfo(expression.SpanStart, expression, SpeculativeBindingOption.BindAsTypeOrNamespace).Type;
PropertyGenerator.cs (1)
137var returnType = property.Type;
Recommendations\CSharpRecommendationServiceRunner.cs (12)
56public override bool TryGetExplicitTypeOfLambdaParameter(SyntaxNode lambdaSyntax, int ordinalInLambda, [NotNullWhen(true)] out ITypeSymbol? explicitLambdaParameterType) 217: ImmutableArray<ITypeSymbol>.Empty; 318if (name.ShouldNameExpressionBeTreatedAsExpressionInsteadOfType(_context.SemanticModel, out var nameBinding, out var container)) 370var container = _context.SemanticModel.GetTypeInfo(expression, _cancellationToken).Type; 393var container = _context.SemanticModel.GetTypeInfo(expression, _cancellationToken).Type; 406var container = _context.SemanticModel.GetTypeInfo(expression, _cancellationToken).Type; 420ITypeSymbol? containerType, 518? symbols.WhereAsArray(s => !(s.IsStatic || s is ITypeSymbol)) 540var container = GetContainerForUnnamedSymbols(semanticModel, originalExpression); 559private ITypeSymbol? GetContainerForUnnamedSymbols(SemanticModel semanticModel, ExpressionSyntax originalExpression) 561return originalExpression.ShouldNameExpressionBeTreatedAsExpressionInsteadOfType(_context.SemanticModel, out _, out var container) 566private void AddIndexers(ITypeSymbol container, ArrayBuilder<ISymbol> symbols)
Recommendations\CSharpRecommendationServiceRunner_Conversions.cs (12)
126private void AddConversions(ITypeSymbol container, ArrayBuilder<ISymbol> symbols) 136private static ITypeSymbol TryMakeNullable(Compilation compilation, ITypeSymbol container) 144ITypeSymbol container, INamedTypeSymbol containerWithoutNullable, ArrayBuilder<ISymbol> symbols) 192ITypeSymbol container, INamedTypeSymbol containerWithoutNullable, ArrayBuilder<ISymbol> symbols) 201public static ImmutableArray<SpecialType>? GetPredefinedNumericConversions(ITypeSymbol container) 220ITypeSymbol container, INamedTypeSymbol containerWithoutNullable, ArrayBuilder<ISymbol> symbols, ImmutableArray<SpecialType> specialTypes) 236static string CreateConversionDocumentationCommentXml(ITypeSymbol fromType, ITypeSymbol toType) 249private static IMethodSymbol CreateConversion(INamedTypeSymbol containingType, ITypeSymbol fromType, ITypeSymbol toType, string? documentationCommentXml) 257ITypeSymbol container, INamedTypeSymbol containerWithoutNullable, ArrayBuilder<ISymbol> symbols)
Recommendations\CSharpRecommendationServiceRunner_Operators.cs (4)
19private static void AddOperators(ITypeSymbol container, ArrayBuilder<ISymbol> symbols) 21var containerWithoutNullable = container.RemoveNullableIfPresent(); 29foreach (var type in containerWithoutNullable.GetBaseTypesAndThis()) 54private static bool ExcludeOperatorType(ITypeSymbol container)
SemanticModelExtensions.cs (3)
22public static IEnumerable<ITypeSymbol> LookupTypeRegardlessOfArity( 32return results.OfType<ITypeSymbol>(); 36return SpecializedCollections.EmptyEnumerable<ITypeSymbol>();
Simplification\CSharpSimplificationService.Expander.cs (7)
74private bool IsPassedToDelegateCreationExpression(ArgumentSyntax argument, ITypeSymbol type) 80var objectCreationType = _semanticModel.GetTypeInfo(objectCreationExpression).Type; 93private bool TryCastTo(ITypeSymbol targetType, ExpressionSyntax expression, ExpressionSyntax newExpression, out ExpressionSyntax newExpressionWithCast) 118var returnType = (_semanticModel.GetSymbolInfo(lambdaExpression).Symbol as IMethodSymbol)?.ReturnType; 140var returnType = (_semanticModel.GetSymbolInfo(parentLambda).Symbol as IMethodSymbol)?.ReturnType; 269var argumentType = _semanticModel.GetTypeInfo(node.Expression).ConvertedType; 845foreach (var typeArgument in namedTypedSymbol.TypeArguments)
Simplification\Reducers\CSharpNullableAnnotationReducer.cs (1)
53var type = semanticModel.GetTypeInfo(node, cancellationToken).Type;
Simplification\Simplifiers\AbstractCSharpSimplifier.cs (2)
157var type = semanticModel.GetTypeInfo(node, cancellationToken).Type; 171var type = semanticModel.GetTypeInfo(node, cancellationToken).Type;
Simplification\Simplifiers\ExpressionSimplifier.cs (1)
376var type = semanticModel.GetTypeInfo(memberAccess.Parent, cancellationToken).Type;
Simplification\Simplifiers\NameSimplifier.cs (2)
250var type = semanticModel.GetTypeInfo(name, cancellationToken).Type; 432var argument = type.TypeArguments.SingleOrDefault();
SpeculationAnalyzer.cs (18)
254var originalParamType = this.OriginalSemanticModel.GetDeclaredSymbol(originalParam).Type; 255var replacedParamType = this.SpeculativeSemanticModel.GetDeclaredSymbol(replacedParam).Type; 373var originalExpressionType = originalExpressionTypeInfo.Type; 374var newExpressionType = newExpressionTypeInfo.Type; 422var originalCaseType = this.OriginalSemanticModel.GetTypeInfo(previousOriginalNode, this.CancellationToken).Type; 423var newCaseType = this.SpeculativeSemanticModel.GetTypeInfo(previousReplacedNode, this.CancellationToken).Type; 548var originalExpressionType = this.OriginalSemanticModel.GetTypeInfo(originalAnonymousObjectMemberDeclarator.Expression, this.CancellationToken).Type; 549var newExpressionType = this.SpeculativeSemanticModel.GetTypeInfo(replacedAnonymousObjectMemberDeclarator.Expression, this.CancellationToken).Type; 685var originalConvertedType = this.OriginalSemanticModel.GetTypeInfo(originalIsOrAsExpression.Right).Type; 686var newConvertedType = this.SpeculativeSemanticModel.GetTypeInfo(newIsOrAsExpression.Right).Type; 768protected override bool ConversionsAreCompatible(ExpressionSyntax originalExpression, ITypeSymbol originalTargetType, ExpressionSyntax newExpression, ITypeSymbol newTargetType) 812protected override void GetForEachSymbols(SemanticModel model, CommonForEachStatementSyntax forEach, out IMethodSymbol getEnumeratorMethod, out ITypeSymbol elementType) 819protected override bool IsReferenceConversion(Compilation compilation, ITypeSymbol sourceType, ITypeSymbol targetType) 822protected override Conversion ClassifyConversion(SemanticModel model, ExpressionSyntax expression, ITypeSymbol targetType) 825protected override Conversion ClassifyConversion(SemanticModel model, ITypeSymbol originalType, ITypeSymbol targetType)
TypeStyleHelper.cs (13)
18public static bool IsBuiltInType(ITypeSymbol type) 33ITypeSymbol? typeInDeclaration, 53var tupleElementType = tupleType.TupleElements[i].Type; 119ITypeSymbol? typeInDeclaration, 129var containingType = semanticModel.GetTypeInfo(containingTypeName, cancellationToken).Type; 144ITypeSymbol? typeInDeclaration, 145ITypeSymbol containingType) 161var returnType = methodSymbol.ReturnType; 176ITypeSymbol? typeInDeclaration, 177ITypeSymbol containingType) 179var returnType = UnwrapTupleType(methodSymbol.ReturnType); 193private static ITypeSymbol? UnwrapTupleType(ITypeSymbol? symbol)
Microsoft.CodeAnalysis.EditorFeatures (3)
GoToDefinition\AbstractGoToDefinitionService.cs (3)
153if (semanticModel.GetDeclaredSymbol(containingTypeDeclaration, cancellationToken) is ITypeSymbol containingTypeSymbol && 154(symbolToNavigateTo is ITypeSymbol || symbolToNavigateTo.IsConstructor())) 156var candidateTypeSymbol = symbolToNavigateTo is ITypeSymbol
Microsoft.CodeAnalysis.EditorFeatures.Cocoa (3)
Snippets\CSharpSnippets\SnippetFunctions\SnippetFunctionGenerateSwitchCases.cs (1)
47protected override bool TryGetEnumTypeSymbol(CancellationToken cancellationToken, [NotNullWhen(returnValue: true)] out ITypeSymbol? typeSymbol)
Snippets\SnippetFunctions\AbstractSnippetFunctionGenerateSwitchCases.cs (2)
30protected abstract bool TryGetEnumTypeSymbol(CancellationToken cancellationToken, [NotNullWhen(returnValue: true)] out ITypeSymbol? typeSymbol); 43if (!TryGetEnumTypeSymbol(cancellationToken, out var typeSymbol) || typeSymbol.TypeKind != TypeKind.Enum)
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (3)
ChangeSignature\AddedParameterOrExistingIndex.cs (1)
66var type = document.Project.Language switch
EditAndContinue\SemanticEditDescription.cs (2)
16public readonly Func<Compilation, ITypeSymbol>? PartialType; 29Func<Compilation, ITypeSymbol>? partialType,
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (41)
CodeGeneration\AbstractCodeGenerationTests.cs (1)
122protected static ITypeSymbol CreateClass(string name)
CodeGeneration\CodeGenerationTests.cs (6)
62Func<SemanticModel, ITypeSymbol> type = null, 72var typeSymbol = type != null ? type(testContext.SemanticModel) : null; 583Func<SemanticModel, ITypeSymbol> getType = null, 683private static ITypeSymbol GetTypeSymbol(Compilation compilation, Type type) 686private static ITypeSymbol GetTypeSymbol(Compilation compilation, string typeFullName, int arrayRank = 0) 698internal static Func<SemanticModel, ITypeSymbol> CreateArrayType(Type type, int rank = 1)
Utilities\SymbolEquivalenceComparerTests.cs (34)
53var type = (ITypeSymbol)(await workspace.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("C").Single(); 125var csharpType = (ITypeSymbol)(await csharpWorkspace.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("C").Single(); 1346var a1 = ((IFieldSymbol)t1.GetMembers("A").Single()).Type; 1347var b1 = ((IFieldSymbol)t1.GetMembers("B").Single()).Type; 1348var c1 = ((IFieldSymbol)t1.GetMembers("C").Single()).Type; 1349var d1 = ((IFieldSymbol)t1.GetMembers("D").Single()).Type; 1350var a2 = ((IFieldSymbol)t2.GetMembers("A").Single()).Type; 1351var b2 = ((IFieldSymbol)t2.GetMembers("B").Single()).Type; 1352var c2 = ((IFieldSymbol)t2.GetMembers("C").Single()).Type; 1353var d2 = ((IFieldSymbol)t2.GetMembers("D").Single()).Type; 1407var a1 = ((IFieldSymbol)t1.GetMembers("A").Single()).Type; 1408var b1 = ((IFieldSymbol)t1.GetMembers("B").Single()).Type; 1409var c1 = ((IFieldSymbol)t1.GetMembers("C").Single()).Type; 1410var d1 = ((IFieldSymbol)t1.GetMembers("D").Single()).Type; 1411var a2 = ((IFieldSymbol)t2.GetMembers("A").Single()).Type; 1412var b2 = ((IFieldSymbol)t2.GetMembers("B").Single()).Type; 1413var c2 = ((IFieldSymbol)t2.GetMembers("C").Single()).Type; 1414var d2 = ((IFieldSymbol)t2.GetMembers("D").Single()).Type; 1617var ta1 = (ITypeSymbol)a1.GlobalNamespace.GetMembers("T").Single(); 1618var ta2 = (ITypeSymbol)a2.GlobalNamespace.GetMembers("T").Single(); 1619var tb1 = (ITypeSymbol)b1.GlobalNamespace.GetMembers("T").Single(); 1620var tb2 = (ITypeSymbol)b2.GlobalNamespace.GetMembers("T").Single(); 1621var tb3 = (ITypeSymbol)b3.GlobalNamespace.GetMembers("T").Single(); 1706var type1 = (ITypeSymbol)c1.GlobalNamespace.GetMembers("C").Single(); 1707var type2 = (ITypeSymbol)c2.GlobalNamespace.GetMembers("C").Single();
Microsoft.CodeAnalysis.ExpressionEvaluator.ExpressionCompiler (3)
AbstractTypeParameterChecker.cs (3)
38foreach (var constraintType in symbol.ConstraintTypes) 94foreach (var typeArgument in symbol.TypeArguments) 123foreach (var typeArgument in symbol.TypeArguments)
Microsoft.CodeAnalysis.Features (420)
AbstractAddExplicitCastCodeFixProvider.cs (10)
31protected abstract TExpressionSyntax Cast(TExpressionSyntax expression, ITypeSymbol type); 54out ImmutableArray<(TExpressionSyntax node, ITypeSymbol type)> potentialConversionTypes); 88var conversionType = potentialConversionTypes[i].type; 108ITypeSymbol conversionType, 119var castType = semanticModel.GetTypeInfo(castTypeNode, cancellationToken).Type; 142private static string GetSubItemName(SemanticModel semanticModel, int position, ITypeSymbol conversionType) 149protected static ImmutableArray<(TExpressionSyntax, ITypeSymbol)> FilterValidPotentialConversionTypes( 152ArrayBuilder<(TExpressionSyntax node, ITypeSymbol type)> mutablePotentialConversionTypes) 157using var _ = ArrayBuilder<(TExpressionSyntax, ITypeSymbol)>.GetInstance(out var validPotentialConversionTypes); 161var targetNodeConversionType = conversionTuple.type;
AbstractAddParameterCodeFixProvider.cs (4)
37protected abstract ITypeSymbol GetArgumentType(SyntaxNode argumentNode, SemanticModel semanticModel, CancellationToken cancellationToken); 391private async Task<(ITypeSymbol, RefKind)> GetArgumentTypeAndRefKindAsync(Document invocationDocument, TArgumentSyntax argument, CancellationToken cancellationToken) 395var argumentType = GetArgumentType(argument, semanticModel, cancellationToken); 533Compilation compilation, TypeInfo argumentTypeInfo, ITypeSymbol parameterType,
AbstractAliasAmbiguousTypeCodeFixProvider.cs (7)
26protected abstract string GetTextPreviewOfChange(string aliasName, ITypeSymbol typeSymbol); 54foreach (var symbol in Sort(symbolInfo.CandidateSymbols.Cast<ITypeSymbol>(), placementOption.PlaceSystemNamespaceFirst)) 78private static IEnumerable<ITypeSymbol> Sort(IEnumerable<ITypeSymbol> types, bool sortSystemFirst) 82var typeToNameSegments = new Dictionary<ITypeSymbol, ImmutableArray<string>>(); 108ImmutableArray<string> GetNameSegments(ITypeSymbol symbol)
AbstractForEachCastCodeFixProvider.cs (3)
25protected abstract ITypeSymbol GetForEachElementType(SemanticModel semanticModel, TForEachStatementSyntax forEachStatement); 73var elementType = GetForEachElementType(semanticModel, forEachStatement); 88ITypeSymbol iterationVariableType,
AbstractForEachCastDiagnosticAnalyzer.cs (5)
41protected abstract (CommonConversion conversion, ITypeSymbol? collectionElementType) GetForEachInfo(SemanticModel semanticModel, TForEachStatementSyntax node); 73variableDeclarator.Symbol.Type is not ITypeSymbol iterationType) 79var collectionType = semanticModel.GetTypeInfo(syntaxFacts.GetExpressionOfForeachStatement(node), cancellationToken).Type; 140private static bool IsStronglyTyped(INamedTypeSymbol ienumerableOfTType, ITypeSymbol collectionType, ITypeSymbol collectionElementType)
AbstractMakeMethodAsynchronousCodeFixProvider.cs (2)
26protected abstract bool IsAsyncReturnType(ITypeSymbol type, KnownTypes knownTypes); 201protected static bool IsTaskLike(ITypeSymbol returnType, KnownTypes knownTypes)
AbstractMatchFolderAndNamespaceDiagnosticAnalyzer.cs (1)
180if (symbol is ITypeSymbol typeSymbol && typeSymbol.DeclaringSyntaxReferences.Length > 1)
AbstractPopulateSwitchCodeFixProvider.cs (3)
39protected abstract ITypeSymbol GetSwitchType(TSwitchOperation switchStatement); 164var enumType = GetSwitchType(switchOperation); 167if (enumType.IsNullable(out var underlyingType))
AbstractPopulateSwitchDiagnosticAnalyzer.cs (1)
96var type = value.Type.RemoveNullableIfPresent();
AbstractPopulateSwitchExpressionCodeFixProvider.cs (1)
43protected sealed override ITypeSymbol GetSwitchType(ISwitchExpressionOperation switchExpression)
AbstractPopulateSwitchStatementCodeFixProvider.cs (1)
59protected sealed override ITypeSymbol GetSwitchType(ISwitchOperation switchOperation)
AbstractRemoveAsyncModifierCodeFixProvider.cs (7)
108private static bool ShouldOfferFix(ITypeSymbol returnType, KnownTypes knownTypes) 113private static bool IsTaskType(ITypeSymbol returnType, KnownTypes knownTypes) 122ITypeSymbol returnType, 185ITypeSymbol returnType, 214private static SyntaxNode GetReturnTaskCompletedTaskStatement(SyntaxGenerator generator, ITypeSymbol returnType, KnownTypes knownTypes) 231private static SyntaxNode WrapExpressionWithTaskFromResult(SyntaxGenerator generator, SyntaxNode expression, ITypeSymbol returnType, KnownTypes knownTypes) 236var unwrappedReturnType = returnType.GetTypeArguments()[0];
AbstractRemoveUnusedValuesCodeFixProvider.cs (2)
590var type = semanticModel.GetTypeInfo(node, cancellationToken).Type; 675TLocalDeclarationStatementSyntax CreateLocalDeclarationStatement(ITypeSymbol type, string name)
AbstractUseCoalesceExpressionForIfNullCheckDiagnosticAnalyzer.cs (1)
165var exprType = semanticModel.GetTypeInfo(initializer, cancellationToken).Type;
AbstractUseCoalesceExpressionForTernaryConditionalCheckDiagnosticAnalyzer.cs (1)
104var conditionType = semanticModel.GetTypeInfo(
AbstractUseIsNullForReferenceEqualsDiagnosticAnalyzer.cs (1)
154var parameterType = semanticModel.GetTypeInfo(argumentExpression, cancellationToken).Type;
AbstractUseNullPropagationDiagnosticAnalyzer.cs (3)
147var whenPartType = semanticModel.GetTypeInfo(whenPartMatch, cancellationToken).Type; 151var type = semanticModel.GetTypeInfo(conditionalExpression, cancellationToken).Type; 358var typeSymbol = semanticModel.GetTypeInfo(type, cancellationToken).Type;
AbstractUseNullPropagationDiagnosticAnalyzer_IfStatement.cs (1)
85var whenPartType = semanticModel.GetTypeInfo(whenPartMatch, cancellationToken).Type;
AbstractValidateFormatStringDiagnosticAnalyzer.cs (2)
186var argsArgumentType = TryGetArgsArgumentType(semanticModel, arguments, parameters, syntaxFacts); 190private ITypeSymbol? TryGetArgsArgumentType(
AddDebuggerDisplay\AbstractAddDebuggerDisplayCodeRefactoringProvider.cs (2)
105private static bool IsClassOrStruct(ITypeSymbol typeSymbol) 108private static bool HasDebuggerDisplayAttribute(ITypeSymbol typeSymbol, Compilation compilation)
AddImport\AbstractAddImportFeatureService.cs (5)
45protected abstract ITypeSymbol GetDeconstructInfo(SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken); 46protected abstract ITypeSymbol GetQueryClauseInfo(SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken); 451protected static bool IsViableExtensionMethod(IMethodSymbol method, ITypeSymbol receiver) 602private static ITypeSymbol? GetAwaitInfo(SemanticModel semanticModel, ISyntaxFacts syntaxFactsService, SyntaxNode node) 614private static ITypeSymbol? GetCollectionExpressionType(SemanticModel semanticModel, ISyntaxFacts syntaxFactsService, SyntaxNode node)
AddImport\SymbolReferenceFinder.cs (10)
213var typeSymbols = OfType<ITypeSymbol>(symbols); 240ITypeSymbol symbol, 319var propertyOrFieldType = symbol.GetSymbolType(); 396ImmutableArray<SymbolResult<IMethodSymbol>> methodSymbols, ITypeSymbol typeSymbol) 451var type = _owner.GetQueryClauseInfo(_semanticModel, _node, searchScope.CancellationToken); 474var type = GetAwaitInfo(_semanticModel, _syntaxFacts, _node); 496var type = GetCollectionExpressionType(_semanticModel, _syntaxFacts, _node); 518var type = GetCollectionExpressionType(_semanticModel, _syntaxFacts, _node); 540var type = _owner.GetDeconstructInfo(_semanticModel, _node, searchScope.CancellationToken); 557SearchScope searchScope, string name, ITypeSymbol type, Func<IMethodSymbol, bool> predicate = null)
AddParameterService.cs (2)
76ITypeSymbol newParameterType, 161ITypeSymbol parameterType,
ChangeSignature\AbstractChangeSignatureService.cs (2)
946var symbolType = symbol.GetSymbolType(); 1054var toType = methodSymbol.Parameters.Last().Type;
ChangeSignature\Parameter.cs (2)
35ITypeSymbol type, 78public ITypeSymbol Type { get; }
CodeRefactorings\AddAwait\AbstractAddAwaitCodeRefactoringProvider.cs (2)
87if (symbol is ITypeSymbol) 90var type = model.GetTypeInfo(node, cancellationToken).Type;
CodeRefactorings\MoveType\AbstractMoveTypeService.MoveTypeEditor.cs (2)
272var symbol = (ITypeSymbol?)State.SemanticDocument.SemanticModel.GetDeclaredSymbol(node, CancellationToken);
CodeRefactorings\SyncNamespace\AbstractChangeNamespaceService.cs (1)
335if (memberSymbol is ITypeSymbol typeSymbol
Completion\Providers\AbstractAwaitCompletionProvider.cs (4)
64protected abstract ITypeSymbol? GetTypeSymbolOfExpression(SemanticModel semanticModel, SyntaxNode potentialAwaitableExpression, CancellationToken cancellationToken); 71private static bool IsConfigureAwaitable(Compilation compilation, ITypeSymbol symbol) 73var originalDefinition = symbol.OriginalDefinition; 247var symbol = GetTypeSymbolOfExpression(semanticModel, potentialAwaitableExpression, cancellationToken);
Completion\Providers\AbstractInternalsVisibleToCompletionProvider.cs (1)
123var type = typeInfo.Type;
Completion\Providers\AbstractObjectCreationCompletionProvider.cs (1)
55var type = typeInferenceService.InferType(
Completion\Providers\AbstractObjectInitializerCompletionProvider.cs (1)
20protected abstract Tuple<ITypeSymbol, Location>? GetInitializedType(Document document, SemanticModel semanticModel, int position, CancellationToken cancellationToken);
Completion\Providers\AbstractOverrideCompletionProvider.cs (3)
25public abstract ImmutableArray<ISymbol> FilterOverrides(ImmutableArray<ISymbol> members, ITypeSymbol? returnType); 70out ITypeSymbol? returnType, 76protected static ITypeSymbol GetReturnType(ISymbol symbol)
Completion\Providers\AbstractOverrideCompletionProvider.ItemGetter.cs (1)
77if (!_provider.TryDetermineReturnType(startToken, semanticModel, _cancellationToken, out var returnType, out var tokenAfterReturnType) ||
Completion\Providers\AbstractRecommendationServiceBasedCompletionProvider.cs (2)
126private static ITypeSymbol? GetSymbolType(ISymbol symbol) 207var typeConvertibilityCache = new Dictionary<ITypeSymbol, bool>(SymbolEqualityComparer.Default);
Completion\Providers\AbstractSymbolCompletionProvider.cs (5)
53ImmutableArray<ITypeSymbol> inferredTypes, 56Dictionary<ITypeSymbol, bool> typeConvertibilityCache) 81var type = symbol.GetMemberType() ?? symbol.GetSymbolType(); 117var typeConvertibilityCache = new Dictionary<ITypeSymbol, bool>(SymbolEqualityComparer.Default); 156Dictionary<ITypeSymbol, bool> typeConvertibilityCache,
Completion\Providers\CompletionUtilities.cs (3)
15public static bool IsTypeImplicitlyConvertible(Compilation compilation, ITypeSymbol sourceType, ImmutableArray<ITypeSymbol> targetTypes) 17foreach (var targetType in targetTypes)
Completion\Providers\ImportCompletionProvider\AbstractExtensionMethodImportCompletionProvider.cs (7)
43if (TryGetReceiverTypeSymbol(syntaxContext, syntaxFacts, cancellationToken, out var receiverTypeSymbol)) 48: ImmutableArray<ITypeSymbol>.Empty; 73[NotNullWhen(true)] out ITypeSymbol? receiverTypeSymbol) 85if (syntaxContext.SemanticModel.GetSymbolInfo(expressionNode, cancellationToken).GetAnySymbol() is not ITypeSymbol) 103private static ITypeSymbol? GetSymbolType(ISymbol symbol) 110IAliasSymbol aliasSymbol => aliasSymbol.Target as ITypeSymbol, 111_ => symbol as ITypeSymbol,
Completion\Providers\ImportCompletionProvider\AbstractTypeImportCompletionProvider.cs (1)
85if (symbol is IAliasSymbol { Target: ITypeSymbol { TypeKind: not TypeKind.Error } target })
Completion\Providers\ImportCompletionProvider\ExtensionMethodImportCompletionHelper.cs (8)
50ITypeSymbol receiverTypeSymbol, 52ImmutableArray<ITypeSymbol> targetTypesSymbols, 102ITypeSymbol receiverTypeSymbol, 104ImmutableArray<ITypeSymbol> targetTypes, 139Compilation compilation, ImmutableArray<IMethodSymbol> extentsionMethodSymbols, ImmutableArray<ITypeSymbol> targetTypeSymbols, CancellationToken cancellationToken) 141Dictionary<ITypeSymbol, bool> typeConvertibilityCache = new(); 208Compilation compilation, IMethodSymbol methodSymbol, ImmutableArray<ITypeSymbol> targetTypeSymbols, 209Dictionary<ITypeSymbol, bool> typeConvertibilityCache)
Completion\Providers\ImportCompletionProvider\ExtensionMethodImportCompletionHelper.SymbolComputer.cs (16)
26private readonly ITypeSymbol _receiverTypeSymbol; 34private readonly ConcurrentDictionary<ITypeSymbol, bool> _checkedReceiverTypes = new(); 39ITypeSymbol receiverTypeSymbol, 57ITypeSymbol receiverTypeSymbol, 235MultiDictionary<ITypeSymbol, IMethodSymbol> matchingMethodSymbols, 245var declaredReceiverTypeInOriginatingCompilation = SymbolFinder.FindSimilarSymbols(declaredReceiverType, _originatingSemanticModel.Compilation, cancellationToken).FirstOrDefault(); 307MultiDictionary<ITypeSymbol, IMethodSymbol> matchingMethodSymbols, 350private MultiDictionary<ITypeSymbol, IMethodSymbol> GetPotentialMatchingSymbolsFromAssembly( 356var builder = new MultiDictionary<ITypeSymbol, IMethodSymbol>(); 391if (MatchExtensionMethod(methodSymbol, receiverTypeName, internalsVisible, out var receiverType)) 402static bool MatchExtensionMethod(IMethodSymbol method, string filterReceiverTypeName, bool internalsVisible, out ITypeSymbol? receiverType) 483private static ImmutableArray<string> GetReceiverTypeNames(ITypeSymbol receiverTypeSymbol) 489static void AddNamesForTypeWorker(ITypeSymbol receiverTypeSymbol, PooledHashSet<string> builder) 493foreach (var constraintType in typeParameter.ConstraintTypes) 527private static string GetReceiverTypeName(ITypeSymbol typeSymbol) 535var elementType = arrayType.ElementType;
Completion\Providers\ImportCompletionProvider\ImportCompletionItem.cs (1)
184if (SymbolKey.ResolveString(receiverTypeKey, compilation).GetAnySymbol() is ITypeSymbol receiverTypeSymbol)
ConvertAnonymousType\AbstractConvertAnonymousTypeToClassCodeRefactoringProvider.cs (1)
203var childType = semanticModel.GetTypeInfo(childCreation, cancellationToken).Type;
ConvertCast\AbstractConvertCastCodeRefactoringProvider.cs (1)
49var type = semanticModel.GetTypeInfo(typeNode, cancellationToken).Type;
ConvertForEachToFor\AbstractConvertForEachToForCodeRefactoringProvider.cs (14)
133ITypeSymbol castType, SyntaxNode collectionVariable, SyntaxToken indexVariable) 180out var explicitCastInterface, out var collectionNameSuggestion, out var countName); 194out ITypeSymbol? explicitCastInterface, out string? collectionNameSuggestion, out string? countName) 201var foreachType = foreachVariable.Type; 207var collectionType = foreachCollection.Type; 292ITypeSymbol? explicitInterface = null; 340ITypeSymbol type1, ITypeSymbol type2, Compilation compilation) 346private static bool IsNullOrErrorType([NotNullWhen(false)] ITypeSymbol? type) 349private static IMethodSymbol? GetInterfaceMember(ITypeSymbol interfaceType, string memberName) 432ITypeSymbol? explicitCastInterface, ITypeSymbol forEachElementType, 452public ITypeSymbol? ExplicitCastInterface { get; } 453public ITypeSymbol ForEachElementType { get; }
ConvertForToForEach\AbstractConvertForToForEachCodeRefactoringProvider.cs (13)
51TExpressionSyntax collectionExpression, ITypeSymbol iterationVariableType); 119out var iterationType)) 232INamedTypeSymbol containingType, ITypeSymbol type, string memberName) where TSymbol : class, ISymbol 239INamedTypeSymbol containingType, ITypeSymbol type, string memberName) where TSymbol : class, ISymbol 245INamedTypeSymbol containingType, ITypeSymbol collectionType, 247[NotNullWhen(true)] out ITypeSymbol? iterationType) 282INamedTypeSymbol ienumeratorType, [NotNullWhen(true)] out ITypeSymbol? iterationType) 284var getEnumeratorReturnType = getEnumeratorMethod.ReturnType; 315ITypeSymbol collectionType, 316ITypeSymbol iterationType, 345var indexerType = GetIndexerType(containingType, collectionType, semanticModel.Compilation.GetSpecialType(SpecialType.System_Collections_Generic_IEnumerable_T)); 499private static ITypeSymbol? GetIndexerType( 501ITypeSymbol collectionType,
ConvertIfToSwitch\AbstractConvertIfToSwitchCodeRefactoringProvider.Analyzer.cs (2)
52public abstract bool CanImplicitlyConvert(SemanticModel semanticModel, SyntaxNode syntax, ITypeSymbol targetType); 64private ITypeSymbol? _switchTargetType = null!;
ConvertNumericLiteral\AbstractConvertNumericLiteralCodeRefactoringProvider.cs (1)
34var symbol = semanticModel.GetTypeInfo(syntaxNode, cancellationToken).Type;
ConvertToInterpolatedString\AbstractConvertPlaceholderToInterpolatedStringRefactoringProvider.cs (3)
83var lastArgumentType = semanticModel.GetTypeInfo(syntaxFacts.GetExpressionOfArgument(lastArgument), cancellationToken).Type; 92var type = semanticModel.GetTypeInfo(syntaxFacts.GetExpressionOfArgument(argument)).Type; 294var convertedType = semanticModel.GetTypeInfo(argumentExpression, cancellationToken).ConvertedType;
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (13)
2284protected static bool SignaturesEquivalent(ImmutableArray<IParameterSymbol> oldParameters, ITypeSymbol oldReturnType, ImmutableArray<IParameterSymbol> newParameters, ITypeSymbol newReturnType) 2316protected static bool TypesEquivalent(ITypeSymbol? oldType, ITypeSymbol? newType, bool exact) 2317=> (exact ? s_exactSymbolEqualityComparer : (IEqualityComparer<ITypeSymbol?>)s_runtimeSymbolEqualityComparer.SignatureTypeEquivalenceComparer).Equals(oldType, newType); 2319protected static bool TypesEquivalent<T>(ImmutableArray<T> oldTypes, ImmutableArray<T> newTypes, bool exact) where T : ITypeSymbol 2344Func<ImmutableArray<IParameterSymbol>, ITypeSymbol, ImmutableArray<IParameterSymbol>, ITypeSymbol, bool>? signatureComparer = null) 3984private static void AnalyzeType(ITypeSymbol oldType, ITypeSymbol newType, ref RudeEditKind rudeEdit, ref bool hasGeneratedAttributeChange, RudeEditKind rudeEditKind = RudeEditKind.TypeUpdate) 5721var oldTypeOpt = GetType(oldCapture); 5722var newTypeOpt = GetType(newCapture); 5901private static ITypeSymbol GetType(ISymbol localOrParameter)
EmbeddedLanguages\AbstractLanguageDetector.cs (1)
42protected abstract bool TryGetOptions(SemanticModel semanticModel, ITypeSymbol exprType, SyntaxNode expr, CancellationToken cancellationToken, out TOptions options);
EmbeddedLanguages\DateAndTime\LanguageServices\DateAndTimeLanguageDetector.cs (3)
48protected override bool TryGetOptions(SemanticModel semanticModel, ITypeSymbol exprType, SyntaxNode expr, CancellationToken cancellationToken, out DateAndTimeOptions options) 90var type = semanticModel.GetTypeInfo(expression, cancellationToken).Type; 183private bool IsDateTimeType(ITypeSymbol? type)
EmbeddedLanguages\EmbeddedLanguageDetector.cs (1)
151var type = semanticModel.GetTypeInfo(expression, cancellationToken).Type;
EmbeddedLanguages\Json\LanguageServices\JsonLanguageDetector.cs (1)
168SemanticModel semanticModel, ITypeSymbol exprType, SyntaxNode expr, CancellationToken cancellationToken, out JsonOptions options)
EmbeddedLanguages\RegularExpressions\LanguageServices\RegexLanguageDetector.cs (1)
206SemanticModel semanticModel, ITypeSymbol exprType, SyntaxNode expr, CancellationToken cancellationToken, out RegexOptions options)
EncapsulateField\AbstractEncapsulateFieldService.cs (1)
395protected static Accessibility ComputeAccessibility(Accessibility accessibility, ITypeSymbol type)
ExtractMethod\Extensions.cs (2)
42public static ITypeSymbol? GetLambdaOrAnonymousMethodReturnType(this SemanticModel binding, SyntaxNode node) 71public static T ResolveType<T>(this SemanticModel semanticModel, T symbol) where T : class, ITypeSymbol
ExtractMethod\MethodExtractor.Analyzer.cs (24)
52protected abstract VariableInfo CreateFromSymbol(Compilation compilation, ISymbol symbol, ITypeSymbol type, VariableStyle variableStyle, bool variableDeclared); 62protected abstract ITypeSymbol GetRangeVariableType(SemanticModel model, IRangeVariableSymbol symbol); 151private (ITypeSymbol typeSymbol, bool hasAnonymousType, bool awaitTaskReturn) AdjustReturnType(SemanticModel model, ITypeSymbol returnType) 172private void UnwrapTaskIfNeeded(SemanticModel model, ref ITypeSymbol returnType) 181var originalDefinition = returnType.OriginalDefinition; 202private void WrapReturnTypeInTask(SemanticModel model, ref ITypeSymbol returnType, out bool awaitTaskReturn) 232private (ImmutableArray<VariableInfo> parameters, ITypeSymbol returnType, VariableInfo? variableToUseAsReturnValue, bool unsafeAddressTakenUsed) 244var returnType = SelectionResult.GetContainingScopeType() ?? compilation.GetSpecialType(SpecialType.System_Object); 254var returnType = variableToUseAsReturnValue != null 485var type = GetSymbolType(model, symbol); 520ITypeSymbol type, 596private bool SelectionContainsOnlyIdentifierWithSameType(ITypeSymbol type) 614private static bool UserDefinedValueType(Compilation compilation, ITypeSymbol type) 624private static bool WellKnownFrameworkValueType(Compilation compilation, ITypeSymbol type) 640protected virtual ITypeSymbol GetSymbolType(SemanticModel model, ISymbol symbol) 746var type = GetRangeVariableType(model, rangeVariable); 769foreach (var type in constraintTypes) 816var visited = new HashSet<ITypeSymbol>(); 828foreach (var type in constraintTypes) 842ITypeSymbol type, HashSet<ITypeSymbol> visited) 897private static IEnumerable<ITypeParameterSymbol> GetMethodTypeParametersInDeclaration(ITypeSymbol returnType, SortedDictionary<int, ITypeParameterSymbol> sortedMap) 945ITypeSymbol type,
ExtractMethod\MethodExtractor.AnalyzerResult.cs (2)
31ITypeSymbol returnType, 100public ITypeSymbol ReturnType { get; }
ExtractMethod\MethodExtractor.CodeGenerator.cs (3)
206var type = SelectionResult.GetContainingScopeType(); 338parameter.GetAttributes(), parameter.Variance, parameter.Name, ImmutableArray.Create<ITypeSymbol>(), parameter.NullableAnnotation, 355var type = parameter.GetVariableType();
ExtractMethod\MethodExtractor.cs (2)
48protected abstract Task<OperationStatus> CheckTypeAsync(Document document, SyntaxNode contextNode, Location location, ITypeSymbol type, CancellationToken cancellationToken); 176var originalType = variable.GetVariableType();
ExtractMethod\MethodExtractor.TypeParameterCollector.cs (2)
19public static IEnumerable<ITypeParameterSymbol> Collect(ITypeSymbol typeSymbol) 51foreach (var argument in namedTypeSymbol.GetAllTypeArguments())
ExtractMethod\MethodExtractor.VariableInfo.cs (2)
122public ITypeSymbol OriginalType => _variableSymbol.OriginalType; 124public ITypeSymbol GetVariableType()
ExtractMethod\MethodExtractor.VariableSymbol.cs (6)
24protected VariableSymbol(Compilation compilation, ITypeSymbol type) 51public ITypeSymbol OriginalType { get; } 82public NotMovableVariableSymbol(Compilation compilation, ITypeSymbol type) 109public ParameterVariableSymbol(Compilation compilation, IParameterSymbol parameterSymbol, ITypeSymbol type) 188public LocalVariableSymbol(Compilation compilation, ILocalSymbol localSymbol, ITypeSymbol type, HashSet<int> nonNoisySet) 302public QueryVariableSymbol(Compilation compilation, IRangeVariableSymbol symbol, ITypeSymbol type)
ExtractMethod\SelectionResult.cs (1)
57public abstract ITypeSymbol GetContainingScopeType();
ExtractMethod\SelectionValidator.NullSelectionResult.cs (1)
35public override ITypeSymbol GetContainingScopeType()
Fixer.cs (7)
24protected abstract TArgumentSyntax GenerateNewArgument(TArgumentSyntax oldArgument, ITypeSymbol conversionType); 38public ImmutableArray<(TExpressionSyntax, ITypeSymbol)> GetPotentialConversionTypes( 60using var __ = ArrayBuilder<(TExpressionSyntax, ITypeSymbol)>.GetInstance(out var mutablePotentialConversionTypes); 65targetArgument, cancellationToken, out var targetArgumentConversionType) 116[NotNullWhen(true)] out ITypeSymbol? targetArgumentConversionType) 153var parameterType = parameters[parameterIndex].Type; 169&& semanticModel.GetTypeInfo(argumentExpression, cancellationToken).Type is ITypeSymbol argumentType
GenerateComparisonOperators\GenerateComparisonOperatorsCodeRefactoringProvider.cs (6)
77var comparedType = iface.TypeArguments[0]; 108var typeArg = missingType.TypeArguments[0]; 122private static IMethodSymbol? TryGetCompareMethodImpl(INamedTypeSymbol containingType, ITypeSymbol comparableType) 186var comparedType = comparableType.TypeArguments[0]; 231private static bool HasAllComparisonOperators(INamedTypeSymbol containingType, ITypeSymbol comparedType) 242private static bool HasComparisonOperator(INamedTypeSymbol containingType, ITypeSymbol comparedType, CodeGenerationOperatorKind kind)
GenerateFromMembers\AbstractGenerateFromMembersCodeRefactoringProvider.cs (1)
97var type = symbol.GetMemberType();
GenerateMember\AbstractGenerateMemberService.cs (1)
111if (typeToGenerateIn.IsNullable(out var underlyingType) &&
GenerateMember\GenerateConstructor\AbstractGenerateConstructorService.cs (3)
39protected abstract ITypeSymbol GetArgumentType(SemanticModel semanticModel, Argument argument, CancellationToken cancellationToken); 42protected abstract bool IsConversionImplicit(Compilation compilation, ITypeSymbol sourceType, ITypeSymbol targetType);
GenerateMember\GenerateConstructor\AbstractGenerateConstructorService.State.cs (9)
45public ImmutableArray<ITypeSymbol> ParameterTypes; 275internal ImmutableArray<ITypeSymbol> GetParameterTypes(CancellationToken cancellationToken) 284private static ITypeSymbol FixType(ITypeSymbol typeSymbol, SemanticModel semanticModel, IEnumerable<ITypeParameterSymbol> allTypeParameters) 358private static bool IsValidAttributeParameterType(ITypeSymbol type) 405ImmutableArray<ITypeSymbol> parameterTypes, 418var parameterType = parameterTypes[i]; 443ITypeSymbol parameterType, 532ITypeSymbol parameterType,
GenerateMember\GenerateParameterizedMember\AbstractGenerateMethodService.cs (1)
28protected abstract ITypeSymbol DetermineReturnTypeForSimpleNameOrMemberAccessExpression(ITypeInferenceService typeInferenceService, SemanticModel semanticModel, TExpressionSyntax expression, CancellationToken cancellationToken);
GenerateMember\GenerateParameterizedMember\AbstractGenerateMethodService.State.cs (2)
182var expressionType = service.DetermineReturnTypeForSimpleNameOrMemberAccessExpression(typeInference, semanticModel, SimpleNameOrMemberAccessExpression, cancellationToken); 249ITypeSymbol expressionType)
GenerateMember\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.AbstractInvocationInfo.cs (6)
83private List<ITypeSymbol> MergeClassTypes(List<ITypeSymbol> classTypes) 89var type1 = classTypes[i]; 96var type2 = classTypes[j]; 113protected abstract bool IsImplicitReferenceConversion(Compilation compilation, ITypeSymbol sourceType, ITypeSymbol targetType);
GenerateMember\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.cs (1)
63var returnType = await state.SignatureInfo.DetermineReturnTypeAsync(cancellationToken).ConfigureAwait(false);
GenerateMember\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.MethodSignatureInfo.cs (4)
31protected override ITypeSymbol DetermineReturnTypeWorker(CancellationToken cancellationToken) 46protected override ImmutableArray<ITypeSymbol> DetermineParameterTypes(CancellationToken cancellationToken) 54protected override ImmutableArray<ITypeSymbol> DetermineTypeArguments(CancellationToken cancellationToken) 55=> ImmutableArray<ITypeSymbol>.Empty;
GenerateMember\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.SignatureInfo.cs (12)
32private IDictionary<ITypeSymbol, ITypeParameterSymbol> _typeArgumentToTypeParameterMap; 52public ValueTask<ITypeSymbol> DetermineReturnTypeAsync(CancellationToken cancellationToken) 54var type = DetermineReturnTypeWorker(cancellationToken); 63protected abstract ImmutableArray<ITypeSymbol> DetermineTypeArguments(CancellationToken cancellationToken); 64protected abstract ITypeSymbol DetermineReturnTypeWorker(CancellationToken cancellationToken); 66protected abstract ImmutableArray<ITypeSymbol> DetermineParameterTypes(CancellationToken cancellationToken); 102var returnType = await DetermineReturnTypeAsync(cancellationToken).ConfigureAwait(false); 140private async ValueTask<ITypeSymbol> FixTypeAsync( 141ITypeSymbol typeSymbol, 163private IDictionary<ITypeSymbol, ITypeParameterSymbol> GetTypeArgumentToTypeParameterMap( 169private IDictionary<ITypeSymbol, ITypeParameterSymbol> CreateTypeArgumentToTypeParameterMap( 179var result = new Dictionary<ITypeSymbol, ITypeParameterSymbol>(SymbolEqualityComparer.Default);
GenerateMember\GenerateParameterizedMember\TypeParameterSubstitution.cs (8)
21private static async ValueTask<ITypeSymbol> ReplaceTypeParametersBasedOnTypeConstraintsAsync( 23ITypeSymbol type, 37public readonly Dictionary<ITypeSymbol, ITypeSymbol> Substitutions = 61foreach (var typeArg in symbol.TypeArguments) 89var commonDerivedType = await DetermineCommonDerivedTypeAsync(symbol).ConfigureAwait(false); 94private async ValueTask<ITypeSymbol> DetermineCommonDerivedTypeAsync(ITypeParameterSymbol symbol) 123var substitutedType = await ReplaceTypeParametersBasedOnTypeConstraintsAsync(
GenerateMember\GenerateVariable\AbstractGenerateVariableService.cs (1)
38protected abstract bool TryConvertToLocalDeclaration(ITypeSymbol type, SyntaxToken identifierToken, SemanticModel semanticModel, CancellationToken cancellationToken, out SyntaxNode newRoot);
GenerateMember\GenerateVariable\AbstractGenerateVariableService.GenerateLocalCodeAction.cs (1)
70var type = _state.LocalType;
GenerateMember\GenerateVariable\AbstractGenerateVariableService.State.cs (4)
44public ITypeSymbol TypeMemberType { get; private set; } 45public ITypeSymbol LocalType { get; private set; } 435var inferredType = typeInference.InferType( 461var namedDelegateType = inferredType.GetDelegateType(compilation)?.DelegateInvokeMethod?.ConvertToType(compilation);
GenerateType\AbstractGenerateTypeService.cs (2)
51protected abstract ITypeSymbol DetermineArgumentType(SemanticModel semanticModel, TArgumentSyntax argument, CancellationToken cancellationToken); 205var type = argument == null ? null : semanticModel.GetTypeInfo(argument, cancellationToken).Type;
GenerateType\AbstractGenerateTypeService.Editor.cs (7)
29protected abstract bool IsConversionImplicit(Compilation compilation, ITypeSymbol sourceType, ITypeSymbol targetType); 575private ImmutableArray<ITypeSymbol> GetArgumentTypes(IList<TArgumentSyntax> argumentList) 587private ITypeSymbol FixType( 588ITypeSymbol typeSymbol) 596ITypeSymbol parameterType, 628ITypeSymbol parameterType,
GenerateType\AbstractGenerateTypeService.GenerateNamedType.cs (2)
68private ITypeSymbol DetermineReturnType() 204var parameterType = parameterTypes[i];
GenerateType\AbstractGenerateTypeService.State.cs (1)
225foreach (var baseType in baseTypes)
ImplementAbstractClass\ImplementAbstractClassData.cs (6)
290var fieldOrPropType = fieldOrProp.GetMemberType(); 306private static bool InheritsFromOrEquals(ITypeSymbol type, ITypeSymbol baseType) 309private static IEnumerable<ITypeSymbol> GetBaseTypesAndThis(ITypeSymbol? type) 311var current = type;
ImplementInterface\AbstractImplementInterfaceService.AccessibilityHelper.cs (5)
65foreach (var typeArg in methodSymbol.TypeArguments) 83private static bool IsTypeLessAccessibleThanOtherType(ITypeSymbol? first, INamedTypeSymbol second, HashSet<ITypeSymbol> alreadyCheckingTypes) 94foreach (var constraint in typeParameter.ConstraintTypes) 121foreach (var genericParam in namedType.TypeArguments)
InheritanceDistanceComparer.cs (8)
34: IComparer<(TExpressionSyntax syntax, ITypeSymbol symbol)> 44public int Compare((TExpressionSyntax syntax, ITypeSymbol symbol) x, 45(TExpressionSyntax syntax, ITypeSymbol symbol) y) 54var baseType = _semanticModel.GetTypeInfo(x.syntax).Type; 64private int GetInheritanceDistanceRecursive(ITypeSymbol baseType, ITypeSymbol? derivedType) 88private int GetInheritanceDistance(ITypeSymbol? baseType, ITypeSymbol castType)
InitializeParameter\AbstractInitializeParameterCodeRefactoringProvider.cs (2)
35protected abstract bool IsImplicitConversion(Compilation compilation, ITypeSymbol source, ITypeSymbol destination);
InlineHints\TypeHint.cs (3)
15public ITypeSymbol Type { get; } 21public TypeHint(ITypeSymbol type, TextSpan span, TextChange? textChange, bool leadingSpace = false, bool trailingSpace = false) 33public void Deconstruct(out ITypeSymbol type, out TextSpan span, out TextChange? textChange, out ImmutableArray<SymbolDisplayPart> prefix, out ImmutableArray<SymbolDisplayPart> suffix)
InlineMethod\AbstractInlineMethodRefactoringProvider.cs (2)
59protected abstract SyntaxNode GenerateTypeSyntax(ITypeSymbol symbol, bool allowVar); 60protected abstract TExpressionSyntax GenerateLiteralExpression(ITypeSymbol typeSymbol, object? value);
IntroduceParameter\AbstractIntroduceParameterCodeRefactoringProvider.cs (1)
67var expressionType = semanticModel.GetTypeInfo(expression, cancellationToken).Type;
IntroduceParameter\IntroduceParameterDocumentRewriter.cs (6)
277var parameterType = await GetTypeOfExpressionAsync(cancellationToken).ConfigureAwait(false); 355private async Task<ITypeSymbol> GetTypeOfExpressionAsync(CancellationToken cancellationToken) 358var typeSymbol = semanticModel.GetTypeInfo(_expression, cancellationToken).ConvertedType ?? semanticModel.Compilation.ObjectType; 403var typeSymbol = await GetTypeOfExpressionAsync(cancellationToken).ConfigureAwait(false); 453string? newMethodIdentifier, ITypeSymbol? typeSymbol, bool isTrampoline, CancellationToken cancellationToken) 538var parameterType = await GetTypeOfExpressionAsync(cancellationToken).ConfigureAwait(false);
IntroduceUsingStatement\AbstractIntroduceUsingStatementCodeRefactoringProvider.cs (3)
84var localType = declarator.Symbol.Type; 104private static bool IsLegalUsingStatementType(Compilation compilation, ITypeSymbol disposableType, ITypeSymbol type)
IntroduceVariable\AbstractIntroduceLocalForExpressionCodeRefactoringProvider.cs (2)
44var type = semanticModel.GetTypeInfo(expression).Type; 83ITypeSymbol type,
IntroduceVariable\AbstractIntroduceVariableService.AbstractIntroduceVariableCodeAction.cs (1)
108protected ITypeSymbol GetExpressionType(
IntroduceVariable\AbstractIntroduceVariableService.cs (1)
404protected static ITypeSymbol GetTypeSymbol(
IntroduceVariable\AbstractIntroduceVariableService.State.cs (1)
86var expressionType = Document.SemanticModel.GetTypeInfo(Expression, cancellationToken).Type;
IntroduceVariable\AbstractIntroduceVariableService.State_Block.cs (1)
32var type = GetTypeSymbol(Document, Expression, cancellationToken, objectAsDefault: false);
LanguageServices\AnonymousTypeDisplayService\AbstractStructuralTypeDisplayService.StructuralTypeCollectorVisitor.cs (3)
57foreach (var typeArgument in symbol.TypeArguments) 106foreach (var typeArgument in symbol.GetAllTypeArguments()) 135foreach (var constraint in symbol.ConstraintTypes)
LanguageServices\SymbolDisplayService\AbstractSymbolDisplayService.AbstractSymbolDescriptionBuilder.cs (2)
549var typeArgument = typeArguments[i]; 768List<ITypeSymbol> typeArguments)
MetadataAsSource\AbstractMetadataAsSourceService.WrappedEventSymbol.cs (1)
39public ITypeSymbol Type => _symbol.Type;
MetadataAsSource\AbstractMetadataAsSourceService.WrappedFieldSymbol.cs (1)
52public ITypeSymbol Type => _symbol.Type;
MetadataAsSource\AbstractMetadataAsSourceService.WrappedMethodSymbol.cs (7)
76public ITypeSymbol ReceiverType => _symbol.ReceiverType; 84public ITypeSymbol GetTypeInferredDuringReduction(ITypeParameterSymbol reducedFromTypeParameter) 98public ITypeSymbol ReturnType => _symbol.ReturnType; 109public ImmutableArray<ITypeSymbol> TypeArguments => _symbol.TypeArguments; 115public IMethodSymbol Construct(params ITypeSymbol[] typeArguments) 118public IMethodSymbol Construct(ImmutableArray<ITypeSymbol> typeArguments, ImmutableArray<NullableAnnotation> typeArgumentNullableAnnotations) 124public IMethodSymbol ReduceExtensionMethod(ITypeSymbol receiverType)
MetadataAsSource\AbstractMetadataAsSourceService.WrappedNamedTypeSymbol.cs (8)
79public ImmutableArray<ITypeSymbol> TypeArguments => _symbol.TypeArguments; 91public INamedTypeSymbol Construct(params ITypeSymbol[] typeArguments) 94public INamedTypeSymbol Construct(ImmutableArray<ITypeSymbol> typeArguments, ImmutableArray<NullableAnnotation> typeArgumentNullableAnnotations) 132ITypeSymbol ITypeSymbol.OriginalDefinition => _symbol.OriginalDefinition; 151NullableAnnotation ITypeSymbol.NullableAnnotation => throw new NotImplementedException(); 153ITypeSymbol ITypeSymbol.WithNullableAnnotation(NullableAnnotation nullableAnnotation)
MetadataAsSource\AbstractMetadataAsSourceService.WrappedPropertySymbol.cs (1)
58public ITypeSymbol Type => _symbol.Type;
PopulateSwitchExpressionHelpers.cs (2)
20var switchExpressionType = switchExpression?.Type; 26switchExpressionType = switchExpressionType.IsNullable(out var underlyingType) ? underlyingType : switchExpressionType;
PopulateSwitchStatementHelpers.cs (3)
47var switchExpressionType = switchExpression?.Type; 55switchExpressionType = switchExpressionType.IsNullable(out var underlyingType) ? underlyingType : switchExpressionType; 133ITypeSymbol enumType,
PreferFrameworkType\PreferFrameworkTypeCodeFixProvider.cs (1)
59if (semanticModel.GetSymbolInfo(node, cancellationToken).Symbol is ITypeSymbol typeSymbol)
PreferFrameworkType\PreferFrameworkTypeDiagnosticAnalyzerBase.cs (1)
89if (semanticModel.GetSymbolInfo(typeNode, cancellationToken).Symbol is not ITypeSymbol typeSymbol ||
QuickInfo\CommonSemanticQuickInfoProvider.ErrorVisitor.cs (1)
61foreach (var typeParameter in symbol.TypeArguments.Concat(symbol.TypeParameters))
ReplaceConditionalWithStatements\AbstractReplaceConditionalWithStatementsCodeRefactoringProvider.cs (2)
303var conditionalType = semanticModel.GetTypeInfo(conditionalExpression, cancellationToken).Type; 323SyntaxNode TryConvert(SyntaxNode expression, ITypeSymbol? conditionalType)
RQName\RQNodeBuilder.cs (2)
258private static RQType? BuildType(ITypeSymbol symbol) 324foreach (var typeArgument in entry.TypeArguments)
Shared\Extensions\ISymbolExtensions_Sorting.cs (1)
43private static INamedTypeSymbol GetNamedType(ITypeSymbol type)
Shared\Utilities\ExtractTypeHelpers.cs (6)
148foreach (var constraint in typeParameter.ConstraintTypes) 153DoesTypeReferenceTypeParameter(constraint, originalTypeParameter, new HashSet<ITypeSymbol>())) 191if (includedMembers.Any(m => DoesMemberReferenceTypeParameter(m, typeParameter, new HashSet<ITypeSymbol>()))) 200private static bool DoesMemberReferenceTypeParameter(ISymbol member, ITypeParameterSymbol typeParameter, HashSet<ITypeSymbol> checkedTypes) 225private static bool DoesTypeReferenceTypeParameter(ITypeSymbol type, ITypeParameterSymbol typeParameter, HashSet<ITypeSymbol> checkedTypes)
SignatureHelp\CommonSignatureHelpUtilities.cs (1)
161var parentType = parentOperation?.Type;
Snippets\SnippetFunctionService.cs (2)
58var typeSymbol = await GetEnumSymbolAsync(document, switchExpressionLocation, cancellationToken).ConfigureAwait(false); 120protected abstract Task<ITypeSymbol?> GetEnumSymbolAsync(Document document, TextSpan switchExpressionSpan, CancellationToken cancellationToken);
StackTraceExplorer\AbstractStackTraceSymbolResolver.cs (3)
23protected static bool MatchTypeArguments(ImmutableArray<ITypeSymbol> typeArguments, StackFrameTypeArgumentList? stackFrameTypeArgumentList) 39protected static bool MatchType(ITypeSymbol type, StackFrameTypeNode stackFrameType) 48ITypeSymbol currentType = arrayType;
SuppressMessageAttributeState.TargetSymbolResolver.cs (9)
407var typeSymbol = result.Value.Type; 696private ITypeSymbol ParseArrayType(ITypeSymbol typeSymbol) 764var boundReturnType = BindParameterOrReturnType(methodSymbol, returnType.Value); 801var parameterType = BindParameterOrReturnType(symbol.ContainingSymbol, parameterInfo.Type); 806private ITypeSymbol BindParameterOrReturnType(ISymbol bindingContext, TypeInfo type) 868public readonly ITypeSymbol Type; 876private TypeInfo(ITypeSymbol type, int startIndex) 882public static TypeInfo Create(ITypeSymbol type)
UseCollectionInitializerAnalyzer.cs (1)
127var type = _semanticModel.GetTypeInfo(_objectCreationExpression, _cancellationToken).Type;
UseNamedMemberInitializerAnalyzer.cs (2)
135var type = _semanticModel.GetTypeInfo(_objectCreationExpression, _cancellationToken).Type; 186ITypeSymbol classOrStructType,
Microsoft.CodeAnalysis.LanguageServer.Protocol (1)
Handler\Definitions\AbstractGoToDefinitionHandler.cs (1)
72if (!typeOnly || symbol is ITypeSymbol)
Microsoft.CodeAnalysis.Remote.ServiceHub (2)
Services\ExtensionMethodImportCompletion\RemoteExtensionMethodImportCompletionService.cs (2)
51if (symbol is ITypeSymbol receiverTypeSymbol) 56.Select(symbolKey => SymbolKey.ResolveString(symbolKey, compilation, cancellationToken: cancellationToken).GetAnySymbol() as ITypeSymbol)
Microsoft.CodeAnalysis.Test.Utilities (24)
Compilation\OperationTreeVerifier.cs (2)
274private void LogType(ITypeSymbol type, string header = "Type") 1218private void LogHasOperatorMethodExpressionCommon(IMethodSymbol operatorMethodOpt, ITypeSymbol constrainedToTypeOpt)
Compilation\TestOperationVisitor.cs (8)
47var type = operation.Type; 442var exceptionType = operation.ExceptionType; 752var constrainedToType = operation.ConstrainedToType; 856private static void AssertConstrainedToType(ISymbol member, ITypeSymbol constrainedToType) 1202foreach (var typeArg in operation.TypeArguments) 1207var containingType = operation.ContainingType; 1259var naturalType = operation.NaturalType; 1473case ITypeSymbol type:
Diagnostics\CouldHaveMoreSpecificTypeAnalyzer.cs (9)
67ITypeSymbol type = increment.Type; 162private static bool HasMoreSpecificSourceType<SymbolType>(SymbolType symbol, ITypeSymbol symbolType, Dictionary<SymbolType, HashSet<INamedTypeSymbol>> symbolsSourceTypes, out INamedTypeSymbol commonSourceType) 237private static void AssignTo(IOperation target, Dictionary<ILocalSymbol, HashSet<INamedTypeSymbol>> localsSourceTypes, Dictionary<IFieldSymbol, HashSet<INamedTypeSymbol>> fieldsSourceTypes, ITypeSymbol sourceType) 252private static void AssignTo<SymbolType>(SymbolType target, ITypeSymbol targetType, Dictionary<SymbolType, HashSet<INamedTypeSymbol>> sourceTypes, IOperation sourceValue) 257private static void AssignTo<SymbolType>(SymbolType target, ITypeSymbol targetType, Dictionary<SymbolType, HashSet<INamedTypeSymbol>> sourceTypes, ITypeSymbol sourceType) 279private static ITypeSymbol OriginalType(IOperation value) 293private void Report(OperationBlockAnalysisContext context, ILocalSymbol local, ITypeSymbol moreSpecificType, DiagnosticDescriptor descriptor) 298private void Report(CompilationAnalysisContext context, IFieldSymbol field, ITypeSymbol moreSpecificType, DiagnosticDescriptor descriptor)
Diagnostics\EmptyArrayAnalyzer.cs (1)
73var elementType = (arrayCreation as IArrayTypeSymbol)?.ElementType;
Diagnostics\FieldCouldBeReadOnlyAnalyzer.cs (2)
49ITypeSymbol staticConstructorType = containingMethod.MethodKind == MethodKind.StaticConstructor ? containingMethod.ContainingType : null; 111private static void AssignTo(IOperation target, bool inConstructor, ITypeSymbol staticConstructorType, HashSet<IFieldSymbol> assignedToFields, HashSet<IFieldSymbol> mightBecomeReadOnlyFields)
Diagnostics\LocalCouldBeConstAnalyzer.cs (1)
88var localType = local.Type;
Mocks\TestMessageProvider.cs (1)
273protected override void ReportInvalidNamedArgument(DiagnosticBag diagnostics, SyntaxNode attributeSyntax, int namedArgumentIndex, ITypeSymbol attributeClass, string parameterName)
Microsoft.CodeAnalysis.UnitTests (2)
MetadataReferences\MetadataReferenceTests.cs (2)
575var c = (ITypeSymbol)comp.GlobalNamespace.GetMembers("C").Single();
Microsoft.CodeAnalysis.VisualBasic (151)
Binding\MemberSemanticModel.vb (1)
107Public Overrides Function ClassifyConversion(expression As ExpressionSyntax, destination As ITypeSymbol) As Conversion
Compilation\ForEachStatementInfo.vb (2)
38Public ReadOnly Property ElementType As ITypeSymbol 67elementType As ITypeSymbol,
Compilation\SemanticModel.vb (2)
2331Public MustOverride Shadows Function ClassifyConversion(expression As ExpressionSyntax, destination As ITypeSymbol) As Conversion 2346Public Shadows Function ClassifyConversion(position As Integer, expression As ExpressionSyntax, destination As ITypeSymbol) As Conversion
Compilation\SpeculativeSemanticModelWithMemberModel.vb (1)
129Public Overrides Function ClassifyConversion(expression As ExpressionSyntax, destination As ITypeSymbol) As Conversion
Compilation\SyntaxTreeSemanticModel.vb (1)
1388Public Overrides Function ClassifyConversion(expression As ExpressionSyntax, destination As ITypeSymbol) As Conversion
Compilation\VisualBasicCompilation.vb (21)
864Protected Overrides ReadOnly Property CommonScriptGlobalsType As ITypeSymbol 1867Public Shadows Function ClassifyConversion(source As ITypeSymbol, destination As ITypeSymbol) As Conversion 1886Public Overrides Function ClassifyCommonConversion(source As ITypeSymbol, destination As ITypeSymbol) As CommonConversion 1890Friend Overrides Function ClassifyConvertibleConversion(source As IOperation, destination As ITypeSymbol, ByRef constantValue As ConstantValue) As IConvertibleConversion 1897Dim sourceType As ITypeSymbol = source.Type 2010Private Protected Overrides Function IsSymbolAccessibleWithinCore(symbol As ISymbol, within As ISymbol, throughType As ITypeSymbol) As Boolean 2020Friend Shadows Function IsSymbolAccessibleWithin(symbol As ISymbol, within As ISymbol, Optional throughType As ITypeSymbol = Nothing) As Boolean 2824Protected Overrides Function CommonCreateArrayTypeSymbol(elementType As ITypeSymbol, rank As Integer, elementNullableAnnotation As NullableAnnotation) As IArrayTypeSymbol 2828Protected Overrides Function CommonCreateTupleTypeSymbol(elementTypes As ImmutableArray(Of ITypeSymbol), 2869Protected Overrides Function CommonCreatePointerTypeSymbol(elementType As ITypeSymbol) As IPointerTypeSymbol 2874returnType As ITypeSymbol, 2876parameterTypes As ImmutableArray(Of ITypeSymbol), 2888memberTypes As ImmutableArray(Of ITypeSymbol), 2918returnType As ITypeSymbol, 2919leftType As ITypeSymbol, 2920rightType As ITypeSymbol) As IMethodSymbol 3002returnType As ITypeSymbol, 3003operandType As ITypeSymbol) As IMethodSymbol 3052Protected Overrides ReadOnly Property CommonDynamicType As ITypeSymbol
Errors\MessageProvider.vb (1)
502Protected Overrides Sub ReportInvalidNamedArgument(diagnostics As DiagnosticBag, attributeSyntax As SyntaxNode, namedArgumentIndex As Integer, attributeClass As ITypeSymbol, parameterName As String)
Operations\VisualBasicOperationFactory.vb (63)
375Dim type As ITypeSymbol = boundAssignmentOperator.Type 384Dim type As ITypeSymbol = boundMeReference.Type 392Dim type As ITypeSymbol = boundMyBaseReference.Type 400Dim type As ITypeSymbol = boundMyClassReference.Type 407Dim type As ITypeSymbol = boundLiteral.Type 416Dim type As ITypeSymbol = boundAwaitOperator.Type 424Dim type As ITypeSymbol = boundNameOfOperator.Type 452Dim type As ITypeSymbol = boundCall.Type 459Dim type As ITypeSymbol = boundOmittedArgument.Type 467Dim type As ITypeSymbol = boundParenthesized.Type 477Dim type As ITypeSymbol = boundArrayAccess.Type 503Dim type As ITypeSymbol = boundUnaryOperator.Type 516Dim type As ITypeSymbol = boundUserDefinedUnaryOperator.Type 569Dim type As ITypeSymbol = currentBinary.Type 588Dim type As ITypeSymbol = boundUserDefinedBinaryOperator.Type 600Dim type As ITypeSymbol = boundBinaryConditionalExpression.Type 629Dim type As ITypeSymbol = boundUserDefinedShortCircuitingOperator.Type 651Dim type As ITypeSymbol = If(syntax.IsMissing, Nothing, boundBadExpression.Type) 668Dim type As ITypeSymbol = Nothing 721Dim type As ITypeSymbol = boundConversionOrCast.Type 751Dim type As ITypeSymbol = boundDelegateCreationExpression.Type 772Dim type As ITypeSymbol = Nothing 782Dim type As ITypeSymbol = boundTernaryConditionalExpression.Type 791Dim typeOperand As ITypeSymbol = boundTypeOf.TargetType 794Dim type As ITypeSymbol = boundTypeOf.Type 800Dim typeOperand As ITypeSymbol = boundGetType.SourceType.Type 802Dim type As ITypeSymbol = boundGetType.Type 813Dim type As ITypeSymbol = boundLateInvocation.Type 825Dim type As ITypeSymbol = boundObjectCreationExpression.Type 834Dim type As ITypeSymbol = boundObjectInitializerExpression.Type 842Dim type As ITypeSymbol = boundCollectionInitializerExpression.Type 850Dim type As ITypeSymbol = boundNewT.Type 858Dim type As ITypeSymbol = creation.Type 867Dim type As ITypeSymbol = boundArrayCreation.Type 887Dim type As ITypeSymbol = boundPropertyAccess.Type 895Dim type As ITypeSymbol = boundWithLValueExpressionPlaceholder.Type 903Dim type As ITypeSymbol = boundWithRValueExpressionPlaceholder.Type 913Dim type As ITypeSymbol = boundEventAccess.Type 924Dim type As ITypeSymbol = boundFieldAccess.Type 935Dim type As ITypeSymbol = boundConditionalAccess.Type 942Dim type As ITypeSymbol = boundConditionalAccessReceiverPlaceholder.Type 950Dim type As ITypeSymbol = boundParameter.Type 959Dim type As ITypeSymbol = boundLocal.Type 970Dim typeArguments As ImmutableArray(Of ITypeSymbol) = ImmutableArray(Of ITypeSymbol).Empty 972typeArguments = ImmutableArray(Of ITypeSymbol).CastUp(boundLateMemberAccess.TypeArgumentsOpt.Arguments) 974Dim containingType As ITypeSymbol = Nothing 985Dim type As ITypeSymbol = boundLateMemberAccess.Type 1023Dim type As ITypeSymbol = boundRValuePlaceholder.Type 1065Dim type As ITypeSymbol = Nothing 1285Dim exceptionType As ITypeSymbol = If(boundCatchBlock.ExceptionSourceOpt?.Type, DirectCast(_semanticModel.Compilation, VisualBasicCompilation).GetWellKnownType(WellKnownType.System_Exception)) 1336Dim expressionType As ITypeSymbol = Nothing 1427Dim type As ITypeSymbol = Nothing 1483Dim eventReferenceType As ITypeSymbol = boundRaiseEventStatement.EventSymbol.Type 1536Dim type As ITypeSymbol = Nothing 1550Private Function CreateTupleOperation(boundTupleExpression As BoundTupleExpression, naturalType As ITypeSymbol) As ITupleOperation 1553Dim type As ITypeSymbol = boundTupleExpression.Type 1561Dim type As ITypeSymbol = boundInterpolatedString.Type 1598Dim type As ITypeSymbol = boundAnonymousTypeCreationExpression.Type 1608Dim type As ITypeSymbol = boundAnonymousTypePropertyAccess.Type 1627Dim type As ITypeSymbol = boundQueryExpression.Type 1644Dim type As ITypeSymbol = boundAggregateClause.Type 1651Dim type As ITypeSymbol = boundNullableIsTrueOperator.Type
Operations\VisualBasicOperationFactory_Methods.vb (2)
91Dim type As ITypeSymbol = boundAssignment.Type 349Dim type As ITypeSymbol = target.Type
SymbolDisplay\SymbolDisplayVisitor.Members.vb (1)
294Dim containingType As ITypeSymbol
SymbolDisplay\SymbolDisplayVisitor.Types.vb (2)
29Dim underlyingNonArrayType As ITypeSymbol = symbol.ElementType 481Private Sub AddTypeArguments(typeArguments As ImmutableArray(Of ITypeSymbol),
SymbolDisplay\SymbolDisplayVisitor.vb (1)
287DirectCast(vbRangeVariable.Type, ITypeSymbol).Accept(Me)
SymbolDisplay\SymbolDisplayVisitor_Constants.vb (1)
39Private Sub AddConstantValue(type As ITypeSymbol, constantValue As Object, Optional preferNumericValueOrExpandedFlagsForEnum As Boolean = False)
Symbols\ArrayTypeSymbol.vb (1)
395Private ReadOnly Property IArrayTypeSymbol_ElementType As ITypeSymbol Implements IArrayTypeSymbol.ElementType
Symbols\EventSymbol.vb (1)
278Private ReadOnly Property IEventSymbol_Type As ITypeSymbol Implements IEventSymbol.Type
Symbols\FieldSymbol.vb (1)
456Private ReadOnly Property IFieldSymbol_Type As ITypeSymbol Implements IFieldSymbol.Type
Symbols\MethodSymbol.vb (8)
922Private ReadOnly Property IMethodSymbol_ReceiverType As ITypeSymbol Implements IMethodSymbol.ReceiverType 934Private Function IMethodSymbol_GetTypeInferredDuringReduction(reducedFromTypeParameter As ITypeParameterSymbol) As ITypeSymbol Implements IMethodSymbol.GetTypeInferredDuringReduction 944Private Function IMethodSymbol_ReduceExtensionMethod(receiverType As ITypeSymbol) As IMethodSymbol Implements IMethodSymbol.ReduceExtensionMethod 1031Private ReadOnly Property IMethodSymbol_ReturnType As ITypeSymbol Implements IMethodSymbol.ReturnType 1055Private ReadOnly Property IMethodSymbol_TypeArguments As ImmutableArray(Of ITypeSymbol) Implements IMethodSymbol.TypeArguments 1057Return StaticCast(Of ITypeSymbol).From(Me.TypeArguments) 1113Private Function IMethodSymbol_Construct(ParamArray typeArguments() As ITypeSymbol) As IMethodSymbol Implements IMethodSymbol.Construct 1121Private Function IMethodSymbol_Construct(typeArguments As ImmutableArray(Of ITypeSymbol), typeArgumentNullableAnnotations As ImmutableArray(Of CodeAnalysis.NullableAnnotation)) As IMethodSymbol Implements IMethodSymbol.Construct
Symbols\NamedTypeSymbol.vb (4)
1146Private ReadOnly Property INamedTypeSymbol_TypeArguments As ImmutableArray(Of ITypeSymbol) Implements INamedTypeSymbol.TypeArguments 1148Return StaticCast(Of ITypeSymbol).From(Me.TypeArgumentsNoUseSiteDiagnostics) 1176Private Function INamedTypeSymbol_Construct(ParamArray typeArguments() As ITypeSymbol) As INamedTypeSymbol Implements INamedTypeSymbol.Construct 1180Private Function INamedTypeSymbol_Construct(typeArguments As ImmutableArray(Of ITypeSymbol), typeArgumentNullableAnnotations As ImmutableArray(Of CodeAnalysis.NullableAnnotation)) As INamedTypeSymbol Implements INamedTypeSymbol.Construct
Symbols\ParameterSymbol.vb (1)
312Private ReadOnly Property IParameterSymbol_Type As ITypeSymbol Implements IParameterSymbol.Type
Symbols\PropertySymbol.vb (1)
598Private ReadOnly Property IPropertySymbol_Type As ITypeSymbol Implements IPropertySymbol.Type
Symbols\Source\LocalSymbol.vb (1)
395Private ReadOnly Property ILocalSymbol_Type As ITypeSymbol Implements ILocalSymbol.Type
Symbols\Symbol.vb (2)
1292Protected Shared Function ConstructTypeArguments(ParamArray typeArguments() As ITypeSymbol) As ImmutableArray(Of TypeSymbol) 1300Protected Shared Function ConstructTypeArguments(typeArguments As ImmutableArray(Of ITypeSymbol), typeArgumentNullableAnnotations As ImmutableArray(Of CodeAnalysis.NullableAnnotation)) As ImmutableArray(Of TypeSymbol)
Symbols\TypeParameterSymbol.vb (2)
391Private ReadOnly Property ITypeParameterSymbol_ConstraintTypes As ImmutableArray(Of ITypeSymbol) Implements ITypeParameterSymbol.ConstraintTypes 393Return StaticCast(Of ITypeSymbol).From(Me.ConstraintTypesNoUseSiteDiagnostics)
Symbols\TypeSymbol.vb (25)
239Public MustOverride ReadOnly Property IsReferenceType As Boolean Implements ITypeSymbol.IsReferenceType, ITypeSymbolInternal.IsReferenceType 246Public MustOverride ReadOnly Property IsValueType As Boolean Implements ITypeSymbol.IsValueType, ITypeSymbolInternal.IsValueType 251Public Overridable ReadOnly Property IsAnonymousType As Boolean Implements ITypeSymbol.IsAnonymousType 276Public Overridable ReadOnly Property SpecialType As SpecialType Implements ITypeSymbol.SpecialType, ITypeSymbolInternal.SpecialType 528Private Function ITypeSymbol_FindImplementationForInterfaceMember(interfaceMember As ISymbol) As ISymbol Implements ITypeSymbol.FindImplementationForInterfaceMember 534Private ReadOnly Property ITypeSymbol_AllInterfaces As ImmutableArray(Of INamedTypeSymbol) Implements ITypeSymbol.AllInterfaces 540Private ReadOnly Property ITypeSymbol_BaseType As INamedTypeSymbol Implements ITypeSymbol.BaseType 546Private ReadOnly Property ITypeSymbol_Interfaces As ImmutableArray(Of INamedTypeSymbol) Implements ITypeSymbol.Interfaces 552Private ReadOnly Property ITypeSymbol_OriginalDefinition As ITypeSymbol Implements ITypeSymbol.OriginalDefinition 558Private ReadOnly Property ITypeSymbol_IsTupleSymbol As Boolean Implements ITypeSymbol.IsTupleType 564Private ReadOnly Property ITypeSymbol_IsNativeIntegerType As Boolean Implements ITypeSymbol.IsNativeIntegerType 570Private ReadOnly Property ITypeSymbol_TypeKind As TypeKind Implements ITypeSymbol.TypeKind, ITypeSymbolInternal.TypeKind 576Private ReadOnly Property ITypeSymbol_IsRefLikeType As Boolean Implements ITypeSymbol.IsRefLikeType 583Private ReadOnly Property ITypeSymbol_IsUnmanagedType As Boolean Implements ITypeSymbol.IsUnmanagedType 590Private ReadOnly Property ITypeSymbol_IsReadOnly As Boolean Implements ITypeSymbol.IsReadOnly 597Private ReadOnly Property ITypeSymbol_IsRecord As Boolean Implements ITypeSymbol.IsRecord 604Private Function ITypeSymbol_ToDisplayString(topLevelNullability As NullableFlowState, Optional format As SymbolDisplayFormat = Nothing) As String Implements ITypeSymbol.ToDisplayString 608Private Function ITypeSymbol_ToDisplayParts(topLevelNullability As NullableFlowState, Optional format As SymbolDisplayFormat = Nothing) As ImmutableArray(Of SymbolDisplayPart) Implements ITypeSymbol.ToDisplayParts 612Private Function ITypeSymbol_ToMinimalDisplayString(semanticModel As SemanticModel, topLevelNullability As NullableFlowState, position As Integer, Optional format As SymbolDisplayFormat = Nothing) As String Implements ITypeSymbol.ToMinimalDisplayString 616Private Function ITypeSymbol_ToMinimalDisplayParts(semanticModel As SemanticModel, topLevelNullability As NullableFlowState, position As Integer, Optional format As SymbolDisplayFormat = Nothing) As ImmutableArray(Of SymbolDisplayPart) Implements ITypeSymbol.ToMinimalDisplayParts 762Private ReadOnly Property ITypeSymbol_NullableAnnotation As NullableAnnotation Implements ITypeSymbol.NullableAnnotation 768Private Function ITypeSymbol_WithNullability(nullableAnnotation As NullableAnnotation) As ITypeSymbol Implements ITypeSymbol.WithNullableAnnotation 772Private Function ITypeSymbolInternal_GetITypeSymbol() As ITypeSymbol Implements ITypeSymbolInternal.GetITypeSymbol
Symbols\WellKnownMembers.vb (1)
354Friend Overrides Function IsAttributeType(type As ITypeSymbol) As Boolean
VisualBasicExtensions.vb (4)
772Public Function ClassifyConversion(compilation As Compilation, source As ITypeSymbol, destination As ITypeSymbol) As Conversion 807Public Function ClassifyConversion(semanticModel As SemanticModel, expression As ExpressionSyntax, destination As ITypeSymbol) As Conversion 825Public Function ClassifyConversion(semanticModel As SemanticModel, position As Integer, expression As ExpressionSyntax, destination As ITypeSymbol) As Conversion
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (31)
ArgumentSyntaxExtensions.vb (1)
16cancellationToken As CancellationToken) As ITypeSymbol
CastAnalyzer.vb (11)
34Private Function CastPassedToParamArrayDefinitelyCantBeRemoved(castType As ITypeSymbol) As Boolean 60Private Shared Function GetOuterCastType(expression As ExpressionSyntax, expressionTypeInfo As TypeInfo, semanticModel As SemanticModel, cancellationToken As CancellationToken) As ITypeSymbol 125Private Shared Function GetSpeculatedExpressionToOuterTypeConversion(speculationAnalyzer As SpeculationAnalyzer, speculatedExpression As ExpressionSyntax, outerSpeculatedExpression As ExpressionSyntax, cancellationToken As CancellationToken, <Out> ByRef speculatedExpressionOuterType As ITypeSymbol) As Conversion 145Private Shared Function AsTypeInVariableDeclarator(node As SyntaxNode, semanticModel As SemanticModel) As ITypeSymbol 209Dim castExpressionType As ITypeSymbol 256Dim speculatedExpressionOuterType As ITypeSymbol = Nothing 322DirectCast(castExpressionType.OriginalDefinition, ITypeSymbol).SpecialType = SpecialType.System_Nullable_T 377Private Shared Function IsRequiredWideningNumericConversion(sourceType As ITypeSymbol, destinationType As ITypeSymbol) As Boolean 397Private Shared Function CastRemovalChangesDefaultValue(castType As ITypeSymbol, outerType As ITypeSymbol) As Boolean
ExpressionSyntaxExtensions.vb (4)
105cancellationToken As CancellationToken) As ITypeSymbol 115Dim returnType As ITypeSymbol = Nothing 144<Out> ByRef returnType As ITypeSymbol) As Boolean 174cancellationToken As CancellationToken) As ITypeSymbol
SemanticModelExtensions.vb (4)
17cancellationToken As CancellationToken) As IList(Of ITypeSymbol) 22Return results.OfType(Of ITypeSymbol)().ToList() 26Return SpecializedCollections.EmptyList(Of ITypeSymbol)() 203Dim returnType As ITypeSymbol = Nothing
SpeculationAnalyzer.vb (8)
547Protected Overrides Function ConversionsAreCompatible(originalExpression As ExpressionSyntax, originalTargetType As ITypeSymbol, newExpression As ExpressionSyntax, newTargetType As ITypeSymbol) As Boolean 596Protected Overrides Sub GetForEachSymbols(model As SemanticModel, forEach As ForEachStatementSyntax, ByRef getEnumeratorMethod As IMethodSymbol, ByRef elementType As ITypeSymbol) 602Protected Overrides Function IsReferenceConversion(compilation As Compilation, sourceType As ITypeSymbol, targetType As ITypeSymbol) As Boolean 606Protected Overrides Function ClassifyConversion(model As SemanticModel, expression As ExpressionSyntax, targetType As ITypeSymbol) As Conversion 610Protected Overrides Function ClassifyConversion(model As SemanticModel, originalType As ITypeSymbol, targetType As ITypeSymbol) As Conversion
VariableDeclaratorSyntaxExtensions.vb (2)
29Public Function Type(variableDeclarator As VariableDeclaratorSyntax, semanticModel As SemanticModel) As ITypeSymbol 33Return TryCast(semanticModel.GetSymbolInfo(asNewType).Symbol, ITypeSymbol)
VisualBasicSemanticFacts.vb (1)
215Public Function IsPartial(typeSymbol As ITypeSymbol, cancellationToken As CancellationToken) As Boolean Implements ISemanticFacts.IsPartial
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (26)
ArgumentFixer.vb (1)
17Protected Overrides Function GenerateNewArgument(oldArgument As ArgumentSyntax, conversionType As ITypeSymbol) As ArgumentSyntax
ExpressionSyntaxExtensions.vb (2)
89targetType As ITypeSymbol, 128targetType As ITypeSymbol,
ITypeSymbolExtensions.vb (3)
14Public Function GenerateExpressionSyntax(typeSymbol As ITypeSymbol) As ExpressionSyntax 59Public Function GetTypeFromPredefinedCastKeyword(compilation As Compilation, castKeyword As SyntaxKind) As ITypeSymbol 102Public Function IsIntrinsicType(this As ITypeSymbol) As Boolean
StringExtensions.vb (2)
47Dim typeSymbol = TryCast(symbol, ITypeSymbol) 95Private Function IsPredefinedType(type As ITypeSymbol) As Boolean
SyntaxTreeExtensions.vb (2)
326Dim objectCreationType = TryCast(symbolInfo.Symbol, ITypeSymbol) 803Return target.IsType AndAlso DirectCast(target, ITypeSymbol).TypeKind = TypeKind.Enum
VisualBasicAddExplicitCastCodeFixProvider.vb (7)
50Protected Overrides Function Cast(expression As ExpressionSyntax, type As ITypeSymbol) As ExpressionSyntax 61ByRef potentialConversionTypes As ImmutableArray(Of (ExpressionSyntax, ITypeSymbol))) As Boolean 62potentialConversionTypes = ImmutableArray(Of (ExpressionSyntax, ITypeSymbol)).Empty 63Dim mutablePotentialConversionTypes = ArrayBuilder(Of (ExpressionSyntax, ITypeSymbol)).GetInstance() 175cancellationToken As CancellationToken) As ImmutableArray(Of (ExpressionSyntax, ITypeSymbol)) 181Dim mutablePotentialConversionTypes = ArrayBuilder(Of (ExpressionSyntax, ITypeSymbol)).GetInstance() 189Dim conversionType As ITypeSymbol = Nothing
VisualBasicAddParameterCodeFixProvider.vb (1)
52Protected Overrides Function GetArgumentType(argumentNode As SyntaxNode, semanticModel As SemanticModel, cancellationToken As CancellationToken) As ITypeSymbol
VisualBasicAliasAmbiguousTypeCodeFixProvider.vb (1)
27Protected Overrides Function GetTextPreviewOfChange(aliasName As String, typeSymbol As ITypeSymbol) As String
VisualBasicMakeMethodAsynchronousCodeFixProvider.vb (1)
56Protected Overrides Function IsAsyncReturnType(type As ITypeSymbol, knownTypes As KnownTypes) As Boolean
VisualBasicSemanticFactsService.vb (1)
134Public Function ClassifyConversion(semanticModel As SemanticModel, expression As SyntaxNode, destination As ITypeSymbol) As CommonConversion Implements ISemanticFactsService.ClassifyConversion
VisualBasicSyntaxContextExtensions.vb (1)
123Dim objectCreationType = TryCast(symbolInfo.Symbol, ITypeSymbol)
VisualBasicSyntaxGeneratorInternal.vb (1)
126Public Overrides Function Type(typeSymbol As ITypeSymbol, typeContext As Boolean) As SyntaxNode
VisualBasicTypeInferenceService.TypeInferrer.vb (3)
22Protected Overrides Function IsUnusableType(otherSideType As ITypeSymbol) As Boolean 959lambda As LambdaExpressionSyntax) As ITypeSymbol 982parameterName As String, node As SyntaxNode) As ITypeSymbol
Microsoft.CodeAnalysis.VisualBasic.EditorFeatures.UnitTests (3)
EditAndContinue\Helpers\EditingTestBase.vb (2)
75If(partialType Is Nothing, Nothing, Function(c As Compilation) CType(c.GetMember(partialType), ITypeSymbol)), 89If(partialType Is Nothing, Nothing, Function(c As Compilation) CType(c.GetMember(partialType), ITypeSymbol)),
SymbolId\SymbolKeyTestBase.vb (1)
47Friend Shared Sub ResolveAndVerifyTypeSymbol(node As ExpressionSyntax, sourceSymbol As ITypeSymbol, model As SemanticModel, sourceComp As Compilation)
Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests (25)
CodeGen\CodeGenTuples.vb (25)
7219Dim intType As ITypeSymbol = comp.GetSpecialType(SpecialType.System_Int32) 7224Assert.Throws(Of ArgumentException)(Sub() comp.CreateTupleTypeSymbol(elementTypes:=ImmutableArray(Of ITypeSymbol).Empty, elementNames:=Nothing)) 7245Dim intType As ITypeSymbol = comp.GetSpecialType(SpecialType.System_Int32) 7246Dim stringType As ITypeSymbol = comp.GetSpecialType(SpecialType.System_String) 7268Dim intType As ITypeSymbol = comp.GetSpecialType(SpecialType.System_Int32) 7269Dim stringType As ITypeSymbol = comp.GetSpecialType(SpecialType.System_String) 7291Dim intType As ITypeSymbol = comp.GetSpecialType(SpecialType.System_Int32) 7292Dim stringType As ITypeSymbol = comp.GetSpecialType(SpecialType.System_String) 7309Dim intType As ITypeSymbol = comp.GetSpecialType(SpecialType.System_Int32) 7310Dim stringType As ITypeSymbol = comp.GetSpecialType(SpecialType.System_String) 7327Dim intType As ITypeSymbol = comp.GetSpecialType(SpecialType.System_Int32) 7343Dim intType As ITypeSymbol = comp.GetSpecialType(SpecialType.System_Int32) 7344Dim stringType As ITypeSymbol = comp.GetSpecialType(SpecialType.System_String) 7364Dim intType As ITypeSymbol = comp.GetSpecialType(SpecialType.System_Int32) 7365Dim stringType As ITypeSymbol = comp.GetSpecialType(SpecialType.System_String) 7385Dim intType As ITypeSymbol = comp.GetSpecialType(SpecialType.System_Int32) 7386Dim stringType As ITypeSymbol = comp.GetSpecialType(SpecialType.System_String) 7406Dim intType As ITypeSymbol = comp.GetSpecialType(SpecialType.System_Int32) 7407Dim stringType As ITypeSymbol = comp.GetSpecialType(SpecialType.System_String) 7433Dim intType As ITypeSymbol = comp.GetSpecialType(SpecialType.System_Int32) 7450Dim intType As ITypeSymbol = comp.GetSpecialType(SpecialType.System_Int32) 7482Dim stringType As ITypeSymbol = comp.GetSpecialType(SpecialType.System_String) 7511Dim tuple3 = DirectCast(comp.CreateTupleTypeSymbol(ImmutableArray.Create(Of ITypeSymbol)(intType, intType, intType, intType, intType, intType, intType, stringType, stringType), 7728Private Shared Function TypeEquals(a As ITypeSymbol, b As ITypeSymbol, compareKind As TypeCompareKind) As Boolean
Microsoft.CodeAnalysis.VisualBasic.Features (75)
AddImport\VisualBasicAddImportFeatureService.vb (4)
221Protected Overrides Function GetDeconstructInfo(semanticModel As SemanticModel, node As SyntaxNode, cancellationToken As CancellationToken) As ITypeSymbol 228cancellationToken As CancellationToken) As ITypeSymbol 260Dim type As ITypeSymbol 333Dim leftExpressionType As ITypeSymbol
ArgumentFixer.vb (1)
17Protected Overrides Function GenerateNewArgument(oldArgument As ArgumentSyntax, conversionType As ITypeSymbol) As ArgumentSyntax
ChangeSignature\VisualBasicChangeSignatureService.vb (1)
131If typeSymbol IsNot Nothing AndAlso typeSymbol.IsKind(SymbolKind.NamedType) AndAlso DirectCast(typeSymbol, ITypeSymbol).TypeKind = TypeKind.Delegate Then
CodeRefactorings\InlineMethod\VisualBasicInlineMethodRefactoringProvider.vb (2)
49Protected Overrides Function GenerateTypeSyntax(symbol As ITypeSymbol, allowVar As Boolean) As SyntaxNode 53Protected Overrides Function GenerateLiteralExpression(typeSymbol As ITypeSymbol, value As Object) As ExpressionSyntax
Completion\CompletionProviders\AwaitCompletionProvider.vb (2)
54Protected Overrides Function GetTypeSymbolOfExpression(semanticModel As SemanticModel, potentialAwaitableExpression As SyntaxNode, cancellationToken As CancellationToken) As ITypeSymbol 61Return If(TypeOf symbol Is ITypeSymbol, Nothing, semanticModel.GetTypeInfo(memberAccessExpression, cancellationToken).Type)
Completion\CompletionProviders\CompletionListTagCompletionProvider.vb (2)
71Private Shared Function GetCompletionListType(inferredType As ITypeSymbol, within As INamedTypeSymbol, compilation As Compilation, cancellationToken As CancellationToken) As ITypeSymbol
Completion\CompletionProviders\EnumCompletionProvider.vb (1)
90Private Shared Function GetTypeFromSymbol(symbol As ISymbol) As ITypeSymbol
Completion\CompletionProviders\HandlesClauseCompletionProvider.vb (2)
82Dim containingType = TryCast(containingSymbol, ITypeSymbol) 106Dim containingType = TryCast(containingSymbol, ITypeSymbol)
Completion\CompletionProviders\ImplementsClauseCompletionProvider.vb (1)
186Private Function interfaceMemberGetter([interface] As ITypeSymbol, within As ISymbol) As ImmutableArray(Of ISymbol)
Completion\CompletionProviders\ObjectInitializerCompletionProvider.vb (2)
58cancellationToken As CancellationToken) As Tuple(Of ITypeSymbol, Location) 95Dim symbol = TryCast(symbolInfo.Symbol, ITypeSymbol)
Completion\CompletionProviders\OverrideCompletionProvider.vb (2)
149ByRef returnType As ITypeSymbol, ByRef nextToken As SyntaxToken) As Boolean 157returnType As ITypeSymbol) As ImmutableArray(Of ISymbol)
Completion\CompletionProviders\SymbolCompletionProvider.vb (1)
118Return If(TryCast(s, ITypeSymbol)?.IsIntrinsicType(), False)
Completion\KeywordRecommenders\Expressions\FromKeywordRecommender.vb (1)
32Dim type = TryCast(context.SemanticModel.GetSymbolInfo(objectCreation.Type, cancellationToken).Symbol, ITypeSymbol)
ConvertForToForEach\VisualBasicConvertForToForEachCodeRefactoringProvider.vb (1)
81foreachIdentifier As SyntaxToken, collectionExpression As ExpressionSyntax, iterationVariableType As ITypeSymbol) As SyntaxNode
ConvertIfToSwitch\VisualBasicConvertIfToSwitchCodeRefactoringProvider.Analyzer.vb (1)
34Public Overrides Function CanImplicitlyConvert(semanticModel As SemanticModel, syntax As SyntaxNode, targetType As ITypeSymbol) As Boolean
ExtractMethod\Extensions.vb (2)
468Public Function IsErrorType(type As ITypeSymbol) As Boolean 473Public Function IsObjectType(type As ITypeSymbol) As Boolean
ExtractMethod\VisualBasicMethodExtractor.Analyzer.vb (2)
31type As ITypeSymbol, style As VariableStyle, requiresDeclarationExpressionRewrite As Boolean) As VariableInfo 72Protected Overrides Function GetRangeVariableType(semanticModel As SemanticModel, symbol As IRangeVariableSymbol) As ITypeSymbol
ExtractMethod\VisualBasicMethodExtractor.PostProcessor.vb (5)
34Dim map = New Dictionary(Of ITypeSymbol, List(Of LocalDeclarationStatementSyntax))() 58Private Sub AppendDeclarationStatementToMap(statement As LocalDeclarationStatementSyntax, map As Dictionary(Of ITypeSymbol, List(Of LocalDeclarationStatementSyntax))) 64Dim type = TryCast(symbolInfo.Symbol, ITypeSymbol) 70Private Shared Function GetMergedDeclarationStatements(map As Dictionary(Of ITypeSymbol, List(Of LocalDeclarationStatementSyntax))) As IEnumerable(Of LocalDeclarationStatementSyntax) 135Dim type = TryCast(symbolInfo.Symbol, ITypeSymbol)
ExtractMethod\VisualBasicMethodExtractor.vb (2)
87type As ITypeSymbol, 106Dim currentType = TryCast(symbolInfo.Symbol, ITypeSymbol)
ExtractMethod\VisualBasicSelectionResult.vb (1)
135Public Overrides Function GetContainingScopeType() As ITypeSymbol
GenerateConstructor\VisualBasicGenerateConstructorService.vb (3)
47cancellationToken As CancellationToken) As ITypeSymbol 165Protected Overrides Function IsConversionImplicit(compilation As Compilation, sourceType As ITypeSymbol, targetType As ITypeSymbol) As Boolean
GenerateMember\GenerateParameterizedMember\VisualBasicGenerateMethodService.vb (1)
162Protected Overrides Function DetermineReturnTypeForSimpleNameOrMemberAccessExpression(typeInferenceService As ITypeInferenceService, semanticModel As SemanticModel, expression As ExpressionSyntax, cancellationToken As CancellationToken) As ITypeSymbol
GenerateMember\GenerateParameterizedMember\VisualBasicGenerateParameterizedMemberService.vb (8)
41Protected Overrides Function DetermineReturnTypeWorker(cancellationToken As CancellationToken) As ITypeSymbol 137Protected Overrides Function DetermineParameterTypes(cancellationToken As CancellationToken) As ImmutableArray(Of ITypeSymbol) 140ImmutableArray(Of ITypeSymbol).Empty) 154cancellationToken As CancellationToken) As ITypeSymbol 162Protected Overrides Function IsImplicitReferenceConversion(compilation As Compilation, sourceType As ITypeSymbol, targetType As ITypeSymbol) As Boolean 167Protected Overrides Function DetermineTypeArguments(cancellationToken As CancellationToken) As ImmutableArray(Of ITypeSymbol) 168Dim Result = ArrayBuilder(Of ITypeSymbol).GetInstance()
GenerateMember\GenerateVariable\VisualBasicGenerateVariableService.vb (1)
120Protected Overrides Function TryConvertToLocalDeclaration(type As ITypeSymbol, identifierToken As SyntaxToken, semanticModel As SemanticModel, cancellationToken As CancellationToken, ByRef newRoot As SyntaxNode) As Boolean
GenerateType\VisualBasicGenerateTypeService.vb (5)
418Protected Overrides Function DetermineArgumentType(semanticModel As SemanticModel, argument As ArgumentSyntax, cancellationToken As CancellationToken) As ITypeSymbol 422Protected Overrides Function IsConversionImplicit(compilation As Compilation, sourceType As ITypeSymbol, targetType As ITypeSymbol) As Boolean 686cancellationToken As CancellationToken) As ITypeSymbol 696Private Shared Function GenerateProperty(propertyName As SimpleNameSyntax, typeSymbol As ITypeSymbol) As IPropertySymbol
InitializeParameter\InitializeParameterHelpers.vb (2)
39Public Shared Function IsImplicitConversion(compilation As Compilation, source As ITypeSymbol, destination As ITypeSymbol) As Boolean
InitializeParameter\VisualBasicAddParameterCheckCodeRefactoringProvider.vb (2)
44Protected Overrides Function IsImplicitConversion(compilation As Compilation, source As ITypeSymbol, destination As ITypeSymbol) As Boolean
InitializeParameter\VisualBasicInitializeMemberFromParameterCodeRefactoringProvider.vb (2)
40Protected Overrides Function IsImplicitConversion(compilation As Compilation, source As ITypeSymbol, destination As ITypeSymbol) As Boolean
NavigationBar\VisualBasicNavigationBarItemService.vb (1)
313eventType As ITypeSymbol,
SignatureHelp\GenericNameSignatureHelpProvider.Method.vb (1)
28Private Shared Function GetContainingType(method As IMethodSymbol) As ITypeSymbol
SignatureHelp\InvocationExpressionSignatureHelpProvider.ElementAccess.vb (1)
22Dim throughType As ITypeSymbol = Nothing
SignatureHelp\InvocationExpressionSignatureHelpProvider.MemberGroup.vb (1)
19Dim throughType As ITypeSymbol = Nothing
Snippets\VisualBasicSnippetFunctionService.vb (1)
29Protected Overrides Async Function GetEnumSymbolAsync(document As Document, switchExpressionSpan As TextSpan, cancellationToken As CancellationToken) As Task(Of ITypeSymbol)
VisualBasicAddExplicitCastCodeFixProvider.vb (7)
50Protected Overrides Function Cast(expression As ExpressionSyntax, type As ITypeSymbol) As ExpressionSyntax 61ByRef potentialConversionTypes As ImmutableArray(Of (ExpressionSyntax, ITypeSymbol))) As Boolean 62potentialConversionTypes = ImmutableArray(Of (ExpressionSyntax, ITypeSymbol)).Empty 63Dim mutablePotentialConversionTypes = ArrayBuilder(Of (ExpressionSyntax, ITypeSymbol)).GetInstance() 175cancellationToken As CancellationToken) As ImmutableArray(Of (ExpressionSyntax, ITypeSymbol)) 181Dim mutablePotentialConversionTypes = ArrayBuilder(Of (ExpressionSyntax, ITypeSymbol)).GetInstance() 189Dim conversionType As ITypeSymbol = Nothing
VisualBasicAddParameterCodeFixProvider.vb (1)
52Protected Overrides Function GetArgumentType(argumentNode As SyntaxNode, semanticModel As SemanticModel, cancellationToken As CancellationToken) As ITypeSymbol
VisualBasicAliasAmbiguousTypeCodeFixProvider.vb (1)
27Protected Overrides Function GetTextPreviewOfChange(aliasName As String, typeSymbol As ITypeSymbol) As String
VisualBasicMakeMethodAsynchronousCodeFixProvider.vb (1)
56Protected Overrides Function IsAsyncReturnType(type As ITypeSymbol, knownTypes As KnownTypes) As Boolean
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (27)
Compilation\CompilationAPITests.vb (25)
1551ImmutableArray.Create(DirectCast(Nothing, ITypeSymbol)), 1562ImmutableArray.Create(DirectCast(compilation.GetSpecialType(SpecialType.System_Int32), ITypeSymbol), 1563DirectCast(compilation.GetSpecialType(SpecialType.System_Int32), ITypeSymbol)), 1575ImmutableArray.Create(DirectCast(Compilation.GetSpecialType(SpecialType.System_Int32), ITypeSymbol), 1576DirectCast(Compilation.GetSpecialType(SpecialType.System_Int32), ITypeSymbol)), 1586ImmutableArray.Create(DirectCast(compilation.GetSpecialType(SpecialType.System_Int32), ITypeSymbol), 1587DirectCast(compilation.GetSpecialType(SpecialType.System_Int32), ITypeSymbol)), 1607ImmutableArray.Create(DirectCast(compilation.GetSpecialType(SpecialType.System_Int32), ITypeSymbol), 1608DirectCast(compilation.GetSpecialType(SpecialType.System_Int32), ITypeSymbol)), 1625ImmutableArray.Create(DirectCast(Nothing, ITypeSymbol)), 1634ImmutableArray.Create(Of ITypeSymbol)(compilation.GetSpecialType(SpecialType.System_Int32)), 1648ImmutableArray.Create(Of ITypeSymbol)(compilation.GetSpecialType(SpecialType.System_Int32)), 1663ImmutableArray.Create(Of ITypeSymbol)(compilation.GetSpecialType(SpecialType.System_Int32), compilation.GetSpecialType(SpecialType.System_Boolean)), 1677Dim memberTypes = ImmutableArray.Create(Of ITypeSymbol)(comp.GetSpecialType(SpecialType.System_Object), comp.GetSpecialType(SpecialType.System_String)) 1706Dim type = comp.CreateAnonymousTypeSymbol(ImmutableArray(Of ITypeSymbol).Empty, ImmutableArray(Of String).Empty, memberNullableAnnotations:=ImmutableArray(Of CodeAnalysis.NullableAnnotation).Empty) 1715Dim memberTypes = ImmutableArray.Create(Of ITypeSymbol)(comp.GetSpecialType(SpecialType.System_Object), comp.GetSpecialType(SpecialType.System_String)) 1729Private Shared Function GetAnonymousTypeNullableAnnotations(type As ITypeSymbol) As ImmutableArray(Of CodeAnalysis.NullableAnnotation) 1942Dim typeArguments = ImmutableArray.Create(Of ITypeSymbol)(comp.GetSpecialType(SpecialType.System_Object), comp.GetSpecialType(SpecialType.System_String)) 1944Assert.Throws(Of ArgumentException)(Function() genericType.Construct(New ImmutableArray(Of ITypeSymbol), New ImmutableArray(Of CodeAnalysis.NullableAnnotation))) 1952Assert.Throws(Of ArgumentException)(Function() genericType.Construct(ImmutableArray.Create(Of ITypeSymbol)(Nothing, Nothing), Nothing)) 1960typeArguments = ImmutableArray.Create(Of ITypeSymbol)(comp.GetSpecialType(SpecialType.System_Object), comp.GetSpecialType(SpecialType.System_String)) 1974Dim typeArguments = ImmutableArray.Create(Of ITypeSymbol)(comp.GetSpecialType(SpecialType.System_Object), comp.GetSpecialType(SpecialType.System_String)) 1976Assert.Throws(Of ArgumentException)(Function() genericMethod.Construct(New ImmutableArray(Of ITypeSymbol), New ImmutableArray(Of CodeAnalysis.NullableAnnotation))) 1984Assert.Throws(Of ArgumentException)(Function() genericMethod.Construct(ImmutableArray.Create(Of ITypeSymbol)(Nothing, Nothing), Nothing)) 1992typeArguments = ImmutableArray.Create(Of ITypeSymbol)(comp.GetSpecialType(SpecialType.System_Object), comp.GetSpecialType(SpecialType.System_String))
Compilation\SemanticModelAPITests.vb (2)
2944Dim getLocalType = Function(name As String) As ITypeSymbol 2985Dim getLocalType = Function(name As String) As ITypeSymbol
Microsoft.CodeAnalysis.VisualBasic.Symbol.UnitTests (4)
SymbolDisplay\SymbolDisplayTests.vb (2)
4747Dim a = DirectCast(comp.GlobalNamespace.GetMembers("A").Single(), ITypeSymbol) 4992Assert.True(DirectCast(description(4).Symbol, ITypeSymbol).IsTupleType)
SymbolsTests\AnonymousTypes\AnonymousTypesSemanticsTests.vb (2)
1924Private Sub CheckFieldNameAndLocation(model As SemanticModel, type As ITypeSymbol, tree As SyntaxTree, identifierIndex As Integer, fieldName As String, Optional isKey As Boolean = False) 2079Public Function TheOnlyConstructor(type As ITypeSymbol) As MethodSymbol
Microsoft.CodeAnalysis.VisualBasic.Test.Utilities (2)
CompilationTestUtils.vb (2)
515Public [Type] As ITypeSymbol = Nothing 516Public ConvertedType As ITypeSymbol = Nothing
Microsoft.CodeAnalysis.VisualBasic.Workspaces (82)
ArgumentSyntaxExtensions.vb (1)
16cancellationToken As CancellationToken) As ITypeSymbol
CaseCorrection\VisualBasicCaseCorrectionService.Rewriter.vb (2)
148If TypeOf symbol Is ITypeSymbol AndAlso DirectCast(symbol, ITypeSymbol).TypeKind = TypeKind.Error Then
CastAnalyzer.vb (11)
34Private Function CastPassedToParamArrayDefinitelyCantBeRemoved(castType As ITypeSymbol) As Boolean 60Private Shared Function GetOuterCastType(expression As ExpressionSyntax, expressionTypeInfo As TypeInfo, semanticModel As SemanticModel, cancellationToken As CancellationToken) As ITypeSymbol 125Private Shared Function GetSpeculatedExpressionToOuterTypeConversion(speculationAnalyzer As SpeculationAnalyzer, speculatedExpression As ExpressionSyntax, outerSpeculatedExpression As ExpressionSyntax, cancellationToken As CancellationToken, <Out> ByRef speculatedExpressionOuterType As ITypeSymbol) As Conversion 145Private Shared Function AsTypeInVariableDeclarator(node As SyntaxNode, semanticModel As SemanticModel) As ITypeSymbol 209Dim castExpressionType As ITypeSymbol 256Dim speculatedExpressionOuterType As ITypeSymbol = Nothing 322DirectCast(castExpressionType.OriginalDefinition, ITypeSymbol).SpecialType = SpecialType.System_Nullable_T 377Private Shared Function IsRequiredWideningNumericConversion(sourceType As ITypeSymbol, destinationType As ITypeSymbol) As Boolean 397Private Shared Function CastRemovalChangesDefaultValue(castType As ITypeSymbol, outerType As ITypeSymbol) As Boolean
Classification\SyntaxClassification\NameSyntaxClassifier.vb (1)
138Dim type = TryCast(symbol, ITypeSymbol)
CodeCleanup\AsyncOrIteratorFunctionReturnTypeFixer.vb (1)
150Private Sub GenerateFunctionAsClause(type As ITypeSymbol,
CodeGeneration\ExpressionGenerator.vb (12)
31If Not TypeOf typedConstant.Value Is ITypeSymbol Then 35Return SyntaxFactory.GetTypeExpression(DirectCast(typedConstant.Value, ITypeSymbol).GenerateTypeSyntax()) 42Friend Function GenerateExpression(generator As SyntaxGenerator, type As ITypeSymbol, value As Object, canUseFieldReference As Boolean) As ExpressionSyntax 58Friend Function GenerateNonEnumValueExpression(type As ITypeSymbol, value As Object, canUseFieldReference As Boolean) As ExpressionSyntax 109Private Function GenerateStringLiteralExpression(type As ITypeSymbol, value As String) As ExpressionSyntax 162type As ITypeSymbol, 178type As ITypeSymbol, 225Private Sub DetermineSuffix(type As ITypeSymbol, 275Private Function GenerateDoubleLiteralExpression(type As ITypeSymbol, 300type As ITypeSymbol, 325type As ITypeSymbol, 373Private Function GenerateDecimalLiteralExpression(type As ITypeSymbol, value As Decimal, canUseFieldReference As Boolean) As ExpressionSyntax
CodeGeneration\NamespaceGenerator.vb (2)
128If TypeOf symbol Is ITypeSymbol Then 129Return TryCast(DirectCast(symbol, ITypeSymbol).GenerateTypeSyntax(), NameSyntax)
CodeGeneration\VisualBasicCodeGenerationService.vb (3)
664Private Shared Function UpdateSimpleAsClause(asClause As SimpleAsClauseSyntax, newType As ITypeSymbol) As SimpleAsClauseSyntax 672Private Shared Function UpdateAsClause(asClause As AsClauseSyntax, newType As ITypeSymbol) As AsClauseSyntax 697Public Overrides Function UpdateDeclarationType(Of TDeclarationNode As SyntaxNode)(declaration As TDeclarationNode, newType As ITypeSymbol, options As VisualBasicCodeGenerationContextInfo, cancellationToken As CancellationToken) As TDeclarationNode
CodeGeneration\VisualBasicSyntaxGenerator.vb (3)
166Private Protected Overrides Function GenerateExpression(type As ITypeSymbol, value As Object, canUseFieldReference As Boolean) As SyntaxNode 174Public Overrides Function DefaultExpression(type As ITypeSymbol) As SyntaxNode 407Private Protected Overrides Function TypeExpression(typeSymbol As ITypeSymbol, refKind As RefKind) As SyntaxNode
ITypeSymbolExtensions.vb (3)
14Public Function GenerateExpressionSyntax(typeSymbol As ITypeSymbol) As ExpressionSyntax 59Public Function GetTypeFromPredefinedCastKeyword(compilation As Compilation, castKeyword As SyntaxKind) As ITypeSymbol 102Public Function IsIntrinsicType(this As ITypeSymbol) As Boolean
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\ExpressionSyntaxExtensions.vb\ExpressionSyntaxExtensions.vb (4)
105cancellationToken As CancellationToken) As ITypeSymbol 115Dim returnType As ITypeSymbol = Nothing 144<Out> ByRef returnType As ITypeSymbol) As Boolean 174cancellationToken As CancellationToken) As ITypeSymbol
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ContextQuery\SyntaxTreeExtensions.vb\SyntaxTreeExtensions.vb (2)
326Dim objectCreationType = TryCast(symbolInfo.Symbol, ITypeSymbol) 803Return target.IsType AndAlso DirectCast(target, ITypeSymbol).TypeKind = TypeKind.Enum
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ExpressionSyntaxExtensions.vb\ExpressionSyntaxExtensions.vb (2)
89targetType As ITypeSymbol, 128targetType As ITypeSymbol,
Recommendations\VisualBasicRecommendationServiceRunner.vb (5)
67Public Overrides Function TryGetExplicitTypeOfLambdaParameter(lambdaSyntax As SyntaxNode, ordinalInLambda As Integer, <NotNullWhen(True)> ByRef explicitLambdaParameterType As ITypeSymbol) As Boolean 155Dim typeSymbol = DirectCast(s, ITypeSymbol) 269If container Is Nothing OrElse TryCast(container, ITypeSymbol)?.TypeKind = TypeKind.Enum Then 398Dim isInterface = TryCast(typeOrAssemblySymbol, ITypeSymbol)?.TypeKind = TypeKind.Interface 488Dim type = TryCast(symbol, ITypeSymbol)
SemanticModelExtensions.vb (4)
17cancellationToken As CancellationToken) As IList(Of ITypeSymbol) 22Return results.OfType(Of ITypeSymbol)().ToList() 26Return SpecializedCollections.EmptyList(Of ITypeSymbol)() 203Dim returnType As ITypeSymbol = Nothing
Simplification\Reducers\VisualBasicVariableDeclaratorReducer.vb (4)
85Dim declaredSymbolType As ITypeSymbol = Nothing 90Dim initializerType As ITypeSymbol 114Dim declaredSymbolType As ITypeSymbol = Nothing 145<Out> ByRef typeSymbol As ITypeSymbol) As Boolean
Simplification\VisualBasicSimplificationService.Expander.vb (2)
47Private Function AddCast(expression As ExpressionSyntax, targetType As ITypeSymbol, oldExpression As ExpressionSyntax) As ExpressionSyntax 63Private Function AddCast(expression As ExpressionSyntax, targetType As ITypeSymbol, semanticModel As SemanticModel) As ExpressionSyntax
SpeculationAnalyzer.vb (8)
547Protected Overrides Function ConversionsAreCompatible(originalExpression As ExpressionSyntax, originalTargetType As ITypeSymbol, newExpression As ExpressionSyntax, newTargetType As ITypeSymbol) As Boolean 596Protected Overrides Sub GetForEachSymbols(model As SemanticModel, forEach As ForEachStatementSyntax, ByRef getEnumeratorMethod As IMethodSymbol, ByRef elementType As ITypeSymbol) 602Protected Overrides Function IsReferenceConversion(compilation As Compilation, sourceType As ITypeSymbol, targetType As ITypeSymbol) As Boolean 606Protected Overrides Function ClassifyConversion(model As SemanticModel, expression As ExpressionSyntax, targetType As ITypeSymbol) As Conversion 610Protected Overrides Function ClassifyConversion(model As SemanticModel, originalType As ITypeSymbol, targetType As ITypeSymbol) As Conversion
StringExtensions.vb (2)
47Dim typeSymbol = TryCast(symbol, ITypeSymbol) 95Private Function IsPredefinedType(type As ITypeSymbol) As Boolean
Utilities\IntrinsicOperators\PredefinedCastExpressionDocumentation.vb (1)
9Private ReadOnly _resultingType As ITypeSymbol
VariableDeclaratorSyntaxExtensions.vb (2)
29Public Function Type(variableDeclarator As VariableDeclaratorSyntax, semanticModel As SemanticModel) As ITypeSymbol 33Return TryCast(semanticModel.GetSymbolInfo(asNewType).Symbol, ITypeSymbol)
VisualBasicSemanticFacts.vb (1)
215Public Function IsPartial(typeSymbol As ITypeSymbol, cancellationToken As CancellationToken) As Boolean Implements ISemanticFacts.IsPartial
VisualBasicSemanticFactsService.vb (1)
134Public Function ClassifyConversion(semanticModel As SemanticModel, expression As SyntaxNode, destination As ITypeSymbol) As CommonConversion Implements ISemanticFactsService.ClassifyConversion
VisualBasicSyntaxContextExtensions.vb (1)
123Dim objectCreationType = TryCast(symbolInfo.Symbol, ITypeSymbol)
VisualBasicSyntaxGeneratorInternal.vb (1)
126Public Overrides Function Type(typeSymbol As ITypeSymbol, typeContext As Boolean) As SyntaxNode
VisualBasicTypeInferenceService.TypeInferrer.vb (3)
22Protected Overrides Function IsUnusableType(otherSideType As ITypeSymbol) As Boolean 959lambda As LambdaExpressionSyntax) As ITypeSymbol 982parameterName As String, node As SyntaxNode) As ITypeSymbol
Microsoft.CodeAnalysis.VisualBasic.Workspaces.UnitTests (2)
CodeGeneration\SyntaxGeneratorTests.vb (2)
260VerifySyntax(Of TypeSyntax)(Generator.TupleTypeExpression(New ITypeSymbol() {intType, intType}), "(System.Int32, System.Int32)") 261VerifySyntax(Of TypeSyntax)(Generator.TupleTypeExpression(New ITypeSymbol() {intType, intType}, New String() {"x", "y"}), "(x As System.Int32, y As System.Int32)")
Microsoft.CodeAnalysis.Workspaces (468)
AbstractCodeGenerationService.cs (2)
113public TDeclarationNode UpdateDeclarationType<TDeclarationNode>(TDeclarationNode declaration, ITypeSymbol newType, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode 140public abstract TDeclarationNode UpdateDeclarationType<TDeclarationNode>(TDeclarationNode declaration, ITypeSymbol newType, TCodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode;
AbstractSemanticFactsService.cs (2)
102protected static IMethodSymbol? FindDisposeMethod(Compilation compilation, ITypeSymbol? type, bool isAsync) 178public bool IsPartial(ITypeSymbol typeSymbol, CancellationToken cancellationToken)
AbstractSpeculationAnalyzer.cs (25)
266private bool ImplicitConversionsAreCompatible(TExpressionSyntax originalExpression, ITypeSymbol originalTargetType, TExpressionSyntax newExpression, ITypeSymbol newTargetType) 279protected abstract bool ConversionsAreCompatible(TExpressionSyntax originalExpression, ITypeSymbol originalTargetType, TExpressionSyntax newExpression, ITypeSymbol newTargetType); 688var previousOriginalType = this.OriginalSemanticModel.GetTypeInfo(previousOriginalNode).Type; 689var previousReplacedType = this.SpeculativeSemanticModel.GetTypeInfo(previousReplacedNode).Type; 743GetForEachSymbols(this.OriginalSemanticModel, forEachStatement, out var originalGetEnumerator, out var originalElementType); 744GetForEachSymbols(this.SpeculativeSemanticModel, newForEachStatement, out var newGetEnumerator, out var newElementType); 760protected abstract void GetForEachSymbols(SemanticModel model, TForEachStatementSyntax forEach, out IMethodSymbol getEnumeratorMethod, out ITypeSymbol elementType); 780var expressionType = this.SpeculativeSemanticModel.GetTypeInfo(newForEachStatementExpression, _cancellationToken).ConvertedType; 805var originalThrowExpressionType = this.OriginalSemanticModel.GetTypeInfo(originalThrowExpression).Type; 807var newThrowExpressionType = this.SpeculativeSemanticModel.GetTypeInfo(newThrowExpression).Type; 924var originalTargetType = this.OriginalSemanticModel.GetTypeInfo(originalLeft).Type; 927var newTargetType = this.SpeculativeSemanticModel.GetTypeInfo(newLeft).Type; 935protected abstract bool IsReferenceConversion(Compilation model, ITypeSymbol sourceType, ITypeSymbol targetType); 962var newReceiverType = newReceiver != null 1001var receiverType = semanticModel.GetTypeInfo(receiver).Type; 1167ITypeSymbol originalTargetType, 1169ITypeSymbol newTargetType, 1184var originalConvertedTypeSymbol = this.OriginalSemanticModel.GetTypeInfo(originalExpression).ConvertedType; 1190var newConvertedTypeSymbol = this.SpeculativeSemanticModel.GetTypeInfo(newExpression).ConvertedType; 1198protected abstract TConversion ClassifyConversion(SemanticModel model, TExpressionSyntax expression, ITypeSymbol targetType); 1199protected abstract TConversion ClassifyConversion(SemanticModel model, ITypeSymbol originalType, ITypeSymbol targetType);
AbstractTypeInferenceService.AbstractTypeInferrer.cs (5)
39protected abstract bool IsUnusableType(ITypeSymbol arg); 86protected static IEnumerable<TypeInferenceInfo> CreateResult(ITypeSymbol type) 91protected static IEnumerable<ITypeSymbol> ExpandParamsParameter(IParameterSymbol parameterSymbol) 93var result = new List<ITypeSymbol>(); 113var elementType = parameters.ElementAtOrDefault(0);
AbstractTypeInferenceService.cs (7)
17private static ImmutableArray<ITypeSymbol> InferTypeBasedOnNameIfEmpty( 18SemanticModel semanticModel, ImmutableArray<ITypeSymbol> result, string nameOpt) 43private static ImmutableArray<ITypeSymbol> InferTypeBasedOnName( 48? ImmutableArray.Create<ITypeSymbol>(semanticModel.Compilation.GetSpecialType(SpecialType.System_Boolean)) 49: ImmutableArray<ITypeSymbol>.Empty; 81public ImmutableArray<ITypeSymbol> InferTypes( 93public ImmutableArray<ITypeSymbol> InferTypes(
Classification\ClassificationExtensions.cs (1)
9public static string? GetClassification(this ITypeSymbol type)
Classification\SyntaxClassification\AbstractSyntaxClassifier.cs (1)
18protected static string? GetClassificationForType(ITypeSymbol type)
CodeGenerationAbstractMethodSymbol.cs (7)
46public abstract ITypeSymbol ReturnType { get; } 47public abstract ImmutableArray<ITypeSymbol> TypeArguments { get; } 55public abstract ITypeSymbol GetTypeInferredDuringReduction(ITypeParameterSymbol reducedFromTypeParameter); 56public abstract IMethodSymbol ReduceExtensionMethod(ITypeSymbol receiverType); 66public virtual ITypeSymbol ReceiverType => this.ContainingType; 111public IMethodSymbol Construct(params ITypeSymbol[] typeArguments) 114public IMethodSymbol Construct(ImmutableArray<ITypeSymbol> typeArguments, ImmutableArray<CodeAnalysis.NullableAnnotation> typeArgumentNullableAnnotations)
CodeGenerationAbstractNamedTypeSymbol.cs (3)
58public INamedTypeSymbol Construct(params ITypeSymbol[] typeArguments) 69public INamedTypeSymbol Construct(ImmutableArray<ITypeSymbol> typeArguments, ImmutableArray<NullableAnnotation> typeArgumentNullableAnnotations) 89public abstract ImmutableArray<ITypeSymbol> TypeArguments { get; }
CodeGenerationArrayTypeSymbol.cs (2)
12public CodeGenerationArrayTypeSymbol(ITypeSymbol elementType, int rank, NullableAnnotation nullableAnnotation) 19public ITypeSymbol ElementType { get; }
CodeGenerationConstructedMethodSymbol.cs (6)
14private readonly ImmutableArray<ITypeSymbol> _typeArguments; 18ImmutableArray<ITypeSymbol> typeArguments) 47public override ITypeSymbol ReturnType 56public override ImmutableArray<ITypeSymbol> TypeArguments => _typeArguments; 84public override ITypeSymbol GetTypeInferredDuringReduction(ITypeParameterSymbol reducedFromTypeParameter) 87public override IMethodSymbol ReduceExtensionMethod(ITypeSymbol receiverType)
CodeGenerationConstructedNamedTypeSymbol.cs (3)
16private readonly ImmutableArray<ITypeSymbol> _typeArguments; 20ImmutableArray<ITypeSymbol> typeArguments, 31public override ImmutableArray<ITypeSymbol> TypeArguments => _typeArguments;
CodeGenerationConversionSymbol.cs (1)
24ITypeSymbol toType,
CodeGenerationEventSymbol.cs (2)
17public ITypeSymbol Type { get; } 31ITypeSymbol type,
CodeGenerationFieldSymbol.cs (2)
19public ITypeSymbol Type { get; } 29ITypeSymbol type,
CodeGenerationHelpers.cs (2)
84public static bool IsSpecialType([NotNullWhen(true)] ITypeSymbol? type, SpecialType specialType) 134public static bool TypesMatch(ITypeSymbol? type, object value)
CodeGenerationMethodSymbol.cs (6)
21public override ITypeSymbol ReturnType { get; } 32ITypeSymbol returnType, 100public override ImmutableArray<ITypeSymbol> TypeArguments 101=> this.TypeParameters.As<ITypeSymbol>(); 114public override ITypeSymbol GetTypeInferredDuringReduction(ITypeParameterSymbol reducedFromTypeParameter) 117public override IMethodSymbol ReduceExtensionMethod(ITypeSymbol receiverType)
CodeGenerationNamedTypeSymbol.cs (2)
127public override ImmutableArray<ITypeSymbol> TypeArguments 131return this.TypeParameters.As<ITypeSymbol>();
CodeGenerationOperatorSymbol.cs (1)
25ITypeSymbol returnType,
CodeGenerationParameterSymbol.cs (2)
21public ITypeSymbol Type { get; } 34ITypeSymbol type,
CodeGenerationPointerTypeSymbol.cs (2)
11public ITypeSymbol PointedAtType { get; } 13public CodeGenerationPointerTypeSymbol(ITypeSymbol pointedAtType)
CodeGenerationPropertySymbol.cs (2)
20public ITypeSymbol Type { get; } 35ITypeSymbol type,
CodeGenerationSymbolFactory.cs (19)
35DeclarationModifiers modifiers, ITypeSymbol type, 52ITypeSymbol type, 84ITypeSymbol type, RefKind refKind, ImmutableArray<IPropertySymbol> explicitInterfaceImplementations, string name, 110ITypeSymbol type, string name, 156ITypeSymbol? returnType, 178ITypeSymbol? returnType, 199ITypeSymbol returnType, 224ITypeSymbol toType, 252ITypeSymbol toType, 268public static IParameterSymbol CreateParameterSymbol(ITypeSymbol type, string name) 271public static IParameterSymbol CreateParameterSymbol(RefKind refKind, ITypeSymbol type, string name) 281ImmutableArray<AttributeData> attributes, RefKind refKind, bool isParams, ITypeSymbol type, string name, bool isOptional = false, bool hasDefaultValue = false, object? defaultValue = null) 294ITypeSymbol? type = null, 323name: name, constraintTypes: ImmutableArray.Create<ITypeSymbol>(), 334ImmutableArray<ITypeSymbol> constraintTypes, 349public static IPointerTypeSymbol CreatePointerTypeSymbol(ITypeSymbol pointedAtType) 355public static IArrayTypeSymbol CreateArrayTypeSymbol(ITypeSymbol elementType, int rank = 1, NullableAnnotation nullableAnnotation = NullableAnnotation.None) 465ITypeSymbol returnType, 522ITypeSymbol? returnType = null,
CodeGenerationTypeParameterSymbol.cs (2)
14public ImmutableArray<ITypeSymbol> ConstraintTypes { get; internal set; } 28ImmutableArray<ITypeSymbol> constraintTypes,
CodeGenerationTypeSymbol.cs (6)
56public static ImmutableArray<ITypeSymbol> TupleElementTypes => default; 60public new ITypeSymbol OriginalDefinition => this; 80bool ITypeSymbol.IsRefLikeType => throw new System.NotImplementedException(); 82bool ITypeSymbol.IsUnmanagedType => throw new System.NotImplementedException(); 84bool ITypeSymbol.IsReadOnly => Modifiers.IsReadOnly; 90public ITypeSymbol WithNullableAnnotation(NullableAnnotation nullableAnnotation)
Editing\SymbolEditorExtensions.cs (3)
22ITypeSymbol baseOrInterfaceType, 32baseOrInterfaceType = (ITypeSymbol)(await editor.GetCurrentSymbolAsync(baseOrInterfaceType, cancellationToken).ConfigureAwait(false)); 96ITypeSymbol newBaseType,
Editing\SyntaxGenerator.cs (21)
349private protected abstract SyntaxNode GenerateExpression(ITypeSymbol? type, object? value, bool canUseFieldReference); 1598/// <see langword="true"/> if the language requires a <see cref="TypeExpression(ITypeSymbol)"/> 1600/// <see cref="LocalDeclarationStatement(ITypeSymbol, string, SyntaxNode, bool)"/>. 1623public SyntaxNode LocalDeclarationStatement(ITypeSymbol type, string name, SyntaxNode? initializer = null, bool isConst = false) 1736public SyntaxNode CatchClause(ITypeSymbol type, string identifier, IEnumerable<SyntaxNode> statements) 1775public abstract SyntaxNode DefaultExpression(ITypeSymbol type); 1837public SyntaxNode GenericName(string identifier, IEnumerable<ITypeSymbol> typeArguments) 1849public SyntaxNode GenericName(string identifier, params ITypeSymbol[] typeArguments) 1850=> GenericName(identifier, (IEnumerable<ITypeSymbol>)typeArguments); 1919public SyntaxNode TypeExpression(ITypeSymbol typeSymbol) 1922private protected abstract SyntaxNode TypeExpression(ITypeSymbol typeSymbol, RefKind refKind); 1929public SyntaxNode TypeExpression(ITypeSymbol typeSymbol, bool addImport) 1981public SyntaxNode TupleTypeExpression(IEnumerable<ITypeSymbol> elementTypes, IEnumerable<string>? elementNames = null) 2010public SyntaxNode TupleElementExpression(ITypeSymbol type, string? name = null) 2194public SyntaxNode ObjectCreationExpression(ITypeSymbol type, IEnumerable<SyntaxNode> arguments) 2206public SyntaxNode ObjectCreationExpression(ITypeSymbol type, params SyntaxNode[] arguments) 2261public SyntaxNode IsTypeExpression(SyntaxNode expression, ITypeSymbol type) 2272public SyntaxNode TryCastExpression(SyntaxNode expression, ITypeSymbol type) 2283public SyntaxNode CastExpression(ITypeSymbol type, SyntaxNode expression) 2294public SyntaxNode ConvertExpression(ITypeSymbol type, SyntaxNode expression) 2373public SyntaxNode LambdaParameter(string identifier, ITypeSymbol type)
ExternalAccess\Pythia\Api\PythiaTypeInferenceServiceWrapper.cs (1)
22public ImmutableArray<ITypeSymbol> InferTypes(SemanticModel semanticModel, int position, string? name, CancellationToken cancellationToken)
FindSymbols\Declarations\DeclarationFinder.cs (1)
106if (IsOn(filter, SymbolFilter.Type) && symbol is ITypeSymbol)
FindSymbols\FindReferences\DependentTypeFinder.cs (3)
25/// types based either on <see cref="ITypeSymbol.BaseType"/> or <see cref="ITypeSymbol.Interfaces"/>. 29/// cref="ITypeSymbol"/>'s themselves), walking down is complicated. The general way this works is by using
FindSymbols\FindReferences\Finders\ExplicitConversionSymbolReferenceFinder.cs (1)
23private static INamedTypeSymbol? GetUnderlyingNamedType(ITypeSymbol symbol)
FindSymbols\FindReferences\Finders\ParameterSymbolReferenceFinder.cs (3)
104var convertedType = semanticModel.GetTypeInfo(lambdaNode, cancellationToken).ConvertedType; 128ITypeSymbol convertedType1, 144var convertedType2 = semanticModel.GetTypeInfo(lambdaNode, cancellationToken).ConvertedType;
ForEachSymbols.cs (2)
15public readonly ITypeSymbol ElementType; 21ITypeSymbol elementType)
ICodeGenerationService.cs (1)
119TDeclarationNode UpdateDeclarationType<TDeclarationNode>(TDeclarationNode declaration, ITypeSymbol newType, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode;
ISemanticFacts.cs (1)
88bool IsPartial(ITypeSymbol typeSymbol, CancellationToken cancellationToken);
ISemanticFactsExtensions.cs (1)
118private static bool IsFloatingPoint([NotNullWhen(returnValue: true)] ITypeSymbol? type)
ISemanticFactsService.cs (1)
47CommonConversion ClassifyConversion(SemanticModel semanticModel, SyntaxNode expression, ITypeSymbol destination);
ISymbolExtensions_Accessibility.cs (9)
19ITypeSymbol? throughType = null) 41ITypeSymbol? throughType = null) 53ITypeSymbol? throughType = null) 66ITypeSymbol? throughType, 85ITypeSymbol? throughType, 194foreach (var typeArg in type.TypeArguments) 254ITypeSymbol? throughType, 339ITypeSymbol? throughType, 379var originalThroughType = throughType?.OriginalDefinition;
ITypeGenerator.cs (6)
9ITypeSymbol CreateArrayTypeSymbol(ITypeSymbol elementType, int rank); 10ITypeSymbol CreatePointerTypeSymbol(ITypeSymbol pointedAtType); 11ITypeSymbol Construct(INamedTypeSymbol namedType, ITypeSymbol[] typeArguments);
ITypeInferenceService.cs (4)
29ImmutableArray<ITypeSymbol> InferTypes(SemanticModel semanticModel, SyntaxNode expression, string nameOpt, CancellationToken cancellationToken); 30ImmutableArray<ITypeSymbol> InferTypes(SemanticModel semanticModel, int position, string nameOpt, CancellationToken cancellationToken); 36internal readonly record struct TypeInferenceInfo(ITypeSymbol InferredType, bool IsParams) 38public TypeInferenceInfo(ITypeSymbol type) : this(type, IsParams: false)
ITypeInferenceServiceExtensions.cs (7)
15public static ImmutableArray<ITypeSymbol> InferTypes(this ITypeInferenceService service, SemanticModel semanticModel, SyntaxNode expression, CancellationToken cancellationToken) 18public static ImmutableArray<ITypeSymbol> InferTypes(this ITypeInferenceService service, SemanticModel semanticModel, int position, CancellationToken cancellationToken) 47private static INamedTypeSymbol? GetFirstDelegateType(SemanticModel semanticModel, ImmutableArray<ITypeSymbol> types) 53public static ITypeSymbol? InferType( 65public static ITypeSymbol? InferType( 83public static ITypeSymbol? InferType( 95public static ITypeSymbol? InferType(
ITypeSymbolExtensions.CollectTypeParameterSymbolsVisitor.cs (2)
64foreach (var child in symbol.GetAllTypeArguments()) 93foreach (var constraint in symbol.ConstraintTypes)
ITypeSymbolExtensions.MinimalAccessibilityVisitor.cs (1)
52foreach (var arg in symbol.TypeArguments)
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\INamedTypeSymbolExtensions.cs\INamedTypeSymbolExtensions.cs (2)
35public static IEnumerable<ITypeSymbol> GetAllTypeArguments(this INamedTypeSymbol? symbol) 620public static INamedTypeSymbol TryConstruct(this INamedTypeSymbol type, ITypeSymbol[] typeArguments)
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.cs\ISymbolExtensions.cs (22)
163=> symbol is ITypeSymbol { TypeKind: TypeKind.Error }; 166=> symbol is ITypeSymbol { TypeKind: TypeKind.Module }; 169=> symbol is ITypeSymbol { TypeKind: TypeKind.Interface }; 175=> symbol is ITypeSymbol { IsTupleType: true }; 244=> symbol is ITypeSymbol { TypeKind: TypeKind.Delegate }; 275public static ITypeSymbol? GetMemberType(this ISymbol? symbol) 386public static ImmutableArray<ITypeSymbol> GetTypeArguments(this ISymbol? symbol) 391_ => ImmutableArray.Create<ITypeSymbol>(), 394public static ImmutableArray<ITypeSymbol> GetAllTypeArguments(this ISymbol symbol) 396var results = ArrayBuilder<ITypeSymbol>.GetInstance(); 410=> (symbol as ITypeSymbol)?.IsAttribute() == true; 424public static ITypeSymbol ConvertToType( 429if (symbol is ITypeSymbol type) 501public static Accessibility ComputeResultantAccessibility(this ISymbol? symbol, ITypeSymbol finalDestination) 560public static ITypeSymbol? GetSymbolType(this ISymbol? symbol) 567IAliasSymbol aliasSymbol => aliasSymbol.Target as ITypeSymbol, 568_ => symbol as ITypeSymbol, 579ITypeSymbol? typeSymbol = null; 583typeSymbol = symbol as ITypeSymbol; 612var returnType = getAwaiter.ReturnType; 646var returnType = getEnumerator.ReturnType; 686var returnType = getAsyncEnumerator.ReturnType;
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.cs\ITypeSymbolExtensions.cs (75)
22public static bool IsIntegralType([NotNullWhen(returnValue: true)] this ITypeSymbol? type) 25public static bool IsSignedIntegralType([NotNullWhen(returnValue: true)] this ITypeSymbol? type) 28public static bool CanAddNullCheck([NotNullWhen(returnValue: true)] this ITypeSymbol? type) 39public static IList<INamedTypeSymbol> GetAllInterfacesIncludingThis(this ITypeSymbol type) 53public static bool IsAbstractClass([NotNullWhen(returnValue: true)] this ITypeSymbol? symbol) 56public static bool IsSystemVoid([NotNullWhen(returnValue: true)] this ITypeSymbol? symbol) 59public static bool IsNullable([NotNullWhen(returnValue: true)] this ITypeSymbol? symbol) 62public static bool IsNonNullableValueType([NotNullWhen(returnValue: true)] this ITypeSymbol? symbol) 66[NotNullWhen(true)] this ITypeSymbol? symbol, 67[NotNullWhen(true)] out ITypeSymbol? underlyingType) 79public static bool IsModuleType([NotNullWhen(returnValue: true)] this ITypeSymbol? symbol) 82public static bool IsInterfaceType([NotNullWhen(returnValue: true)] this ITypeSymbol? symbol) 85public static bool IsDelegateType([NotNullWhen(returnValue: true)] this ITypeSymbol? symbol) 88public static bool IsFunctionPointerType([NotNullWhen(returnValue: true)] this ITypeSymbol? symbol) 91public static bool IsStructType([NotNullWhen(returnValue: true)] this ITypeSymbol? symbol) 98this ITypeSymbol type, 112public static IEnumerable<ITypeSymbol> GetBaseTypesAndThis(this ITypeSymbol? type) 114var current = type; 122public static IEnumerable<INamedTypeSymbol> GetBaseTypes(this ITypeSymbol type) 132public static IEnumerable<ITypeSymbol> GetContainingTypesAndThis(this ITypeSymbol? type) 134var current = type; 142public static IEnumerable<INamedTypeSymbol> GetContainingTypes(this ITypeSymbol type) 155this ITypeSymbol type, ITypeSymbol baseType, bool includeInterfaces) 168this ITypeSymbol type, ITypeSymbol baseType) 176this ITypeSymbol type, ITypeSymbol baseType) 178var originalBaseType = baseType.OriginalDefinition; 186IEnumerable<ITypeSymbol> baseTypes = (baseType.TypeKind == TypeKind.Interface) ? type.AllInterfaces : type.GetBaseTypes(); 193this ITypeSymbol type, ITypeSymbol baseType) 195var originalBaseType = baseType.OriginalDefinition; 215this ITypeSymbol type, ITypeSymbol interfaceType) 217var originalInterfaceType = interfaceType.OriginalDefinition; 222this ITypeSymbol type, ITypeSymbol interfaceType) 227public static bool IsAttribute(this ITypeSymbol symbol) 245public static bool IsFormattableStringOrIFormattable([NotNullWhen(returnValue: true)] this ITypeSymbol? symbol) 254this ITypeSymbol typeSymbol, bool allowDelegateAndEnumConstraints = false) 282public static bool IsNumericType([NotNullWhen(returnValue: true)] this ITypeSymbol? type) 308public static Accessibility DetermineMinimalAccessibility(this ITypeSymbol typeSymbol) 311public static bool ContainsAnonymousType([NotNullWhen(returnValue: true)] this ITypeSymbol? symbol) 327foreach (var typeArg in type.GetAllTypeArguments()) 336public static string CreateParameterName(this ITypeSymbol type, bool capitalize = false) 357private static string GetParameterName(ITypeSymbol? type) 370public static bool IsSpecialType([NotNullWhen(returnValue: true)] this ITypeSymbol? symbol) 401public static bool CanSupportCollectionInitializer(this ITypeSymbol typeSymbol, ISymbol within) 412public static INamedTypeSymbol? GetDelegateType(this ITypeSymbol? typeSymbol, Compilation compilation) 419var typeArgument = ((INamedTypeSymbol)typeSymbol).TypeArguments[0]; 432public static IEnumerable<T> GetAccessibleMembersInBaseTypes<T>(this ITypeSymbol containingType, ISymbol within) where T : class, ISymbol 443public static ImmutableArray<T> GetAccessibleMembersInThisAndBaseTypes<T>(this ITypeSymbol? containingType, ISymbol within) where T : class, ISymbol 453public static bool? AreMoreSpecificThan(this IList<ITypeSymbol> t1, IList<ITypeSymbol> t2) 488public static IEnumerable<T> SelectAccessibleMembers<T>(this IEnumerable<ITypeSymbol>? types, ISymbol within) where T : class, ISymbol 498private static IEnumerable<T> SelectAccessibleMembers<T>(this IEnumerable<ITypeSymbol>? types, string memberName, ISymbol within) where T : class, ISymbol 508private static bool? IsMoreSpecificThan(this ITypeSymbol t1, ITypeSymbol t2) 587public static bool IsOrDerivesFromExceptionType([NotNullWhen(returnValue: true)] this ITypeSymbol? type, Compilation compilation) 594foreach (var baseType in type.GetBaseTypesAndThis()) 605foreach (var constraint in ((ITypeParameterSymbol)type).ConstraintTypes) 620public static bool IsEnumType([NotNullWhen(true)] this ITypeSymbol? type) 623public static bool IsEnumType([NotNullWhen(true)] this ITypeSymbol? type, [NotNullWhen(true)] out INamedTypeSymbol? enumType) 635public static bool? IsMutableValueType(this ITypeSymbol type) 637if (type.IsNullable(out var underlyingType)) 714public static bool IsDisposable([NotNullWhen(returnValue: true)] this ITypeSymbol? type, [NotNullWhen(returnValue: true)] ITypeSymbol? iDisposableType) 719public static ITypeSymbol WithNullableAnnotationFrom(this ITypeSymbol type, ITypeSymbol symbolForNullableAnnotation) 723public static ITypeSymbol? RemoveNullableIfPresent(this ITypeSymbol? symbol)
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ITypeSymbolExtensions.cs\ITypeSymbolExtensions.cs (2)
12this ITypeSymbol? type, IList<ITypeParameterSymbol>? result = null) 20this ITypeSymbol? type, IList<ITypeParameterSymbol>? result = null)
NullableSyntaxAnnotation.cs (1)
10/// Annotation placed on <see cref="ITypeSymbol"/>s that the <see cref="SyntaxGenerator"/> converts to a node. This
Recommendations\AbstractRecommendationServiceRunner.cs (19)
44public abstract bool TryGetExplicitTypeOfLambdaParameter(SyntaxNode lambdaSyntax, int ordinalInLambda, [NotNullWhen(returnValue: true)] out ITypeSymbol explicitLambdaParameterType); 96var parameterTypeSymbols = ImmutableArray<ITypeSymbol>.Empty; 98if (TryGetExplicitTypeOfLambdaParameter(lambdaSyntax, parameter.Ordinal, out var explicitLambdaParameterType)) 131private ImmutableArray<ITypeSymbol> SubstituteTypeParameters(ImmutableArray<ITypeSymbol> parameterTypeSymbols, SyntaxNode invocationExpression) 144using var _ = ArrayBuilder<ITypeSymbol>.GetInstance(out var concreteTypes); 150foreach (var parameterTypeSymbol in parameterTypeSymbols) 157var concreteType = typeArguments.ElementAtOrDefault(index); 182private ImmutableArray<ITypeSymbol> GetTypeSymbols( 191using var _ = ArrayBuilder<ITypeSymbol>.GetInstance(out var builder); 197if (!TryGetMatchingParameterTypeForArgument(method, argumentName, ordinalInInvocation, out var type)) 235private bool TryGetMatchingParameterTypeForArgument(IMethodSymbol method, string argumentName, int ordinalInInvocation, out ITypeSymbol parameterType) 331if (unwrapNullable && namespaceOrType is ITypeSymbol typeSymbol) 351if (container is not ITypeSymbol containerType) 380static bool MatchesConstraints(ITypeSymbol originalContainerType, ImmutableArray<ITypeSymbol> constraintTypes) 387foreach (var constraintType in constraintTypes) 396static bool MatchesConstraint(ITypeSymbol originalContainerType, ITypeSymbol originalConstraintType)
Rename\ConflictEngine\DeclarationConflictHelpers.cs (9)
40Func<ISymbol, ImmutableArray<ImmutableArray<ITypeSymbol>>> getAllSignatures) 42var signatureToConflictingMember = new Dictionary<ImmutableArray<ITypeSymbol>, ISymbol>(ConflictingSignatureComparer.Instance); 76private sealed class ConflictingSignatureComparer : IEqualityComparer<ImmutableArray<ITypeSymbol>> 82public bool Equals(ImmutableArray<ITypeSymbol> x, ImmutableArray<ITypeSymbol> y) 85public int GetHashCode(ImmutableArray<ITypeSymbol> obj) 94private static ImmutableArray<ImmutableArray<ITypeSymbol>> GetAllSignatures(ImmutableArray<IParameterSymbol> parameters, bool trimOptionalParameters) 96var resultBuilder = ArrayBuilder<ImmutableArray<ITypeSymbol>>.GetInstance(); 98var signatureBuilder = ArrayBuilder<ITypeSymbol>.GetInstance();
SemanticModelExtensions.cs (4)
153public static string GenerateNameFromType(this SemanticModel semanticModel, ITypeSymbol type, ISyntaxFacts syntaxFacts, bool capitalize) 184private static bool ShouldPluralize(this SemanticModel semanticModel, ITypeSymbol type) 199ImmutableArray<ITypeSymbol> typeArguments, 234public static ITypeSymbol GetType(
Shared\Extensions\IMethodSymbolExtensions.cs (4)
69var mapping = new Dictionary<ITypeSymbol, ITypeSymbol>(SymbolEqualityComparer.Default); 123var mapping = new Dictionary<ITypeSymbol, ITypeSymbol>(SymbolEqualityComparer.Default);
Shared\Extensions\ITypeParameterSymbolExtensions.cs (1)
15private static INamedTypeSymbol? GetNamedTypeSymbol(ITypeSymbol type)
Shared\Extensions\ITypeSymbolExtensions.AnonymousTypeRemover.cs (10)
14private class AnonymousTypeRemover : SymbolVisitor<ITypeSymbol> 21public override ITypeSymbol DefaultVisit(ISymbol node) 24public override ITypeSymbol VisitDynamicType(IDynamicTypeSymbol symbol) 27public override ITypeSymbol VisitArrayType(IArrayTypeSymbol symbol) 29var elementType = symbol.ElementType.Accept(this); 38public override ITypeSymbol VisitFunctionPointerType(IFunctionPointerTypeSymbol symbol) 46public override ITypeSymbol VisitNamedType(INamedTypeSymbol symbol) 58public override ITypeSymbol VisitPointerType(IPointerTypeSymbol symbol) 60var elementType = symbol.PointedAtType.Accept(this); 69public override ITypeSymbol VisitTypeParameter(ITypeParameterSymbol symbol)
Shared\Extensions\ITypeSymbolExtensions.CompilationTypeGenerator.cs (6)
18public ITypeSymbol CreateArrayTypeSymbol(ITypeSymbol elementType, int rank) 21public ITypeSymbol CreatePointerTypeSymbol(ITypeSymbol pointedAtType) 24public ITypeSymbol Construct(INamedTypeSymbol namedType, ITypeSymbol[] typeArguments)
Shared\Extensions\ITypeSymbolExtensions.cs (20)
31this ITypeSymbol typeSymbol, 111for (var currentType = typeSymbol; currentType != null; currentType = currentType.BaseType) 132public static ISymbol? FindImplementations(this ITypeSymbol typeSymbol, ISymbol constructedInterfaceMember, SolutionServices services) 142this ITypeSymbol typeSymbol, 181public static ITypeSymbol? RemoveUnavailableTypeParameters( 182this ITypeSymbol? type, 190private static ITypeSymbol? RemoveUnavailableTypeParameters( 191this ITypeSymbol? type, 199public static ITypeSymbol? RemoveAnonymousTypes( 200this ITypeSymbol? type, 207public static ITypeSymbol? RemoveUnnamedErrorTypes( 208this ITypeSymbol? type, 215public static ITypeSymbol? SubstituteTypes<TType1, TType2>( 216this ITypeSymbol? type, 219where TType1 : ITypeSymbol 220where TType2 : ITypeSymbol 226public static ITypeSymbol? SubstituteTypes<TType1, TType2>( 227this ITypeSymbol? type, 230where TType1 : ITypeSymbol 231where TType2 : ITypeSymbol
Shared\Extensions\ITypeSymbolExtensions.SubstituteTypesVisitor.cs (18)
15private class SubstituteTypesVisitor<TType1, TType2> : SymbolVisitor<ITypeSymbol> 16where TType1 : ITypeSymbol 17where TType2 : ITypeSymbol 31public override ITypeSymbol DefaultVisit(ISymbol node) 34private ITypeSymbol VisitType(ITypeSymbol symbol) 44public override ITypeSymbol VisitDynamicType(IDynamicTypeSymbol symbol) 47public override ITypeSymbol VisitTypeParameter(ITypeParameterSymbol symbol) 50public override ITypeSymbol VisitFunctionPointerType(IFunctionPointerTypeSymbol symbol) 57public override ITypeSymbol VisitNamedType(INamedTypeSymbol symbol) 59var mapped = VisitType(symbol); 78var updatedContainingType = symbol.ContainingType?.Accept(this); 95public override ITypeSymbol VisitArrayType(IArrayTypeSymbol symbol) 97var mapped = VisitType(symbol); 103var elementType = symbol.ElementType.Accept(this); 112public override ITypeSymbol VisitPointerType(IPointerTypeSymbol symbol) 114var mapped = VisitType(symbol); 120var pointedAtType = symbol.PointedAtType.Accept(this);
Shared\Extensions\ITypeSymbolExtensions.UnavailableTypeParameterRemover.cs (10)
15private class UnavailableTypeParameterRemover : SymbolVisitor<ITypeSymbol> 26public override ITypeSymbol DefaultVisit(ISymbol node) 29public override ITypeSymbol VisitDynamicType(IDynamicTypeSymbol symbol) 32public override ITypeSymbol VisitArrayType(IArrayTypeSymbol symbol) 34var elementType = symbol.ElementType.Accept(this); 43public override ITypeSymbol VisitFunctionPointerType(IFunctionPointerTypeSymbol symbol) 49public override ITypeSymbol VisitNamedType(INamedTypeSymbol symbol) 60public override ITypeSymbol VisitPointerType(IPointerTypeSymbol symbol) 62var elementType = symbol.PointedAtType.Accept(this); 71public override ITypeSymbol VisitTypeParameter(ITypeParameterSymbol symbol)
Shared\Extensions\ITypeSymbolExtensions.UnnamedErrorTypeRemover.cs (10)
14private class UnnamedErrorTypeRemover : SymbolVisitor<ITypeSymbol> 21public override ITypeSymbol DefaultVisit(ISymbol node) 24public override ITypeSymbol VisitDynamicType(IDynamicTypeSymbol symbol) 27public override ITypeSymbol VisitArrayType(IArrayTypeSymbol symbol) 29var elementType = symbol.ElementType.Accept(this); 38public override ITypeSymbol VisitFunctionPointerType(IFunctionPointerTypeSymbol symbol) 44public override ITypeSymbol VisitNamedType(INamedTypeSymbol symbol) 60public override ITypeSymbol VisitPointerType(IPointerTypeSymbol symbol) 62var elementType = symbol.PointedAtType.Accept(this); 71public override ITypeSymbol VisitTypeParameter(ITypeParameterSymbol symbol)
Shared\Extensions\SemanticModelExtensions.cs (4)
23private static ISymbol? MapSymbol(ISymbol? symbol, ITypeSymbol? type) 55methodSymbol.ContainingType is ITypeSymbol containingType) 88ITypeSymbol? type = null; 89ITypeSymbol? convertedType = null;
Shared\Extensions\SyntaxGeneratorExtensions.cs (2)
227var parameterType = parameter.Type; 584var throughMemberType = throughMember.GetMemberType();
Shared\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (5)
227var memberType = member.GetSymbolType(); 356public static string? GetLocalName(this ITypeSymbol containingType, string? fallback = "v") 380private static bool ImplementsIEquatable(ITypeSymbol memberType, INamedTypeSymbol iequatableType) 393private static bool ShouldUseEqualityOperator(ITypeSymbol typeSymbol) 397if (typeSymbol.IsNullable(out var underlyingType))
Shared\Extensions\TokenSemanticInfo.cs (4)
22public readonly ITypeSymbol Type; 23public readonly ITypeSymbol ConvertedType; 30ITypeSymbol type, 31ITypeSymbol convertedType,
Shared\Utilities\SignatureComparer.cs (1)
25private IEqualityComparer<ITypeSymbol> SignatureTypeEquivalenceComparer => _symbolEquivalenceComparer.SignatureTypeEquivalenceComparer;
SymbolEquivalenceComparer.cs (1)
180=> symbol.IsKind(SymbolKind.NamedType, out ITypeSymbol? typeSymbol) && typeSymbol.SpecialType == SpecialType.System_Object;
SymbolEquivalenceComparer.EquivalenceVisitor.cs (4)
110private bool NullableAnnotationsEquivalent(ITypeSymbol x, ITypeSymbol y) 479private bool TypeArgumentsAreEquivalent(ImmutableArray<ITypeSymbol> xTypeArguments, ImmutableArray<ITypeSymbol> yTypeArguments, Dictionary<INamedTypeSymbol, INamedTypeSymbol>? equivalentTypesWithDifferingAssemblies)
SymbolEquivalenceComparer.GetHashCodeVisitor.cs (2)
50return Hash.Combine(GetNullableAnnotationsHashCode((ITypeSymbol)x), Hash.Combine(typeof(IDynamicTypeSymbol), currentHash)); 56private int GetNullableAnnotationsHashCode(ITypeSymbol type)
SymbolEquivalenceComparer.SignatureTypeSymbolEquivalenceComparer.cs (6)
11internal class SignatureTypeSymbolEquivalenceComparer : IEqualityComparer<ITypeSymbol?> 18public bool Equals(ITypeSymbol? x, ITypeSymbol? y) 21public bool Equals(ITypeSymbol? x, ITypeSymbol? y, Dictionary<INamedTypeSymbol, INamedTypeSymbol>? equivalentTypesWithDifferingAssemblies) 24public int GetHashCode(ITypeSymbol? x)
SymbolKey.AnonymousTypeSymbolKey.cs (1)
41using var propertyTypes = reader.ReadSymbolKeyArray<INamedTypeSymbol, ITypeSymbol>(
SymbolKey.ArrayTypeSymbolKey.cs (2)
32foreach (var typeSymbol in elementTypeResolution.OfType<ITypeSymbol>())
SymbolKey.BuiltinOperatorSymbolKey.cs (3)
30using var parameterTypes = reader.ReadSymbolKeyArray<IMethodSymbol, ITypeSymbol>( 47var returnTypeSymbol = (ITypeSymbol?)returnType.GetAnySymbol();
SymbolKey.ErrorTypeSymbolKey.cs (2)
45visitor.WriteSymbolKeyArray(ImmutableArray<ITypeSymbol>.Empty); 73using var typeArguments = reader.ReadSymbolKeyArray<INamedTypeSymbol, ITypeSymbol>(
SymbolKey.FunctionPointerTypeSymbolKey.cs (2)
58using var parameterTypes = reader.ReadSymbolKeyArray<IFunctionPointerTypeSymbol, ITypeSymbol>( 78if (returnType.GetAnySymbol() is not ITypeSymbol returnTypeSymbol)
SymbolKey.MethodSymbolKey.cs (6)
45foreach (var receiverType in receiverTypeResolution.OfType<ITypeSymbol>()) 71using var typeArguments = reader.ReadSymbolKeyArray<IMethodSymbol, ITypeSymbol>( 224_ = reader.ReadSymbolKeyArray<IMethodSymbol, ITypeSymbol>( 247var returnType = (ITypeSymbol?)reader.ReadSymbolKey(contextualSymbol: method.ReturnType, out _).GetAnySymbol();
SymbolKey.NamedTypeSymbolKey.cs (7)
34visitor.WriteSymbolKeyArray(ImmutableArray<ITypeSymbol>.Empty); 47using var typeArguments = reader.ReadSymbolKeyArray<INamedTypeSymbol, ITypeSymbol>( 63? Array.Empty<ITypeSymbol>() 88ITypeSymbol[] typeArgumentsArray, 138ITypeSymbol[] typeArgumentsArray, 165ITypeSymbol[] typeArguments) 189private static INamedTypeSymbol Construct(INamedTypeSymbol type, bool isUnboundGenericType, ITypeSymbol[] typeArguments)
SymbolKey.PointerTypeSymbolKey.cs (2)
34foreach (var typeSymbol in pointedAtTypeResolution.OfType<ITypeSymbol>())
SymbolKey.PropertySymbolKey.cs (1)
67_ = reader.ReadSymbolKeyArray<IPropertySymbol, ITypeSymbol>(
SymbolKey.SymbolKeyReader.cs (2)
383Func<TOwningSymbol, int, ITypeSymbol?> getContextualType, 387using var originalParameterTypes = this.ReadSymbolKeyArray<TOwningSymbol, ITypeSymbol>(owningSymbol, getContextualType, out _);
SymbolKey.TupleTypeSymbolKey.cs (1)
98using var elementTypes = reader.ReadSymbolKeyArray<INamedTypeSymbol, ITypeSymbol>(
SymbolSpecification.cs (1)
400SymbolCategory.Type => symbol is ITypeSymbol type && type.TypeKind == (TypeKind)_kind,
SyntaxContext.cs (1)
54public ImmutableArray<ITypeSymbol> InferredTypes { get; }
SyntaxGeneratorExtensions.cs (2)
62ITypeSymbol type) 72private static ITypeSymbol GetType(Compilation compilation, ISymbol symbol)
SyntaxGeneratorExtensions_Negate.cs (1)
429var type = variableExpression.Type;
SyntaxGeneratorInternal.cs (2)
77/// Produces an appropriate TypeSyntax for the given <see cref="ITypeSymbol"/>. The <paramref name="typeContext"/> 91public abstract SyntaxNode Type(ITypeSymbol typeSymbol, bool typeContext);
TypeGenerator.cs (6)
15public ITypeSymbol CreateArrayTypeSymbol(ITypeSymbol elementType, int rank) 18public ITypeSymbol CreatePointerTypeSymbol(ITypeSymbol pointedAtType) 21public ITypeSymbol Construct(INamedTypeSymbol namedType, ITypeSymbol[] typeArguments)
Workspace\Solution\SolutionState.UnrootedSymbolSet.cs (3)
46public readonly WeakReference<ITypeSymbol?> PrimaryDynamicSymbol; 58WeakReference<ITypeSymbol?> primaryDynamicSymbol, 73var primaryDynamic = new WeakReference<ITypeSymbol?>(
Microsoft.CodeAnalysis.Workspaces.UnitTests (6)
FindReferencesTests.cs (1)
502var constraint = comp.GetTypeByMetadataName("C`1").TypeParameters.Single().ConstraintTypes.Single();
SymbolKeyTests.cs (5)
1024var propType = symbol.Type; 1059var propType = symbol.Type; 1106var propType = symbol.Type; 1153var propType = symbol.Type; 1207var symbol = semanticModel.GetTypeInfo(node).Type;
Microsoft.VisualStudio.LanguageServices (24)
ChangeSignature\AddParameterDialogViewModel.cs (3)
56public ITypeSymbol? TypeSymbol { get; set; } 230private bool DoesTypeFullyBind(ITypeSymbol? type) 237foreach (var typeArgument in type.GetTypeArguments())
Library\ObjectBrowser\AbstractDescriptionBuilder.cs (2)
89protected void AddTypeLink(ITypeSymbol typeSymbol, LinkFlags flags) 275else if (containingSymbol is ITypeSymbol typeSymbol)
Library\ObjectBrowser\Extensions.cs (1)
48public static string GetTypeNavInfoNameOrEmpty(this ITypeSymbol typeSymbol)
Library\VsNavInfo\NavInfoFactory.cs (3)
46case ITypeSymbol typeSymbol: 74public IVsNavInfo CreateForType(ITypeSymbol typeSymbol, Project project, Compilation compilation, bool useExpandedHierarchy = false) 233private string GetClassName(ITypeSymbol typeSymbol)
Progression\GraphBuilder.cs (1)
484if (symbol is ITypeSymbol typeSymbol && typeSymbol.IsAnonymousType)
Progression\GraphNodeCreation.cs (1)
42return await GraphNodeIdCreation.GetIdForTypeAsync((ITypeSymbol)symbol, solution, cancellationToken).ConfigureAwait(false);
Progression\GraphNodeIdCreation.cs (10)
52internal static async Task<GraphNodeId> GetIdForTypeAsync(ITypeSymbol symbol, Solution solution, CancellationToken cancellationToken) 67private static async Task<IEnumerable<GraphNodeId>> GetPartialsForNamespaceAndTypeAsync(ITypeSymbol symbol, bool includeNamespace, Solution solution, CancellationToken cancellationToken, bool isInGenericArguments = false) 77var underlyingType = ChaseToUnderlyingType(symbol); 122private static async Task<GraphNodeId> GetPartialForTypeAsync(ITypeSymbol symbol, GraphNodeIdName nodeName, Solution solution, CancellationToken cancellationToken, bool isInGenericArguments = false) 192foreach (var arg in namedType.TypeArguments) 239var underlyingType = ChaseToUnderlyingType(arrayType); 272private static ITypeSymbol ChaseToUnderlyingType(ITypeSymbol symbol) 375if (symbol is not ITypeSymbol typeSymbol) 380var underlyingType = ChaseToUnderlyingType(typeSymbol);
ProjectSystem\AbstractEntryPointFinder.cs (1)
62var elementType = ((IArrayTypeSymbol)parameter.Type).ElementType;
Venus\ContainedLanguageCodeSupport.cs (2)
103var eventType = ((IEventSymbol)eventMember).Type; 178var eventType = ((IEventSymbol)eventMember).Type;
Microsoft.VisualStudio.LanguageServices.CSharp (28)
CodeModel\CSharpCodeModelService.cs (16)
679var typeSymbol = GetTypeSymbolFromFullName(typeName, compilation); 696public override EnvDTE.vsCMTypeRef GetTypeKindForCodeTypeRef(ITypeSymbol typeSymbol) 769public override string GetAsFullNameForCodeTypeRef(ITypeSymbol typeSymbol) 772public override string GetAsStringForCodeTypeRef(ITypeSymbol typeSymbol) 2719public override SyntaxNode SetType(SyntaxNode node, ITypeSymbol? typeSymbol) 3017protected override ITypeSymbol? GetTypeSymbolFromPartialName(string partialName, SemanticModel semanticModel, int position) 3024public override ITypeSymbol? GetTypeSymbolFromFullName(string fullName, Compilation compilation) 3026ITypeSymbol? typeSymbol = compilation.GetTypeByMetadataName(fullName); 3067public override SyntaxNode CreateReturnDefaultValueStatement(ITypeSymbol type) 3694private static TypeDeclarationSyntax InsertIntoBaseList(TypeDeclarationSyntax typeDeclaration, ITypeSymbol typeSymbol, SemanticModel semanticModel, int insertionIndex) 3712public override bool IsValidBaseType(SyntaxNode node, ITypeSymbol typeSymbol) 3726public override SyntaxNode AddBase(SyntaxNode node, ITypeSymbol typeSymbol, SemanticModel semanticModel, int? position) 3759public override SyntaxNode RemoveBase(SyntaxNode node, ITypeSymbol typeSymbol, SemanticModel semanticModel) 3809public override bool IsValidInterfaceType(SyntaxNode node, ITypeSymbol typeSymbol) 3819public override SyntaxNode AddImplementedInterface(SyntaxNode node, ITypeSymbol typeSymbol, SemanticModel semanticModel, int? position) 3854public override SyntaxNode RemoveImplementedInterface(SyntaxNode node, ITypeSymbol typeSymbol, SemanticModel semanticModel)
CodeModel\MethodXml\MethodXmlBuilder.cs (7)
144var typeSymbol = SemanticModel.GetTypeInfo(type).Type; 255var type = SemanticModel.GetTypeInfo(expression).Type; 375var type = SemanticModel.GetTypeInfo(castExpression.Type).Type; 391if (SemanticModel.GetSymbolInfo(objectCreationExpression.Type).Symbol is not ITypeSymbol type) 414var type = SemanticModel.GetTypeInfo(arrayCreationExpression).Type; 502GenerateType((ITypeSymbol)leftHandSymbol); 569var type = SemanticModel.GetTypeInfo(typeOfExpression.Type).Type;
LanguageService\CSharpHelpContextService.cs (2)
534if (symbol is ITypeSymbol type && type.OriginalDefinition.SpecialType == SpecialType.System_Nullable_T) 552if (symbol is ITypeSymbol or INamespaceSymbol)
ObjectBrowser\DescriptionBuilder.cs (1)
380foreach (var constraintType in typeParameterSymbol.ConstraintTypes)
Progression\CSharpProgressionLanguageService.cs (2)
104var typeToShow = GetType(symbol); 119private static ITypeSymbol GetType(ISymbol symbol)
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (4)
GlyphExtensionsTests.cs (4)
184ITypeSymbol elementType = null, 186ITypeSymbol pointedAtType = null, 201ITypeSymbol elementType = null, 203ITypeSymbol pointedAtType = null,
Microsoft.VisualStudio.LanguageServices.Implementation (96)
CodeModel\AbstractCodeModelObject_CodeGen.cs (4)
85private protected SyntaxNode CreateEventDeclaration(SyntaxNode containerNode, string name, EnvDTE.vsCMAccess access, ITypeSymbol type, CodeGenerationOptions options, bool createPropertyStyleEvent) 131private protected SyntaxNode CreateFieldDeclaration(SyntaxNode containerNode, string name, EnvDTE.vsCMAccess access, ITypeSymbol type, CodeGenerationOptions options) 146private protected SyntaxNode CreateMethodDeclaration(SyntaxNode containerNode, string name, EnvDTE.vsCMAccess access, ITypeSymbol returnType, CodeGenerationOptions options) 180ITypeSymbol type,
CodeModel\AbstractCodeModelService.cs (19)
257public EnvDTE.CodeElement CreateCodeType(CodeModelState state, ProjectId projectId, ITypeSymbol typeSymbol) 311public abstract EnvDTE.vsCMTypeRef GetTypeKindForCodeTypeRef(ITypeSymbol typeSymbol); 312public abstract string GetAsFullNameForCodeTypeRef(ITypeSymbol typeSymbol); 313public abstract string GetAsStringForCodeTypeRef(ITypeSymbol typeSymbol); 544protected EnvDTE.vsCMElement GetElementKind(ITypeSymbol typeSymbol) 574CodeModelState state, Project project, ITypeSymbol typeSymbol, [NotNullWhen(true)] out EnvDTE.CodeElement? element) 733public abstract SyntaxNode SetType(SyntaxNode node, ITypeSymbol? typeSymbol); 804private ITypeSymbol GetSpecialType(EnvDTE.vsCMTypeRef type, Compilation compilation) 807protected abstract ITypeSymbol? GetTypeSymbolFromPartialName(string partialName, SemanticModel semanticModel, int position); 808public abstract ITypeSymbol? GetTypeSymbolFromFullName(string fullName, Compilation compilation); 810public ITypeSymbol GetTypeSymbol(object type, SemanticModel semanticModel, int position) 812ITypeSymbol? typeSymbol; 851public abstract SyntaxNode CreateReturnDefaultValueStatement(ITypeSymbol type); 1295public abstract bool IsValidBaseType(SyntaxNode node, ITypeSymbol typeSymbol); 1296public abstract SyntaxNode AddBase(SyntaxNode node, ITypeSymbol typeSymbol, SemanticModel semanticModel, int? position); 1297public abstract SyntaxNode RemoveBase(SyntaxNode node, ITypeSymbol typeSymbol, SemanticModel semanticModel); 1299public abstract bool IsValidInterfaceType(SyntaxNode node, ITypeSymbol typeSymbol); 1300public abstract SyntaxNode AddImplementedInterface(SyntaxNode node, ITypeSymbol typeSymbol, SemanticModel semanticModel, int? position); 1301public abstract SyntaxNode RemoveImplementedInterface(SyntaxNode node, ITypeSymbol typeSymbol, SemanticModel semanticModel);
CodeModel\CodeTypeRef.cs (6)
32internal static EnvDTE.CodeTypeRef Create(CodeModelState state, object parent, ProjectId projectId, ITypeSymbol typeSymbol) 42private CodeTypeRef(CodeModelState state, object parent, ProjectId projectId, ITypeSymbol typeSymbol) 50internal ITypeSymbol LookupTypeSymbol() 52if (CodeModelService.ResolveSymbol(this.State.Workspace, _projectId, _symbolId) is not ITypeSymbol typeSymbol) 92var typeSymbol = LookupTypeSymbol(); 131var typeSymbol = LookupTypeSymbol();
CodeModel\Collections\BasesCollection.cs (8)
62private ITypeSymbol LookupSymbol() 66return semanticModel.GetDeclaredSymbol(node) as ITypeSymbol; 69private IEnumerable<ITypeSymbol> GetBaseTypes() 71var symbol = LookupSymbol(); 83return SpecializedCollections.SingletonEnumerable<ITypeSymbol>(symbol.BaseType); 92var child = baseTypes.ElementAt(index); 114foreach (var child in GetBaseTypes()) 133var symbol = LookupSymbol();
CodeModel\Collections\ExternalMemberCollection.cs (3)
26ITypeSymbol typeSymbol) 36private ExternalMemberCollection(CodeModelState state, object parent, ProjectId projectId, ITypeSymbol typeSymbol) 53if (_typeSymbolId.Resolve(project.GetCompilationAsync().Result).Symbol is not ITypeSymbol typeSymbol)
CodeModel\ExternalElements\AbstractExternalCodeType.cs (6)
20internal AbstractExternalCodeType(CodeModelState state, ProjectId projectId, ITypeSymbol symbol) 25protected internal ITypeSymbol TypeSymbol 27get { return (ITypeSymbol)LookupSymbol(); } 35var type = TypeSymbol; 62var typeSymbol = TypeSymbol; 114var currentType = TypeSymbol;
CodeModel\ExternalElements\ExternalCodeClass.cs (2)
20internal static EnvDTE.CodeClass Create(CodeModelState state, ProjectId projectId, ITypeSymbol typeSymbol) 26private ExternalCodeClass(CodeModelState state, ProjectId projectId, ITypeSymbol typeSymbol)
CodeModel\ExternalElements\ExternalCodeDelegate.cs (2)
19internal static EnvDTE.CodeDelegate Create(CodeModelState state, ProjectId projectId, ITypeSymbol typeSymbol) 25private ExternalCodeDelegate(CodeModelState state, ProjectId projectId, ITypeSymbol symbol)
CodeModel\ExternalElements\ExternalCodeEnum.cs (2)
21internal static EnvDTE.CodeEnum Create(CodeModelState state, ProjectId projectId, ITypeSymbol typeSymbol) 27private ExternalCodeEnum(CodeModelState state, ProjectId projectId, ITypeSymbol typeSymbol)
CodeModel\ExternalElements\ExternalCodeInterface.cs (2)
20internal static EnvDTE.CodeInterface Create(CodeModelState state, ProjectId projectId, ITypeSymbol typeSymbol) 26private ExternalCodeInterface(CodeModelState state, ProjectId projectId, ITypeSymbol typeSymbol)
CodeModel\ExternalElements\ExternalCodeStruct.cs (2)
20internal static EnvDTE.CodeStruct Create(CodeModelState state, ProjectId projectId, ITypeSymbol typeSymbol) 26private ExternalCodeStruct(CodeModelState state, ProjectId projectId, ITypeSymbol typeSymbol)
CodeModel\ExternalElements\ExternalCodeUnknown.cs (2)
17internal static EnvDTE.CodeElement Create(CodeModelState state, ProjectId projectId, ITypeSymbol typeSymbol) 23private ExternalCodeUnknown(CodeModelState state, ProjectId projectId, ITypeSymbol typeSymbol)
CodeModel\ExternalElements\ExternalCodeVariable.cs (2)
29private ITypeSymbol GetSymbolType() 88var type = GetSymbolType();
CodeModel\FileCodeModel_CodeGen.cs (11)
170var typeSymbol = CodeModelService.GetTypeSymbol(type, this.GetSemanticModel(), containerNode.SpanStart); 267var type = (ITypeSymbol?)semanticModel.GetDeclaredSymbol(containerNode); 314var returnType = kind == EnvDTE.vsCMFunction.vsCMFunctionFunction 398var propertyType = CodeModelService.GetTypeSymbol(type, semanticModel, containerNodePosition); 448var fieldType = CodeModelService.GetTypeSymbol(type, semanticModel, containerNodePosition); 656var typeSymbol = codeTypeRef != null 701var typeSymbol = CodeModelService.GetTypeSymbol(@base, semanticModel, node.SpanStart); 724var typeSymbol = CodeModelService.GetTypeSymbol(element, semanticModel, node.SpanStart); 737var typeSymbol = CodeModelService.GetTypeSymbol(@base, semanticModel, node.SpanStart); 762var typeSymbol = CodeModelService.GetTypeSymbol(element, semanticModel, node.SpanStart);
CodeModel\ICodeModelService.cs (14)
88EnvDTE.CodeElement CreateCodeType(CodeModelState state, ProjectId projectId, ITypeSymbol typeSymbol); 95EnvDTE.vsCMTypeRef GetTypeKindForCodeTypeRef(ITypeSymbol typeSymbol); 96string GetAsFullNameForCodeTypeRef(ITypeSymbol typeSymbol); 97string GetAsStringForCodeTypeRef(ITypeSymbol typeSymbol); 262SyntaxNode SetType(SyntaxNode node, ITypeSymbol? typeSymbol); 286ITypeSymbol GetTypeSymbol(object type, SemanticModel semanticModel, int position); 288ITypeSymbol? GetTypeSymbolFromFullName(string fullName, Compilation compilation); 290SyntaxNode CreateReturnDefaultValueStatement(ITypeSymbol type); 368bool IsValidBaseType(SyntaxNode node, ITypeSymbol typeSymbol); 369SyntaxNode AddBase(SyntaxNode node, ITypeSymbol typeSymbol, SemanticModel semanticModel, int? position); 370SyntaxNode RemoveBase(SyntaxNode node, ITypeSymbol typeSymbol, SemanticModel semanticModel); 372bool IsValidInterfaceType(SyntaxNode node, ITypeSymbol typeSymbol); 373SyntaxNode AddImplementedInterface(SyntaxNode node, ITypeSymbol typeSymbol, SemanticModel semanticModel, int? position); 374SyntaxNode RemoveImplementedInterface(SyntaxNode node, ITypeSymbol typeSymbol, SemanticModel semanticModel);
CodeModel\InternalElements\CodeParameter.cs (2)
196var type = this.ParameterSymbol.Type; 199var elementType = type is IArrayTypeSymbol
CodeModel\InternalElements\CodeVariable.cs (2)
60private ITypeSymbol GetSymbolType() 138var type = GetSymbolType();
CodeModel\MetadataNameHelpers.cs (2)
63public static string GetMetadataName(ITypeSymbol typeSymbol) 87if (symbol.ContainingSymbol is ITypeSymbol)
CodeModel\MethodXml\AbstractMethodXmlBuilder.cs (3)
364protected string GetTypeName(ITypeSymbol typeSymbol) 386protected void GenerateType(ITypeSymbol type, bool? @implicit = null, bool assemblyQualify = false) 419protected void GenerateNumber(object value, ITypeSymbol type)
CodeModel\RootCodeModel.cs (2)
142var typeSymbol = CodeModelService.GetTypeSymbolFromFullName(name, compilation); 165var typeSymbol = CodeModelService.GetTypeSymbolFromFullName(languageName, compilation);
Microsoft.VisualStudio.LanguageServices.VisualBasic (32)
CodeModel\MethodXML\MethodXmlBuilder.vb (4)
294Dim type = TryCast(SemanticModel.GetSymbolInfo(objectCreationExpression.Type).Symbol, ITypeSymbol) 383GenerateType(DirectCast(leftHandSymbol, ITypeSymbol)) 478Private Function TryGenerateCast(type As ITypeSymbol, expression As ExpressionSyntax, Optional specialCastKind As SpecialCastKind? = Nothing) As Boolean 575Private Function TryGenerateNewArray(arrayBounds As ArgumentListSyntax, initializer As ExpressionSyntax, type As ITypeSymbol) As Boolean
CodeModel\VisualBasicCodeModelService.vb (24)
750Public Overrides Function GetTypeKindForCodeTypeRef(typeSymbol As ITypeSymbol) As EnvDTE.vsCMTypeRef 819Public Overrides Function GetAsFullNameForCodeTypeRef(typeSymbol As ITypeSymbol) As String 823Public Overrides Function GetAsStringForCodeTypeRef(typeSymbol As ITypeSymbol) As String 2973Private Shared Function SetDelegateType(delegateStatement As DelegateStatementSyntax, typeSymbol As ITypeSymbol) As DelegateStatementSyntax 3023Private Shared Function SetEventType(eventStatement As EventStatementSyntax, typeSymbol As ITypeSymbol) As EventStatementSyntax 3056Private Shared Function SetEventType(eventBlock As EventBlockSyntax, typeSymbol As ITypeSymbol) As EventBlockSyntax 3137Private Shared Function SetMethodType(declareStatement As DeclareStatementSyntax, typeSymbol As ITypeSymbol) As DeclareStatementSyntax 3193Private Shared Function SetMethodType(methodStatement As MethodStatementSyntax, typeSymbol As ITypeSymbol) As MethodStatementSyntax 3247Private Shared Function SetMethodType(methodBlock As MethodBlockSyntax, typeSymbol As ITypeSymbol) As MethodBlockSyntax 3276Private Shared Function SetParameterType(parameter As ParameterSyntax, typeSymbol As ITypeSymbol) As ParameterSyntax 3305Private Shared Function SetPropertyType(propertyStatement As PropertyStatementSyntax, typeSymbol As ITypeSymbol) As PropertyStatementSyntax 3334Private Shared Function SetPropertyType(propertyBlock As PropertyBlockSyntax, typeSymbol As ITypeSymbol) As PropertyBlockSyntax 3388Private Shared Function SetVariableType(variableDeclarator As VariableDeclaratorSyntax, typeSymbol As ITypeSymbol) As VariableDeclaratorSyntax 3417Public Overrides Function SetType(node As SyntaxNode, typeSymbol As ITypeSymbol) As SyntaxNode 3627Public Overrides Function GetTypeSymbolFromFullName(fullName As String, compilation As Compilation) As ITypeSymbol 3628Dim typeSymbol As ITypeSymbol = compilation.GetTypeByMetadataName(fullName) 3671Protected Overrides Function GetTypeSymbolFromPartialName(partialName As String, semanticModel As SemanticModel, position As Integer) As ITypeSymbol 3677Public Overrides Function CreateReturnDefaultValueStatement(type As ITypeSymbol) As SyntaxNode 4245Public Overrides Function IsValidBaseType(node As SyntaxNode, typeSymbol As ITypeSymbol) As Boolean 4255Public Overrides Function AddBase(node As SyntaxNode, typeSymbol As ITypeSymbol, semanticModel As SemanticModel, position As Integer?) As SyntaxNode 4281Public Overrides Function RemoveBase(node As SyntaxNode, typeSymbol As ITypeSymbol, semanticModel As SemanticModel) As SyntaxNode 4313Public Overrides Function IsValidInterfaceType(node As SyntaxNode, typeSymbol As ITypeSymbol) As Boolean 4321Public Overrides Function AddImplementedInterface(node As SyntaxNode, typeSymbol As ITypeSymbol, semanticModel As SemanticModel, position As Integer?) As SyntaxNode 4353Public Overrides Function RemoveImplementedInterface(node As SyntaxNode, typeSymbol As ITypeSymbol, semanticModel As SemanticModel) As SyntaxNode
CodeModel\VisualBasicCodeModelService_Prototype.vb (1)
210Private Shared Sub AppendType(builder As StringBuilder, type As ITypeSymbol, flags As PrototypeFlags)
Help\VisualBasicHelpContextService.vb (1)
112If TypeOf symbol Is ITypeSymbol OrElse TypeOf symbol Is INamespaceSymbol Then
Help\VisualBasicHelpContextService.Visitor.vb (2)
450ElseIf TypeOf symbol Is ITypeSymbol AndAlso DirectCast(symbol, ITypeSymbol).SpecialType <> SpecialType.None Then