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));
2095if (IsBadLocalOrParameterCapture(parameter, parameter.Type, parameter.RefKind))
2103else if (parameter.Type.IsRestrictedType(ignoreSpanLikeTypes: true))
2105Error(diagnostics, ErrorCode.ERR_SpecialByRefInLambda, node, parameter.Type);
2109Debug.Assert(parameter.Type.IsRefLikeOrAllowsRefLikeType());
2119(parameter.RefKind != RefKind.None || parameter.Type.IsRestrictedType()) &&
2126else if (parameter.Type.IsRestrictedType(ignoreSpanLikeTypes: true))
2128Error(diagnostics, ErrorCode.ERR_UnsupportedPrimaryConstructorParameterCapturingRefAny, node, parameter.Type);
2132Debug.Assert(parameter.Type.IsRefLikeOrAllowsRefLikeType());
3606if (parameters[paramsIndex].Type.IsSZArray())
3829placeholderType = parameter.Type;
3848placeholderType = parameter.Type;
10037original.Parameters[0] is { Type.SpecialType: SpecialType.System_Int32, RefKind: RefKind.None })
10135original.Parameters[0] is { Type.SpecialType: SpecialType.System_Int32, RefKind: RefKind.None } &&
10136original.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)
349new BoundLiteral(parameterSyntax, defaultValue, Type));
403if (Type.IsNullableType())
405convertedExpression = binder.GenerateConversionForAssignment(Type.GetNullableUnderlyingType(),
887return RefKind != RefKind.None || (HasParamsModifier && Type.IsRefLikeOrAllowsRefLikeType());
997if (this.Type.IsReferenceType)
1021else if (!compilation.Conversions.ClassifyConversionFromType((TypeSymbol)arg.TypeInternal, this.Type, isChecked: false, ref useSiteInfo).Kind.IsImplicitConversion())
1230if (!Type.Equals(this.DeclaringCompilation.GetWellKnownType(WellKnownType.System_Threading_CancellationToken)))
1253if (Type is not NamedTypeSymbol { IsInterpolatedStringHandlerType: true } handlerType)
1256diagnostics.Add(ErrorCode.ERR_TypeIsNotAnInterpolatedStringHandlerType, arguments.AttributeSyntaxOpt.Location, Type);
1515public sealed override bool IsParamsArray => (_parameterSyntaxKind & ParameterFlags.ParamsParameter) != 0 && this.Type.IsSZArray();
1517public sealed override bool IsParamsCollection => (_parameterSyntaxKind & ParameterFlags.ParamsParameter) != 0 && !this.Type.IsSZArray();
1545if (DeclaredScope == ScopedKind.ScopedValue && !Type.IsErrorOrRefLikeOrAllowsRefLikeType())
1562var collectionTypeKind = ConversionsBase.GetCollectionExpressionTypeKind(DeclaringCompilation, Type, out TypeWithAnnotations elementTypeWithAnnotations);
1576binder.TryGetCollectionIterationType(syntax, Type, out elementTypeWithAnnotations);
1584if (!binder.HasCollectionExpressionApplicableConstructor(syntax, Type, out MethodSymbol? constructor, isExpanded: out _, diagnostics, isParamsModifierValidation: true))
1594if (!binder.HasCollectionExpressionApplicableAddMethod(syntax, Type, out ImmutableArray<MethodSymbol> addMethods, diagnostics))
1604diagnostics.Add(ErrorCode.ERR_ParamsCollectionExtensionAddMethod, syntax, Type);
1635binder.TryGetCollectionIterationType(syntax, Type, out elementTypeWithAnnotations);
1643MethodSymbol? collectionBuilderMethod = binder.GetAndValidateCollectionBuilderMethod(syntax, (NamedTypeSymbol)Type, diagnostics, elementType: out _);