2 implementations of Type
Microsoft.CodeAnalysis.CSharp (1)
Symbols\PublicModel\ParameterSymbol.cs (1)
26ITypeSymbol IParameterSymbol.Type
Microsoft.CodeAnalysis.VisualBasic (1)
Symbols\ParameterSymbol.vb (1)
318Private ReadOnly Property IParameterSymbol_Type As ITypeSymbol Implements IParameterSymbol.Type
725 references to Type
Aspire.Hosting.Analyzers (1)
AppHostAnalyzer.cs (1)
84SymbolEqualityComparer.Default.Equals(parameterData.Symbol.Type, wellKnownTypes.Get(SpecialType.System_String))
ConfigurationSchemaGenerator (30)
RuntimeSource\Configuration.Binder\ConfigurationBindingGenerator.Parser.cs (6)
583if (IsUnsupportedType(parameter.Type)) 861SymbolEqualityComparer.Default.Equals(element, method.Parameters[0].Type))) 877SymbolEqualityComparer.Default.Equals(key, method.Parameters[0].Type) && 878SymbolEqualityComparer.Default.Equals(element, method.Parameters[1].Type))) 962if (firstParam.Name == "argument" && firstParam.Type.SpecialType == SpecialType.System_Object 963&& secondParam.Name == "paramName" && secondParam.Type.Equals(_typeSymbols.String, SymbolEqualityComparer.Default))
RuntimeSource\Configuration.Binder\Parser\ConfigurationBinder.cs (12)
45if (!SymbolEqualityComparer.Default.Equals(_typeSymbols.IConfiguration, @params[0].Type)) 58if (@params[1].Type.SpecialType is SpecialType.System_String) 62else if (SymbolEqualityComparer.Default.Equals(@params[2].Type, _typeSymbols.ActionOfBinderOptions)) 82if (instanceArg.Parameter?.Type.SpecialType is not SpecialType.System_Object) 114IParameterReferenceOperation p => p.Parameter.Type, 140if (!SymbolEqualityComparer.Default.Equals(_typeSymbols.IConfiguration, @params[0].Type)) 161else if (paramCount is 2 && SymbolEqualityComparer.Default.Equals(@params[1].Type, _typeSymbols.ActionOfBinderOptions)) 179else if (paramCount is 3 && SymbolEqualityComparer.Default.Equals(@params[2].Type, _typeSymbols.ActionOfBinderOptions)) 200if (paramCount > 3 || @params[1].Type.SpecialType is not SpecialType.System_String) 211else if (paramCount is 3 && SymbolEqualityComparer.Default.Equals(@params[2].Type, type)) 222if (@params[2].Type.SpecialType is not SpecialType.System_String) 234else if (paramCount is 4 && @params[3].Type.SpecialType is SpecialType.System_Object)
RuntimeSource\Configuration.Binder\Parser\OptionsBuilderConfigurationExtensions.cs (5)
22@params[0].Type is not INamedTypeSymbol { IsGenericType: true } genericType || 51if (!SymbolEqualityComparer.Default.Equals(_typeSymbols.IConfiguration, @params[1].Type)) 593 when SymbolEqualityComparer.Default.Equals(_typeSymbols.ActionOfBinderOptions, @params[2].Type) => 79@params[1].Type.SpecialType is SpecialType.System_String && 80SymbolEqualityComparer.Default.Equals(_typeSymbols.ActionOfBinderOptions, @params[2].Type))
RuntimeSource\Configuration.Binder\Parser\OptionsConfigurationServiceCollectionExtensions.cs (7)
23!SymbolEqualityComparer.Default.Equals(_typeSymbols.IServiceCollection, @params[0].Type)) 35if (paramCount is 2 && SymbolEqualityComparer.Default.Equals(_typeSymbols.IConfiguration, @params[1].Type)) 41ITypeSymbol? secondParamType = @params[1].Type; 42ITypeSymbol? thirdParamType = @params[2].Type; 60@params[1].Type.SpecialType is SpecialType.System_String && 61SymbolEqualityComparer.Default.Equals(_typeSymbols.IConfiguration, @params[2].Type) && 62SymbolEqualityComparer.Default.Equals(_typeSymbols.ActionOfBinderOptions, @params[3].Type))
ILLink.RoslynAnalyzer (4)
COMAnalyzer.cs (1)
85 typeSymbol = parameterSymbol.Type;
DynamicallyAccessedMembersAnalyzer.cs (1)
161 if (parameter.GetDynamicallyAccessedMemberTypes () != DynamicallyAccessedMemberTypes.None && !parameter.Type.IsTypeInterestingForDataflow (isByRef: parameter.RefKind is not RefKind.None))
TrimAnalysis\FlowAnnotations.cs (1)
147 if (!parameter.OriginalDefinition.Type.IsTypeInterestingForDataflow (isByRef))
TrimAnalysis\ParameterProxy.cs (1)
49 : new TypeProxy (Method.Method.Parameters[MetadataIndex].Type);
Microsoft.Analyzers.Extra (7)
AsyncMethodWithoutCancellation.cs (1)
158if (typeSymbols.Contains(argument.Type))
CallAnalysis\Fixers\LegacyLoggingFixer.cs (2)
185matchParams = invocationArgList[i].Equals(methodSymbol.Parameters[i].Type, SymbolEqualityComparer.Default); 249if (SymbolEqualityComparer.Default.Equals(ctorArg.Type, param.Type))
CallAnalysis\StartsEndsWith.cs (4)
23.Where(m => SymbolEqualityComparer.Default.Equals(m.Parameters[0].Type, stringType)) 26(m.Parameters.Length == 2 && SymbolEqualityComparer.Default.Equals(m.Parameters[1].Type, stringCompType))); 29.Where(m => SymbolEqualityComparer.Default.Equals(m.Parameters[0].Type, stringType)) 32(m.Parameters.Length == 2 && SymbolEqualityComparer.Default.Equals(m.Parameters[1].Type, stringCompType)));
Microsoft.Analyzers.Local (1)
CallAnalysis\ToInvariantString.cs (1)
32if (method.Parameters.Length == 1 && SymbolEqualityComparer.Default.Equals(method.Parameters[0].Type, formatProvider))
Microsoft.AspNetCore.Analyzers (4)
MiddlewareAnalyzer.cs (1)
36SymbolEqualityComparer.Default.Equals(invocation.Arguments[0].Parameter?.Type, _context.StartupSymbols.IApplicationBuilder))
ServicesAnalyzer.cs (1)
31SymbolEqualityComparer.Default.Equals(invocation.Arguments[0].Parameter?.Type, _context.StartupSymbols.IServiceCollection))
StartupFacts.cs (2)
77return SymbolEqualityComparer.Default.Equals(symbol.Parameters[0].Type, symbols.IServiceCollection); 112if (SymbolEqualityComparer.Default.Equals(symbol.Parameters[i].Type, symbols.IApplicationBuilder))
Microsoft.AspNetCore.App.Analyzers (19)
Http\HeaderDictionaryIndexerAnalyzer.cs (1)
30property.Parameters[0].Type.SpecialType == SpecialType.System_String &&
RouteEmbeddedLanguage\Infrastructure\RouteUsageDetector.cs (4)
270a => SymbolEqualityComparer.Default.Equals(a.Type, wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Routing_IEndpointRouteBuilder)) || 271a.Type.Implements(wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Routing_IEndpointRouteBuilder)))) 278var delegateParameter = method.Parameters.FirstOrDefault(p => delegateSymbol.IsAssignableFrom(p.Type)); 291var routeStringParameter = method.Parameters.FirstOrDefault(p => SymbolEqualityComparer.Default.Equals(stringSymbol, p.Type) &&
RouteHandlers\AtMostOneFromBodyAttribute.cs (1)
29var fromBodyMetadataInterfaceMembers = asParameterDecoratedParameter.Type.GetMembers().Where(
RouteHandlers\DisallowNonParsableComplexTypesOnParameters.cs (2)
121if (parameterSymbol.Type is IArrayTypeSymbol arrayTypeSymbol) 125else if (parameterSymbol.Type is INamedTypeSymbol namedTypeSymbol)
RouteHandlers\RouteHandlerAnalyzer.cs (1)
208var parmeterType = targetMethod.Parameters[DelegateParameterOrdinal].Type;
src\Shared\Roslyn\CodeAnalysisExtensions.cs (1)
194return invocation.TargetMethod.Parameters[0].Type as INamedTypeSymbol;
src\Shared\RoslynUtils\ParsabilityHelper.cs (6)
100methodSymbol.Parameters[0].Type.SpecialType == SpecialType.System_String && 110methodSymbol.Parameters[0].Type.SpecialType == SpecialType.System_String && 111SymbolEqualityComparer.Default.Equals(methodSymbol.Parameters[1].Type, wellKnownTypes.Get(WellKnownType.System_IFormatProvider)) && 139SymbolEqualityComparer.Default.Equals(methodSymbol.Parameters[0].Type, wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Http_HttpContext)) && 150SymbolEqualityComparer.Default.Equals(methodSymbol.Parameters[0].Type, wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Http_HttpContext)) && 151SymbolEqualityComparer.Default.Equals(methodSymbol.Parameters[1].Type, wellKnownTypes.Get(WellKnownType.System_Reflection_ParameterInfo)) &&
src\Shared\RoslynUtils\SymbolExtensions.cs (3)
147IParameterSymbol parameterSymbol => parameterSymbol.Type, 165parameterSymbol.Type is INamedTypeSymbol 223var parameterTypes = constructor.Parameters.Select(parameter => $"typeof({parameter.Type.ToDisplayString()})");
Microsoft.AspNetCore.Components.Analyzers (1)
InternalUsageAnalyzer.cs (1)
111VisitDeclarationSymbol(context, parameter.Type, method);
Microsoft.AspNetCore.Components.SdkAnalyzers (1)
InternalUsageAnalyzer.cs (1)
111VisitDeclarationSymbol(context, parameter.Type, method);
Microsoft.AspNetCore.Http.RequestDelegateGenerator (13)
src\Shared\RoslynUtils\ParsabilityHelper.cs (6)
100methodSymbol.Parameters[0].Type.SpecialType == SpecialType.System_String && 110methodSymbol.Parameters[0].Type.SpecialType == SpecialType.System_String && 111SymbolEqualityComparer.Default.Equals(methodSymbol.Parameters[1].Type, wellKnownTypes.Get(WellKnownType.System_IFormatProvider)) && 139SymbolEqualityComparer.Default.Equals(methodSymbol.Parameters[0].Type, wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Http_HttpContext)) && 150SymbolEqualityComparer.Default.Equals(methodSymbol.Parameters[0].Type, wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Http_HttpContext)) && 151SymbolEqualityComparer.Default.Equals(methodSymbol.Parameters[1].Type, wellKnownTypes.Get(WellKnownType.System_Reflection_ParameterInfo)) &&
src\Shared\RoslynUtils\SymbolExtensions.cs (3)
147IParameterSymbol parameterSymbol => parameterSymbol.Type, 165parameterSymbol.Type is INamedTypeSymbol 223var parameterTypes = constructor.Parameters.Select(parameter => $"typeof({parameter.Type.ToDisplayString()})");
StaticRouteHandlerModel\Emitters\DiagnosticEmitter.cs (1)
32var typeSymbol = parameterSymbol.Type;
StaticRouteHandlerModel\EndpointParameter.cs (2)
21public EndpointParameter(Endpoint endpoint, IParameterSymbol parameter, WellKnownTypes wellKnownTypes) : this(endpoint, parameter.Type, parameter.Name, wellKnownTypes) 497var key = new ParameterLookupKey(parameter.Name!, parameter.Type);
StaticRouteHandlerModel\InvocationOperationExtensions.cs (1)
33routeHandlerParameter is { Parameter.Type: {} delegateType } &&
Microsoft.AspNetCore.Mvc.Analyzers (4)
src\Shared\Roslyn\CodeAnalysisExtensions.cs (1)
194return invocation.TargetMethod.Parameters[0].Type as INamedTypeSymbol;
TopLevelParameterNameAnalyzer.cs (3)
77parameter.Type.Name, 98if (!IsComplexType(parameter.Type)) 105var type = parameter.Type;
Microsoft.AspNetCore.Mvc.Api.Analyzers (4)
src\Shared\Roslyn\CodeAnalysisExtensions.cs (1)
194return invocation.TargetMethod.Parameters[0].Type as INamedTypeSymbol;
SymbolApiConventionMatcher.cs (2)
48if (!IsTypeMatch(methodParameters[i].Type, conventionParameter.Type, typeMatchBehavior) ||
SymbolApiResponseMetadataProvider.cs (1)
212(parameter.Type.SpecialType & SpecialType.System_Int32) == SpecialType.System_Int32)
Microsoft.AspNetCore.SignalR.Client.SourceGenerator (6)
HubClientProxyGenerator.Parser.cs (3)
89if (!SymbolEqualityComparer.Default.Equals(symbol.TypeArguments[0], symbol.Parameters[1].Type)) 106var hubConnectionSymbol = symbol.Parameters[0].Type as INamedTypeSymbol; 317FullyQualifiedTypeName = parameter.Type.ToString()
HubServerProxyGenerator.Parser.cs (3)
96var hubConnectionSymbol = symbol.Parameters[0].Type as INamedTypeSymbol; 305FullyQualifiedTypeName = parameter.Type.ToString() 310switch (parameter.Type)
Microsoft.CodeAnalysis (24)
Compilation\Compilation.cs (1)
1725if (!isContainingAssemblyInReferences(param.Type))
DiagnosticAnalyzer\SuppressMessageAttributeState.TargetSymbolResolver.cs (1)
803return parameterType != null && symbol.Type.Equals(parameterType);
DocumentationCommentId.cs (2)
494this.GetReferenceGenerator(p.ContainingSymbol).Visit(p.Type); 1407return parameterType != null && symbol.Type.Equals(parameterType, SymbolEqualityComparer.CLRSignature);
Operations\ControlFlowGraphBuilder.cs (8)
2499(ITypeSymbolHelpers.IsNullableType(left.Type) || !ITypeSymbolHelpers.IsNullableType(unaryOperatorMethod.Parameters[0].Type)))) 2587if (unaryOperatorMethod == null ? isLifted : !ITypeSymbolHelpers.IsNullableType(unaryOperatorMethod.Parameters[0].Type)) 2593Debug.Assert(unaryOperatorMethod == null || !ITypeSymbolHelpers.IsNullableType(unaryOperatorMethod.Parameters[0].Type)); 2597else if (unaryOperatorMethod != null && ITypeSymbolHelpers.IsNullableType(unaryOperatorMethod.Parameters[0].Type)) 2599condition = MakeInvalidOperation(unaryOperatorMethod.Parameters[0].Type, condition); 6825Debug.Assert(outParameterArgument is { Parameter: { RefKind: RefKind.Out, Type.SpecialType: SpecialType.System_Boolean } }); 7209operation.Syntax, operation.Parameter.Type, isImplicit: true); 7251operation.Syntax, parameter.Type, constantValue: null, isImplicit: true);
SymbolDisplay\AbstractSymbolDisplayVisitor_Minimal.cs (1)
120return parameterSymbol.Type;
Symbols\Attributes\CommonAttributeData.cs (10)
208Debug.Assert(parameters[0].Type.SpecialType == SpecialType.System_Byte); 209Debug.Assert(parameters[1].Type.SpecialType == SpecialType.System_Byte); 216if (parameters[2].Type.SpecialType == SpecialType.System_Int32) 218Debug.Assert(parameters[2].Type.SpecialType == SpecialType.System_Int32); 219Debug.Assert(parameters[3].Type.SpecialType == SpecialType.System_Int32); 220Debug.Assert(parameters[4].Type.SpecialType == SpecialType.System_Int32); 228Debug.Assert(parameters[2].Type.SpecialType == SpecialType.System_UInt32); 229Debug.Assert(parameters[3].Type.SpecialType == SpecialType.System_UInt32); 230Debug.Assert(parameters[4].Type.SpecialType == SpecialType.System_UInt32); 406if (attribute.AttributeConstructor.Parameters[0].Type.SpecialType == SpecialType.System_Int16)
Symbols\Attributes\MarshalAsAttributeDecoder.cs (1)
102if (attribute.AttributeConstructor.Parameters[0].Type.SpecialType == SpecialType.System_Int16)
Microsoft.CodeAnalysis.CodeStyle (39)
src\Analyzers\Core\Analyzers\Helpers\DeserializationConstructorCheck.cs (2)
21methodSymbol.Parameters[0].Type.Equals(_serializationInfoType) && 22methodSymbol.Parameters[1].Type.Equals(_streamingContextType) &&
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (2)
832attribute.AttributeConstructor?.Parameters is [_, { Name: "checkId", Type.SpecialType: SpecialType.System_String }, ..] && 841attribute.AttributeConstructor.Parameters[0].Type.SpecialType == SpecialType.System_String &&
src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (1)
744methodSymbol.Parameters[0].Type.Equals(memberSymbol.ContainingType))
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.BlockAnalyzer.cs (1)
433method.Parameters.Any(static p => p.IsRefOrOut() && p.Type.IsDelegateType())))
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.cs (4)
233method.Parameters is [{ Type.SpecialType: SpecialType.System_Object }, var secondParam] && 234secondParam.Type.InheritsFromOrEquals(_eventArgsType)) 273if (method is { MetadataName: "GetInstance", IsStatic: true, Parameters: [{ Type.SpecialType: SpecialType.System_String }] } && 295if (parameter.Type.SpecialType != SpecialType.System_Int32)
src\Analyzers\Core\Analyzers\SimplifyLinqExpression\AbstractSimplifyLinqExpressionDiagnosticAnalyzer.cs (1)
84if (parameters is [_, { Type: INamedTypeSymbol { Arity: 2 } }])
src\Analyzers\Core\Analyzers\UseCollectionInitializer\UpdateExpressionState.cs (2)
253useSpread = parameter.Type.Equals(convertedType); 263useSpread = method.GetOriginalUnreducedDefinition() is not IMethodSymbol { IsExtensionMethod: true, Parameters: [_, { Type: ITypeParameterSymbol }] };
src\Analyzers\Core\Analyzers\ValidateFormatString\AbstractValidateFormatStringDiagnosticAnalyzer.cs (1)
139var hasIFormatProvider = parameters[0].Type.Equals(formatProviderType);
src\Compilers\Core\Portable\DiagnosticAnalyzer\SuppressMessageAttributeState.TargetSymbolResolver.cs (1)
803return parameterType != null && symbol.Type.Equals(parameterType);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\IMethodSymbolExtensions.cs (2)
45method.Parameters is [{ Type.SpecialType: SpecialType.System_Object }, var secondParam] && 46secondParam.Type.InheritsFromOrEquals(eventArgsType);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\INamedTypeSymbolExtensions.cs (1)
234return method.Parameters.Any(static (p, within) => p.Type.Equals(within, SymbolEqualityComparer.Default), within);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.cs (5)
282IParameterSymbol parameterSymbol => parameterSymbol.Type, 349return ((IParameterSymbol)symbol).Type; 449.Select(p => (p.Type ?? compilation.GetSpecialType(SpecialType.System_Object)).WithNullableAnnotation(p.NullableAnnotation)); 567IParameterSymbol parameterSymbol => parameterSymbol.Type, 634if (!methods.Any(x => x.Name == WellKnownMemberNames.OnCompleted && x.ReturnsVoid && x.Parameters is [{ Type.TypeKind: TypeKind.Delegate }]))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.RequiresUnsafeModifierVisitor.cs (1)
126return symbol.Type.Accept(this);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions_Accessibility.cs (1)
113if (!IsSymbolAccessibleCore(param.Type, within, null, out failedThroughTypeCheck))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.CollectTypeParameterSymbolsVisitor.cs (1)
46parameter.Type.Accept(this);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.MinimalAccessibilityVisitor.cs (1)
35accessibility = AccessibilityUtilities.Minimum(accessibility, parameter.Type.Accept(this));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (2)
37/// the "same" <see cref="IParameterSymbol.Type"/>s and 61/// the "same" <see cref="IParameterSymbol.Type"/>s and
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (1)
402if (!signatureComparer.Equals(originalParameterTypes[i], parameters[i].Type))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (1)
80_writeParameterType = p => WriteSymbolKey(p.Type);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (2)
474CompareAcrossSemanticModels(parameterSymbol.Type, newParameterSymbol.Type);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.EquivalenceVisitor.cs (2)
570AreEquivalent(x.Type, y.Type, equivalentTypesWithDifferingAssemblies) &&
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (1)
228GetHashCode(x.Type,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.ParameterSymbolEqualityComparer.cs (3)
50symbolEqualityComparer.SignatureTypeEquivalenceComparer.Equals(x.Type, y.Type, equivalentTypesWithDifferingAssemblies); 68symbolEqualityComparer.SignatureTypeEquivalenceComparer.GetHashCode(x.Type));
Microsoft.CodeAnalysis.CodeStyle.Fixes (20)
src\Analyzers\Core\CodeFixes\AddExplicitCast\Fixer.cs (1)
153var parameterType = parameters[parameterIndex].Type;
src\Analyzers\Core\CodeFixes\AddParameter\AbstractAddParameterCodeFixProvider.cs (2)
496compilation, argumentTypeInfo, parameter.Type, 521if (parameter.IsParams && parameter.Type is IArrayTypeSymbol arrayType)
src\Analyzers\Core\CodeFixes\GenerateConstructor\AbstractGenerateConstructorService.State.cs (2)
225constructor.Parameters.Select(p => p.Type).SequenceEqual(ParameterTypes)) 259var result = SymbolEquivalenceComparer.Instance.Equals(ctorParameter.Type, ParameterTypes[i]) &&
src\Analyzers\Core\CodeFixes\GenerateConstructor\GenerateConstructorHelpers.cs (1)
113var conversion = semanticFacts.ClassifyConversion(semanticModel, expression, constructorParameter.Type);
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateMethodService.State.cs (1)
238var typeLocalName = parameter.Type.GetLocalName(fallback: parameter.Name);
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.SignatureInfo.cs (1)
106isUnsafe = returnType.RequiresUnsafeModifier() || parameters.Any(static p => p.Type.RequiresUnsafeModifier());
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.cs (1)
230Equals(parameter.Type, cancellationTokenType))
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementHelpers.cs (1)
153if (IsTypeLessAccessibleThanOtherType(parameter.Type, second, []))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationSymbolFactory.cs (1)
305type ?? parameter.Type,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\IParameterSymbolExtensions.cs (1)
30parameter.Type,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions.cs (5)
277type: parameter.Type, 299type: parameter.Type, 331var parameterType = parameter.Type; 380var shouldAddNullCheck = addNullChecks && parameter.Type.CanAddNullCheck() && !parameter.Type.IsNullable();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (1)
80.Single(m => containingType.Equals(m.Parameters.FirstOrDefault()?.Type));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\TypeInferenceService\AbstractTypeInferenceService.AbstractTypeInferrer.cs (2)
93parameterSymbol.Type 98if (parameterSymbol.Type is IArrayTypeSymbol arrayTypeSymbol)
Microsoft.CodeAnalysis.CSharp (6)
SymbolDisplay\SymbolDisplayVisitor.Members.cs (6)
294symbol = symbol.ReduceExtensionMethod(symbol.Parameters.First().Type) ?? symbol; 637param.Type.Accept(this.NotFirstVisitor); 796CanAddConstant(symbol.Type, symbol.ExplicitDefaultValue); 832!(symbol.IsParams && symbol.Type is { IsRefLikeType: true } or ITypeParameterSymbol { AllowsRefLikeType: true })) 839symbol.Type.Accept(this.NotFirstVisitor); 862AddConstantValue(symbol.Type, symbol.ExplicitDefaultValue);
Microsoft.CodeAnalysis.CSharp.CodeStyle (22)
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryLambdaExpression\CSharpRemoveUnnecessaryLambdaExpressionDiagnosticAnalyzer.cs (2)
171if (!IsIdentityOrImplicitConversion(compilation, lambdaParameter.Type, invokedParameter.Type))
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (6)
326var capacityConstructor = GetAccessibleInstanceConstructor(constructors, c => c.Parameters is [{ Name: "capacity", Type.SpecialType: SpecialType.System_Int32 }]); 582if (siblingParameter.Type.IsRefLikeType && 1014Type: INamedTypeSymbol 1052if (originalCreateMethod.Parameters.All(static p => p.Type is ITypeParameterSymbol { TypeParameterKind: TypeParameterKind.Method })) 1057if (originalCreateMethod.Parameters is [{ IsParams: true, Type: IArrayTypeSymbol { ElementType: ITypeParameterSymbol { TypeParameterKind: TypeParameterKind.Method } } }]) 1080Type: INamedTypeSymbol
src\Analyzers\CSharp\Analyzers\UseCollectionInitializer\CSharpUseCollectionInitializerAnalyzer.cs (3)
74if (Equals(firstParameter.Type.OriginalDefinition, ienumerableOfTType) || 75firstParameter.Type.AllInterfaces.Any(i => Equals(i.OriginalDefinition, ienumerableOfTType))) 82else if (firstParameter is { Type.SpecialType: SpecialType.System_Int32, Name: "capacity" })
src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\Helpers.cs (5)
77method.OriginalDefinition.Parameters[0].Type.SpecialType == SpecialType.System_Int32; 115=> parameter.Type.SpecialType == SpecialType.System_Int32 && 119=> parameter.Type.SpecialType == SpecialType.System_Int32 && 134p.Parameters[0].Type.Equals(parameterType)) 149m.Parameters[0].Type.Equals(parameterType) &&
src\Analyzers\CSharp\Analyzers\UsePrimaryConstructor\CSharpUsePrimaryConstructorDiagnosticAnalyzer.cs (2)
369if (constructor.Parameters.Any(p => p.Type.IsRefLikeType)) 534parameter.Type.Equals(member.GetMemberType(), SymbolEqualityComparer.IncludeNullability))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SemanticModelExtensions.cs (1)
442if (parameter.Type.OriginalDefinition.TypeKind != TypeKind.TypeParameter)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.cs (1)
826expressionType.Equals(method.Parameters[0].Type?.OriginalDefinition))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (2)
257if (argumentOp.Parameter?.Type == null) 260return argumentOp.Value.Type.Equals(argumentOp.Parameter.Type);
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (14)
src\Analyzers\CSharp\CodeFixes\AssignOutParameters\AbstractAssignOutParametersCodeFixProvider.cs (1)
163ExpressionGenerator.GenerateExpression(generator, parameter.Type, value: null, canUseFieldReference: false))));
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordHelpers.cs (3)
37methodSymbol.Parameters.First().Type.SpecialType == SpecialType.System_Object && 511if (parameter.Type.Equals(type)) 518else if (parameter.Type.SpecialType == SpecialType.System_Object)
src\Analyzers\CSharp\CodeFixes\MakeLocalFunctionStatic\MakeLocalFunctionStaticCodeFixHelper.cs (1)
187parameterList, parameterList.WithParameters(parameters.Insert(0, Parameter(Identifier("@this")).WithType(thisParameter.Type.GenerateTypeSyntax()))));
src\Analyzers\CSharp\CodeFixes\UseLocalFunction\CSharpUseLocalFunctionCodeFixProvider.cs (2)
257parameterNode = parameterNode.WithType(delegateParameter?.Type.GenerateTypeSyntax() ?? s_objectType); 316=> EqualsValueClause(ExpressionGenerator.GenerateExpression(generator, parameter.Type, parameter.ExplicitDefaultValue, canUseFieldReference: true));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\MethodGenerator.cs (1)
223.SelectMany(p => p.Type.GetReferencedTypeParameters())
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\ParameterGenerator.cs (2)
72.WithType(parameter.Type.GenerateTypeSyntax()) 119=> ExpressionGenerator.GenerateExpression(generator, parameter.Type, value, canUseFieldReference: true);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.TypeSyntaxGeneratorVisitor.cs (1)
164var parameters = symbol.Signature.Parameters.Select(p => (p.Type, RefKindModifiers: CSharpSyntaxGeneratorInternal.GetParameterModifiers(p.RefKind)))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (3)
765.Select(p => new TypeInferenceInfo(p.Type, p.IsParams)); 778var info = new TypeInferenceInfo(parameter.Type, parameter.IsParams); 1207return CreateResult(parameter.Type);
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (4)
SymbolKey\SymbolKeyMetadataVsSourceTests.cs (3)
83var member04 = (typesym.GetMembers("M").Single() as IMethodSymbol).Parameters[0].Type; 248var mtsym20_2 = mem20_2.Parameters[0].Type; 251var mtsym20_3 = mem20_2.Parameters[1].Type;
SymbolKey\SymbolKeyTests.cs (1)
171var parameterType = callbackParamater.Type;
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (19)
CodeGen\CodeGenFunctionPointersTests.cs (1)
7423Assert.True(lambdaSymbol.Parameters.Single().Type.IsErrorType());
CodeGen\CodeGenLocalFunctionTests.cs (15)
3137Assert.True(goo.Parameters[0].Type.IsValueType); 3164Assert.True(goo.Parameters[0].Type.IsValueType); 3165Assert.True(bar.Parameters[0].Type.IsValueType); 3166Assert.True(bar.Parameters[1].Type.IsValueType); 3167Assert.Equal(goo.Parameters[0].Type.OriginalDefinition, bar.Parameters[0].Type.OriginalDefinition); 3168var gooFrame = (INamedTypeSymbol)goo.Parameters[0].Type; 3169var barFrame = (INamedTypeSymbol)bar.Parameters[1].Type; 3217Assert.True(inner.Parameters[0].Type.IsValueType); 3218Assert.True(inner.Parameters[1].Type.IsValueType); 3219Assert.True(middle.Parameters[0].Type.IsValueType); 3280Assert.True(goo.Parameters[0].Type.IsValueType); 3321Assert.True(goo.Parameters[1].Type.IsValueType); 3322Assert.True(bar.Parameters[1].Type.IsValueType); 3323Assert.True(bar.Parameters[2].Type.IsValueType);
CodeGen\CodeGenTupleTest.cs (2)
14254m1Tuple = (INamedTypeSymbol)((IMethodSymbol)symbolInfo.Symbol).Parameters[0].Type; 14348m6Tuple = m6Method.Parameters.Last().Type;
CodeGen\IndexAndRangeTests.cs (1)
1002Assert.Equal(SpecialType.System_Int32, property.Parameters[0].Type.SpecialType);
Microsoft.CodeAnalysis.CSharp.Features (39)
ChangeSignature\CSharpChangeSignatureService.cs (1)
910var objectCreation = ArrayCreationExpression((ArrayTypeSyntax)parameterSymbol.Type.GenerateTypeSyntax(), initializerExpression);
CodeRefactorings\ConvertLocalFunctionToMethod\CSharpConvertLocalFunctionToMethodCodeRefactoringProvider.cs (1)
271.WithType(p.Type.GenerateTypeSyntax());
Completion\CompletionProviders\DeclarationName\DeclarationNameRecommender.cs (1)
307methodParameterType.Equals(overloadParameter.Type, SymbolEqualityComparer.Default))
Completion\CompletionProviders\OperatorsAndIndexer\UnnamedSymbolCompletionProvider_Conversions.cs (1)
72var symbols = ImmutableArray.Create<ISymbol>(conversion.ContainingType, conversion.Parameters.First().Type, conversion.ReturnType);
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.cs (1)
593Parameters: [{ Type.SpecialType: SpecialType.System_Boolean }],
InitializeParameter\CSharpInitializeMemberFromPrimaryConstructorParameterCodeRefactoringProvider.cs (2)
229parameter.Type, 253parameter.Type,
InlineHints\CSharpInlineTypeHintsService.cs (4)
83IsValidType(parameter?.Type)) 86? new TypeHint(parameter.Type, span, textChange: new TextChange(span, parameter.Type.ToDisplayString(s_minimalTypeStyle) + " "), trailingSpace: true) 87: new TypeHint(parameter.Type, span, textChange: null, trailingSpace: true);
IntroduceParameter\CSharpIntroduceParameterCodeRefactoringProvider.cs (1)
30return ExpressionGenerator.GenerateExpression(CSharpSyntaxGenerator.Instance, parameterSymbol.Type, parameterSymbol.ExplicitDefaultValue, canUseFieldReference: true);
SignatureHelp\LightweightOverloadResolution.cs (1)
123var type = parameter.Type;
SignatureHelp\ObjectCreationExpressionSignatureHelpProvider_DelegateType.cs (1)
65parts.AddRange(parameter.Type.ToMinimalDisplayParts(semanticModel, position));
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryLambdaExpression\CSharpRemoveUnnecessaryLambdaExpressionDiagnosticAnalyzer.cs (2)
171if (!IsIdentityOrImplicitConversion(compilation, lambdaParameter.Type, invokedParameter.Type))
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (5)
326var capacityConstructor = GetAccessibleInstanceConstructor(constructors, c => c.Parameters is [{ Name: "capacity", Type.SpecialType: SpecialType.System_Int32 }]); 1014Type: INamedTypeSymbol 1052if (originalCreateMethod.Parameters.All(static p => p.Type is ITypeParameterSymbol { TypeParameterKind: TypeParameterKind.Method })) 1057if (originalCreateMethod.Parameters is [{ IsParams: true, Type: IArrayTypeSymbol { ElementType: ITypeParameterSymbol { TypeParameterKind: TypeParameterKind.Method } } }]) 1080Type: INamedTypeSymbol
src\Analyzers\CSharp\Analyzers\UseCollectionInitializer\CSharpUseCollectionInitializerAnalyzer.cs (3)
74if (Equals(firstParameter.Type.OriginalDefinition, ienumerableOfTType) || 75firstParameter.Type.AllInterfaces.Any(i => Equals(i.OriginalDefinition, ienumerableOfTType))) 82else if (firstParameter is { Type.SpecialType: SpecialType.System_Int32, Name: "capacity" })
src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\Helpers.cs (5)
77method.OriginalDefinition.Parameters[0].Type.SpecialType == SpecialType.System_Int32; 115=> parameter.Type.SpecialType == SpecialType.System_Int32 && 119=> parameter.Type.SpecialType == SpecialType.System_Int32 && 134p.Parameters[0].Type.Equals(parameterType)) 149m.Parameters[0].Type.Equals(parameterType) &&
src\Analyzers\CSharp\Analyzers\UsePrimaryConstructor\CSharpUsePrimaryConstructorDiagnosticAnalyzer.cs (2)
369if (constructor.Parameters.Any(p => p.Type.IsRefLikeType)) 534parameter.Type.Equals(member.GetMemberType(), SymbolEqualityComparer.IncludeNullability))
src\Analyzers\CSharp\CodeFixes\AssignOutParameters\AbstractAssignOutParametersCodeFixProvider.cs (1)
163ExpressionGenerator.GenerateExpression(generator, parameter.Type, value: null, canUseFieldReference: false))));
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordHelpers.cs (3)
37methodSymbol.Parameters.First().Type.SpecialType == SpecialType.System_Object && 511if (parameter.Type.Equals(type)) 518else if (parameter.Type.SpecialType == SpecialType.System_Object)
src\Analyzers\CSharp\CodeFixes\MakeLocalFunctionStatic\MakeLocalFunctionStaticCodeFixHelper.cs (1)
187parameterList, parameterList.WithParameters(parameters.Insert(0, Parameter(Identifier("@this")).WithType(thisParameter.Type.GenerateTypeSyntax()))));
src\Analyzers\CSharp\CodeFixes\UseLocalFunction\CSharpUseLocalFunctionCodeFixProvider.cs (2)
257parameterNode = parameterNode.WithType(delegateParameter?.Type.GenerateTypeSyntax() ?? s_objectType); 316=> EqualsValueClause(ExpressionGenerator.GenerateExpression(generator, parameter.Type, parameter.ExplicitDefaultValue, canUseFieldReference: true));
UseNamedArguments\CSharpUseNamedArgumentsCodeRefactoringProvider.cs (1)
49var conversion = semanticModel.Compilation.ClassifyConversion(argType, parameters[0].Type);
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (1)
IOperation\FunctionPointerOperations.cs (1)
210Assert.Equal(SpecialType.System_String, signature.Parameters[0].Type.SpecialType);
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (38)
Semantics\FunctionPointerTests.cs (6)
1620var functionPointer = (IFunctionPointerTypeSymbol)methodSymbol.Parameters[0].Type; 1621Assert.Equal(SpecialType.System_String, functionPointer.Signature.Parameters[0].Type.SpecialType); 1780var functionPointer = (IFunctionPointerTypeSymbol)methodSymbol.Parameters[0].Type; 1941var functionPointer = (IFunctionPointerTypeSymbol)m1InvocationSymbol.Parameters[0].Type; 1943Assert.Equal(TypeKind.TypeParameter, functionPointer.Signature.Parameters[0].Type.TypeKind); 1947Assert.True(declaredSymbol.TypeParameters[0].Equals(functionPointer.Signature.Parameters[0].Type, TypeCompareKind.ConsiderEverything));
Semantics\LambdaDiscardParametersTests.cs (2)
114Assert.Equal(expectedType, symbol1.Type.ToTestDisplayString()); 117Assert.Equal(expectedType, symbol1.Type.ToTestDisplayString());
Semantics\LambdaTests.cs (5)
2668Assert.False(parameter.Type.IsErrorType()); 2671Assert.False(parameter.Type.IsErrorType()); 2674Assert.Equal(tooMany, parameter.Type.IsErrorType()); 2681Assert.False(parameter.Type.IsErrorType()); 2684Assert.Equal(tooMany, parameter.Type.IsErrorType());
Semantics\LocalFunctionTests.cs (2)
5119Assert.Equal(expected, parameterSymbol.Type.ToTestDisplayString()); 5120Assert.Same(symbol, parameterSymbol.Type);
Semantics\NativeIntegerTests.cs (2)
3641var underlyingType0 = method.Parameters[0].Type.GetSymbol<NamedTypeSymbol>(); 3642var underlyingType1 = method.Parameters[1].Type.GetSymbol<NamedTypeSymbol>();
Semantics\OperatorTests.cs (14)
7622symbol1.Name, symbol1.ReturnType, symbol1.Parameters[0].Type); 7656Assert.Same(symbol1.ContainingSymbol, symbol1.Parameters[0].Type); 8213signature = new BinaryOperatorSignature(op | BinaryOperatorKind.Pointer, leftType, symbol1.Parameters[1].Type.GetSymbol(), leftType); 8214Assert.True(symbol1.Parameters[1].Type.GetSymbol().IsIntegralType()); 8218signature = new BinaryOperatorSignature(op | BinaryOperatorKind.Pointer, symbol1.Parameters[0].Type.GetSymbol(), rightType, rightType); 8219Assert.True(symbol1.Parameters[0].Type.GetSymbol().IsIntegralType()); 8225signature = new BinaryOperatorSignature(op | BinaryOperatorKind.String, leftType, symbol1.Parameters[1].Type.GetSymbol(), leftType); 8226Assert.True(symbol1.Parameters[1].Type.GetSymbol().IsIntegralType()); 8398symbol1.Name, symbol1.ReturnType, symbol1.Parameters[0].Type, symbol1.Parameters[1].Type); 8431Assert.True(SymbolEqualityComparer.ConsiderEverything.Equals(symbol1.ContainingSymbol, symbol1.Parameters[0].Type) || 8432SymbolEqualityComparer.ConsiderEverything.Equals(symbol1.ContainingSymbol, symbol1.Parameters[1].Type)); 8440if (SymbolEqualityComparer.ConsiderEverything.Equals(symbol1.ContainingSymbol, symbol1.Parameters[0].Type)) 8445if (SymbolEqualityComparer.ConsiderEverything.Equals(symbol1.ContainingSymbol, symbol1.Parameters[1].Type))
Semantics\SemanticErrorTests.cs (1)
3347var paramTypeSymbol = constructedMethodSymbol.Parameters.Single().Type;
Semantics\UnsafeTests.cs (4)
8876summaryMethod.Name, summaryMethod.ReturnType, summaryMethod.Parameters[0].Type, summaryMethod.Parameters[1].Type); 9338summaryMethod.Name, summaryMethod.ReturnType, summaryMethod.Parameters[0].Type, summaryMethod.Parameters[1].Type);
Semantics\Utf8StringsLiteralsTests.cs (2)
4089method.Name, method.ReturnType, method.Parameters[0].Type, method.Parameters[1].Type);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (75)
Compilation\GetSemanticInfoTests.cs (5)
1170Assert.Equal(systemActionType, parameterSymbol.Type); 1199Assert.Equal(systemActionType, parameterSymbol.Type); 1818Assert.Equal(TypeKind.Array, candidate.Parameters.Last().Type.TypeKind); 1819Assert.Equal(TypeKind.TypeParameter, ((IMethodSymbol)candidate.OriginalDefinition).Parameters.Last().Type.TypeKind); 5486Assert.Equal("System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<System.Threading.Tasks.Task<Program.A>>>", parameterSymbol.Type.ToTestDisplayString());
Compilation\SemanticModelAPITests.cs (2)
2615Assert.Equal("Int32", paramSymbol.Type.Name); 3134Assert.Equal(TypeKind.Error, ((IParameterSymbol)symbol).Type.TypeKind);
Compilation\SemanticModelGetDeclaredSymbolAPITests.cs (10)
984Assert.Equal("St", mSymbol.Parameters[0].Type.Name); 985Assert.Equal<ISymbol>(structSymbol, mSymbol.Parameters[1].Type.OriginalDefinition); 1335var names = model.LookupNames(methodDecl.SpanStart, paramSymbol.Type); 1347names = model.LookupNames(methodDecl.SpanStart, paramSymbol.Type); 1438var symbols = model.LookupSymbols(methodDecl.SpanStart, paramSymbol.Type); 1452symbols = model.LookupSymbols(methodDecl.SpanStart, paramSymbol.Type); 1877var typeA = ((IParameterSymbol)symbols[0]).Type; 1881var typeB = ((IParameterSymbol)symbols[0]).Type; 2014var type = ((IParameterSymbol)symbols[0]).Type; 3674Assert.Equal(SpecialType.System_Int32, parameter.Type.SpecialType);
Compilation\SemanticModelGetSemanticInfoTests.cs (4)
5668Assert.Equal("System.String", lambdaSym.Parameters[0].Type.ToTestDisplayString()); 5704Assert.Equal(TypeKind.Error, lambdaSym.Parameters[0].Type.TypeKind); 6344Assert.Equal(TypeKind.Error, param.Type.TypeKind); 6348Assert.NotEqual(semanticInfo.Type, param.Type);
Compilation\SymbolVisitorTests.cs (3)
147symbol.Type.Accept(this); 329symbol.Type.Accept(this); 468symbol.Type.Accept(this, argument);
Symbols\ConversionTests.cs (2)
1805Assert.Equal(SpecialType.System_Byte, method.Parameters.Single().Type.SpecialType); 1839Assert.Equal(SpecialType.System_Byte, method.Parameters.Single().Type.SpecialType);
Symbols\Source\EventTests.cs (2)
443Assert.Equal("dynamic", parameterSymbol.Type.ToTestDisplayString()); 489Assert.Equal("dynamic", parameterSymbol.Type.ToTestDisplayString());
Symbols\Source\MethodTests.cs (2)
123Assert.Equal(SymbolKind.NamedType, x.Type.Kind); 124Assert.Equal("Int32", x.Type.Name); // fully qualified to work around a metadata reader bug
Symbols\Source\NullablePublicAPITests.cs (24)
381var result = member.Type.NullableAnnotation; 488members = e.GetMembers().OfType<IMethodSymbol>().Where(m => m.Name.StartsWith("M")).Select(m => m.ReduceExtensionMethod(m.Parameters[0].Type)).ToArray(); 575Assert.Equal(method.ReturnNullableAnnotation, method.Parameters[0].Type.NullableAnnotation); 1863Assert.Equal(expectedAnnotation, methodSymbol.Parameters.Single().Type.NullableAnnotation); 1906Assert.Equal(expectedAnnotation, methodSymbol.Parameters.Single().Type.NullableAnnotation); 2637Assert.Equal(SpecialType.System_String, symbol.Type.SpecialType); 3276Assert.Equal(secondAnnotation, propertySymbol.Parameters[0].Type.NullableAnnotation); 3493Assert.Equal(PublicNullableAnnotation.Annotated, lambdaSymbol.Parameters[0].Type.NullableAnnotation); 3505Assert.Equal(PublicNullableAnnotation.Annotated, parameterSymbol.Type.NullableAnnotation); 3546Assert.Equal(PublicNullableAnnotation.NotAnnotated, innerLambdaSymbol.Parameters[0].Type.NullableAnnotation); 3558Assert.Equal(PublicNullableAnnotation.Annotated, o1Symbol.Type.NullableAnnotation); 3569Assert.Equal(PublicNullableAnnotation.NotAnnotated, o2Symbol.Type.NullableAnnotation); 3607Assert.Equal(PublicNullableAnnotation.NotAnnotated, innerLambdaSymbol.Parameters[0].Type.NullableAnnotation); 3619Assert.Equal(PublicNullableAnnotation.Annotated, o1Symbol.Type.NullableAnnotation); 3630Assert.Equal(PublicNullableAnnotation.NotAnnotated, o2Symbol.Type.NullableAnnotation); 3921Assert.Equal(PublicNullableAnnotation.NotAnnotated, o1Symbol.Type.NullableAnnotation); 3935Assert.Equal(PublicNullableAnnotation.NotAnnotated, o3Symbol.Type.NullableAnnotation); 3985Assert.Equal(PublicNullableAnnotation.NotAnnotated, innerLambdaSymbol1.Parameters[0].Type.NullableAnnotation); 3987Assert.Equal(PublicNullableAnnotation.NotAnnotated, innerLambdaSymbol1.Parameters[1].Type.NullableAnnotation); 3989Assert.Equal(PublicNullableAnnotation.NotAnnotated, innerLambdaSymbol1.Parameters[2].Type.NullableAnnotation); 3995Assert.Equal(PublicNullableAnnotation.NotAnnotated, innerLambdaSymbol2.Parameters[0].Type.NullableAnnotation); 3997Assert.Equal(PublicNullableAnnotation.NotAnnotated, innerLambdaSymbol2.Parameters[1].Type.NullableAnnotation); 3999Assert.Equal(PublicNullableAnnotation.NotAnnotated, innerLambdaSymbol2.Parameters[2].Type.NullableAnnotation); 4703Assert.Equal(PublicNullableAnnotation.NotAnnotated, symbol2.Parameters.Single().Type.NullableAnnotation);
Symbols\SymbolEqualityTests.cs (2)
846var method1ParamType = method1.Parameters.First().Type; // A<T!> 847var method2ParamType = method2.Parameters.First().Type; // A<T!>
Symbols\TypeTests.cs (3)
1703memType = paras[0].Type; 1706memType = paras[1].Type; 1721var compType = (model.GetDeclaredSymbol(mnode) as IMethodSymbol).Parameters[0].Type;
Symbols\UnsignedRightShiftTests.cs (16)
135Assert.Same(shiftSymbol.Parameters[0].Type, unsignedShiftSymbol.Parameters[0].Type); 136Assert.Same(shiftSymbol.Parameters[1].Type, unsignedShiftSymbol.Parameters[1].Type); 638Assert.Same(shiftSymbol.Parameters[0].Type, unsignedShiftSymbol.Parameters[0].Type); 639Assert.Same(shiftSymbol.Parameters[1].Type, unsignedShiftSymbol.Parameters[1].Type); 1188Assert.Same(shiftSymbol.Parameters[0].Type, unsignedShiftSymbol.Parameters[0].Type); 1189Assert.Same(shiftSymbol.Parameters[1].Type, unsignedShiftSymbol.Parameters[1].Type); 1596Assert.Same(shiftSymbol.Parameters[0].Type, unsignedShiftSymbol.Parameters[0].Type); 1597Assert.Same(shiftSymbol.Parameters[1].Type, unsignedShiftSymbol.Parameters[1].Type);
Microsoft.CodeAnalysis.CSharp.Test.Utilities (7)
Extensions.cs (6)
185return type.InstanceConstructors.Single(c => c.Parameters is [{ Type: var parameterType }] && parameterType.Equals(type, SymbolEqualityComparer.Default)); 203return type.GetMembers("Equals").OfType<IMethodSymbol>().Single(m => m.Parameters is [{ Type: var parameterType }] && parameterType.Equals(type, SymbolEqualityComparer.Default)); 216m.Parameters.All(p => p.RefKind == RefKind.Out && p.Type.Equals(primaryConstructor.Parameters[p.Ordinal].Type, SymbolEqualityComparer.Default))); 699public static ITypeSymbol GetParameterType(this IMethodSymbol method, int index) => method.Parameters[index].Type; 825return ((IParameterSymbol)symbol).Type;
FunctionPointerUtilities.cs (1)
244ITypeSymbol signatureParamType = signature.Parameters[i].Type;
Microsoft.CodeAnalysis.CSharp.Workspaces (22)
Recommendations\CSharpRecommendationServiceRunner.cs (1)
790var useBaseReferenceAccessibility = symbol is IParameterSymbol { IsThis: true } p && !p.Type.Equals(containerType);
Recommendations\CSharpRecommendationServiceRunner_Conversions.cs (3)
172if (!type.Equals(method.Parameters[0].Type)) 190=> method.ReturnType.IsNonNullableValueType() && method.Parameters.Single().Type.IsNonNullableValueType(); 196TryMakeNullable(compilation, method.Parameters.Single().Type),
Recommendations\CSharpRecommendationServiceRunner_Operators.cs (1)
62if (symbol.IsUserDefinedOperator() && symbol.Parameters.All(p => p.Type.IsValueType))
Rename\CSharpRenameRewriterLanguageService.cs (1)
776(matchingLocal.IsKind(SymbolKind.Parameter) && ((IParameterSymbol)matchingLocal).Type.IsDelegateType());
Simplification\CSharpSimplificationService.Expander.cs (4)
181if (parameterSymbols.All(p => p.Type?.ContainsAnonymousType() == false)) 187var typeSyntax = parameterSymbols[i].Type.GenerateTypeSyntax().WithTrailingTrivia(s_oneWhitespaceSeparator); 224if (parameterSymbol?.Type?.ContainsAnonymousType() == false) 226var typeSyntax = parameterSymbol.Type.GenerateTypeSyntax().WithTrailingTrivia(s_oneWhitespaceSeparator);
Simplification\Reducers\CSharpMiscellaneousReducer.cs (1)
57Equals(oldSymbol.Type, newSymbol.Type))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SemanticModelExtensions.cs (1)
442if (parameter.Type.OriginalDefinition.TypeKind != TypeKind.TypeParameter)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.cs (1)
826expressionType.Equals(method.Parameters[0].Type?.OriginalDefinition))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (2)
257if (argumentOp.Parameter?.Type == null) 260return argumentOp.Value.Type.Equals(argumentOp.Parameter.Type);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\MethodGenerator.cs (1)
223.SelectMany(p => p.Type.GetReferencedTypeParameters())
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\ParameterGenerator.cs (2)
72.WithType(parameter.Type.GenerateTypeSyntax()) 119=> ExpressionGenerator.GenerateExpression(generator, parameter.Type, value, canUseFieldReference: true);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.TypeSyntaxGeneratorVisitor.cs (1)
164var parameters = symbol.Signature.Parameters.Select(p => (p.Type, RefKindModifiers: CSharpSyntaxGeneratorInternal.GetParameterModifiers(p.RefKind)))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (3)
765.Select(p => new TypeInferenceInfo(p.Type, p.IsParams)); 778var info = new TypeInferenceInfo(parameter.Type, parameter.IsParams); 1207return CreateResult(parameter.Type);
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (2)
CodeGeneration\SyntaxGeneratorTests.cs (2)
990m.Name == WellKnownMemberNames.ExplicitConversionName && m.Parameters[0].Type.Equals(gcHandleType)); 998m.Name == WellKnownMemberNames.ImplicitConversionName && m.Parameters[0].Type.Equals(_emptyCompilation.GetSpecialType(SpecialType.System_Byte)));
Microsoft.CodeAnalysis.ExpressionEvaluator.ExpressionCompiler (2)
AbstractTypeParameterChecker.cs (1)
61Visit(symbol.Type);
InstructionDecoder.cs (1)
43builder.Append(parameter.Type.ToDisplayString(DisplayFormat));
Microsoft.CodeAnalysis.Features (68)
ChangeSignature\AbstractChangeSignatureService.cs (1)
1062var toType = methodSymbol.Parameters.Last().Type;
Completion\Providers\ImportCompletionProvider\AbstractExtensionMethodImportCompletionProvider.cs (1)
109IParameterSymbol parameterSymbol => parameterSymbol.Type,
Completion\Providers\ImportCompletionProvider\ExtensionMethodImportCompletionHelper.SymbolComputer.cs (2)
407if (filterReceiverTypeName.Length > 0 && !string.Equals(filterReceiverTypeName, GetReceiverTypeName(method.Parameters[0].Type), StringComparison.Ordinal)) 412receiverType = method.Parameters[0].Type;
ConvertForToForEach\AbstractConvertForToForEachCodeRefactoringProvider.cs (1)
534=> property is { IsIndexer: true, Parameters: [{ Type.SpecialType: SpecialType.System_Int32 }] };
EditAndContinue\Utilities\Extensions.cs (1)
176=> symbol is IMethodSymbol { Parameters: [var parameter] } && SymbolEqualityComparer.Default.Equals(parameter.Type, symbol.ContainingType);
EmbeddedLanguages\EmbeddedLanguageDetector.cs (1)
190m => m is IMethodSymbol { Parameters: [{ Type.SpecialType: SpecialType.System_String }, ..] });
ExtractMethod\MethodExtractor.Analyzer.cs (3)
170&& thisParameterBeingRead.Type is { TypeKind: TypeKind.Struct, IsReadOnly: false }; 654IParameterSymbol parameter => parameter.Type, 748AddTypeParametersToMap(TypeParameterCollector.Collect(parameter.Type), sortedMap);
ExtractMethod\MethodExtractor.TypeParameterCollector.cs (1)
39param.Type.Accept(this);
GenerateComparisonOperators\GenerateComparisonOperatorsCodeRefactoringProvider.cs (1)
247comparedType.Equals(method.Parameters[1].Type))
GenerateConstructorFromMembers\AbstractGenerateConstructorFromMembersCodeRefactoringProvider.State.cs (4)
106let constructorTypes = c.Parameters.Select(p => p.Type) 107let symbolTypes = parameters.Take(c.Parameters.Length).Select(p => p.Type) 118=> parameters.Select(p => p.Type).SequenceEqual(constructor.Parameters.Select(p => p.Type));
GenerateEqualsAndGetHashCodeFromMembers\GenerateEqualsAndGetHashCodeFromMembersCodeRefactoringProvider.cs (2)
130containingType.Equals(m.Parameters[0].Type) && 131containingType.Equals(m.Parameters[1].Type));
InitializeParameter\AbstractAddParameterCheckCodeRefactoringProvider.cs (6)
108if (parameter.Type.SpecialType == SpecialType.System_String) 160if (parameter.Type.SpecialType == SpecialType.System_String) 234else if (parameter.Type.SpecialType == SpecialType.System_String && 247if (parameter.Type.IsReferenceType) 250if (parameter.Type.NullableAnnotation == NullableAnnotation.Annotated) 253else if (!parameter.Type.IsNullable())
InitializeParameter\AbstractInitializeMemberFromParameterCodeRefactoringProviderMemberCreation.cs (4)
304parameter.Type, uniqueName); 345parameter.Type, 701IsImplicitConversion(compilation, source: parameter.Type, destination: field.Type) && 711IsImplicitConversion(compilation, source: parameter.Type, destination: property.Type) &&
InlineHints\AbstractInlineParameterNameHintsService.cs (1)
240return parameter.Type.SpecialType == SpecialType.System_Boolean;
InlineMethod\AbstractInlineMethodRefactoringProvider.InlineContext.cs (2)
259parameterAndName.parameterSymbol.Type, 282return (TStatementSyntax)syntaxGenerator.LocalDeclarationStatement(parameterSymbol.Type, name, expression);
InlineMethod\AbstractInlineMethodRefactoringProvider.MethodParametersInfo.cs (2)
503&& parameterSymbol.Type is IArrayTypeSymbol paramArrayParameter 523return GenerateLiteralExpression(parameterSymbol.Type, parameterSymbol.ExplicitDefaultValue);
IntroduceParameter\IntroduceParameterDocumentRewriter.cs (1)
605!parameter.Type.Equals(compilation.GetTypeByMetadataName(typeof(CancellationToken)?.FullName!));
LanguageServices\AnonymousTypeDisplayService\AbstractStructuralTypeDisplayService.StructuralTypeCollectorVisitor.cs (1)
114=> symbol.Type.Accept(this);
QuickInfo\CommonSemanticQuickInfoProvider.ErrorVisitor.cs (1)
73=> Visit(symbol.Type);
ReplaceMethodWithProperty\ReplaceMethodWithPropertyCodeRefactoringProvider.cs (1)
138SymbolEqualityComparer.IncludeNullability.Equals(parameter.Type, getMethod.ReturnType) &&
ReplacePropertyWithMethods\ReplacePropertyWithMethodsCodeRefactoringProvider.cs (1)
157comparer.Equals(m.Parameters[0].Type, property.Type));
RQName\RQNodeBuilder.cs (1)
145var parameterType = BuildType(parameter.Type);
Shared\Extensions\ISymbolExtensions_Sorting.cs (3)
78var xParamType = GetNamedType(xParam.Type); 79var yParamType = GetNamedType(yParam.Type); 136.Select(p => p.Type.ToMinimalDisplayString(semanticModel, position))
src\Analyzers\Core\Analyzers\Helpers\DeserializationConstructorCheck.cs (2)
21methodSymbol.Parameters[0].Type.Equals(_serializationInfoType) && 22methodSymbol.Parameters[1].Type.Equals(_streamingContextType) &&
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (2)
832attribute.AttributeConstructor?.Parameters is [_, { Name: "checkId", Type.SpecialType: SpecialType.System_String }, ..] && 841attribute.AttributeConstructor.Parameters[0].Type.SpecialType == SpecialType.System_String &&
src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (1)
744methodSymbol.Parameters[0].Type.Equals(memberSymbol.ContainingType))
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.BlockAnalyzer.cs (1)
433method.Parameters.Any(static p => p.IsRefOrOut() && p.Type.IsDelegateType())))
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.cs (4)
233method.Parameters is [{ Type.SpecialType: SpecialType.System_Object }, var secondParam] && 234secondParam.Type.InheritsFromOrEquals(_eventArgsType)) 273if (method is { MetadataName: "GetInstance", IsStatic: true, Parameters: [{ Type.SpecialType: SpecialType.System_String }] } && 295if (parameter.Type.SpecialType != SpecialType.System_Int32)
src\Analyzers\Core\Analyzers\SimplifyLinqExpression\AbstractSimplifyLinqExpressionDiagnosticAnalyzer.cs (1)
84if (parameters is [_, { Type: INamedTypeSymbol { Arity: 2 } }])
src\Analyzers\Core\Analyzers\UseCollectionInitializer\UpdateExpressionState.cs (2)
253useSpread = parameter.Type.Equals(convertedType); 263useSpread = method.GetOriginalUnreducedDefinition() is not IMethodSymbol { IsExtensionMethod: true, Parameters: [_, { Type: ITypeParameterSymbol }] };
src\Analyzers\Core\Analyzers\ValidateFormatString\AbstractValidateFormatStringDiagnosticAnalyzer.cs (1)
139var hasIFormatProvider = parameters[0].Type.Equals(formatProviderType);
src\Analyzers\Core\CodeFixes\AddExplicitCast\Fixer.cs (1)
153var parameterType = parameters[parameterIndex].Type;
src\Analyzers\Core\CodeFixes\AddParameter\AbstractAddParameterCodeFixProvider.cs (2)
496compilation, argumentTypeInfo, parameter.Type, 521if (parameter.IsParams && parameter.Type is IArrayTypeSymbol arrayType)
src\Analyzers\Core\CodeFixes\GenerateConstructor\AbstractGenerateConstructorService.State.cs (2)
225constructor.Parameters.Select(p => p.Type).SequenceEqual(ParameterTypes)) 259var result = SymbolEquivalenceComparer.Instance.Equals(ctorParameter.Type, ParameterTypes[i]) &&
src\Analyzers\Core\CodeFixes\GenerateConstructor\GenerateConstructorHelpers.cs (1)
113var conversion = semanticFacts.ClassifyConversion(semanticModel, expression, constructorParameter.Type);
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateMethodService.State.cs (1)
238var typeLocalName = parameter.Type.GetLocalName(fallback: parameter.Name);
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.SignatureInfo.cs (1)
106isUnsafe = returnType.RequiresUnsafeModifier() || parameters.Any(static p => p.Type.RequiresUnsafeModifier());
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.cs (1)
230Equals(parameter.Type, cancellationTokenType))
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementHelpers.cs (1)
153if (IsTypeLessAccessibleThanOtherType(parameter.Type, second, []))
src\Compilers\Core\Portable\DiagnosticAnalyzer\SuppressMessageAttributeState.TargetSymbolResolver.cs (1)
803return parameterType != null && symbol.Type.Equals(parameterType);
StackTraceExplorer\AbstractStackTraceSymbolResolver.cs (1)
100if (!MatchType(paramSymbol.Type, stackFrameParameter.Type))
Microsoft.CodeAnalysis.Test.Utilities (4)
Compilation\TestOperationVisitor.cs (3)
815semanticModel.Compilation.CreateBuiltinOperator(symbol.Name, method.ReturnType, method.Parameters[0].Type); 818semanticModel.Compilation.CreateBuiltinOperator(symbol.Name, method.ReturnType, method.Parameters[0].Type, method.Parameters[1].Type);
Diagnostics\CouldHaveMoreSpecificTypeAnalyzer.cs (1)
92AssignTo(argument.Value, localsSourceTypes, fieldsSourceTypes, argument.Parameter.Type);
Microsoft.CodeAnalysis.VisualBasic (3)
SymbolDisplay\SymbolDisplayVisitor.Members.vb (2)
552symbol.Type.Accept(Me.NotFirstVisitor()) 561AddConstantValue(symbol.Type, symbol.ExplicitDefaultValue)
Symbols\ParameterSymbol.vb (1)
318Private ReadOnly Property IParameterSymbol_Type As ITypeSymbol Implements IParameterSymbol.Type
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (4)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SemanticModelExtensions.vb (1)
256If parameter.Type.TypeKind <> TypeKind.TypeParameter Then
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SyntaxNodeExtensions.vb (1)
1091expressionTypeOpt.Equals(method.Parameters(0).Type.OriginalDefinition) Then
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Utilities\CastAnalyzer.vb (2)
38If parameter?.IsParams = True AndAlso TypeOf parameter.Type Is IArrayTypeSymbol Then 39Dim parameterType = DirectCast(parameter.Type, IArrayTypeSymbol)
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (10)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\EventGenerator.vb (1)
194Return CodeGenerationSymbolFactory.CreateParameterSymbol(parameter.GetAttributes(), parameter.RefKind, isParams:=False, type:=parameter.Type, name:=parameter.Name, hasDefaultValue:=False)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\ParameterGenerator.vb (5)
43If parameter.Type.IsArrayType() Then 44Dim arrayType = DirectCast(parameter.Type, IArrayTypeSymbol) 62Dim asClause = If(parameter.Type Is Nothing, 64SyntaxFactory.SimpleAsClause(type:=parameter.Type.GenerateTypeSyntax())) 96parameter.Type,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\IMethodSymbolExtensions.vb (2)
32If parameter.Type.TypeKind = TypeKind.Delegate Then 33Dim delegateInvokeMethod = DirectCast(parameter.Type, INamedTypeSymbol).DelegateInvokeMethod
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ParameterSyntaxExtensions.vb (2)
29Equals(oldSymbol.Type, newSymbol.Type) Then
Microsoft.CodeAnalysis.VisualBasic.Features (6)
Completion\CompletionProviders\EnumCompletionProvider.vb (1)
93If(TryCast(symbol, IParameterSymbol)?.Type,
ExtractMethod\VisualBasicMethodExtractor.VisualBasicCodeGenerator.vb (1)
356Return method.Parameters(0).Type.SpecialType = SpecialType.System_Boolean
IntroduceParameter\VisualBasicIntroduceParameterCodeRefactoringProvider.vb (1)
23Return GenerateExpression(VisualBasicSyntaxGenerator.Instance, parameterSymbol.Type, parameterSymbol.ExplicitDefaultValue, canUseFieldReference:=True)
SignatureHelp\FunctionAggregationSignatureHelpProvider.vb (2)
146If parameter.Type.TypeKind = TypeKind.Delegate Then 147Dim delegateInvokeMethod = DirectCast(parameter.Type, INamedTypeSymbol).DelegateInvokeMethod
SignatureHelp\ObjectCreationExpressionSignatureHelpProvider.DelegateType.vb (1)
67parts.AddRange(parameter.Type.ToMinimalDisplayParts(semanticModel, position))
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (21)
Compilation\SemanticModelGetDeclaredSymbolAPITests.vb (13)
1255Assert.Equal("System.Int32", paramSymbol1.Type.ToTestDisplayString()) 1263Assert.Equal("System.String", paramSymbol2.Type.ToTestDisplayString()) 1271Assert.Equal("System.Int64", paramSymbol3.Type.ToTestDisplayString()) 1279Assert.Equal("System.Int32", paramSymbol4.Type.ToTestDisplayString()) 1287Assert.Equal("System.String", paramSymbol5.Type.ToTestDisplayString()) 1321Assert.Equal("System.Single", paramSymbol1.Type.ToTestDisplayString()) 1368Assert.Equal("System.Int64", paramSymbol1.Type.ToTestDisplayString()) 1373Assert.Equal("System.Single", paramSymbol2.Type.ToTestDisplayString()) 1378Assert.Equal("System.Int32", paramSymbol3.Type.ToTestDisplayString()) 1383Assert.Equal("System.String", paramSymbol4.Type.ToTestDisplayString()) 1388Assert.Equal("System.String", paramSymbol5.Type.ToTestDisplayString()) 1392Assert.Equal("System.Double", paramSymbol6.Type.ToTestDisplayString()) 1396Assert.Equal("System.Decimal", paramSymbol7.Type.ToTestDisplayString())
Semantics\NativeIntegerTests.vb (8)
27VerifyType(DirectCast(method.Parameters(0).Type, INamedTypeSymbol), signed:=True, isNativeInteger:=False) 28VerifyType(DirectCast(method.Parameters(1).Type, INamedTypeSymbol), signed:=True, isNativeInteger:=True) 32VerifyType(DirectCast(method.Parameters(0).Type, INamedTypeSymbol), signed:=False, isNativeInteger:=False) 33VerifyType(DirectCast(method.Parameters(1).Type, INamedTypeSymbol), signed:=False, isNativeInteger:=True) 41VerifyType(DirectCast(method.Parameters(0).Type, INamedTypeSymbol), signed:=True, isNativeInteger:=False) 42VerifyType(DirectCast(method.Parameters(1).Type, INamedTypeSymbol), signed:=True, isNativeInteger:=False) 46VerifyType(DirectCast(method.Parameters(0).Type, INamedTypeSymbol), signed:=False, isNativeInteger:=False) 47VerifyType(DirectCast(method.Parameters(1).Type, INamedTypeSymbol), signed:=False, isNativeInteger:=False)
Microsoft.CodeAnalysis.VisualBasic.Workspaces (16)
Recommendations\VisualBasicRecommendationServiceRunner.vb (1)
257useBaseReferenceAccessibility = Not parameter.Type.Equals(container)
Simplification\VisualBasicSimplificationService.Expander.vb (2)
84Dim conversionType = conversion.MethodSymbol.Parameters(0).Type 108Dim symbolType = newNodeSymbol.Type
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SemanticModelExtensions.vb (1)
256If parameter.Type.TypeKind <> TypeKind.TypeParameter Then
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SyntaxNodeExtensions.vb (1)
1091expressionTypeOpt.Equals(method.Parameters(0).Type.OriginalDefinition) Then
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Utilities\CastAnalyzer.vb (2)
38If parameter?.IsParams = True AndAlso TypeOf parameter.Type Is IArrayTypeSymbol Then 39Dim parameterType = DirectCast(parameter.Type, IArrayTypeSymbol)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\EventGenerator.vb (1)
194Return CodeGenerationSymbolFactory.CreateParameterSymbol(parameter.GetAttributes(), parameter.RefKind, isParams:=False, type:=parameter.Type, name:=parameter.Name, hasDefaultValue:=False)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\ParameterGenerator.vb (5)
43If parameter.Type.IsArrayType() Then 44Dim arrayType = DirectCast(parameter.Type, IArrayTypeSymbol) 62Dim asClause = If(parameter.Type Is Nothing, 64SyntaxFactory.SimpleAsClause(type:=parameter.Type.GenerateTypeSyntax())) 96parameter.Type,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\IMethodSymbolExtensions.vb (2)
32If parameter.Type.TypeKind = TypeKind.Delegate Then 33Dim delegateInvokeMethod = DirectCast(parameter.Type, INamedTypeSymbol).DelegateInvokeMethod
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ParameterSyntaxExtensions.vb (1)
29Equals(oldSymbol.Type, newSymbol.Type) Then
Microsoft.CodeAnalysis.Workspaces (61)
Editing\SyntaxGenerator.cs (4)
243method.Parameters.Any(p => p.Type.GetReferencedTypeParameters().Any(t => IsNullableAnnotatedTypeParameter(typeParameter, t))); 325TypeExpression(symbol.Type), 327symbol.HasExplicitDefaultValue ? GenerateExpression(symbol.Type, symbol.ExplicitDefaultValue, canUseFieldReference: true) : null, 332or { RefKind: RefKind.None, Type.IsRefLikeType: true, ScopedKind: ScopedKind.ScopedValue });
Recommendations\AbstractRecommendationServiceRunner.cs (8)
53? GetMemberSymbols(parameter.Type, position, excludeInstance: false, useBaseReferenceAccessibility, unwrapNullable, isForDereference) 126if (!parameterTypeSymbols.Contains(parameter.Type, SymbolEqualityComparer.Default)) 127parameterTypeSymbols = parameterTypeSymbols.Concat(parameter.Type); 229builder.Add(parameters[ordinalInLambda].Type); 242parameterType = method.Parameters.FirstOrDefault(p => _stringComparerForLanguage.Equals(p.Name, argumentName))?.Type; 249if (method.Parameters.LastOrDefault()?.Type is IArrayTypeSymbol arrayType) 263parameterType = method.Parameters[ordinalInInvocation].Type; 415if (originalMember is IMethodSymbol { Parameters: [{ Type: ITypeParameterSymbol parameterType }, ..] })
Rename\ConflictEngine\DeclarationConflictHelpers.cs (1)
111signatureBuilder.Add(parameter.Type);
Shared\Extensions\IMethodSymbolExtensions.cs (4)
48if (!invoke.Parameters[i].Type.InheritsFromOrEquals(method.Parameters[i].Type)) 87return p1.Select(p => p.Type).ToList().AreMoreSpecificThan(p2.Select(p => p.Type).ToList());
Shared\Extensions\IParameterSymbolExtensions.cs (1)
21parameter.Type,
Shared\Extensions\ISymbolExtensions.cs (2)
529if (!left.Parameters[i].Type.Equals(right.Parameters[i].Type))
Shared\Utilities\EditorBrowsableHelpers.cs (3)
43.Where(c => c.Parameters.Length == 1 && Equals(c.Parameters[0].Type, editorBrowsableStateType)); 109(Equals(c.Parameters[0].Type, typeLibFlagsType) || Equals(c.Parameters[0].Type, shortType)));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\IMethodSymbolExtensions.cs (2)
45method.Parameters is [{ Type.SpecialType: SpecialType.System_Object }, var secondParam] && 46secondParam.Type.InheritsFromOrEquals(eventArgsType);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\INamedTypeSymbolExtensions.cs (1)
234return method.Parameters.Any(static (p, within) => p.Type.Equals(within, SymbolEqualityComparer.Default), within);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.cs (5)
282IParameterSymbol parameterSymbol => parameterSymbol.Type, 349return ((IParameterSymbol)symbol).Type; 449.Select(p => (p.Type ?? compilation.GetSpecialType(SpecialType.System_Object)).WithNullableAnnotation(p.NullableAnnotation)); 567IParameterSymbol parameterSymbol => parameterSymbol.Type, 634if (!methods.Any(x => x.Name == WellKnownMemberNames.OnCompleted && x.ReturnsVoid && x.Parameters is [{ Type.TypeKind: TypeKind.Delegate }]))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.RequiresUnsafeModifierVisitor.cs (1)
126return symbol.Type.Accept(this);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions_Accessibility.cs (1)
113if (!IsSymbolAccessibleCore(param.Type, within, null, out failedThroughTypeCheck))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.CollectTypeParameterSymbolsVisitor.cs (1)
46parameter.Type.Accept(this);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.MinimalAccessibilityVisitor.cs (1)
35accessibility = AccessibilityUtilities.Minimum(accessibility, parameter.Type.Accept(this));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (2)
37/// the "same" <see cref="IParameterSymbol.Type"/>s and 61/// the "same" <see cref="IParameterSymbol.Type"/>s and
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (1)
402if (!signatureComparer.Equals(originalParameterTypes[i], parameters[i].Type))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (1)
80_writeParameterType = p => WriteSymbolKey(p.Type);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (2)
474CompareAcrossSemanticModels(parameterSymbol.Type, newParameterSymbol.Type);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.EquivalenceVisitor.cs (2)
570AreEquivalent(x.Type, y.Type, equivalentTypesWithDifferingAssemblies) &&
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (1)
228GetHashCode(x.Type,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.ParameterSymbolEqualityComparer.cs (3)
50symbolEqualityComparer.SignatureTypeEquivalenceComparer.Equals(x.Type, y.Type, equivalentTypesWithDifferingAssemblies); 68symbolEqualityComparer.SignatureTypeEquivalenceComparer.GetHashCode(x.Type));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationSymbolFactory.cs (1)
305type ?? parameter.Type,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\IMethodSymbolExtensions.cs (2)
73CodeGenerationSymbolFactory.CreateParameterSymbol(p.GetAttributes(), p.RefKind, p.IsParams, p.Type.SubstituteTypes(mapping, typeGenerator), p.Name, p.IsOptional, 170p.RefKind, p.IsParams, p.Type, p.Name, p.IsOptional,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\IParameterSymbolExtensions.cs (1)
30parameter.Type,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\IPropertySymbolExtensions.cs (1)
63p.RefKind, p.IsParams, p.Type, p.Name, p.IsOptional,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions.cs (5)
277type: parameter.Type, 299type: parameter.Type, 331var parameterType = parameter.Type; 380var shouldAddNullCheck = addNullChecks && parameter.Type.CanAddNullCheck() && !parameter.Type.IsNullable();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (2)
80.Single(m => containingType.Equals(m.Parameters.FirstOrDefault()?.Type)); 449method.Parameters[0].Type.SpecialType == SpecialType.System_Object &&
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\TypeInferenceService\AbstractTypeInferenceService.AbstractTypeInferrer.cs (2)
93parameterSymbol.Type 98if (parameterSymbol.Type is IArrayTypeSymbol arrayTypeSymbol)
Microsoft.CodeAnalysis.Workspaces.UnitTests (4)
SymbolKeyTests.cs (2)
1038Assert.True(method.Parameters[0].Type.IsTupleType); 1075Assert.True(method.Parameters[0].Type.IsTupleType);
UtilityTest\DocumentationCommentIdTests.cs (2)
216CheckDeclarationId<IMethodSymbol>("M:Acme.ValueType.M(System.Int32)", compilation, s => s.Name == "M" && s.Parameters is [{ Type.Name: "Int32" }]); 217CheckDeclarationId<IMethodSymbol>("M:Acme.Widget.NestedClass.M(System.Int32)", compilation, s => s.Name == "M" && s.Parameters is [{ Type.Name: "Int32" }]);
Microsoft.DotNet.CodeAnalysis (2)
Analyzers\AppContextDefaultsAnalyzer.cs (2)
147if (methodSym.Parameters[0].Type.SpecialType != SpecialType.System_String) 150if (methodSym.Parameters[1].Type.SpecialType != SpecialType.System_Boolean)
Microsoft.Extensions.Logging.Generators (2)
LoggerMessageGenerator.Parser.cs (2)
355ITypeSymbol paramTypeSymbol = paramSymbol.Type; 694if (IsBaseOrIdentity(parameter.Type, loggerSymbol))
Microsoft.Extensions.Options.SourceGeneration (4)
Parser.cs (4)
204&& m.Parameters[0].Type.SpecialType == SpecialType.System_String 205&& SymbolEqualityComparer.Default.Equals(m.Parameters[1].Type, modelType)); 622if (constructorParameters.Length == 1 && constructorParameters[0].Name == "otherProperty" && constructorParameters[0].Type.SpecialType == SpecialType.System_String) 646argumentType = constructorParameters[0].Type;
Microsoft.Gen.ComplianceReports (3)
Parser.cs (3)
128ci.TypeName = FormatType(ps.Type); 225TypeName = FormatType(p.Type), 229foreach (var attribute in p.Type.GetAttributes())
Microsoft.Gen.Logging (15)
Parsing\Parser.cs (7)
152&& paramSymbol.Type.Kind != SymbolKind.TypeParameter) 154Diag(DiagDescriptors.DefaultToString, paramSymbol.GetLocation(), paramSymbol.Type, paramSymbol.Name); 189paramSymbol.Type.IsRecord) 192RecordHasSensitivePublicMembers(paramSymbol.Type, symbols)) 536var paramTypeSymbol = paramSymbol.Type; 716if (ParserUtilities.IsBaseOrIdentity(parameter.Type, loggerSymbol, _compilation)) 731isNullable = parameter.Type.NullableAnnotation == NullableAnnotation.Annotated;
Parsing\Parser.LogProperties.cs (2)
37if (!CanLogProperties(paramSymbol, paramSymbol.Type, symbols)) 42var paramTypeSymbol = paramSymbol.Type;
Parsing\Parser.TagProvider.cs (3)
26var paramTypeSymbol = paramSymbol.Type; 101&& SymbolEqualityComparer.Default.Equals(tagCollectorType, method.Parameters[0].Type) 102&& IsAssignableTo(complexObjType, method.Parameters[1].Type))
Parsing\TypeSymbolExtensions.cs (3)
28&& SymbolEqualityComparer.Default.Equals(ts.Parameters[0].Type, symbols.FormatProviderSymbol)) 51&& ts.Parameters[0].Type.SpecialType == SpecialType.System_String 52&& SymbolEqualityComparer.Default.Equals(ts.Parameters[1].Type, symbols.FormatProviderSymbol))
Microsoft.Gen.Logging.Unit.Tests (1)
LogParserUtilitiesTests.cs (1)
172paramSymbolMock.SetupGet(x => x.Type)
Microsoft.Gen.Metrics (1)
Parser.cs (1)
531var paramTypeSymbol = paramSymbol.Type;
Microsoft.Gen.MetricsReports (1)
src\Generators\Microsoft.Gen.Metrics\Parser.cs (1)
531var paramTypeSymbol = paramSymbol.Type;
Microsoft.Interop.ComInterfaceGenerator (1)
src\libraries\System.Runtime.InteropServices\gen\Common\ConvertToSourceGeneratedInteropFixer.cs (1)
244if (parameter.Type.SpecialType == SpecialType.System_Boolean
Microsoft.Interop.LibraryImportGenerator (19)
Analyzers\ConvertToLibraryImportFixer.cs (1)
683if (param.Type.SpecialType is SpecialType.System_String or SpecialType.System_Char)
Analyzers\CustomMarshallerAttributeAnalyzer.cs (9)
894if (!SymbolEqualityComparer.Default.Equals(methods.UnmanagedValuesDestination.Parameters[0].Type, unmanagedType)) 915if (unmanagedType is not null && !SymbolEqualityComparer.Default.Equals(unmanagedType, toManagedMethod.Parameters[0].Type)) 921unmanagedType = toManagedMethod.Parameters[0].Type; 925if (!SymbolEqualityComparer.Default.Equals(methods.UnmanagedValuesSource.Parameters[0].Type, unmanagedType)) 934if (!SymbolEqualityComparer.Default.Equals(methods.ToManaged.Parameters[1].Type, methods.ToManagedFinally.Parameters[1].Type)) 987INamedTypeSymbol allocatedBufferType = (INamedTypeSymbol)callerAllocatedBufferMethod.Parameters[1].Type; 1213if (unmanagedType is not null && !SymbolEqualityComparer.Default.Equals(unmanagedType, fromUnmanagedMethod.Parameters[0].Type)) 1220unmanagedType = fromUnmanagedMethod.Parameters[0].Type;
Analyzers\CustomMarshallerAttributeFixer.cs (7)
363unmanagedType = methods.ToManaged.Parameters[0].Type; 367unmanagedType = methods.ToManagedFinally.Parameters[0].Type; 371unmanagedType = methods.UnmanagedValuesSource.Parameters[0].Type; 375unmanagedType = methods.UnmanagedValuesDestination.Parameters[0].Type; 534unmanagedType = methods.FromUnmanaged.Parameters[0].Type; 538unmanagedType = methods.UnmanagedValuesSource.Parameters[0].Type; 542unmanagedType = methods.UnmanagedValuesDestination.Parameters[0].Type;
Analyzers\NativeMarshallingAttributeAnalyzer.cs (1)
170IParameterSymbol param => param.Type,
src\libraries\System.Runtime.InteropServices\gen\Common\ConvertToSourceGeneratedInteropFixer.cs (1)
244if (parameter.Type.SpecialType == SpecialType.System_Boolean
Microsoft.Interop.SourceGeneration (32)
ManualTypeMarshallingHelper.cs (6)
492nativeType = methods.UnmanagedValuesSource.Parameters[0].Type; 506nativeType = methods.ToManagedFinally.Parameters[0].Type; 510nativeType = methods.ToManaged.Parameters[0].Type; 525bufferElementType = ManagedTypeInfo.CreateTypeInfoForTypeSymbol(((INamedTypeSymbol)methods.ToUnmanagedWithBuffer.Parameters[1].Type).TypeArguments[0]); 585nativeType = methods.FromUnmanaged.Parameters[0].Type; 605bufferElementType = ManagedTypeInfo.CreateTypeInfoForTypeSymbol(((INamedTypeSymbol)methods.FromManagedWithBuffer.Parameters[1].Type).TypeArguments[0]);
MarshallerShape.cs (22)
221&& SymbolEqualityComparer.Default.Equals(m.Parameters[0].Type, managedType)); 263&& SymbolEqualityComparer.Default.Equals(managedType, m.Parameters[0].Type)); 275&& SymbolEqualityComparer.Default.Equals(managedType, m.Parameters[0].Type)); 279if (IsSpanOfUnmanagedType(method.Parameters[1].Type, spanOfT, type)) 315&& managedType.IsConstructedFromEqualTypes(m.Parameters[0].Type) 316&& m.Parameters[1].Type.SpecialType == SpecialType.System_Int32 326&& managedType.IsConstructedFromEqualTypes(m.Parameters[0].Type) 327&& m.Parameters[2].Type.SpecialType == SpecialType.System_Int32 332if (IsSpanOfUnmanagedType(method.Parameters[1].Type, spanOfT, type)) 347&& managedType.IsConstructedFromEqualTypes(m.Parameters[0].Type) 357&& m.Parameters[1].Type.SpecialType == SpecialType.System_Int32 367&& m.Parameters[1].Type.SpecialType == SpecialType.System_Int32 377&& m.Parameters[1].Type.SpecialType == SpecialType.System_Int32 387&& managedType.IsConstructedFromEqualTypes(m.Parameters[0].Type) 397&& m.Parameters[1].Type.SpecialType == SpecialType.System_Int32 566&& SymbolEqualityComparer.Default.Equals(managedType, m.Parameters[0].Type)); 577&& SymbolEqualityComparer.Default.Equals(managedType, m.Parameters[0].Type)); 581if (StatelessMarshallerShapeHelper.IsSpanOfUnmanagedType(method.Parameters[1].Type, spanOfT, type)) 641if (SymbolEqualityComparer.Default.Equals(candidates[0].Parameters[0].Type, unmanagedType)) 672&& SymbolEqualityComparer.Default.Equals(m.Parameters[0].Type, managedType)); 709&& m.Parameters[0].Type.SpecialType == SpecialType.System_Int32 719&& m.Parameters[0].Type.SpecialType == SpecialType.System_Int32
MethodSignatureElementInfoProvider.cs (2)
49marshallingInfoCallback(param.Type, new UseSiteAttributeProvider(_useSiteAttributeParsers, param.GetAttributes(), rootProvider, _generatorDiagnostics, marshallingInfoCallback), 0), _compilation) with 71marshallingInfoCallback(param.Type, new UseSiteAttributeProvider(_useSiteAttributeParsers, param.GetAttributes(), rootProvider, _generatorDiagnostics, marshallingInfoCallback), 0), _compilation) with
SignatureContext.cs (1)
112MarshallingInfo marshallingInfo = marshallingInfoParser.ParseMarshallingInfo(param.Type, param.GetAttributes());
TypePositionInfo.cs (1)
92var typeInfo = new TypePositionInfo(ManagedTypeInfo.CreateTypeInfoForTypeSymbol(paramSymbol.Type), marshallingInfo)
Microsoft.VisualStudio.LanguageServices (7)
ChangeSignature\ChangeSignatureDialogViewModel.ParameterViewModels.cs (2)
218public override string Type => ParameterSymbol.Type.ToDisplayString(s_parameterDisplayFormat); 243return ParameterSymbol.ExplicitDefaultValue == null ? (ParameterSymbol.Type.IsReferenceType ? @null : @default) :
ProjectSystem\AbstractEntryPointFinder.cs (2)
57if (parameter.Type is IArrayTypeSymbol) 59var elementType = ((IArrayTypeSymbol)parameter.Type).ElementType;
Venus\ContainedLanguageCodeSupport.cs (3)
388if (!method.Parameters[0].Type.Equals(compilation.ObjectType)) 393if (!method.Parameters[1].Type.InheritsFromOrEquals(compilation.EventArgsType())) 450return string.Format("{0}({1})", member.Name, string.Join(",", ((IMethodSymbol)member).Parameters.Select(p => p.Type.ToDisplayString())));
Microsoft.VisualStudio.LanguageServices.CSharp (2)
CodeModel\CSharpCodeModelService_Prototype.cs (1)
541builder.Append(GetAsStringForCodeTypeRef(parameter.Type));
ObjectBrowser\DescriptionBuilder.cs (1)
450AddTypeLink(current.Type, LinkFlags.None);
Microsoft.VisualStudio.LanguageServices.VisualBasic (2)
CodeModel\VisualBasicCodeModelService_Prototype.vb (1)
190builder.Append(parameter.Type.ToDisplayString(s_prototypeFullNameFormat))
ObjectBrowser\DescriptionBuilder.vb (1)
402AddTypeLink(current.Type, LinkFlags.None)
System.Text.Json.SourceGeneration (4)
Helpers\RoslynExtensions.cs (2)
322if (parameter.Type.IsNullableType()) 329return !IsInputTypeNonNullable(parameter, parameter.Type);
JsonSourceGenerator.Parser.cs (2)
1470if (parameterInfo.Type.IsRefLikeType) 1477TypeRef parameterTypeRef = EnqueueType(parameterInfo.Type, typeToGenerate.Mode);
System.Windows.Forms.Analyzers.CSharp (1)
System\Windows\Forms\CSharp\Analyzers\AvoidPassingTaskWithoutCancellationToken\AvoidPassingTaskWithoutCancellationTokenAnalyzer.cs (1)
49if (funcParameter.Type is not INamedTypeSymbol funcType
System.Windows.Forms.Analyzers.VisualBasic (2)
Analyzers\AvoidPassingTaskWithoutCancellationToken\AvoidPassingTaskWithoutCancellationTokenAnalyzer.vb (2)
54If Not (TypeOf funcParameter.Type Is INamedTypeSymbol) Then 58Dim funcType = DirectCast(funcParameter.Type, INamedTypeSymbol)