Binder\Binder.CapturedParametersFinder.cs (2)
168if (isTypeOrValueReceiver(enclosingBinder, id, parameter.Type, out SyntaxNode? memberAccessNode, out string? memberName, out int targetMemberArity, out bool invoked))
171if (TreatAsInstanceMemberAccess(enclosingBinder, parameter.Type, memberAccessNode, memberName, targetMemberArity, invoked, lookupResult))
Binder\Binder_Conversions.cs (12)
580method.Parameters[0].Type is ArrayTypeSymbol { IsSZArray: true, ElementType: TypeParameterSymbol });
590static (readonlySpanType, method) => method.Parameters[0].Type.IsSpan() &&
640arg.source.Equals(parameter.Type.OriginalDefinition, TypeCompareKind.ConsiderEverything) &&
646((NamedTypeSymbol)parameter.Type).TypeArgumentsWithAnnotationsNoUseSiteDiagnostics[0].Type.Equals(typeArgument.Type, TypeCompareKind.ConsiderEverything) &&
669Parameters: [{ Type.SpecialType: SpecialType.System_String }]
1061var parameterType = (NamedTypeSymbol)collectionBuilderMethod.Parameters[0].Type;
1530var conversion = conversions.ConvertExtensionMethodThisArg(constructed.Parameters[0].Type, receiverType, ref useSiteInfo, isMethodGroupConversion: false);
1876if (method.Parameters is not [{ RefKind: RefKind.None, Type: var parameterType }]
1894var spanTypeArg = ((NamedTypeSymbol)methodWithTargetTypeParameters.Parameters[0].Type).TypeArgumentsWithAnnotationsNoUseSiteDiagnostics[0].Type;
2842(Conversions.ConvertExtensionMethodThisArg(methodParameters[0].Type, receiverOpt!.Type, ref useSiteInfo, isMethodGroupConversion: true).Exists && useSiteInfo.Diagnostics.IsNullOrEmpty()));
2866source: delegateParameter.Type,
2867destination: methodParameter.Type,
Binder\Binder_Expressions.cs (15)
511defaultValueBinder.GenerateConversionForAssignment(parameter.Type, valueBeforeConversion, diagnostics, ConversionForAssignmentFlags.DefaultParameter));
2092if (IsBadLocalOrParameterCapture(parameter, parameter.Type, parameter.RefKind))
2100else if (parameter.Type.IsRestrictedType(ignoreSpanLikeTypes: true))
2102Error(diagnostics, ErrorCode.ERR_SpecialByRefInLambda, node, parameter.Type);
2106Debug.Assert(parameter.Type.IsRefLikeOrAllowsRefLikeType());
2116(parameter.RefKind != RefKind.None || parameter.Type.IsRestrictedType()) &&
2123else if (parameter.Type.IsRestrictedType(ignoreSpanLikeTypes: true))
2125Error(diagnostics, ErrorCode.ERR_UnsupportedPrimaryConstructorParameterCapturingRefAny, node, parameter.Type);
2129Debug.Assert(parameter.Type.IsRefLikeOrAllowsRefLikeType());
3603if (parameters[paramsIndex].Type.IsSZArray())
3826placeholderType = parameter.Type;
3845placeholderType = parameter.Type;
10036original.Parameters[0] is { Type.SpecialType: SpecialType.System_Int32, RefKind: RefKind.None })
10134original.Parameters[0] is { Type.SpecialType: SpecialType.System_Int32, RefKind: RefKind.None } &&
10135original.Parameters[1] is { Type.SpecialType: SpecialType.System_Int32, RefKind: RefKind.None };
Lowering\ClosureConversion\ExpressionLambdaRewriter.cs (6)
702var conversionInputType = method.Parameters[0].Type;
709? Convert(Visit(node.Operand), node.Operand.Type, method.Parameters[0].Type, node.Checked, false)
767unquoted = _bound.Call(_bound.MethodInfo(method, createDelegate.ContainingType), createDelegate, _bound.Typeof(delegateType, createDelegate.Parameters[0].Type), receiver);
774_bound.Typeof(delegateType, createDelegate.Parameters[0].Type),
776_bound.MethodInfo(method, createDelegate.Parameters[2].Type));
847_bound.Typeof(_typeMap.SubstituteType(p.Type).Type, _bound.WellKnownType(WellKnownType.System_Type)), _bound.Literal(p.Name));
Lowering\Instrumentation\LocalStateTracingInstrumenter.cs (9)
312var parameterLogger = GetLocalOrParameterStoreLogger(parameter.Type, parameter, refAssignmentSourceIsLocal: null, _factory.Syntax);
316MakeStoreLoggerArguments(parameterLogger.Parameters[0], parameter, parameter.Type, _factory.Parameter(parameter), refAssignmentSourceIndex: null, _factory.Literal((ushort)parameter.Ordinal)))));
424type = parameterSymbol.Type;
450if (parameter.Type.IsVoidPointer() && !targetType.IsPointerOrFunctionPointer())
453Debug.Assert(!parameter.Type.IsManagedTypeNoUseSiteDiagnostics);
456(BoundExpression)new BoundAddressOfOperator(_factory.Syntax, value, isManaged: false, parameter.Type) :
457_factory.Sequence(new[] { value }, new BoundAddressOfOperator(_factory.Syntax, VariableRead(targetSymbol), isManaged: false, parameter.Type));
462if (parameter.Type.SpecialType == SpecialType.System_String && targetType.SpecialType != SpecialType.System_String)
482return ImmutableArray.Create(_factory.Convert(parameter.Type, value), index);
Symbols\Source\SourceComplexParameterSymbol.cs (19)
348new BoundLiteral(parameterSyntax, defaultValue, Type));
402if (Type.IsNullableType())
404convertedExpression = binder.GenerateConversionForAssignment(Type.GetNullableUnderlyingType(),
881return UseUpdatedEscapeRules && (RefKind != RefKind.None || (HasParamsModifier && Type.IsRefLikeOrAllowsRefLikeType()));
991if (this.Type.IsReferenceType)
1015else if (!compilation.Conversions.ClassifyConversionFromType((TypeSymbol)arg.TypeInternal, this.Type, isChecked: false, ref useSiteInfo).Kind.IsImplicitConversion())
1224if (!Type.Equals(this.DeclaringCompilation.GetWellKnownType(WellKnownType.System_Threading_CancellationToken)))
1247if (Type is not NamedTypeSymbol { IsInterpolatedStringHandlerType: true } handlerType)
1250diagnostics.Add(ErrorCode.ERR_TypeIsNotAnInterpolatedStringHandlerType, arguments.AttributeSyntaxOpt.Location, Type);
1509public sealed override bool IsParamsArray => (_parameterSyntaxKind & ParameterFlags.ParamsParameter) != 0 && this.Type.IsSZArray();
1511public sealed override bool IsParamsCollection => (_parameterSyntaxKind & ParameterFlags.ParamsParameter) != 0 && !this.Type.IsSZArray();
1539if (DeclaredScope == ScopedKind.ScopedValue && !Type.IsErrorOrRefLikeOrAllowsRefLikeType())
1556var collectionTypeKind = ConversionsBase.GetCollectionExpressionTypeKind(DeclaringCompilation, Type, out TypeWithAnnotations elementTypeWithAnnotations);
1570binder.TryGetCollectionIterationType(syntax, Type, out elementTypeWithAnnotations);
1578if (!binder.HasCollectionExpressionApplicableConstructor(syntax, Type, out MethodSymbol? constructor, isExpanded: out _, diagnostics, isParamsModifierValidation: true))
1588if (!binder.HasCollectionExpressionApplicableAddMethod(syntax, Type, out ImmutableArray<MethodSymbol> addMethods, diagnostics))
1598diagnostics.Add(ErrorCode.ERR_ParamsCollectionExtensionAddMethod, syntax, Type);
1629binder.TryGetCollectionIterationType(syntax, Type, out elementTypeWithAnnotations);
1637MethodSymbol? collectionBuilderMethod = binder.GetAndValidateCollectionBuilderMethod(syntax, (NamedTypeSymbol)Type, diagnostics, elementType: out _);