9 overrides of RefKind
Microsoft.CodeAnalysis.CSharp (9)
Binder\Binder.ValueChecks.cs (1)
3002public override RefKind RefKind
Symbols\FunctionPointers\FunctionPointerParameterSymbol.cs (1)
27public override RefKind RefKind { get; }
Symbols\Metadata\PE\PEParameterSymbol.cs (1)
451public override RefKind RefKind
Symbols\SignatureOnlyParameterSymbol.cs (1)
48public override RefKind RefKind { get { return _refKind; } }
Symbols\Source\SourceClonedParameterSymbol.cs (1)
93public override RefKind RefKind
Symbols\Source\SourceParameterSymbol.cs (1)
215public sealed override RefKind RefKind
Symbols\Source\ThisParameterSymbol.cs (1)
143public override RefKind RefKind
Symbols\Synthesized\SynthesizedParameterSymbol.cs (1)
47public override RefKind RefKind => _refKind;
Symbols\Wrapped\WrappedParameterSymbol.cs (1)
44public sealed override RefKind RefKind
186 references to RefKind
Microsoft.CodeAnalysis.CSharp (186)
Binder\Binder.ValueChecks.cs (18)
116Debug.Assert(parameter.RefKind.IsWritableReference() && parameter.Type.IsRefLikeOrAllowsRefLikeType()); 1119if (parameterSymbol.RefKind is RefKind.In or RefKind.RefReadOnlyParameter && RequiresAssignableVariable(valueKind)) 1124else if (parameterSymbol.RefKind == RefKind.None && RequiresRefAssignableVariable(valueKind)) 1130Debug.Assert(parameterSymbol.RefKind != RefKind.None || !RequiresRefAssignableVariable(valueKind)); 1134if (parameterSymbol.RefKind == RefKind.None && 1233{ RefKind: RefKind.Out, UseUpdatedEscapeRules: true } => SafeContext.ReturnOnly, 1245{ RefKind: RefKind.None } => SafeContext.CurrentMethod, 1247{ HasUnscopedRefAttribute: true, RefKind: RefKind.Out } => SafeContext.ReturnOnly, 1280Debug.Assert(parameterSymbol.RefKind == RefKind.None || isRefScoped || refSafeToEscape.IsReturnOnly); 2344var refKind = parameter?.RefKind ?? RefKind.None; 2350parameter?.RefKind is RefKind.In or RefKind.RefReadOnlyParameter) 2352refKind = parameter.RefKind; 2362parameter.RefKind.IsWritableReference(); 2422refKind = thisParameter.RefKind; 2992Debug.Assert(underlyingParameter.RefKind != RefKind.Out); // Shouldn't get here for a constructor 3006if (_underlyingParameter.RefKind is not RefKind.None and var underlyingRefKind) 4539if (constructMethod is not { Parameters: [{ RefKind: RefKind.None } parameter] }) 5738((BoundParameter)expression).ParameterSymbol.RefKind is not (RefKind.In or RefKind.RefReadOnlyParameter);
Binder\Binder_Attributes.cs (1)
250if (attributeConstructor.Parameters.Any(static p => p.RefKind is RefKind.In or RefKind.RefReadOnlyParameter))
Binder\Binder_Conversions.cs (3)
1876if (method.Parameters is not [{ RefKind: RefKind.None, Type: var parameterType }] 2868sourceRefKind: delegateParameter.RefKind, 2869destinationRefKind: methodParameter.RefKind,
Binder\Binder_Deconstruct.cs (1)
687if (parameters[i].RefKind != RefKind.Out)
Binder\Binder_Expressions.cs (14)
2092if (IsBadLocalOrParameterCapture(parameter, parameter.Type, parameter.RefKind)) 2096if (parameter.RefKind != RefKind.None) 2116(parameter.RefKind != RefKind.None || parameter.Type.IsRestrictedType()) && 2119if (parameter.RefKind != RefKind.None) 2133else if (primaryCtor is { ThisParameter.RefKind: not RefKind.None } && 2494if (thisSymbol is not null && thisSymbol.ContainingSymbol != ContainingMemberOrLambda && thisSymbol.RefKind != RefKind.None) 3412getCorrespondingParameter(in result, parameters, arg).RefKind == RefKind.RefReadOnlyParameter) 3425if (getCorrespondingParameter(in result, parameters, arg).RefKind == RefKind.In) 3436getCorrespondingParameter(in result, parameters, arg).RefKind == RefKind.RefReadOnlyParameter) 3825refKind = parameter.RefKind; 3844refKind = parameter.RefKind; 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 };
Binder\Binder_Invocation.cs (2)
1226if (receiverParameter.RefKind == RefKind.Ref) 1242else if (receiverParameter.RefKind == RefKind.In)
Binder\Binder_Operators.cs (1)
2644if (parameterSymbol.RefKind != RefKind.None)
Binder\Binder_Statements.cs (2)
2143var delegateRefKind = delegateParameters[i].RefKind; 2186var delegateRefKind = delegateParameters[i].RefKind;
Binder\ExecutableCodeBinder.cs (1)
112if (parameter.RefKind != RefKind.None)
Binder\Semantics\Conversions\Conversions.cs (2)
419isParamsArray: parameter.IsParamsArray, isParamsCollection: parameter.IsParamsCollection, parameter.RefKind); 423analyzedArguments.RefKinds.Add(parameter.RefKind);
Binder\Semantics\Conversions\ConversionsBase.cs (6)
1517delegateParameterRefKind: delegateParameters[p].RefKind, 1529if (delegateParameters[p].RefKind != RefKind.None) 1571if (delegateParameters[p].RefKind == RefKind.Out) 3401if (sourceParam.RefKind != destinationParam.RefKind) 3406if (!hasConversion(sourceParam.RefKind, destinationSig.Parameters[i].TypeWithAnnotations, sourceSig.Parameters[i].TypeWithAnnotations, ref useSiteInfo))
Binder\Semantics\OverloadResolution\MethodTypeInference.cs (2)
2421if ((sourceParam.Type.IsReferenceType || sourceParam.Type.IsFunctionPointer()) && sourceParam.RefKind == RefKind.None) 2771if ((sourceParam.Type.IsReferenceType || sourceParam.Type.IsFunctionPointer()) && sourceParam.RefKind == RefKind.None)
Binder\Semantics\OverloadResolution\OverloadResolution.cs (8)
2553parameter1RefKind = parameter.RefKind; 2621if (p1.RefKind == RefKind.None && isAcceptableRefMismatch(p2.RefKind, isInterpolatedStringHandlerConversion)) 2632else if (p2.RefKind == RefKind.None && isAcceptableRefMismatch(p1.RefKind, isInterpolatedStringHandlerConversion)) 3697if (param1.RefKind != param2.RefKind) 3861var paramRefKind = parameter.RefKind;
Binder\Semantics\OverloadResolution\OverloadResolutionResult.cs (2)
1122if (parameters[i].RefKind != RefKind.None) 1190RefKind refParameter = parameter.RefKind;
BoundTree\BoundExpressionExtensions.cs (1)
28return ((BoundParameter)node).ParameterSymbol.RefKind;
BoundTree\UnboundLambda.cs (1)
1111refKindsBuilder.Add(p.RefKind);
CodeGen\EmitAddress.cs (1)
482if (parameterSymbol.RefKind == RefKind.None)
CodeGen\EmitExpression.cs (12)
951Debug.Assert(parameters.All(p => p.RefKind == RefKind.None) || !argRefKindsOpt.IsDefault, "there are nontrivial parameters, so we must have argRefKinds"); 977Debug.Assert(argRefKind == parameters[i].RefKind || 978parameters[i].RefKind switch 988Debug.Assert(parameters[i].RefKind != RefKind.RefReadOnlyParameter, 992argRefKind = parameters[i].RefKind switch 1288return ((BoundParameter)receiver).ParameterSymbol.RefKind != RefKind.None; 1424if (parameter.ParameterSymbol.RefKind != RefKind.None) 2217return ((BoundParameter)receiver).ParameterSymbol.RefKind != RefKind.None; 2633if (System.Linq.ImmutableArrayExtensions.All(ctor.Parameters, p => p.RefKind == RefKind.None) && 2757return ((BoundParameter)left).ParameterSymbol.RefKind == RefKind.None; 2800if (left.ParameterSymbol.RefKind != RefKind.None && 3297if (parameter.ParameterSymbol.RefKind != RefKind.None && !refAssign)
CodeGen\EmitStatement.cs (1)
1292if (parameter.ParameterSymbol.RefKind == RefKind.None)
CodeGen\Optimizer.cs (1)
1041if (((BoundParameter)lhs).ParameterSymbol.RefKind != RefKind.None)
DocumentationComments\DocumentationCommentIDVisitor.PartVisitor.cs (1)
248if (symbol.RefKind != RefKind.None)
Emitter\EditAndContinue\CSharpSymbolMatcher.cs (6)
657return parameter.RefKind is RefKind.None == other.RefKind is RefKind.None && 687ValidateFunctionPointerParamOrReturn(param.TypeWithAnnotations, param.RefKind, param.RefCustomModifiers, allowOut: true); 688ValidateFunctionPointerParamOrReturn(otherParam.TypeWithAnnotations, otherParam.RefKind, otherParam.RefCustomModifiers, allowOut: true); 690return param.RefKind == otherParam.RefKind && AreTypesEqual(param.TypeWithAnnotations, otherParam.TypeWithAnnotations);
Emitter\Model\ParameterSymbolAdapter.cs (1)
41return AdaptedParameterSymbol.RefKind != RefKind.None;
Emitter\Model\ParameterTypeInformation.cs (1)
39return _underlyingParameter.RefKind != RefKind.None;
FlowAnalysis\AbstractFlowPass.cs (1)
1442var thisRefKind = thisParameter.RefKind;
FlowAnalysis\DataFlowsOutWalker.cs (1)
233((param.RefKind != RefKind.None && !param.IsImplicitlyDeclared && !RegionContains(param.GetFirstLocation().SourceSpan)) ||
FlowAnalysis\DefiniteAssignment.cs (10)
349NoteWrite(parameter, value: null, read: true, isRef: parameter.RefKind != RefKind.None); 1234((ParameterSymbol)symbol).RefKind == RefKind.Out) 1622if (isRef && param.RefKind == RefKind.Out) 1814if (parameter.RefKind != RefKind.Out) 1826if (thisParameter.RefKind != RefKind.Out) 1849if (current is not MethodSymbol && parameter.RefKind == RefKind.Out) 1879if (parameter.RefKind == RefKind.Out && !(this.CurrentSymbol is MethodSymbol currentMethod && currentMethod.IsAsync)) // out parameters not allowed in async 1887NoteWrite(parameter, value: null, read: true, isRef: parameter.RefKind != RefKind.None); 1945if (!parameter.IsThis && parameter.RefKind != RefKind.Out && parameter.ContainingSymbol is SynthesizedPrimaryConstructor primaryCtor) 1957if (parameter.RefKind != RefKind.None)
FlowAnalysis\NullableWalker.cs (6)
1255var refKind = parameter.RefKind; 2822if (parameter.RefKind != RefKind.Out) 10088case BoundParameter { ParameterSymbol: { RefKind: RefKind.None } parameter } when 10221VisitArgumentConversionAndInboundAssignmentsAndPreConditions(conversionOpt: null, variable.Expression, underlyingConversion, parameter.RefKind, 10235variable.Expression, parameter.RefKind, parameter, parameter.TypeWithAnnotations, GetRValueAnnotations(parameter), 11840parameter.RefKind,
FlowAnalysis\ReadWriteWalker.cs (2)
87if (p.RefKind != RefKind.None) _readOutside.Add(p); 95if ((object)thisParameter != null && thisParameter.RefKind != RefKind.None)
Lowering\DiagnosticsPass_ExpressionTrees.cs (1)
575if (p.RefKind != RefKind.None && p.TryGetFirstLocation() is Location location)
Lowering\DiagnosticsPass_Warnings.cs (1)
244if (method.Parameters[i].RefKind != RefKind.None && (argumentRefKindsOpt.IsDefault || argumentRefKindsOpt[i] == RefKind.None)) return true;
Lowering\Instrumentation\LocalStateTracingInstrumenter.cs (2)
307if (parameter.RefKind == RefKind.Out || parameter.IsDiscard) 448Debug.Assert(parameter.RefKind == RefKind.None);
Lowering\Instrumentation\ModuleCancellationInstrumenter.cs (1)
186member is MethodSymbol { Parameters: [.., { RefKind: RefKind.None, Type: { } lastParamType }] parametersWithCancellationToken } overload &&
Lowering\LocalRewriter\LocalRewriter.cs (1)
1128symbol.Parameters.Any(static p => p.RefKind == RefKind.In))
Lowering\LocalRewriter\LocalRewriter.PatternLocalRewriter.cs (1)
188Debug.Assert(parameter.RefKind == RefKind.Out);
Lowering\LocalRewriter\LocalRewriter_Call.cs (7)
239|| methodThisParameter.RefKind != interceptorThisParameterForCompare.RefKind: 285var thisRefKind = methodThisParameter.RefKind; 881RefKind paramRefKind = parameters[paramIndex].RefKind; 1161var paramRefKind = parameters[i].RefKind; 1323RefKind paramRefKind = parameters[p].RefKind; 1616RefKind paramRefKind = parameters[argIndex].RefKind;
Lowering\LocalRewriter\LocalRewriter_CompoundAssignmentOperator.cs (1)
854((BoundParameter)expression).ParameterSymbol.RefKind != RefKind.None ||
Lowering\LocalRewriter\LocalRewriter_DeconstructionAssignmentOperator.cs (1)
171case BoundParameter { ParameterSymbol: { RefKind: RefKind.None } parameterSymbol }:
Lowering\LocalRewriter\LocalRewriter_IndexerAccess.cs (1)
273possiblyRefCapturedReceiver = _factory.StoreToTemp(possiblyRefCapturedReceiver, out var refCapture, createSpan.Parameters[0].RefKind == RefKind.In ? RefKindExtensions.StrictIn : RefKind.Ref);
Lowering\LocalRewriter\LocalRewriter_NullCoalescingOperator.cs (1)
146if (unwrappedRight is { ConstantValueOpt: not null } or BoundLocal { LocalSymbol.IsRef: false } or BoundParameter { ParameterSymbol.RefKind: RefKind.None } &&
Lowering\LocalRewriter\LocalRewriter_ObjectOrCollectionInitializerExpression.cs (2)
147.All(p => p.RefKind is RefKind.None or RefKind.In or RefKind.RefReadOnlyParameter)); 164if (addMethod.Parameters[0].RefKind == RefKind.Ref)
Lowering\LocalRewriter\LocalRewriter_StringConcat.cs (3)
506readOnlySpanCtorRefParamGeneric.Parameters[0].RefKind != RefKind.Out) 544Debug.Assert(readOnlySpanCtorRefParamChar.Parameters[0].RefKind != RefKind.Out); 551argumentRefKindsOpt: [readOnlySpanCtorRefParamChar.Parameters[0].RefKind == RefKind.Ref ? RefKind.Ref : RefKindExtensions.StrictIn],
Lowering\LocalRewriter\LocalRewriter_UnaryOperator.cs (1)
493return ((BoundParameter)expression).ParameterSymbol.RefKind != RefKind.None;
Lowering\StateMachineRewriter\IteratorAndAsyncCaptureWalker.cs (1)
251Debug.Assert(parameter.IsThis || parameter.RefKind == RefKind.None);
Lowering\SynthesizedMethodBaseSymbol.cs (1)
141p.RefKind,
Symbols\Compilation_WellKnownMembers.cs (2)
1007handle(param.RefKind, param.RefCustomModifiers, param.TypeWithAnnotations); 1172return parameter.RefKind != RefKind.None;
Symbols\FunctionPointers\FunctionPointerMethodSymbol.cs (1)
469originalParam.RefKind,
Symbols\MemberSignatureComparer.cs (2)
796var refKind1 = param1.RefKind; 797var refKind2 = param2.RefKind;
Symbols\Metadata\PE\DynamicTypeDecoder.cs (1)
369var (transformedParamType, paramTransformed) = handle(ref this, param.RefKind, param.RefCustomModifiers, param.TypeWithAnnotations);
Symbols\Metadata\PE\MemberRefMetadataDecoder.cs (1)
254if ((candidateParam.RefKind != RefKind.None) != targetParam.IsByRef)
Symbols\Metadata\PE\PEMethodSymbol.cs (1)
1125switch (parameter.RefKind)
Symbols\NamedTypeSymbol.cs (2)
363if ((thisParam.RefKind == RefKind.Ref && !thisParam.Type.IsValueType) || 364(thisParam.RefKind is RefKind.In or RefKind.RefReadOnlyParameter && thisParam.Type.TypeKind != TypeKind.Struct))
Symbols\ParameterSignature.cs (1)
46var refKind = parameter.RefKind;
Symbols\ParameterSymbol.cs (2)
162((refKind = RefKind) == RefKind.None || 452RefKind IParameterSymbolInternal.RefKind => RefKind;
Symbols\PropertySymbolExtensions.cs (2)
73if (param.RefKind == RefKind.Ref || param.RefKind == RefKind.Out)
Symbols\PublicModel\ParameterSymbol.cs (1)
59RefKind IParameterSymbol.RefKind => _underlying.RefKind;
Symbols\ReducedExtensionMethodSymbol.cs (1)
539internal override bool IsEffectivelyReadOnly => _reducedFrom.Parameters[0].RefKind is RefKind.In or RefKind.RefReadOnlyParameter;
Symbols\Source\CustomModifierUtils.cs (1)
146destinationParameter.RefKind != RefKind.None ? sourceParameter.RefCustomModifiers : ImmutableArray<CustomModifier>.Empty,
Symbols\Source\ExplicitInterfaceHelpers.cs (2)
402if (implementedMemberParameters[i].RefKind != collisionCandidateParameters[i].RefKind)
Symbols\Source\ParameterHelpers.cs (4)
196parameter.RefKind, parameter.ContainingSymbol, thisKeyword, paramsKeyword, firstDefault, diagnostics); 243if (parameter.RefKind == RefKind.In) 254else if (parameter.RefKind == RefKind.RefReadOnlyParameter) 336return IsRefScopedByDefault(parameter.UseUpdatedEscapeRules, parameter.RefKind);
Symbols\Source\SourceMemberContainerSymbol.cs (4)
2154var refKind1 = method1.Parameters[i].RefKind; 2155var refKind2 = method2.Parameters[i].RefKind; 3946if (methodParam.RefKind != RefKind.None) 3969methodParams[0].RefKind == RefKind.None &&
Symbols\Source\SourceMemberContainerSymbol_ImplementationChecks.cs (7)
1301overrideParameter.RefKind, 1310overrideParameter.RefKind, 1395else if (parameters.Any(p => (p.RefKind is RefKind.Ref or RefKind.Out) && p.Type.IsRefLikeOrAllowsRefLikeType())) 1406int nRefParameters = parameters.Count(p => p.RefKind is RefKind.Ref or RefKind.In or RefKind.RefReadOnlyParameter or RefKind.Out); 1411else if (parameters.Any(p => p.RefKind == RefKind.None && p.Type.IsRefLikeOrAllowsRefLikeType())) 1509if (baseParameter.RefKind != overrideParameter.RefKind)
Symbols\Source\SourceMethodSymbol.cs (1)
65if (parameter.RefKind != RefKind.None)
Symbols\Source\SourceMethodSymbolWithAttributes.cs (2)
764if (param.RefKind == RefKind.Out) 1396checkAndReportManagedTypes(param.Type, param.RefKind, param.GetNonNullSyntaxNode(), isParam: true, diagnostics);
Symbols\Source\SourceOrdinaryMethodSymbol.cs (2)
209var parameter0RefKind = this.Parameters[0].RefKind; 819else if (IsPartial && !HasExplicitAccessModifier && Parameters.Any(static p => p.RefKind == RefKind.Out))
Symbols\Source\SourceParameterSymbolBase.cs (2)
97AddSynthesizedAttribute(ref attributes, compilation.SynthesizeDynamicAttribute(type.Type, type.CustomModifiers.Length + this.RefCustomModifiers.Length, this.RefKind)); 116switch (this.RefKind)
Symbols\Source\SourceUserDefinedOperatorSymbolBase.cs (2)
334if (p.RefKind != RefKind.None && p.RefKind != RefKind.In)
Symbols\SymbolExtensions.cs (1)
524refKind = parameter.RefKind;
Symbols\Synthesized\Records\SynthesizedRecordClone.cs (1)
124if (ctor.ParameterCount == 1 && ctor.Parameters[0].RefKind == RefKind.None &&
Symbols\Synthesized\Records\SynthesizedRecordCopyCtor.cs (1)
148method.Parameters[0].RefKind == RefKind.None;
Symbols\Synthesized\Records\SynthesizedRecordEqualityOperator.cs (1)
45if (member is MethodSymbol candidate && candidate.ParameterCount == 1 && candidate.Parameters[0].RefKind == RefKind.None &&
Symbols\Synthesized\SynthesizedParameterSymbol.cs (1)
313oldParam.RefKind,
Symbols\VarianceSafety.cs (1)
242requireOutputSafety: param.RefKind != RefKind.None,
Symbols\Wrapped\WrappedParameterSymbol.cs (1)
46get { return _underlyingParameter.RefKind; }