1046 references to None
ConfigurationSchemaGenerator (1)
RuntimeSource\Configuration.Binder\ConfigurationBindingGenerator.Parser.cs (1)
704else if (parameter.RefKind is not RefKind.None)
ILLink.RoslynAnalyzer (7)
DynamicallyAccessedMembersAnalyzer.cs (3)
153 if (member is IFieldSymbol field && field.GetDynamicallyAccessedMemberTypes () != DynamicallyAccessedMemberTypes.None && !field.Type.IsTypeInterestingForDataflow (isByRef: field.RefKind is not RefKind.None)) 161 if (parameter.GetDynamicallyAccessedMemberTypes () != DynamicallyAccessedMemberTypes.None && !parameter.Type.IsTypeInterestingForDataflow (isByRef: parameter.RefKind is not RefKind.None)) 283 || !propertySymbol.Type.IsTypeInterestingForDataflow (isByRef: propertySymbol.RefKind is not RefKind.None)
IOperationExtensions.cs (1)
178 return containingMethod?.RefKind ?? RefKind.None;
TrimAnalysis\FlowAnnotations.cs (2)
112 if (!field.OriginalDefinition.Type.IsTypeInterestingForDataflow (isByRef: field.RefKind is not RefKind.None)) 146 bool isByRef = parameter.RefKind is not RefKind.None;
TrimAnalysis\ParameterProxy.cs (1)
29 case RefKind.None: return ReferenceKind.None;
Microsoft.CodeAnalysis (7)
DiagnosticAnalyzer\SuppressMessageAttributeState.TargetSymbolResolver.cs (1)
796if ((symbol.RefKind == RefKind.None) == parameterInfo.IsRefOrOut)
DocumentationCommentId.cs (2)
495if (p.RefKind != RefKind.None) 1400if ((symbol.RefKind == RefKind.None) == parameterInfo.IsRefOrOut)
Operations\ControlFlowGraphBuilder.cs (1)
4663return new SimpleAssignmentOperation(isRef: local.RefKind != RefKind.None,
Operations\OperationExtensions.cs (1)
322return RefKind.None;
Symbols\ISymbolExtensions.cs (1)
146if (enterScopeMethod is not { ReturnsVoid: false, RefKind: RefKind.None })
Symbols\RefKind.cs (1)
83case RefKind.None: return string.Empty;
Microsoft.CodeAnalysis.CodeStyle (9)
src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (1)
762methodSymbol.Parameters[0].RefKind == RefKind.None &&
src\Analyzers\Core\Analyzers\UseCompoundAssignment\UseCompoundAssignmentUtilities.cs (1)
133if (property.RefKind == RefKind.None)
src\Analyzers\Core\Analyzers\UseConditionalExpression\ForReturn\UseConditionalExpressionForReturnHelpers.cs (2)
81syntaxFacts, anyReturn.GetRefKind(containingSymbol) != RefKind.None, 122isRef = anyReturn.GetRefKind(containingSymbol) != RefKind.None;
src\Compilers\Core\Portable\DiagnosticAnalyzer\SuppressMessageAttributeState.TargetSymbolResolver.cs (1)
796if ((symbol.RefKind == RefKind.None) == parameterInfo.IsRefOrOut)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.cs (1)
486if (symbol is IMethodSymbol method && method.Parameters.All(p => p.RefKind == RefKind.None))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\OperationExtensions.cs (1)
233return containingMethod?.RefKind ?? RefKind.None;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.ParameterSymbolEqualityComparer.cs (2)
76: (rk1 == RefKind.None) == (rk2 == RefKind.None);
Microsoft.CodeAnalysis.CodeStyle.Fixes (15)
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateDeconstructMethodService.State.cs (1)
76refKind: RefKind.None,
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateMethodService.State.cs (1)
255refKind: RefKind.None,
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.CodeAction.cs (2)
70var setAccessor = _isReadonly || _refKind != RefKind.None 121return _state.TypeToGenerateIn.TypeKind != TypeKind.Interface && _refKind != RefKind.None
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.cs (4)
153document, state, generateProperty: false, isReadonly: false, isConstant: true, refKind: RefKind.None)); 167document, state, generateProperty: false, isReadonly: true, isConstant: false, refKind: RefKind.None)); 181document, state, generateProperty: false, isReadonly: false, isConstant: false, refKind: RefKind.None)); 266return RefKind.None;
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.GenerateParameterCodeAction.cs (1)
44RefKind.None,
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator_DisposePattern.cs (1)
203g.Argument(DisposingName, RefKind.None, g.TrueLiteralExpression())))));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationSymbolFactory.cs (2)
269=> CreateParameterSymbol(RefKind.None, type, name); 396refKind: RefKind.None,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationFieldSymbol.cs (1)
84public RefKind RefKind => RefKind.None;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions.cs (1)
300refKind: RefKind.None,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (1)
56refKind: RefKind.None,
Microsoft.CodeAnalysis.CSharp (674)
Binder\Binder.QueryUnboundLambdaState.cs (1)
49public override RefKind RefKind(int index) { return Microsoft.CodeAnalysis.RefKind.None; }
Binder\Binder.ValueChecks.cs (65)
53Method is { RefKind: not RefKind.None, ReturnType: { } returnType } && 363if (indexerAccess.Indexer.RefKind != RefKind.None) 1038(localSymbol.RefKind == RefKind.None && !localSymbol.IsWritableVariable)) 1046if (localSymbol.RefKind == RefKind.None) 1078if (localSymbol.RefKind == RefKind.None) 1124else if (parameterSymbol.RefKind == RefKind.None && RequiresRefAssignableVariable(valueKind)) 1130Debug.Assert(parameterSymbol.RefKind != RefKind.None || !RequiresRefAssignableVariable(valueKind)); 1134if (parameterSymbol.RefKind == RefKind.None && 1138Debug.Assert(backingField.RefKind == RefKind.None); 1143Debug.Assert(backingField.RefKind == RefKind.None); 1245{ RefKind: RefKind.None } => SafeContext.CurrentMethod, 1280Debug.Assert(parameterSymbol.RefKind == RefKind.None || isRefScoped || refSafeToEscape.IsReturnOnly); 1330if ((fieldSymbol.RefKind == RefKind.None ? RequiresAssignableVariable(valueKind) : RequiresRefAssignableVariable(valueKind)) && 1342case RefKind.None: 1367case RefKind.None: 1382case RefKind.None: 1485if (fieldSymbol.RefKind != RefKind.None) 1509if (fieldSymbol.RefKind != RefKind.None) 1645if (RequiresVariable(valueKind) && methodSymbol.RefKind == RefKind.None) 1691propertySymbol.RefKind == RefKind.None) 1721var requiresSet = RequiresAssignableVariable(valueKind) && propertySymbol.RefKind == RefKind.None; 1790var requiresGet = !RequiresAssignmentOnly(valueKind) || propertySymbol.RefKind != RefKind.None; 2082(param is { RefKind: not RefKind.None, Type: { } type } && type.IsRefLikeOrAllowsRefLikeType())) && 2174var valid = effectiveRefKind != RefKind.None && isRefEscape ? 2243(param is { RefKind: not RefKind.None, Type: { } type } && type.IsRefLikeOrAllowsRefLikeType())) && 2344var refKind = parameter?.RefKind ?? RefKind.None; 2349if (refKind == RefKind.None && 2407return new EscapeArgument(parameter: null, receiver, RefKind.None); 2410var refKind = RefKind.None; 2437var refKind = argRefKindsOpt.IsDefault ? RefKind.None : argRefKindsOpt[argIndex]; 2615if (refKind != RefKind.None) 2635if (parameter.RefKind != RefKind.None && GetParameterRefEscapeLevel(parameter) is { } refEscapeLevel) 2704if (parameter.RefKind != RefKind.None) 3006if (_underlyingParameter.RefKind is not RefKind.None and var underlyingRefKind) 3013return RefKind.None; 3226Debug.Assert(field.RefKind == RefKind.None ? RequiresAssignableVariable(kind) : RequiresRefAssignableVariable(kind)); 3423if (methodSymbol.RefKind == RefKind.None) 3445if (methodSymbol.RefKind == RefKind.None) 3506if (methodSymbol.RefKind == RefKind.None) 3533Debug.Assert(GetInlineArrayAccessEquivalentSignatureMethod(elementAccess, out _, out _).RefKind == RefKind.None); 3541Debug.Assert(equivalentSignatureMethod.RefKind != RefKind.None); 3585conversion.Conversion.Method.RefKind == RefKind.None)); 3592unaryMethod.RefKind == RefKind.None)); 3599binaryMethod.RefKind == RefKind.None)); 3605logicalOperator.LogicalOperator.RefKind == RefKind.None)); 3612compoundMethod.RefKind == RefKind.None)); 3740if (methodSymbol.RefKind == RefKind.None) 3766if (indexerSymbol.RefKind == RefKind.None) 3797if (indexerSymbol.RefKind == RefKind.None) 3823if (methodSymbol.RefKind == RefKind.None) 3854Debug.Assert(GetInlineArrayAccessEquivalentSignatureMethod(elementAccess, out _, out _).RefKind == RefKind.None); 3862Debug.Assert(equivalentSignatureMethod.RefKind != RefKind.None); 3884if (signature.RefKind == RefKind.None) 3908if (propertySymbol.RefKind == RefKind.None) 3955conversion.Conversion.Method.RefKind == RefKind.None); 3962unaryMethod.RefKind == RefKind.None)); 3969binaryMethod.RefKind == RefKind.None)); 3975logicalOperator.LogicalOperator.RefKind == RefKind.None)); 3982compoundMethod.RefKind == RefKind.None)); 4539if (constructMethod is not { Parameters: [{ RefKind: RefKind.None } parameter] }) 4674var accessorKind = property.RefKind == RefKind.None ? AccessorKind.Set : AccessorKind.Get; 5447resultRefKind = RefKind.None; 5448parameterRefKind = RefKind.None; 5461resultRefKind = RefKind.None; 5522RefKind.None,
Binder\Binder_AnonymousTypes.cs (1)
96RefKind.None,
Binder\Binder_Attributes.cs (2)
482BindArgumentExpression(diagnostics, argument.Expression, RefKind.None, allowArglist: false), 484refKind: RefKind.None);
Binder\Binder_Crefs.cs (2)
794refKind: RefKind.None, 811refKind: RefKind.None,
Binder\Binder_Expressions.cs (28)
454if (field is { IsStatic: false, RefKind: RefKind.None, ContainingSymbol: SourceMemberContainerTypeSymbol { PrimaryConstructor: { } primaryConstructor } } && 1935if (refKind != RefKind.None || type.IsRestrictedType()) 2059if (localSymbol.RefKind == RefKind.None && type.IsRestrictedType(ignoreSpanLikeTypes: true)) 2099if (parameter.RefKind != RefKind.None) 2119(parameter.RefKind != RefKind.None || parameter.Type.IsRestrictedType()) && 2122if (parameter.RefKind != RefKind.None) 2136else if (primaryCtor is { ThisParameter.RefKind: not RefKind.None } && 2497if (thisSymbol is not null && thisSymbol.ContainingSymbol != ContainingMemberOrLambda && thisSymbol.RefKind != RefKind.None) 3055RefKind refKind = origRefKind == RefKind.None || RefMustBeObeyed(isDelegateCreation, argumentSyntax) ? origRefKind : RefKind.None; 3068if (!hadError && isDelegateCreation && origRefKind != RefKind.None && result.Arguments.Count == 1) 3294if (refKind != RefKind.None) 3304result.RefKinds.Add(RefKind.None); 3355refKind == RefKind.None ? 3414if (argRefKind is RefKind.None or RefKind.In && 3438else if (argRefKind == RefKind.None && 3807refKind = RefKind.None; 8212extensionMethodArguments.RefKinds.Add(RefKind.None); 8608fieldSymbol.RefKind != RefKind.None) 9571if (refKind != RefKind.None) 10039original.Parameters[0] is { Type.SpecialType: SpecialType.System_Int32, RefKind: RefKind.None }) 10137original.Parameters[0] is { Type.SpecialType: SpecialType.System_Int32, RefKind: RefKind.None } && 10138original.Parameters[1] is { Type.SpecialType: SpecialType.System_Int32, RefKind: RefKind.None }; 10201getMethod.RefKind == RefKind.None && 10823if (returnsVoid && returnRefKind != RefKind.None) 10837returnRefKind == RefKind.None && 10839(parameterRefKinds.IsDefault || parameterRefKinds.All(refKind => refKind == RefKind.None)) && 10873parameterRefKinds.IsDefault ? RefKind.None : parameterRefKinds[i],
Binder\Binder_InterpolatedString.cs (2)
716refKindsBuilder.Add(RefKind.None); 717refKindsBuilder.Add(RefKind.None);
Binder\Binder_Invocation.cs (5)
294else if (analyzedArguments.RefKind(i) == RefKind.None) 301case RefKind.None: 1245Debug.Assert(analyzedArguments.RefKind(0) == RefKind.None); 1552argumentRefKindsBuilder.Add(RefKind.None); 1577argumentRefKindsBuilder.Add(RefKind.None);
Binder\Binder_Lambda.cs (3)
49RefKind returnRefKind = RefKind.None; 170var refKind = RefKind.None; 210if (refKindsBuilder.Any(r => r != RefKind.None))
Binder\Binder_Operators.cs (2)
2644if (parameterSymbol.RefKind != RefKind.None) 2675return localSymbol.RefKind != RefKind.None;
Binder\Binder_Query.cs (3)
696return lambdaBodyBinder.CreateBlockFromExpression(node, ImmutableArray<LocalSymbol>.Empty, RefKind.None, construction, null, d); 776return this.CreateBlockFromExpression(expression, locals, RefKind.None, result, expression, diagnostics); 818new AnonymousTypeField(fieldName, fieldValue.Syntax.Location, TypeWithAnnotations.Create(TypeOrError(fieldValue)), RefKind.None, ScopedKind.None);
Binder\Binder_Statements.cs (21)
915RefKind expressionRefKind = RefKind.None; 917if (variableRefKind == RefKind.None) 998if (localSymbol.RefKind != RefKind.None) 1064localSymbol.RefKind != RefKind.None ? ConversionForAssignmentFlags.RefAssignment : ConversionForAssignmentFlags.None); 2144if (delegateRefKind != RefKind.None) 2198if (delegateRefKind == RefKind.None) 2983refKind = RefKind.None; 2989var refKind = RefKind.None; 3018if (refKind != RefKind.None) 3030else if ((object)retType != null && (refKind != RefKind.None) != (sigRefKind != RefKind.None)) 3032var errorCode = refKind != RefKind.None 3140Debug.Assert(returnRefKind == RefKind.None); 3162if (returnRefKind != RefKind.None) 3453if (IsInAsyncMethod() && refKind != RefKind.None) 3462if ((refKind != RefKind.None) != (returnRefKind != RefKind.None) && expression.Kind != BoundKind.ThrowExpression) 3464var errorCode = refKind != RefKind.None 3469statement = new BoundReturnStatement(syntax, RefKind.None, expression, @checked: CheckOverflowAtRuntime) { WasCompilerGenerated = true }; 3602return bodyBinder.CreateBlockFromExpression(body, bodyBinder.GetDeclaredLocalsForScope(body), RefKind.None, expression, body, diagnostics); 3608if (refKind != RefKind.None)
Binder\ExecutableCodeBinder.cs (2)
112if (parameter.RefKind != RefKind.None) 141if (refKind != RefKind.None)
Binder\ForEachLoopBinder.cs (3)
323if (local.RefKind != RefKind.None) 336case RefKind.None: 1203patternDisposeMethod.ParameterRefKinds.All(static refKind => refKind is RefKind.None or RefKind.In or RefKind.RefReadOnlyParameter));
Binder\InMethodBinder.cs (2)
148if (refKind == RefKind.None && returnType.Kind == SymbolKind.NamedType) 179if (refKind == RefKind.None && returnType.Kind == SymbolKind.NamedType)
Binder\LockBinder.cs (1)
80if (enterScopeMethod is not { ReturnsVoid: false, RefKind: RefKind.None })
Binder\RefSafetyAnalysis.cs (4)
492Debug.Assert(localSymbol.RefKind == RefKind.None || 506if (localSymbol.RefKind != RefKind.None) 523ValidateEscape(expr, SafeContext.ReturnOnly, node.RefKind != RefKind.None, _diagnostics); 1078AddLocalScopes(local, refEscapeScope: local.RefKind == RefKind.None ? _localScopeDepth : collectionEscape, valEscapeScope: collectionEscape);
Binder\Semantics\Conversions\ConversionsBase.cs (2)
1529if (delegateParameters[p].RefKind != RefKind.None) 3419case RefKind.None:
Binder\Semantics\Operators\BinaryOperatorOverloadResolution.cs (4)
1276if (op1.LeftRefKind == RefKind.None && op2.LeftRefKind == RefKind.In) 1280else if (op2.LeftRefKind == RefKind.None && op1.LeftRefKind == RefKind.In) 1289if (op1.RightRefKind == RefKind.None && op2.RightRefKind == RefKind.In) 1300else if (op2.RightRefKind == RefKind.None && op1.RightRefKind == RefKind.In)
Binder\Semantics\Operators\BinaryOperatorSignature.cs (2)
108return RefKind.None; 128return RefKind.None;
Binder\Semantics\Operators\UnaryOperatorOverloadResolution.cs (2)
229if (op1.RefKind == RefKind.None && op2.RefKind == RefKind.In) 233else if (op2.RefKind == RefKind.None && op1.RefKind == RefKind.In)
Binder\Semantics\Operators\UnaryOperatorSignature.cs (1)
62return RefKind.None;
Binder\Semantics\OverloadResolution\AnalyzedArguments.cs (2)
78return RefKinds.Count > 0 ? RefKinds[i] : Microsoft.CodeAnalysis.RefKind.None; 101if ((object?)argument.Type != null && argument.Type.IsDynamic() && (!hasRefKinds || RefKinds[i] == Microsoft.CodeAnalysis.RefKind.None))
Binder\Semantics\OverloadResolution\MethodTypeInference.cs (5)
426return _formalParameterRefKinds.IsDefault ? RefKind.None : _formalParameterRefKinds[index]; 2421if ((sourceParam.Type.IsReferenceType || sourceParam.Type.IsFunctionPointer()) && sourceParam.RefKind == RefKind.None) 2431if ((sourceSignature.ReturnType.IsReferenceType || sourceSignature.ReturnType.IsFunctionPointer()) && sourceSignature.RefKind == RefKind.None) 2771if ((sourceParam.Type.IsReferenceType || sourceParam.Type.IsFunctionPointer()) && sourceParam.RefKind == RefKind.None) 2781if ((sourceSignature.ReturnType.IsReferenceType || sourceSignature.ReturnType.IsFunctionPointer()) && sourceSignature.RefKind == RefKind.None)
Binder\Semantics\OverloadResolution\OverloadResolution.cs (20)
864else if (returnRefKind == RefKind.None) 2629if (p1.RefKind == RefKind.None && isAcceptableRefMismatch(p2.RefKind, isInterpolatedStringHandlerConversion)) 2640else if (p2.RefKind == RefKind.None && isAcceptableRefMismatch(p1.RefKind, isInterpolatedStringHandlerConversion)) 2864Debug.Assert(refKind1 == RefKind.None || refKind1 == RefKind.Ref); 2865Debug.Assert(refKind2 == RefKind.None || refKind2 == RefKind.Ref); 2869if (refKind1 == RefKind.None) 3854RefKind argRefKind = hasAnyRefArg ? argumentRefKinds[arg] : RefKind.None; 3859if (paramRefKind != RefKind.None) 3861refs = ArrayBuilder<RefKind>.GetInstance(arg, RefKind.None); 3893if (argRefKind == RefKind.None) 3895return RefKind.None; 3903else if (paramRefKind == RefKind.RefReadOnlyParameter && argRefKind is RefKind.None or RefKind.Ref or RefKind.In) 3916if ((options & Options.AllowRefOmittedArguments) != 0 && paramRefKind == RefKind.Ref && argRefKind == RefKind.None && !binder.InAttributeArgument) 3919return RefKind.None; 4007var argRefKind = hasAnyRefArg ? argumentRefKinds[arg] : RefKind.None; 4011if (paramRefKind != RefKind.None) 4445RefKind parameterRefKind = parameters.ParameterRefKinds.IsDefault ? RefKind.None : parameters.ParameterRefKinds[argumentPosition]; 4450Debug.Assert(argumentRefKind == RefKind.None); 4600Debug.Assert(argRefKind != RefKind.None); 4606if (argRefKind == RefKind.None || hasInterpolatedStringRefMismatch)
Binder\Semantics\OverloadResolution\OverloadResolutionResult.cs (5)
1122if (parameters[i].RefKind != RefKind.None) 1194Debug.Assert(refArg == RefKind.None); 1253!(refArg == RefKind.None && refParameter == RefKind.In) && 1255!(refParameter == RefKind.RefReadOnlyParameter && refArg is RefKind.None or RefKind.Ref or RefKind.In)) 1276else if (refParameter is RefKind.None or RefKind.In or RefKind.RefReadOnlyParameter)
BoundTree\BoundExpressionExtensions.cs (4)
60return RefKind.None; 66return RefKind.None; 72EventSymbol => RefKind.None, 77return RefKind.None;
BoundTree\Constructors.cs (4)
63fieldSymbol.RefKind != RefKind.None || 192var parameterRefKind = method.ParameterRefKinds.IsDefault ? RefKind.None : method.ParameterRefKinds[i]; 193var argumentRefKind = argumentRefKindsOpt.IsDefault ? RefKind.None : argumentRefKindsOpt[i]; 194Debug.Assert(argumentRefKind is RefKind.None or RefKind.Ref or RefKind.In or RefKind.Out or RefKindExtensions.StrictIn &&
BoundTree\UnboundLambda.cs (8)
177parameterRefKinds.IsDefault ? Enumerable.Repeat(RefKind.None, parameterTypes.Length).ToImmutableArray() : parameterRefKinds, 207RefKind refKind = RefKind.None; 211if (rk != RefKind.None) 642refKind = CodeAnalysis.RefKind.None; 798refKind == CodeAnalysis.RefKind.None && 1215refKind = CodeAnalysis.RefKind.None; 1536return _parameterRefKinds.IsDefault ? Microsoft.CodeAnalysis.RefKind.None : _parameterRefKinds[index]; 1571statements[0] is BoundReturnStatement { RefKind: Microsoft.CodeAnalysis.RefKind.None, ExpressionOpt: BoundExpression expr })
CodeGen\CodeGenerator.cs (1)
169var slotConstraints = _method.RefKind == RefKind.None
CodeGen\CodeGenerator_HasHome.cs (2)
94return !((CodeGenerator.IsStackLocal(local, stackLocalsOpt) && local.RefKind == RefKind.None) || 216Debug.Assert(field.RefKind == RefKind.None);
CodeGen\EmitAddress.cs (5)
36Debug.Assert(((BoundDup)expression).RefKind != RefKind.None, "taking address of a stack value?"); 274if (local.RefKind != RefKind.None) 480if (parameterSymbol.RefKind == RefKind.None) 554field.RefKind == RefKind.None ? 558_builder.EmitOpCode(field.RefKind == RefKind.None ? ILOpCode.Ldflda : ILOpCode.Ldfld);
CodeGen\EmitExpression.cs (34)
710RefKind refKind = expression.ArgumentRefKindsOpt.IsDefaultOrEmpty ? RefKind.None : expression.ArgumentRefKindsOpt[i]; 719case RefKind.None: 737Debug.Assert(argument.Type.IsDynamic() || argument is BoundFieldAccess { FieldSymbol.RefKind: not RefKind.None }, "passing args byref should not clone them into temps"); 779if (expression.RefKind == RefKind.None) 951Debug.Assert(parameters.All(p => p.RefKind == RefKind.None) || !argRefKindsOpt.IsDefault, "there are nontrivial parameters, so we must have argRefKinds"); 1003argRefKind = RefKind.None; 1132if (!field.IsVolatile && !field.IsStatic && fieldAccess.ReceiverOpt.Type.IsVerifierValue() && field.RefKind == RefKind.None) 1144if (field.RefKind != RefKind.None) 1288return ((BoundParameter)receiver).ParameterSymbol.RefKind != RefKind.None; 1292return ((BoundLocal)receiver).LocalSymbol.RefKind != RefKind.None; 1301if (field.IsStatic || field.RefKind != RefKind.None) 1392bool isRefLocal = local.LocalSymbol.RefKind != RefKind.None; 1424if (parameter.ParameterSymbol.RefKind != RefKind.None) 2214return ((BoundLocal)receiver).LocalSymbol.RefKind != RefKind.None; 2217return ((BoundParameter)receiver).ParameterSymbol.RefKind != RefKind.None; 2220return ((BoundCall)receiver).Method.RefKind != RefKind.None; 2223return ((BoundFunctionPointerInvocation)receiver).FunctionPointer.Signature.RefKind != RefKind.None; 2226return ((BoundDup)receiver).RefKind != RefKind.None; 2633if (System.Linq.ImmutableArrayExtensions.All(ctor.Parameters, p => p.RefKind == RefKind.None) && 2757return ((BoundParameter)left).ParameterSymbol.RefKind == RefKind.None; 2762return ((BoundLocal)left).LocalSymbol.RefKind == RefKind.None; 2782if (left.FieldSymbol.RefKind != RefKind.None && 2800if (left.ParameterSymbol.RefKind != RefKind.None && 2832if (left.LocalSymbol.RefKind != RefKind.None && !assignmentOperator.IsRef) 2931Debug.Assert(left.Method.RefKind != RefKind.None); 2942Debug.Assert(left.FunctionPointer.Signature.RefKind != RefKind.None); 3077if (local.LocalSymbol.RefKind != RefKind.None && !assignment.IsRef) 3110Debug.Assert(((BoundDup)expression).RefKind != RefKind.None); 3133Debug.Assert(((BoundCall)expression).Method.RefKind != RefKind.None); 3138Debug.Assert(((BoundFunctionPointerInvocation)expression).FunctionPointer.Signature.RefKind != RefKind.None); 3282if (field.RefKind != RefKind.None && !refAssign) 3297if (parameter.ParameterSymbol.RefKind != RefKind.None && !refAssign) 4088if (useKind == UseKind.UsedAsValue && method.RefKind != RefKind.None) 4094Debug.Assert(method.RefKind != RefKind.None);
CodeGen\EmitStatement.cs (9)
749Debug.Assert(local.RefKind == RefKind.None || local.SynthesizedKind.IsLongLived(), 865if (boundReturnStatement.RefKind == RefKind.None) 1147Debug.Assert(exceptionSourceLocal.LocalSymbol.RefKind == RefKind.None); 1159Debug.Assert(left.FieldSymbol.RefKind == RefKind.None); 1283if (local.RefKind == RefKind.None && !IsStackLocal(local)) 1292if (parameter.ParameterSymbol.RefKind == RefKind.None) 1759CSharpCompilation.DynamicTransformsEncoder.Encode(local.Type, RefKind.None, 0) : 1789Debug.Assert(local.RefKind == RefKind.None); 1805(local.RefKind != RefKind.None ? LocalSlotConstraints.ByRef : LocalSlotConstraints.None);
CodeGen\Optimizer.cs (13)
858if (node.LocalSymbol.RefKind != RefKind.None) 878if (node.LocalSymbol.RefKind != RefKind.None) 1031(lhs.Kind is BoundKind.Local or BoundKind.Parameter or BoundKind.FieldAccess && lhs.GetRefKind() != RefKind.None), 1041if (((BoundParameter)lhs).ParameterSymbol.RefKind != RefKind.None) 1049if (((BoundLocal)lhs).LocalSymbol.RefKind != RefKind.None) 1221if (unwrappedSequence is BoundLocal { LocalSymbol: { RefKind: not RefKind.None } localSymbol }) 1274ExprContext context = (argRefKind == RefKind.None) ? ExprContext.Value : ExprContext.Address; 1300RefKind refKind = argRefKindsOpt.IsDefaultOrEmpty ? RefKind.None : argRefKindsOpt[i]; 1428if (localSym.RefKind == RefKind.None) 1874Debug.Assert(local.RefKind == RefKind.None, "cannot take a ref of a ref"); 1935return top.Item2 == (local.RefKind == RefKind.None ? ExprContext.Value : ExprContext.Address) && 2162var isIndirectLocalStore = left.LocalSymbol.RefKind != RefKind.None && !node.IsRef; 2430get { return RefKind.None; }
Compilation\CSharpCompilation.cs (2)
2226if (method.RefKind != RefKind.None) 4196fields.Add(new AnonymousTypeField(name, location, TypeWithAnnotations.Create(type, nullableAnnotation), RefKind.None, ScopedKind.None));
Compiler\MethodBodySynthesizer.cs (4)
193statement = new BoundReturnStatement(accessor.SyntaxNode, RefKind.None, fieldAccess, @checked: false); 311BoundStatement returnStatement = BoundReturnStatement.Synthesized(syntax, RefKind.None, processHandlerCall); 321BoundStatement returnStatement = new BoundReturnStatement(syntax, RefKind.None, expressionOpt: null, @checked: false); 358refKind: RefKind.None,
DocumentationComments\DocumentationCommentIDVisitor.PartVisitor.cs (1)
248if (symbol.RefKind != RefKind.None)
Emitter\EditAndContinue\CSharpSymbolMatcher.cs (2)
657return parameter.RefKind is RefKind.None == other.RefKind is RefKind.None &&
Emitter\Model\FieldSymbolAdapter.cs (1)
56bool Cci.IFieldReference.IsByReference => AdaptedFieldSymbol.RefKind != RefKind.None;
Emitter\Model\ParameterSymbolAdapter.cs (1)
41return AdaptedParameterSymbol.RefKind != RefKind.None;
Emitter\Model\ParameterTypeInformation.cs (1)
39return _underlyingParameter.RefKind != RefKind.None;
Emitter\Model\PEModuleBuilder.cs (1)
1228!optArgList.ArgumentRefKindsOpt.IsDefaultOrEmpty && optArgList.ArgumentRefKindsOpt[i] != RefKind.None,
Emitter\Model\SpecializedFieldReference.cs (1)
80bool Cci.IFieldReference.IsByReference => _underlyingField.RefKind != RefKind.None;
FlowAnalysis\AbstractFlowPass.cs (12)
1293VisitRvalue(node.InitializerOpt, isKnownToBeAnLvalue: node.LocalSymbol.RefKind != RefKind.None); 1296if (node.LocalSymbol.RefKind != RefKind.None) 1531VisitRvalue(arguments[i], isKnownToBeAnLvalue: refKind != RefKind.None); 1550case RefKind.None: 1568return refKindsOpt.IsDefault || refKindsOpt.Length <= index ? RefKind.None : refKindsOpt[index]; 2026VisitRvalue(node.ExpressionOpt, isKnownToBeAnLvalue: node.RefKind != RefKind.None); 2029if (node.RefKind != RefKind.None) 2139if (property.RefKind == RefKind.None) 2194if (property.RefKind == RefKind.None) 2213if (property.RefKind == RefKind.None) 2805if (property.RefKind == RefKind.None) 3709property.RefKind == RefKind.None)
FlowAnalysis\DataFlowsOutWalker.cs (1)
233((param.RefKind != RefKind.None && !param.IsImplicitlyDeclared && !RegionContains(param.GetFirstLocation().SourceSpan)) ||
FlowAnalysis\DefiniteAssignment.cs (11)
349NoteWrite(parameter, value: null, read: true, isRef: parameter.RefKind != RefKind.None); 859write: field.RefKind == RefKind.None || isRef); 971write: field.RefKind == RefKind.None || isRef); 1334if (fieldSymbol.RefKind != RefKind.None) 1518if (!isRef && node is BoundFieldAccess { FieldSymbol.RefKind: not RefKind.None } fieldAccess) 1571if (local.LocalSymbol.RefKind != RefKind.None && !isRef) 1640write: field.RefKind == RefKind.None || isRef); 1887NoteWrite(parameter, value: null, read: true, isRef: parameter.RefKind != RefKind.None); 1957if (parameter.RefKind != RefKind.None) 2583if (refKind != RefKind.None && ((object)method == null || method.IsExtern) && arg.Type is TypeSymbol type) 2771NoteWrite(iterationVariable, null, read: true, isRef: iterationVariable.RefKind != RefKind.None);
FlowAnalysis\FlowAnalysisPass.cs (3)
85var newStatements = block.Statements.Add(new BoundReturnStatement(trailingExpression.Syntax, RefKind.None, trailingExpression, @checked: false)); 138if (field.RefKind == RefKind.None) 202: BoundReturnStatement.Synthesized(syntax, RefKind.None, null);
FlowAnalysis\NullableWalker.cs (12)
2383return AreParameterAnnotationsCompatible(RefKind.None, overriddenType, overriddenAnnotations, overridingType, overridingAnnotations, forRef: true) && 2387if (refKind is RefKind.None or RefKind.In or RefKind.RefReadOnlyParameter) 2895if (node.RefKind == RefKind.None && 2904if (node.RefKind == RefKind.None) 7057refKindsBuilder.AddMany(RefKind.None, elements.Length); 7300case RefKind.None: 7361case RefKind.None: 7496case RefKind.None: 7750if (refKind == RefKind.None) 10087case BoundLocal { LocalSymbol.RefKind: RefKind.None }: 10088case BoundParameter { ParameterSymbol: { RefKind: RefKind.None } parameter } when 11995TypeWithAnnotations elementType = InMethodBinder.GetIteratorElementTypeFromReturnType(compilation, RefKind.None,
FlowAnalysis\NullableWalker.PlaceholderLocal.cs (1)
59public override RefKind RefKind => RefKind.None;
FlowAnalysis\ReadWriteWalker.cs (2)
87if (p.RefKind != RefKind.None) _readOutside.Add(p); 95if ((object)thisParameter != null && thisParameter.RefKind != RefKind.None)
Lowering\AsyncRewriter\AsyncExceptionHandlerRewriter.cs (1)
335unpendReturn = new BoundReturnStatement(_F.Syntax, RefKind.None, pendingValue, @checked: false);
Lowering\AsyncRewriter\AsyncMethodBuilderMemberCollection.cs (1)
488method.RefKind == RefKind.None &&
Lowering\ClosureConversion\ClosureConversion.cs (2)
562new BoundReturnStatement(syntax, RefKind.None, null, @checked: false)); 922refkindsBuilder.AddMany(RefKind.None, arguments.Length);
Lowering\ClosureConversion\LambdaCapturedVariable.cs (1)
120public override RefKind RefKind => RefKind.None;
Lowering\DiagnosticsPass_ExpressionTrees.cs (3)
347else if (method.RefKind != RefKind.None) 540if (_inExpressionLambda && property.RefKind != RefKind.None) 575if (p.RefKind != RefKind.None && p.TryGetFirstLocation() is Location location)
Lowering\DiagnosticsPass_Warnings.cs (3)
28if (argumentRefKindsOpt[i] != RefKind.None) 244if (method.Parameters[i].RefKind != RefKind.None && (argumentRefKindsOpt.IsDefault || argumentRefKindsOpt[i] == RefKind.None)) return true;
Lowering\Extensions.cs (1)
25return RefKind.None;
Lowering\InitializerRewriter.cs (2)
68boundStatements.Add(new BoundReturnStatement(lastStatement.Syntax, RefKind.None, trailingExpression, @checked: false)); 106isRef: field.RefKind != RefKind.None)
Lowering\Instrumentation\LocalStateTracingInstrumenter.cs (1)
448Debug.Assert(parameter.RefKind == RefKind.None);
Lowering\Instrumentation\ModuleCancellationInstrumenter.cs (3)
131(argumentRefKindsOpt.IsDefault || argumentRefKindsOpt is [.., RefKind.None]) && 145argumentRefKindsOpt = argumentRefKindsOpt.IsDefault ? default : [.. argumentRefKindsOpt, RefKind.None]; 186member is MethodSymbol { Parameters: [.., { RefKind: RefKind.None, Type: { } lastParamType }] parametersWithCancellationToken } overload &&
Lowering\IteratorRewriter\IteratorConstructor.cs (1)
28SynthesizedParameterSymbol.Create(this, TypeWithAnnotations.Create(intType), 0, RefKind.None, GeneratedNames.MakeStateMachineStateFieldName()));
Lowering\IteratorRewriter\IteratorFinallyMethodSymbol.cs (1)
142get { return RefKind.None; }
Lowering\LocalRewriter\LocalRewriter.cs (3)
1087return ((BoundCall)expr).Method.RefKind != RefKind.None; 1090return ((BoundPropertyAccess)expr).PropertySymbol.RefKind != RefKind.None; 1093return ((BoundIndexerAccess)expr).Indexer.RefKind != RefKind.None;
Lowering\LocalRewriter\LocalRewriter.PatternLocalRewriter.cs (1)
520&& loweredInput.GetRefKind() == RefKind.None &&
Lowering\LocalRewriter\LocalRewriter_AssignmentOperator.cs (1)
222Debug.Assert(!isRef || rewrittenLeft.GetRefKind() != RefKind.None);
Lowering\LocalRewriter\LocalRewriter_Call.cs (21)
287if (thisRefKind != RefKind.None 304if (argumentRefKindsOpt.IsDefault && thisRefKind != RefKind.None) 561return kind != RefKind.None; 691refKind = rewrittenReceiver.Type.IsValueType || rewrittenReceiver.Type.Kind == SymbolKind.TypeParameter ? RefKind.Ref : RefKind.None; 697refKind = RefKind.None; 703if (refKind == RefKind.None && 1085ArrayBuilder<RefKind> refKinds = ArrayBuilder<RefKind>.GetInstance(parameters.Length, RefKind.None); 1163var argRefKind = argumentRefKindsOpt.IsDefault ? RefKind.None : argumentRefKindsOpt[i]; 1165refKindsBuilder[i] = argRefKind == RefKind.None ? RefKind.In : RefKindExtensions.StrictIn; 1169var argRefKind = argumentRefKindsOpt.IsDefault ? RefKind.None : argumentRefKindsOpt[i]; 1170if (argRefKind == RefKind.None) 1202refKindsBuilder = ArrayBuilder<RefKind>.GetInstance(parameters.Length, fillWithValue: RefKind.None); 1247if (refKind != RefKind.None) 1330Debug.Assert(argRefKind == RefKind.None); 1346arg.rewriter.StoreArgumentToTempIfNecessary(arg.forceLambdaSpilling, arg.storesToTemps, element, RefKind.None, RefKind.None), 1365Debug.Assert(argRefKind is RefKind.None or RefKind.In or RefKind.Ref); 1366argRefKind = argRefKind == RefKind.None ? RefKind.In : RefKindExtensions.StrictIn; 1388? (argRefKind == RefKind.None ? RefKind.In : RefKindExtensions.StrictIn) 1620if (argRefKind != RefKind.None || paramRefKind != RefKind.Ref) 1635Debug.Assert(localRefKind == RefKind.None);
Lowering\LocalRewriter\LocalRewriter_CompoundAssignmentOperator.cs (12)
205var receiverTemp = _factory.StoreToTemp(rewrittenReceiver, out assignmentToTemp, refKind: variableRepresentsLocation ? RefKind.Ref : RefKind.None); 332ArrayBuilder<RefKind> refKinds = ArrayBuilder<RefKind>.GetInstance(parameters.Length, RefKind.None); 425Debug.Assert(implicitIndexerAccess.IndexerOrSliceAccess.GetRefKind() == RefKind.None); 526var temp = _factory.StoreToTemp(VisitExpression(arguments[i]), out assignmentToTemp, indexerAccess.ArgumentRefKindsOpt.RefKinds(i) != RefKind.None ? RefKind.Ref : RefKind.None); 597if (propertyAccess.PropertySymbol.RefKind == RefKind.None) 612if (indexerAccess.GetRefKind() == RefKind.None) 625if (implicitIndexerAccess.GetRefKind() == RefKind.None) 699Debug.Assert(((BoundCall)originalLHS).Method.RefKind != RefKind.None); 703Debug.Assert(((BoundFunctionPointerInvocation)originalLHS).FunctionPointer.Signature.RefKind != RefKind.None); 854((BoundParameter)expression).ParameterSymbol.RefKind != RefKind.None || 858return localsMayBeAssignedOrCaptured || ((BoundLocal)expression).LocalSymbol.RefKind != RefKind.None;
Lowering\LocalRewriter\LocalRewriter_DeconstructionAssignmentOperator.cs (2)
168case BoundLocal { LocalSymbol: { RefKind: RefKind.None } localSymbol }: 171case BoundParameter { ParameterSymbol: { RefKind: RefKind.None } parameterSymbol }:
Lowering\LocalRewriter\LocalRewriter_FixedStatement.cs (1)
36if (pinnedTemp.RefKind == RefKind.None)
Lowering\LocalRewriter\LocalRewriter_ForEachStatement.cs (1)
619RefKind collectionTempRefKind = RefKind.None;
Lowering\LocalRewriter\LocalRewriter_IndexerAccess.cs (4)
116if (isLeftOfAssignment && indexer.RefKind == RefKind.None) 505receiver.Type.IsReferenceType ? RefKind.None : RefKind.Ref); 570if (isLeftOfAssignment && indexerAccess.GetRefKind() == RefKind.None) 807receiver.Type.IsReferenceType ? RefKind.None : 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 (3)
147.All(p => p.RefKind is RefKind.None or RefKind.In or RefKind.RefReadOnlyParameter)); 169var builder = ArrayBuilder<RefKind>.GetInstance(addMethod.Parameters.Length, RefKind.None); 609elementArg.rewriter.EvaluateSideEffects(element, RefKind.None, elementArg.sideeffects, ref elementArg.temps),
Lowering\LocalRewriter\LocalRewriter_PropertyAccess.cs (1)
52if (isLeftOfAssignment && propertySymbol.RefKind == RefKind.None)
Lowering\LocalRewriter\LocalRewriter_StringInterpolation.cs (1)
51Debug.Assert(construction.ArgumentRefKindsOpt[i] == RefKind.None);
Lowering\LocalRewriter\LocalRewriter_UnaryOperator.cs (2)
489return ((BoundLocal)expression).LocalSymbol.RefKind != RefKind.None; 493return ((BoundParameter)expression).ParameterSymbol.RefKind != RefKind.None;
Lowering\LocalRewriter\LocalRewriter_UsingStatement.cs (2)
500Debug.Assert(method.Parameters.AsSpan()[1..].All(static (p) => (p.IsOptional || p.IsParams) && p.RefKind is RefKind.None or RefKind.In or RefKind.RefReadOnlyParameter)); 507Debug.Assert(method.ParameterRefKinds.IsDefaultOrEmpty || method.ParameterRefKinds.All(static refKind => refKind is RefKind.In or RefKind.RefReadOnlyParameter or RefKind.None));
Lowering\LocalRewriter\LoweredDynamicOperationFactory.cs (22)
111return MakeDynamicOperation(binderConstruction, null, RefKind.None, loweredArguments, default(ImmutableArray<RefKind>), null, resultType); 147return MakeDynamicOperation(binderConstruction, null, RefKind.None, loweredArguments, default(ImmutableArray<RefKind>), null, resultType); 190return MakeDynamicOperation(binderConstruction, null, RefKind.None, loweredArguments, default(ImmutableArray<RefKind>), null, resultType); 228receiverRefKind = RefKind.None; 292return MakeDynamicOperation(binderConstruction, loweredReceiver, RefKind.None, loweredArguments, default(ImmutableArray<RefKind>), loweredHandler, resultType); 329return MakeDynamicOperation(binderConstruction, loweredReceiver, RefKind.None, loweredArguments, refKinds, null, resultType); 356return MakeDynamicOperation(binderConstruction, loweredReceiver, RefKind.None, loweredArguments, refKinds, null, type); 391return MakeDynamicOperation(binderConstruction, loweredReceiver, RefKind.None, loweredArguments, default(ImmutableArray<RefKind>), null, resultType); 432return MakeDynamicOperation(binderConstruction, loweredReceiver, RefKind.None, loweredArguments, default(ImmutableArray<RefKind>), loweredRight, AssemblySymbol.DynamicType); 458return MakeDynamicOperation(binderConstruction, loweredReceiver, RefKind.None, loweredArguments, refKinds, null, resultType); 516return MakeDynamicOperation(binderConstruction, loweredReceiver, RefKind.None, ImmutableArray<BoundExpression>.Empty, default(ImmutableArray<RefKind>), null, resultType); 547return RefKind.None; 555return hasHome ? RefKind.Ref : RefKind.None; 564RefKind receiverRefKind = RefKind.None, 571Debug.Assert(!receiverIsStaticType || receiverRefKind == RefKind.None); 586refKinds.IsDefault ? RefKind.None : refKinds[i], 592infos[j++] = GetArgumentInfo(argumentInfoFactory, loweredRight, NoName, RefKind.None, isStaticType: false); 736bool hasByRefs = receiverRefKind != RefKind.None || !refKinds.IsDefaultOrEmpty; 776byRefs[j++] = RefKind.None; 794return refKind == RefKind.None ? RefKind.None : RefKind.Ref; 817Debug.Assert(refKind == RefKind.None || refKind == RefKind.Ref || refKind == RefKind.Out, "unexpected refKind in dynamic");
Lowering\MethodToClassRewriter.cs (1)
493if (leftLocal.LocalSymbol.RefKind != RefKind.None &&
Lowering\SpillSequenceSpiller.cs (24)
305RefKind refKind = RefKind.None, 317Debug.Assert(refKind == RefKind.None); 324Debug.Assert(refKind == RefKind.None); 337if (refKind != RefKind.None || expression.Type?.IsRefLikeOrAllowsRefLikeType() == true) 380if (refKind != RefKind.None || expression.Type.IsReferenceType) 388if (refKind != RefKind.None) 397if (local.LocalSymbol.SynthesizedKind == SynthesizedLocalKind.Spill || refKind != RefKind.None) 410if (refKind != RefKind.None || fieldSymbol.IsReadOnly) 417if (refKind == RefKind.None) goto default; 419var receiver = Spill(builder, field.ReceiverOpt, fieldSymbol.ContainingType.IsValueType ? refKind : RefKind.None); 437if (refKind != RefKind.None) 482if (refKind == RefKind.None && 489[Spill(builder, objectCreationExpression.Arguments[0], argRefKinds.IsDefault ? RefKind.None : argRefKinds[0])], 550Left: BoundLocal { LocalSymbol: { SynthesizedKind: SynthesizedLocalKind.LoweringTemp, RefKind: RefKind.None } referenceTypeClone }, 554Value: BoundLocal { LocalSymbol: { SynthesizedKind: SynthesizedLocalKind.LoweringTemp, RefKind: RefKind.None } } referenceTypeReceiver 634var refKind = refKinds.IsDefault ? RefKind.None : refKinds[i]; 892expression = Spill(leftBuilder, expression, RefKind.None); 939expression = Spill(leftBuilder, expression, RefKind.None); 1034Debug.Assert(refKind == RefKind.None || !receiver.Type.IsReferenceType); 1038if (refKind != RefKind.None && 1073var result = RefKind.None; 1286if (receiver.Type.IsReferenceType || receiver.Type.IsValueType || receiverRefKind == RefKind.None) 1289receiver = Spill(receiverBuilder, receiver, RefKind.None); 1306var clone = _F.SynthesizedLocal(receiver.Type, _F.Syntax, refKind: RefKind.None, kind: SynthesizedLocalKind.Spill);
Lowering\StateMachineRewriter\IteratorAndAsyncCaptureWalker.cs (3)
91Debug.Assert(local.RefKind != RefKind.None); 213(variable is LocalSymbol { RefKind: not RefKind.None } refLocal && !canRefLocalBeHoisted(refLocal))) 251Debug.Assert(parameter.IsThis || parameter.RefKind == RefKind.None);
Lowering\StateMachineRewriter\MethodToStateMachineRewriter.cs (12)
313if (local.RefKind != RefKind.None) 588BoundExpression expression = HoistExpression(array.Expression, awaitSyntaxOpt, syntaxOffset, RefKind.None, sideEffects, hoistedFields, ref needsSacrificialEvaluation); 592indices.Add(HoistExpression(index, awaitSyntaxOpt, syntaxOffset, RefKind.None, sideEffects, hoistedFields, ref needsSacrificialEvaluation)); 605if (refKind != RefKind.None || field.FieldSymbol.IsReadOnly) return expr; 609if (refKind == RefKind.None) 617isFieldOfStruct ? refKind : RefKind.None, sideEffects, hoistedFields, ref needsSacrificialEvaluation); 639if (refKind != RefKind.None && refKind != RefKind.In) 642Debug.Assert(call.Method.RefKind != RefKind.None); 646refKind = RefKind.None; 657if (refKind != RefKind.None && refKind != RefKind.RefReadOnly) 664refKind = RefKind.None; 673if (refKind != RefKind.None)
Lowering\StateMachineRewriter\StateMachineFieldSymbol.cs (1)
62public override RefKind RefKind => RefKind.None;
Lowering\StateMachineRewriter\StateMachineRewriter.cs (2)
171if (local.RefKind != RefKind.None) 179Debug.Assert(local.RefKind == RefKind.None);
Lowering\StateMachineRewriter\SynthesizedStateMachineProperty.cs (1)
43get { return RefKind.None; }
Lowering\SyntheticBoundNodeFactory.cs (7)
561Debug.Assert(CurrentFunction.RefKind == RefKind.None); 586RefKind refKind = RefKind.None, 626return SynthesizedParameterSymbol.Create(container, TypeWithAnnotations.Create(type), ordinal, RefKind.None, name); 1633RefKind refKind = RefKind.None, 1664refKind = RefKind.None; 1668case RefKind.None: 1700isRef: refKind != RefKind.None);
Operations\CSharpOperationFactory.cs (1)
884MethodSymbol? accessor = isObjectOrCollectionInitializer || property.RefKind != RefKind.None
SymbolDisplay\SymbolDisplayVisitor.Members.cs (1)
831symbol.RefKind == RefKind.None &&
Symbols\AnonymousTypes\AnonymousTypeManager.Templates.cs (2)
259if (fields.Any(static f => f.RefKind != RefKind.None)) 463var fields = key.Fields.SelectAsArray(f => new AnonymousTypeField(f.Name, Location.None, typeWithAnnotations: default, refKind: RefKind.None, ScopedKind.None));
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.ConstructorSymbol.cs (2)
33paramsArr.Add(SynthesizedParameterSymbol.Create(this, property.TypeWithAnnotations, index, RefKind.None, property.Name)); 55get { return RefKind.None; }
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.DelegateTemplateSymbol.cs (2)
60new SynthesizedDelegateInvokeMethod.ParameterDescription(TypeWithAnnotations.Create(typeParams[i]), refKinds.IsNull ? RefKind.None : refKinds[i], ScopedKind.None, defaultValue: null, isParams: false, hasUnscopedRefAttribute: false)); 65var returnRefKind = (refKinds.IsNull || voidReturnTypeOpt is { }) ? RefKind.None : refKinds[parameterCount];
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.EqualsMethodSymbol.cs (2)
25SynthesizedParameterSymbol.Create(this, TypeWithAnnotations.Create(this.Manager.System_Object), 0, RefKind.None, "value")); 40get { return RefKind.None; }
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.FieldSymbol.cs (1)
35public override RefKind RefKind => RefKind.None;
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.GetHashCodeMethodSymbol.cs (1)
44get { return RefKind.None; }
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.PropertyAccessorSymbol.cs (1)
41get { return RefKind.None; }
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.PropertySymbol.cs (1)
66get { return RefKind.None; }
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.ToStringMethodSymbol.cs (1)
44get { return RefKind.None; }
Symbols\BaseTypeAnalysis.cs (1)
203if (field.RefKind != RefKind.None)
Symbols\Compilation_WellKnownMembers.cs (7)
775internal SynthesizedAttributeData? SynthesizeDynamicAttribute(TypeSymbol type, int customModifiersCount, RefKind refKindOpt = RefKind.None) 780if (type.IsDynamic() && refKindOpt == RefKind.None && customModifiersCount == 0) 919if (refKind != RefKind.None) 1017if (refKind != RefKind.None) 1172return parameter.RefKind != RefKind.None; 1177return method.RefKind != RefKind.None; 1182return property.RefKind != RefKind.None;
Symbols\ErrorMethodSymbol.cs (1)
160get { return RefKind.None; }
Symbols\ErrorPropertySymbol.cs (1)
44public override RefKind RefKind { get { return RefKind.None; } }
Symbols\FieldSymbol.cs (1)
356if (DeriveUseSiteInfoFromType(ref result, this.TypeWithAnnotations, RefKind == RefKind.None ? AllowedRequiredModifierType.System_Runtime_CompilerServices_Volatile : AllowedRequiredModifierType.None) ||
Symbols\FunctionPointers\FunctionPointerMethodSymbol.cs (15)
28RefKind refKind = RefKind.None; 44case SyntaxKind.RefKeyword when refKind == RefKind.None: 59Debug.Assert(refKind != RefKind.None); 73if (returnType.IsVoidType() && refKind != RefKind.None) 88if (refKind != RefKind.None) 285if (returnRefKind == RefKind.None) 312Debug.Assert(refKind is RefKind.None or RefKind.In or RefKind.Ref or RefKind.Out); 351var returnVariance = RefKind == RefKind.None ? variance : VarianceKind.None; 366(VarianceKind.In, RefKind.None) => VarianceKind.Out, 367(VarianceKind.Out, RefKind.None) => VarianceKind.In, 497Debug.Assert(refCustomModifiers.IsDefaultOrEmpty || refKind != RefKind.None); 509Debug.Assert(refCustomModifiers.IsEmpty || refKind != RefKind.None); 585false => RefKind.None, 648var modifiersToSearch = RefKind != RefKind.None ? RefCustomModifiers : ReturnTypeWithAnnotations.CustomModifiers; 671var modifiersToSearch = RefKind != RefKind.None ? RefCustomModifiers : ReturnTypeWithAnnotations.CustomModifiers;
Symbols\FunctionPointers\FunctionPointerTypeSymbol.cs (4)
191? (refKind1 == RefKind.None) == (refKind2 == RefKind.None) 201=> refKind == RefKind.None ? RefKind.None : RefKind.Ref;
Symbols\LocalSymbol.cs (1)
365public bool IsRef => RefKind != RefKind.None;
Symbols\MemberSignatureComparer.cs (2)
809if ((refKind1 == RefKind.None) != (refKind2 == RefKind.None))
Symbols\Metadata\PE\DynamicTypeDecoder.cs (2)
69RefKind targetSymbolRefKind = RefKind.None) 212return refKind == RefKind.None || !ConsumeFlag();
Symbols\Metadata\PE\MemberRefMetadataDecoder.cs (2)
183(field.RefKind != RefKind.None) == fieldInfo.IsByRef && 254if ((candidateParam.RefKind != RefKind.None) != targetParam.IsByRef)
Symbols\Metadata\PE\PEFieldSymbol.cs (2)
327RefKind.None; 636if (RefKind != RefKind.None &&
Symbols\Metadata\PE\PEMethodSymbol.cs (2)
1127case RefKind.None: 1153case RefKind.None:
Symbols\Metadata\PE\PEParameterSymbol.cs (3)
258RefKind refKind = RefKind.None; 264refKind = isByRef ? RefKind.Ref : RefKind.None; 333Debug.Assert(refKind != RefKind.None);
Symbols\Metadata\PE\PEPropertySymbol.cs (2)
290_refKind = RefKind.None; 376if (this.RefKind != RefKind.None && _setMethod != null)
Symbols\ParameterSignature.cs (2)
49if (refKind != RefKind.None) 51refs = ArrayBuilder<RefKind>.GetInstance(parm, RefKind.None);
Symbols\ParameterSymbol.cs (1)
162((refKind = RefKind) == RefKind.None ||
Symbols\RefKindExtensions.cs (3)
18return refKind != RefKind.None; 32return RefKind.None; 45case RefKind.None:
Symbols\Source\CustomModifierUtils.cs (3)
43destinationMethod.RefKind != RefKind.None ? constructedSourceMethod.RefCustomModifiers : ImmutableArray<CustomModifier>.Empty; 73const RefKind refKind = RefKind.None; 146destinationParameter.RefKind != RefKind.None ? sourceParameter.RefCustomModifiers : ImmutableArray<CustomModifier>.Empty,
Symbols\Source\GlobalExpressionVariable.cs (1)
68public sealed override RefKind RefKind => RefKind.None;
Symbols\Source\LambdaSymbol.cs (2)
368refKind = RefKind.None; 374refKind = RefKind.None;
Symbols\Source\LocalFunctionSymbol.cs (1)
286Debug.Assert(_refKind == RefKind.None
Symbols\Source\ParameterHelpers.cs (7)
691else if (refKind != RefKind.None && 923var refKind = RefKind.None; 935if (refKind == RefKind.None) 942if (refKind == RefKind.None) 949if (refKind == RefKind.None) 962Debug.Assert(refKind == RefKind.None); 976scope = (refKind == RefKind.None) ? ScopedKind.ScopedValue : ScopedKind.ScopedRef;
Symbols\Source\SourceAssemblySymbol.cs (1)
2743else if (field.RefKind != RefKind.None)
Symbols\Source\SourceComplexParameterSymbol.cs (2)
881return UseUpdatedEscapeRules && (RefKind != RefKind.None || (HasParamsModifier && Type.IsRefLikeOrAllowsRefLikeType())); 1737Debug.Assert(refKind != RefKind.None || _refCustomModifiers.IsEmpty);
Symbols\Source\SourceConstructorSymbol.cs (1)
93methodKind, RefKind.None, declarationModifiers, returnsVoid: true, returnsVoidIsSet: true,
Symbols\Source\SourceDelegateMethodSymbol.cs (8)
217: base(delegateType, voidType, syntax, MethodKind.Constructor, RefKind.None, DeclarationModifiers.Public) 220SynthesizedParameterSymbol.Create(this, objectType, 0, RefKind.None, "object"), 221SynthesizedParameterSymbol.Create(this, intPtrType, 1, RefKind.None, "method"))); 355: base((SourceNamedTypeSymbol)invoke.ContainingType, iAsyncResultType, syntax, MethodKind.Ordinary, RefKind.None, DeclarationModifiers.Virtual | DeclarationModifiers.Public) 365parameters.Add(SynthesizedParameterSymbol.Create(this, asyncCallbackType, paramCount, RefKind.None, GetUniqueParameterName(parameters, "callback"))); 366parameters.Add(SynthesizedParameterSymbol.Create(this, objectType, paramCount + 1, RefKind.None, GetUniqueParameterName(parameters, "object"))); 402if (p.RefKind != RefKind.None) 409parameters.Add(SynthesizedParameterSymbol.Create(this, iAsyncResultType, ordinal++, RefKind.None, GetUniqueParameterName(parameters, "result")));
Symbols\Source\SourceDestructorSymbol.cs (1)
68MethodKind.Destructor, RefKind.None, declarationModifiers, returnsVoid: true, returnsVoidIsSet: true,
Symbols\Source\SourceEnumConstantSymbol.cs (1)
58public sealed override RefKind RefKind => RefKind.None;
Symbols\Source\SourceEventAccessorSymbol.cs (1)
37RefKind.None,
Symbols\Source\SourceLocalSymbol.cs (1)
69_scope = _refKind != RefKind.None
Symbols\Source\SourceMemberContainerSymbol.cs (14)
3946if (methodParam.RefKind != RefKind.None) 3969methodParams[0].RefKind == RefKind.None && 4296RefKind.None, 4342RefKind.None 4344RefKind.None, 4391RefKind.None)), 4392RefKind.None, 4447RefKind.None, 4526RefKind.None, 4621RefKind.None, 4652RefKind.None, 4718RefKind.None 4720RefKind.None, 4928var modifiers = SourceMemberFieldSymbol.MakeModifiers(this, fieldSyntax.Declaration.Variables[0].Identifier, fieldSyntax.Modifiers, isRefField: refKind != RefKind.None, diagnostics, out modifierErrors);
Symbols\Source\SourceMemberContainerSymbol_ImplementationChecks.cs (1)
1411else if (parameters.Any(p => p.RefKind == RefKind.None && p.Type.IsRefLikeOrAllowsRefLikeType()))
Symbols\Source\SourceMemberFieldSymbol.cs (6)
451RefKind refKind = RefKind.None; 489Debug.Assert(refKind is RefKind.None or RefKind.Ref or RefKind.RefReadOnly); 491if (refKind != RefKind.None) 508Debug.Assert(refKindToAssert == RefKind.None); // Otherwise we might need to report an error 539var initializerOpt = executableBinder.BindInferredVariableInitializer(diagnostics, RefKind.None, syntaxNode, declarator); 568if (refKind != RefKind.None)
Symbols\Source\SourceMethodSymbol.cs (1)
65if (parameter.RefKind != RefKind.None)
Symbols\Source\SourceMethodSymbolWithAttributes.cs (2)
1401if (refKind != RefKind.None) 1524if (this.RefKind != RefKind.None)
Symbols\Source\SourceOrdinaryMethodSymbol.cs (1)
153Debug.Assert(this.RefKind == RefKind.None || !returnType.IsVoidType() || returnTypeSyntax.HasErrors);
Symbols\Source\SourcePropertySymbolBase.cs (5)
249_lazyRefCustomModifiers = _refKind != RefKind.None ? overriddenOrImplementedProperty.RefCustomModifiers : ImmutableArray<CustomModifier>.Empty; 865if (RefKind != RefKind.None && IsRequired) 889if (this.RefKind != RefKind.None) 926if (_refKind != RefKind.None) 953else if (RefKind != RefKind.None)
Symbols\Source\SourceUserDefinedOperatorSymbolBase.cs (2)
39methodKind, RefKind.None, declarationModifiers, 334if (p.RefKind != RefKind.None && p.RefKind != RefKind.In)
Symbols\Source\ThisParameterSymbol.cs (1)
149return RefKind.None;
Symbols\SymbolExtensions.cs (3)
494refKind = RefKind.None; 512refKind = RefKind.None; 529refKind = RefKind.None;
Symbols\Synthesized\ReadOnlyListType\SynthesizedReadOnlyListConstructor.cs (1)
15SynthesizedParameterSymbol.Create(this, TypeWithAnnotations.Create(parameterType), ordinal: 0, RefKind.None, parameterName));
Symbols\Synthesized\ReadOnlyListType\SynthesizedReadOnlyListEnumeratorConstructor.cs (1)
15SynthesizedParameterSymbol.Create(this, TypeWithAnnotations.Create(parameterType), ordinal: 0, RefKind.None, "item"));
Symbols\Synthesized\ReadOnlyListType\SynthesizedReadOnlyListProperty.cs (1)
33public override RefKind RefKind => RefKind.None;
Symbols\Synthesized\Records\SynthesizedPrimaryConstructor.cs (1)
43RefKind.None,
Symbols\Synthesized\Records\SynthesizedPrimaryConstructorParameterBackingFieldSymbol.cs (1)
45public override RefKind RefKind => RefKind.None;
Symbols\Synthesized\Records\SynthesizedRecordBaseEquals.cs (1)
33ordinal: 0, RefKind.None, "other", Locations)));
Symbols\Synthesized\Records\SynthesizedRecordClone.cs (1)
124if (ctor.ParameterCount == 1 && ctor.Parameters[0].RefKind == RefKind.None &&
Symbols\Synthesized\Records\SynthesizedRecordCopyCtor.cs (2)
30RefKind.None, 148method.Parameters[0].RefKind == RefKind.None;
Symbols\Synthesized\Records\SynthesizedRecordEqualityContractProperty.cs (1)
41RefKind.None,
Symbols\Synthesized\Records\SynthesizedRecordEqualityOperator.cs (1)
45if (member is MethodSymbol candidate && candidate.ParameterCount == 1 && candidate.Parameters[0].RefKind == RefKind.None &&
Symbols\Synthesized\Records\SynthesizedRecordEqualityOperatorBase.cs (2)
73ordinal: 0, RefKind.None, "left", Locations), 76ordinal: 1, RefKind.None, "right", Locations)));
Symbols\Synthesized\Records\SynthesizedRecordEquals.cs (1)
41ordinal: 0, RefKind.None, "other", Locations)));
Symbols\Synthesized\Records\SynthesizedRecordObjEquals.cs (1)
36ordinal: 0, RefKind.None, "obj", Locations)));
Symbols\Synthesized\Records\SynthesizedRecordOrdinaryMethod.cs (1)
27MethodKind.Ordinary, RefKind.None, declarationModifiers, returnsVoid: false, returnsVoidIsSet: false,
Symbols\Synthesized\Records\SynthesizedRecordPrintMembers.cs (1)
98ordinal: 0, RefKind.None, "builder", Locations)));
Symbols\Synthesized\Records\SynthesizedRecordPropertySymbol.cs (1)
39RefKind.None,
Symbols\Synthesized\RefKindVector.cs (2)
46(false, false, false) => RefKind.None, 59RefKind.None => (false, false, false),
Symbols\Synthesized\SynthesizedAccessorValueParameterSymbol.cs (1)
23: base(accessor, ordinal, RefKind.None, ParameterSymbol.ValueParameterName, accessor.TryGetFirstLocation(),
Symbols\Synthesized\SynthesizedBackingFieldSymbol.cs (1)
92Debug.Assert(property.RefKind is RefKind.None or RefKind.Ref or RefKind.RefReadOnly);
Symbols\Synthesized\SynthesizedDelegateSymbol.cs (2)
21SynthesizedParameterSymbol.Create(this, TypeWithAnnotations.Create(objectType), 0, RefKind.None, "object"), 22SynthesizedParameterSymbol.Create(this, TypeWithAnnotations.Create(intPtrType), 1, RefKind.None, "method"));
Symbols\Synthesized\SynthesizedEmbeddedNativeIntegerAttributeSymbol.cs (1)
53m => ImmutableArray.Create(SynthesizedParameterSymbol.Create(m, boolArrayType, 0, RefKind.None)),
Symbols\Synthesized\SynthesizedEmbeddedNullableAttributeSymbol.cs (2)
53m => ImmutableArray.Create(SynthesizedParameterSymbol.Create(m, annotatedByteType, 0, RefKind.None)), 57m => ImmutableArray.Create(SynthesizedParameterSymbol.Create(m, byteArrayType, 0, RefKind.None)),
Symbols\Synthesized\SynthesizedEmbeddedNullableContextAttributeSymbol.cs (1)
41m => ImmutableArray.Create(SynthesizedParameterSymbol.Create(m, TypeWithAnnotations.Create(systemByteType), 0, RefKind.None)),
Symbols\Synthesized\SynthesizedEmbeddedNullablePublicOnlyAttributeSymbol.cs (1)
41m => ImmutableArray.Create(SynthesizedParameterSymbol.Create(m, TypeWithAnnotations.Create(systemBooleanType), 0, RefKind.None)),
Symbols\Synthesized\SynthesizedEmbeddedRefSafetyRulesAttributeSymbol.cs (1)
39m => ImmutableArray.Create(SynthesizedParameterSymbol.Create(m, TypeWithAnnotations.Create(int32Type), 0, RefKind.None)),
Symbols\Synthesized\SynthesizedEntryPointSymbol.cs (6)
117get { return RefKind.None; } 411refKind: RefKind.None, 429refKind: RefKind.None, 522RefKind.None, 541TypeWithAnnotations.Create(submissionArrayType), 0, RefKind.None, "submissionArray")); 613RefKind.None,
Symbols\Synthesized\SynthesizedEnumValueFieldSymbol.cs (1)
29public override RefKind RefKind => RefKind.None;
Symbols\Synthesized\SynthesizedFieldSymbol.cs (1)
36public override RefKind RefKind => RefKind.None;
Symbols\Synthesized\SynthesizedGlobalMethodSymbol.cs (1)
206get { return RefKind.None; }
Symbols\Synthesized\SynthesizedHotReloadExceptionConstructorSymbol.cs (2)
19SynthesizedParameterSymbol.Create(this, TypeWithAnnotations.Create(stringType), ordinal: 0, RefKind.None), 20SynthesizedParameterSymbol.Create(this, TypeWithAnnotations.Create(intType), ordinal: 1, RefKind.None)
Symbols\Synthesized\SynthesizedInlineArrayAsReadOnlySpanMethod.cs (1)
18SynthesizedParameterSymbol.Create(this, TypeWithAnnotations.Create(intType), 1, RefKind.None, "length")));
Symbols\Synthesized\SynthesizedInlineArrayAsSpanMethod.cs (1)
18SynthesizedParameterSymbol.Create(this, TypeWithAnnotations.Create(intType), 1, RefKind.None, "length")));
Symbols\Synthesized\SynthesizedInlineArrayElementRefMethod.cs (1)
18SynthesizedParameterSymbol.Create(this, TypeWithAnnotations.Create(intType), 1, RefKind.None, "index")));
Symbols\Synthesized\SynthesizedInlineArrayElementRefReadOnlyMethod.cs (1)
18SynthesizedParameterSymbol.Create(this, TypeWithAnnotations.Create(intType), 1, RefKind.None, "index")));
Symbols\Synthesized\SynthesizedInstanceConstructor.cs (1)
151get { return RefKind.None; }
Symbols\Synthesized\SynthesizedInteractiveInitializerMethod.cs (1)
116get { return RefKind.None; }
Symbols\Synthesized\SynthesizedIntrinsicOperatorSymbol.cs (2)
220return RefKind.None; 468) : base(container, TypeWithAnnotations.Create(type), ordinal, RefKind.None, ScopedKind.None, name)
Symbols\Synthesized\SynthesizedLambdaCacheFieldSymbol.cs (1)
36public override RefKind RefKind => RefKind.None;
Symbols\Synthesized\SynthesizedLocal.cs (1)
41RefKind refKind = RefKind.None
Symbols\Synthesized\SynthesizedSimpleProgramEntryPointSymbol.cs (2)
59TypeWithAnnotations.Create(Binder.GetSpecialType(compilation, SpecialType.System_String, NoLocation.Singleton, diagnostics)))), 0, RefKind.None, "args")); 73RefKind.None,
Symbols\Synthesized\SynthesizedStaticConstructor.cs (1)
131return RefKind.None;
Symbols\Synthesized\SynthesizedStringHashFunctionSymbol.cs (2)
21this.SetParameters(ImmutableArray.Create<ParameterSymbol>(SynthesizedParameterSymbol.Create(this, TypeWithAnnotations.Create(paramType), 0, RefKind.None, "s"))); 31this.SetParameters(ImmutableArray.Create<ParameterSymbol>(SynthesizedParameterSymbol.Create(this, TypeWithAnnotations.Create(paramType), 0, RefKind.None, "s")));
Symbols\Synthesized\SynthesizedSubmissionConstructor.cs (1)
29SynthesizedParameterSymbol.Create(this, TypeWithAnnotations.Create(submissionArrayType), 0, RefKind.None, "submissionArray"));
Symbols\Synthesized\SynthesizedThrowSwitchExpressionExceptionMethod.cs (1)
19this.SetParameters(ImmutableArray.Create(SynthesizedParameterSymbol.Create(this, TypeWithAnnotations.Create(paramType), 0, RefKind.None, "unmatchedValue")));
Symbols\Tuples\TupleErrorFieldSymbol.cs (1)
157public override RefKind RefKind => RefKind.None;
Symbols\TypeSymbol.cs (2)
2002RefKind interfaceMemberRefKind = RefKind.None; 2554return elementField is { RefKind: RefKind.None, IsFixedSizeBuffer: false };
Symbols\VarianceSafety.cs (3)
163requireInputSafety: method.RefKind != RefKind.None, 199requireInputSafety: hasSetter || !(property.GetMethod?.RefKind == RefKind.None), 242requireOutputSafety: param.RefKind != RefKind.None,
Syntax\SyntaxNodeExtensions.cs (2)
283refKind = RefKind.None; 324refKind = RefKind.None;
Microsoft.CodeAnalysis.CSharp.CodeStyle (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ArgumentSyntaxExtensions.cs (1)
30_ => RefKind.None,
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (7)
src\Analyzers\CSharp\CodeFixes\GenerateConstructor\CSharpGenerateConstructorService.cs (1)
77refKind: RefKind.None,
src\Analyzers\CSharp\CodeFixes\GenerateParameterizedMember\CSharpGenerateConversionService.cs (1)
210refKind: RefKind.None,
src\Analyzers\CSharp\CodeFixes\GenerateParameterizedMember\CSharpGenerateParameterizedMemberService.cs (1)
39=> _invocationExpression.IsParentKind(SyntaxKind.RefExpression) ? RefKind.Ref : RefKind.None;
src\Analyzers\CSharp\CodeFixes\ImplementInterface\CSharpImplementInterfaceService.cs (1)
101g.Argument(DisposingName, RefKind.None, g.FalseLiteralExpression()))));
src\Analyzers\CSharp\CodeFixes\MakeLocalFunctionStatic\MakeLocalFunctionStaticCodeFixHelper.cs (1)
216refKind: RefKind.None,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpSyntaxGeneratorInternal.cs (1)
138RefKind.None => [],
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (1)
715return InferTypeInArgument(index, parameterizedSymbols, name, RefKind.None);
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (43)
CodeGen\CodeGenFunctionPointersTests.cs (29)
102(RefKind.None, IsSpecialType(SpecialType.System_Int32)), 103(RefKind.None, IsSpecialType(SpecialType.System_String))); 197(RefKind.None, IsVoidType()), 198(RefKind.None, IsFunctionPointerTypeSymbol(CallingConvention.Standard, 199(RefKind.None, IsVoidType()), 200(RefKind.None, IsSpecialType(SpecialType.System_Int32))) 205(RefKind.None, IsFunctionPointerTypeSymbol(CallingConvention.Default, 206(RefKind.None, IsTypeName("S")))), 207(RefKind.None, IsTypeName("C"))); 573(RefKind.None, IsVoidType()), 578(RefKind.None, IsVoidType()), 583(RefKind.None, IsVoidType()), 588(RefKind.None, IsVoidType()), 649(RefKind.None, IsVoidType()), 655(RefKind.None, 657(RefKind.None, IsSpecialType(SpecialType.System_Int32)))), 660(RefKind.None, 662(RefKind.None, IsVoidType())))))); 790(RefKind.None, IsVoidType()), 791(RefKind.None, IsSpecialType(SpecialType.System_String)))); 794(RefKind.None, IsSpecialType(SpecialType.System_Int32)))); 820(RefKind.None, IsTypeName("C")), 821(RefKind.None, IsTypeName("C"))); 988(RefKind.None, IsVoidType())); 996(RefKind.None, IsVoidType())); 7674returnRefKind: RefKind.None, parameterTypes: ImmutableArray<TypeWithAnnotations>.Empty, parameterRefKinds: ImmutableArray<RefKind>.Empty, 7683parameterRefCustomModifiers: default, returnRefKind: RefKind.None, parameterTypes: ImmutableArray<TypeWithAnnotations>.Empty, parameterRefKinds: ImmutableArray<RefKind>.Empty, 7759returnRefKind: RefKind.None, parameterTypes: ImmutableArray<TypeWithAnnotations>.Empty, parameterRefKinds: ImmutableArray<RefKind>.Empty, 7768returnRefKind: RefKind.None, parameterTypes: ImmutableArray<TypeWithAnnotations>.Empty, parameterRefKinds: ImmutableArray<RefKind>.Empty,
CodeGen\CodeGenReadonlyStructTests.cs (10)
874Assert.Equal(RefKind.None, namedType.Constructors[0].ThisParameter.RefKind); 875Assert.Equal(RefKind.None, namedType.GetMethod("M1").ThisParameter.RefKind); 876Assert.Equal(RefKind.None, namedType.GetMethod("ToString").ThisParameter.RefKind); 881Assert.Equal(RefKind.None, namedType.Constructors[0].ThisParameter.RefKind); 882Assert.Equal(RefKind.None, namedType.GetMethod("Invoke").ThisParameter.RefKind); 1038Assert.Equal(RefKind.None, namedType.Constructors[0].ThisParameter.RefKind); 1039Assert.Equal(RefKind.None, namedType.GetMethod("M1").ThisParameter.RefKind); 1040Assert.Equal(RefKind.None, namedType.GetMethod("ToString").ThisParameter.RefKind); 1045Assert.Equal(RefKind.None, namedType.Constructors[0].ThisParameter.RefKind); 1046Assert.Equal(RefKind.None, namedType.GetMethod("Invoke").ThisParameter.RefKind);
Emit\EmitMetadataTests.cs (2)
2026Assert.Equal(RefKind.None, m.Parameters[0].RefKind); 2092if (invoke.Parameters[i].RefKind != RefKind.None)
Emit\InAttributeModifierTests.cs (2)
3839Assert.Equal(RefKind.None, classMethod.RefKind); 3868Assert.Equal(RefKind.None, classMethod.RefKind);
Microsoft.CodeAnalysis.CSharp.Features (14)
CodeRefactorings\ConvertLocalFunctionToMethod\CSharpConvertLocalFunctionToMethodCodeRefactoringProvider.cs (1)
92refKind: dataFlow.WrittenInside.Contains(capture) ? RefKind.Ref : RefKind.None,
Completion\Providers\ContextVariableArgumentProvider.cs (1)
47case RefKind.None:
ConvertLinq\CSharpConvertLinqQueryToForEachProvider.cs (2)
305methodSymbol.RefKind == RefKind.None) 342methodSymbol.RefKind == RefKind.None &&
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.cs (1)
105refKind: AnalyzerResult.ReturnsByRef ? RefKind.Ref : RefKind.None,
GenerateType\CSharpGenerateTypeService.cs (1)
814refKind: RefKind.None,
InitializeParameter\CSharpInitializeMemberFromPrimaryConstructorParameterCodeRefactoringProvider.cs (1)
254RefKind.None,
SignatureHelp\LightweightOverloadResolution.cs (2)
113if (parameterRefKind == RefKind.None) 139if (parameterRefKind == RefKind.In && argumentRefKind == RefKind.None)
src\Analyzers\CSharp\CodeFixes\GenerateConstructor\CSharpGenerateConstructorService.cs (1)
77refKind: RefKind.None,
src\Analyzers\CSharp\CodeFixes\GenerateParameterizedMember\CSharpGenerateConversionService.cs (1)
210refKind: RefKind.None,
src\Analyzers\CSharp\CodeFixes\GenerateParameterizedMember\CSharpGenerateParameterizedMemberService.cs (1)
39=> _invocationExpression.IsParentKind(SyntaxKind.RefExpression) ? RefKind.Ref : RefKind.None;
src\Analyzers\CSharp\CodeFixes\ImplementInterface\CSharpImplementInterfaceService.cs (1)
101g.Argument(DisposingName, RefKind.None, g.FalseLiteralExpression()))));
src\Analyzers\CSharp\CodeFixes\MakeLocalFunctionStatic\MakeLocalFunctionStaticCodeFixHelper.cs (1)
216refKind: RefKind.None,
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (112)
Semantics\FunctionPointerTests.cs (2)
3942(RefKind.None, IsVoidType()), 3943(RefKind.None, IsErrorType()));
Semantics\LambdaTests.cs (2)
7113Assert.Equal(RefKind.None, lambdaParameter1.RefKind); 7118Assert.Equal(RefKind.None, lambdaParameter2.RefKind);
Semantics\RefFieldTests.cs (106)
10919VerifyParameterSymbol(parameters[0], "R x1", RefKind.None, ScopedKind.None); 10920VerifyParameterSymbol(parameters[1], "scoped R y1", RefKind.None, ScopedKind.ScopedValue); 11028VerifyParameterSymbol(localFunctions[0].Parameters[0], "R x1", RefKind.None, ScopedKind.None); 11029VerifyParameterSymbol(localFunctions[0].Parameters[1], "scoped R y1", RefKind.None, ScopedKind.ScopedValue); 11101verifyParameter(delegateTypesAndLambdas[0], 0, "R", "x1", RefKind.None, ScopedKind.None, false); 11102verifyParameter(delegateTypesAndLambdas[0], 1, "scoped R", "y1", RefKind.None, ScopedKind.ScopedValue, false); 11158VerifyParameterSymbol(comp.GetMember<NamedTypeSymbol>("D1").DelegateInvokeMethod.Parameters[0], "scoped R r1", RefKind.None, ScopedKind.ScopedValue); 11224VerifyParameterSymbol(methods[0].Parameters[0], "R", RefKind.None, ScopedKind.None); 11246VerifyParameterSymbol(comp.GetMember<MethodSymbol>("Program.F0").Parameters[0], "scoped R r", RefKind.None, ScopedKind.ScopedValue); 11355VerifyParameterSymbol(comp.GetMember<MethodSymbol>("Program.F0").Parameters[0], "scoped s", RefKind.None, ScopedKind.None); 11356VerifyParameterSymbol(comp.GetMember<MethodSymbol>("Program.F1").Parameters[0], "scoped scoped s", RefKind.None, ScopedKind.ScopedValue); 11391VerifyParameterSymbol(lambdas[0].Parameters[0], "R r1", RefKind.None, ScopedKind.None); 11392VerifyParameterSymbol(lambdas[1].Parameters[0], "R r2", RefKind.None, ScopedKind.None); 11471VerifyParameterSymbol(parameters[0], "R a", RefKind.None, ScopedKind.None); 11549VerifyParameterSymbol(comp.GetMember<MethodSymbol>("C..ctor").ThisParameter, "C this", RefKind.None, ScopedKind.None); 11550VerifyParameterSymbol(comp.GetMember<MethodSymbol>("C.F1").ThisParameter, "C this", RefKind.None, ScopedKind.None); 11602VerifyParameterSymbol(comp.GetMember<MethodSymbol>("Extensions.F0").Parameters[0], "R<System.Object> r", RefKind.None, ScopedKind.None); 11603VerifyParameterSymbol(comp.GetMember<MethodSymbol>("Extensions.F1").Parameters[0], "scoped R<System.Object> r", RefKind.None, ScopedKind.ScopedValue); 11604VerifyParameterSymbol(comp.GetMember<MethodSymbol>("Extensions.F2").Parameters[0], "scoped", RefKind.None, ScopedKind.None); 11623VerifyParameterSymbol(comp.GetMember<MethodSymbol>("Program.F2").Parameters[0], "params scoped System.Object[] args", RefKind.None, ScopedKind.ScopedValue); 11923verifyValueParameter(comp.GetMember<PropertySymbol>("R2.P2"), "R1 value", RefKind.None, ScopedKind.None); 11924verifyValueParameter(comp.GetMember<PropertySymbol>("R2.P3"), "R1 value", RefKind.None, ScopedKind.None); 11950VerifyParameterSymbol(method.Parameters[0], "scoped R<System.Int32> x", RefKind.None, ScopedKind.ScopedValue); 11984VerifyParameterSymbol(method.Parameters[0], "scoped R x", RefKind.None, ScopedKind.ScopedValue); 12064VerifyLocalSymbol(locals[0], "scoped R r1", RefKind.None, ScopedKind.ScopedValue); 12067VerifyLocalSymbol(locals[3], "scoped R r11", RefKind.None, ScopedKind.ScopedValue); 12138Assert.Equal(RefKind.None, f.RefKind); 12201VerifyLocalSymbol(locals[0], "scoped R r1", RefKind.None, ScopedKind.ScopedValue); 12387VerifyLocalSymbol(locals[0], "scoped R r1", RefKind.None, ScopedKind.ScopedValue); 12388VerifyLocalSymbol(locals[1], "scoped R r2", RefKind.None, ScopedKind.ScopedValue); 12389VerifyLocalSymbol(locals[2], "scoped R r5", RefKind.None, ScopedKind.ScopedValue); 12390VerifyLocalSymbol(locals[3], "scoped R r11", RefKind.None, ScopedKind.ScopedValue); 12391VerifyLocalSymbol(locals[4], "scoped R r21", RefKind.None, ScopedKind.ScopedValue); 12392VerifyLocalSymbol(locals[5], "scoped R r51", RefKind.None, ScopedKind.ScopedValue); 12577Assert.Equal(RefKind.None, f.RefKind); 12798VerifyLocalSymbol(locals[0], "scoped R r1", RefKind.None, ScopedKind.ScopedValue); 12799VerifyLocalSymbol(locals[1], "scoped R r2", RefKind.None, ScopedKind.ScopedValue); 12800VerifyLocalSymbol(locals[2], "scoped R r5", RefKind.None, ScopedKind.ScopedValue); 12801VerifyLocalSymbol(locals[3], "scoped R r11", RefKind.None, ScopedKind.ScopedValue); 12802VerifyLocalSymbol(locals[4], "scoped R r21", RefKind.None, ScopedKind.ScopedValue); 12803VerifyLocalSymbol(locals[5], "scoped R r51", RefKind.None, ScopedKind.ScopedValue); 12984Assert.Equal(RefKind.None, f.RefKind); 13154VerifyLocalSymbol(locals[0], "scoped s1", RefKind.None, ScopedKind.None); 13157VerifyLocalSymbol(locals[3], "scoped scoped s4", RefKind.None, ScopedKind.ScopedValue); 13209VerifyLocalSymbol(locals[0], "scoped s1", RefKind.None, ScopedKind.None); 13212VerifyLocalSymbol(locals[3], "scoped scoped s4", RefKind.None, ScopedKind.ScopedValue); 13268VerifyLocalSymbol(locals[0], "scoped s1", RefKind.None, ScopedKind.None); 13269VerifyLocalSymbol(locals[2], "scoped s3", RefKind.None, ScopedKind.None); 13270VerifyLocalSymbol(locals[4], "scoped scoped s4", RefKind.None, ScopedKind.ScopedValue); 13271VerifyLocalSymbol(locals[6], "scoped scoped s6", RefKind.None, ScopedKind.ScopedValue); 13313VerifyLocalSymbol(locals[0], "scoped s1", RefKind.None, ScopedKind.None); 13314VerifyLocalSymbol(locals[1], "scoped s3", RefKind.None, ScopedKind.None); 13315VerifyLocalSymbol(locals[2], "scoped scoped s4", RefKind.None, ScopedKind.ScopedValue); 13316VerifyLocalSymbol(locals[3], "scoped scoped s6", RefKind.None, ScopedKind.ScopedValue); 13340VerifyLocalSymbol(locals[0], "System.Boolean scoped", RefKind.None, ScopedKind.None); 13365VerifyLocalSymbol(locals[0], "System.Boolean scoped", RefKind.None, ScopedKind.None); 13385VerifyLocalSymbol(locals[0], "System.Boolean scoped", RefKind.None, ScopedKind.None); 13407VerifyLocalSymbol(locals[0], "System.Boolean scoped", RefKind.None, ScopedKind.None); 13448VerifyLocalSymbol(locals[0], "scoped R<System.Int32> r1", RefKind.None, ScopedKind.ScopedValue); 13512VerifyLocalSymbol(locals[0], "scoped R<System.Int32> r1", RefKind.None, ScopedKind.ScopedValue); 13588VerifyLocalSymbol(locals[0], "scoped R<System.Int32> r1", RefKind.None, ScopedKind.ScopedValue); 13589VerifyLocalSymbol(locals[2], "scoped R<System.Int32> r3", RefKind.None, ScopedKind.ScopedValue); 13659VerifyLocalSymbol(locals[0], "scoped R<System.Int32> r1", RefKind.None, ScopedKind.ScopedValue); 13660VerifyLocalSymbol(locals[1], "scoped R<System.Int32> r3", RefKind.None, ScopedKind.ScopedValue); 14525VerifyLocalSymbol(locals[0], "R r11", RefKind.None, ScopedKind.None); 14526VerifyLocalSymbol(locals[1], "R r12", RefKind.None, ScopedKind.None); 14527VerifyLocalSymbol(locals[2], "scoped R r21", RefKind.None, ScopedKind.ScopedValue); 14528VerifyLocalSymbol(locals[3], "scoped R r22", RefKind.None, ScopedKind.ScopedValue); 14601VerifyLocalSymbol(locals[0], "scoped R r1", RefKind.None, ScopedKind.ScopedValue); 14846VerifyLocalSymbol(locals[0], "scoped R r1", RefKind.None, ScopedKind.ScopedValue); 14847VerifyLocalSymbol(locals[1], "scoped R r2", RefKind.None, ScopedKind.ScopedValue); 14848VerifyLocalSymbol(locals[2], "scoped R r5", RefKind.None, ScopedKind.ScopedValue); 14849VerifyLocalSymbol(locals[3], "scoped R r11", RefKind.None, ScopedKind.ScopedValue); 14850VerifyLocalSymbol(locals[4], "scoped R r21", RefKind.None, ScopedKind.ScopedValue); 14851VerifyLocalSymbol(locals[5], "scoped R r51", RefKind.None, ScopedKind.ScopedValue); 15054VerifyLocalSymbol(locals[0], "scoped s1", RefKind.None, ScopedKind.None); 15057VerifyLocalSymbol(locals[3], "scoped scoped s4", RefKind.None, ScopedKind.ScopedValue); 15080VerifyLocalSymbol(locals[0], "System.Boolean scoped", RefKind.None, ScopedKind.None); 15141VerifyLocalSymbol(locals[0], "scoped R<System.Int32> r1", RefKind.None, ScopedKind.ScopedValue); 17949VerifyParameterSymbol(delegateInvokeMethods[0].Parameters[0], "R arg1", RefKind.None, ScopedKind.None); 17950VerifyParameterSymbol(delegateInvokeMethods[0].Parameters[1], "scoped R arg2", RefKind.None, ScopedKind.ScopedValue); 23214VerifyParameterSymbol(type.GetMethod("F4").Parameters[0], "R<T> t4", RefKind.None, ScopedKind.None, expectedHasUnscopedRefAttribute: true); 23318VerifyParameterSymbol(parameters[0], "System.Int32 x", RefKind.None, default, expectedHasUnscopedRefAttribute: true); 23319VerifyParameterSymbol(parameters[1], "System.Object y", RefKind.None, default, expectedHasUnscopedRefAttribute: true); 23626VerifyParameterSymbol(baseType.GetMethod("F1A").Parameters[0], "R<System.Int32> r1", RefKind.None, ScopedKind.None, expectedHasUnscopedRefAttribute: false); 23627VerifyParameterSymbol(baseType.GetMethod("F2A").Parameters[0], "scoped R<System.Int32> r2", RefKind.None, ScopedKind.ScopedValue, expectedHasUnscopedRefAttribute: false); 23628VerifyParameterSymbol(baseType.GetMethod("F3A").Parameters[0], "R<System.Int32> r3", RefKind.None, ScopedKind.None, expectedHasUnscopedRefAttribute: true); 23629VerifyParameterSymbol(baseType.GetMethod("F4A").Parameters[0], "R<System.Int32> r4", RefKind.None, ScopedKind.None, expectedHasUnscopedRefAttribute: true); 23654VerifyParameterSymbol(comp.GetMember<MethodSymbol>("Program.F1").Parameters[0], "R<T> r1", RefKind.None, ScopedKind.None, expectedHasUnscopedRefAttribute: true); 24746verifyParameter(delegateTypesAndLambdas[1], 0, "R", "r2", RefKind.None, ScopedKind.None); 24796VerifyParameterSymbol(getFunctionPointerMethod(comp, "A.F2").Parameters[0], "R", RefKind.None, ScopedKind.None); 24858VerifyParameterSymbol(comp.GetMember<MethodSymbol>("Program.F2").Parameters[0], "R r2", RefKind.None, ScopedKind.None, expectedHasUnscopedRefAttribute: true); 27050VerifyLocalSymbol(locals[0], "scoped R r1", RefKind.None, ScopedKind.ScopedValue); 27140VerifyLocalSymbol(locals[0], "scoped R r1", RefKind.None, ScopedKind.ScopedValue); 27260VerifyLocalSymbol(locals[0], "scoped s1", RefKind.None, ScopedKind.None); 27263VerifyLocalSymbol(locals[3], "scoped scoped s4", RefKind.None, ScopedKind.ScopedValue); 27361VerifyLocalSymbol(locals[0], "scoped s1", RefKind.None, ScopedKind.None); 27364VerifyLocalSymbol(locals[3], "scoped scoped s4", RefKind.None, ScopedKind.ScopedValue); 27412VerifyLocalSymbol(locals[0], "scoped R<System.Int32> r1", RefKind.None, ScopedKind.ScopedValue); 27413VerifyLocalSymbol(locals[1], "scoped R<System.Int32> r3", RefKind.None, ScopedKind.ScopedValue); 27472VerifyLocalSymbol(locals[0], "scoped R<System.Int32> r1", RefKind.None, ScopedKind.ScopedValue); 27473VerifyLocalSymbol(locals[1], "scoped R<System.Int32> r3", RefKind.None, ScopedKind.ScopedValue); 27696VerifyLocalSymbol(locals[0], "scoped R r2", RefKind.None, ScopedKind.ScopedValue); 27697VerifyLocalSymbol(locals[1], "scoped R r5", RefKind.None, ScopedKind.ScopedValue); 27744VerifyLocalSymbol(locals[0], "scoped R r2", RefKind.None, ScopedKind.ScopedValue); 27745VerifyLocalSymbol(locals[1], "scoped R r5", RefKind.None, ScopedKind.ScopedValue);
Semantics\RefLocalsAndReturnsTests.cs (2)
5262Assert.Equal(RefKind.None, f.RefKind); 5301Assert.Equal(RefKind.None, f.RefKind);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (41)
SymbolDisplay\SymbolDisplayTests.cs (1)
6684Assert.Equal(RefKind.None, local.RefKind);
Symbols\FunctionPointerTypeSymbolTests.cs (35)
26[InlineData("", RefKind.None, "delegate*<System.Object>")] 113verifyRefKind(RefKind.None, mParams[0]); 117verifyRefKind(RefKind.None, mParams[4]); 118verifyRefKind(RefKind.None, mParams[5]); 120verifyRefKind(RefKind.None, mParams[7]); 481Assert.Equal(RefKind.None, fourthParam.Parameters.Single().RefKind); 574Assert.Equal(RefKind.None, firstParam.Parameters.Single().RefKind); 577Assert.Equal(RefKind.None, secondParam.Parameters.Single().RefKind); 1532Assert.Throws<ArgumentNullException>("returnType", () => comp.CreateFunctionPointerTypeSymbol(returnType: null!, returnRefKind: RefKind.None, parameterTypes: ImmutableArray<ITypeSymbol>.Empty, parameterRefKinds: ImmutableArray<RefKind>.Empty)); 1533Assert.Throws<ArgumentNullException>("parameterTypes", () => comp.CreateFunctionPointerTypeSymbol(returnType: @string, returnRefKind: RefKind.None, parameterTypes: default, parameterRefKinds: ImmutableArray<RefKind>.Empty)); 1534Assert.Throws<ArgumentNullException>("parameterTypes[0]", () => comp.CreateFunctionPointerTypeSymbol(returnType: @string, returnRefKind: RefKind.None, parameterTypes: ImmutableArray.Create((ITypeSymbol?)null)!, parameterRefKinds: ImmutableArray.Create(RefKind.None))); 1535Assert.Throws<ArgumentNullException>("parameterRefKinds", () => comp.CreateFunctionPointerTypeSymbol(returnType: @string, returnRefKind: RefKind.None, parameterTypes: ImmutableArray<ITypeSymbol>.Empty, parameterRefKinds: default)); 1536Assert.Throws<ArgumentNullException>("callingConventionTypes[0]", () => comp.CreateFunctionPointerTypeSymbol(returnType: @string, returnRefKind: RefKind.None, parameterTypes: ImmutableArray<ITypeSymbol>.Empty, parameterRefKinds: ImmutableArray<RefKind>.Empty, callingConvention: SignatureCallingConvention.Unmanaged, ImmutableArray.Create((INamedTypeSymbol)null!))); 1537Assert.Throws<ArgumentException>(() => comp.CreateFunctionPointerTypeSymbol(returnType: @string, returnRefKind: RefKind.None, parameterTypes: ImmutableArray<ITypeSymbol>.Empty, parameterRefKinds: ImmutableArray.Create(RefKind.None))); 1539Assert.Throws<ArgumentOutOfRangeException>(() => comp.CreateFunctionPointerTypeSymbol(returnType: @string, returnRefKind: RefKind.None, parameterTypes: ImmutableArray<ITypeSymbol>.Empty, parameterRefKinds: ImmutableArray<RefKind>.Empty, callingConvention: (SignatureCallingConvention)10)); 1540Assert.Throws<ArgumentException>(() => comp.CreateFunctionPointerTypeSymbol(returnType: @string, returnRefKind: RefKind.None, parameterTypes: ImmutableArray<ITypeSymbol>.Empty, parameterRefKinds: ImmutableArray<RefKind>.Empty, callingConvention: SignatureCallingConvention.Default, callingConventionTypes: ImmutableArray.Create(cdeclType)!)); 1541Assert.Throws<ArgumentException>(() => comp.CreateFunctionPointerTypeSymbol(returnType: @string, returnRefKind: RefKind.None, parameterTypes: ImmutableArray<ITypeSymbol>.Empty, parameterRefKinds: ImmutableArray<RefKind>.Empty, callingConvention: SignatureCallingConvention.StdCall, callingConventionTypes: ImmutableArray.Create(cdeclType)!)); 1542Assert.Throws<ArgumentException>(() => comp.CreateFunctionPointerTypeSymbol(returnType: @string, returnRefKind: RefKind.None, parameterTypes: ImmutableArray<ITypeSymbol>.Empty, parameterRefKinds: ImmutableArray<RefKind>.Empty, callingConvention: SignatureCallingConvention.FastCall, callingConventionTypes: ImmutableArray.Create(cdeclType)!)); 1543Assert.Throws<ArgumentException>(() => comp.CreateFunctionPointerTypeSymbol(returnType: @string, returnRefKind: RefKind.None, parameterTypes: ImmutableArray<ITypeSymbol>.Empty, parameterRefKinds: ImmutableArray<RefKind>.Empty, callingConvention: SignatureCallingConvention.CDecl, callingConventionTypes: ImmutableArray.Create(cdeclType)!)); 1544Assert.Throws<ArgumentException>(() => comp.CreateFunctionPointerTypeSymbol(returnType: @string, returnRefKind: RefKind.None, parameterTypes: ImmutableArray<ITypeSymbol>.Empty, parameterRefKinds: ImmutableArray<RefKind>.Empty, callingConvention: SignatureCallingConvention.ThisCall, callingConventionTypes: ImmutableArray.Create(cdeclType)!)); 1545Assert.Throws<ArgumentException>(() => comp.CreateFunctionPointerTypeSymbol(returnType: @string, returnRefKind: RefKind.None, parameterTypes: ImmutableArray<ITypeSymbol>.Empty, parameterRefKinds: ImmutableArray<RefKind>.Empty, callingConvention: SignatureCallingConvention.Unmanaged, callingConventionTypes: ImmutableArray.Create(@string)!)); 1553var ptr = comp.CreateFunctionPointerTypeSymbol(returnType: @string, returnRefKind: RefKind.None, parameterTypes: ImmutableArray<ITypeSymbol>.Empty, parameterRefKinds: ImmutableArray<RefKind>.Empty, callingConvention: SignatureCallingConvention.VarArgs); 1569RefKind.None, 1571ImmutableArray.Create(RefKind.None, RefKind.None)); 1601RefKind.None, 1638var ptr = comp.CreateFunctionPointerTypeSymbol(@string, returnRefKind: RefKind.None, parameterTypes: ImmutableArray<ITypeSymbol>.Empty, parameterRefKinds: ImmutableArray<RefKind>.Empty, convention); 1653var ptr = comp.CreateFunctionPointerTypeSymbol(@string, returnRefKind: RefKind.None, parameterTypes: ImmutableArray<ITypeSymbol>.Empty, parameterRefKinds: ImmutableArray<RefKind>.Empty, SignatureCallingConvention.Unmanaged, ImmutableArray.Create(cdeclType, stdcallType)!); 1658ptr = comp.CreateFunctionPointerTypeSymbol(@string, returnRefKind: RefKind.None, parameterTypes: ImmutableArray<ITypeSymbol>.Empty, parameterRefKinds: ImmutableArray<RefKind>.Empty, SignatureCallingConvention.Unmanaged, ImmutableArray.Create(cdeclType)!); 1967returnRefKind: RefKind.None, 2047returnRefKind: RefKind.None, 2114returnRefKind: RefKind.None, 2173returnRefKind: RefKind.None,
Symbols\Metadata\PE\DynamicTransformsTests.cs (2)
283Assert.Equal(RefKind.None, f3.Parameters[0].RefKind); 307Assert.Equal(RefKind.None, f4.Parameters[0].RefKind);
Symbols\PEParameterSymbolTests.cs (1)
120Assert.Equal(RefKind.None, z.RefKind);
Symbols\Source\DelegateTests.cs (1)
179if (invoke.Parameters[i].RefKind != RefKind.None)
Symbols\TypeTests.cs (1)
518Assert.Equal(RefKind.None, p3.RefKind);
Microsoft.CodeAnalysis.CSharp.Test.Utilities (3)
Extensions.cs (1)
610Assert.Equal(RefKind.None, valueParameter.RefKind);
FunctionPointerUtilities.cs (2)
288case RefKind.None: 320case RefKind.None:
Microsoft.CodeAnalysis.CSharp.WinRT.UnitTests (2)
Metadata\WinMdDumpTest.cs (2)
343AppendSignatureType(result, method.ReturnType, RefKind.None); 420if (refKind != RefKind.None)
Microsoft.CodeAnalysis.CSharp.Workspaces (5)
CodeGeneration\CSharpSyntaxGenerator.cs (2)
215case RefKind.None: 3616=> this.ParameterDeclaration(identifier, type, initializer: null, RefKind.None);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ArgumentSyntaxExtensions.cs (1)
30_ => RefKind.None,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpSyntaxGeneratorInternal.cs (1)
138RefKind.None => [],
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (1)
715return InferTypeInArgument(index, parameterizedSymbols, name, RefKind.None);
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (2)
CodeGeneration\SyntaxGeneratorTests.cs (2)
531Generator.Argument("goo", RefKind.None, Generator.IdentifierName("x")), 532Generator.Argument("bar", RefKind.None, Generator.IdentifierName("y"))]), "(goo: x, bar: y)");
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (9)
CodeGeneration\CodeGenerationTests.cs (7)
160RefKind.None, 353RefKind.None, 448RefKind.None, 459RefKind.None, 483RefKind.None, 658attributes: default, RefKind.None, isParams, GetTypeSymbol(s.Compilation, type), name, 665attributes: default, RefKind.None, isParams, GetTypeSymbol(s.Compilation, typeFullName, typeArrayRank), parameterName,
CodeGeneration\ExpressionGenerationTests.cs (2)
382f.Argument("n", RefKind.None, f.IdentifierName("a"))), 448f.Argument("n", RefKind.None, f.IdentifierName("a"))),
Microsoft.CodeAnalysis.Features (29)
AddConstructorParametersFromMembers\AddConstructorParametersFromMembersCodeRefactoringProvider.State.cs (1)
110return constructorParams.All(parameter => parameter.RefKind == RefKind.None) &&
ChangeSignature\AbstractChangeSignatureService.cs (1)
833refKind: RefKind.None,
Completion\Providers\AbstractContextVariableArgumentProvider.cs (1)
31|| context.Parameter.RefKind != RefKind.None;
ConvertToInterpolatedString\AbstractConvertPlaceholderToInterpolatedStringRefactoringProvider.cs (1)
72if (syntaxFacts.GetRefKindOfArgument(argument) != RefKind.None)
ConvertTupleToStruct\AbstractConvertTupleToStructCodeRefactoringProvider.cs (1)
870RefKind.None,
EncapsulateField\AbstractEncapsulateFieldService.cs (1)
351refKind: RefKind.None,
ExtractMethod\MethodExtractor.CodeGenerator.cs (1)
379parameterBehavior == ParameterBehavior.Out ? RefKind.Out : RefKind.None;
GenerateConstructorFromMembers\AbstractGenerateConstructorFromMembersCodeRefactoringProvider.State.cs (1)
105where c.Parameters.All(p => p.RefKind == RefKind.None) && !c.Parameters.Any(static p => p.IsParams)
GenerateEqualsAndGetHashCodeFromMembers\AbstractGenerateEqualsAndGetHashCodeService.cs (1)
139refKind: RefKind.None,
GenerateFromMembers\AbstractGenerateFromMembersCodeRefactoringProvider.cs (1)
112refKind: RefKind.None,
GenerateType\AbstractGenerateTypeService.GenerateNamedType.cs (1)
50RefKind.None,
InitializeParameter\AbstractInitializeMemberFromParameterCodeRefactoringProviderMemberCreation.cs (1)
346RefKind.None,
IntroduceParameter\IntroduceParameterDocumentRewriter.cs (1)
576? (TArgumentSyntax)_generator.Argument(parameterName, RefKind.None, newArgumentExpression)
ReplaceMethodWithProperty\ReplaceMethodWithPropertyCodeRefactoringProvider.cs (1)
137setMethod.Parameters is [{ RefKind: RefKind.None } parameter] &&
src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (1)
762methodSymbol.Parameters[0].RefKind == RefKind.None &&
src\Analyzers\Core\Analyzers\UseCompoundAssignment\UseCompoundAssignmentUtilities.cs (1)
133if (property.RefKind == RefKind.None)
src\Analyzers\Core\Analyzers\UseConditionalExpression\ForReturn\UseConditionalExpressionForReturnHelpers.cs (2)
81syntaxFacts, anyReturn.GetRefKind(containingSymbol) != RefKind.None, 122isRef = anyReturn.GetRefKind(containingSymbol) != RefKind.None;
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateDeconstructMethodService.State.cs (1)
76refKind: RefKind.None,
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateMethodService.State.cs (1)
255refKind: RefKind.None,
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.CodeAction.cs (2)
70var setAccessor = _isReadonly || _refKind != RefKind.None 121return _state.TypeToGenerateIn.TypeKind != TypeKind.Interface && _refKind != RefKind.None
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.cs (4)
153document, state, generateProperty: false, isReadonly: false, isConstant: true, refKind: RefKind.None)); 167document, state, generateProperty: false, isReadonly: true, isConstant: false, refKind: RefKind.None)); 181document, state, generateProperty: false, isReadonly: false, isConstant: false, refKind: RefKind.None)); 266return RefKind.None;
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.GenerateParameterCodeAction.cs (1)
44RefKind.None,
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator_DisposePattern.cs (1)
203g.Argument(DisposingName, RefKind.None, g.TrueLiteralExpression())))));
src\Compilers\Core\Portable\DiagnosticAnalyzer\SuppressMessageAttributeState.TargetSymbolResolver.cs (1)
796if ((symbol.RefKind == RefKind.None) == parameterInfo.IsRefOrOut)
Microsoft.CodeAnalysis.Test.Utilities (1)
Compilation\OperationTreeVerifier.cs (1)
898Assert.Equal(RefKind.None, operation.GetArgumentRefKind(i));
Microsoft.CodeAnalysis.UnitTests (1)
Diagnostics\OperationTests.cs (1)
50Assert.Equal(RefKind.None, dynamicExpression.GetArgumentRefKind(0));
Microsoft.CodeAnalysis.VisualBasic (7)
Compilation\ClsComplianceChecker.vb (1)
958builder.Add(If(parameter.IsByRef, RefKind.Ref, RefKind.None))
SymbolDisplay\SymbolDisplayVisitor.Members.vb (1)
527If symbol.RefKind <> RefKind.None AndAlso IsExplicitByRefParameter(symbol) Then
Symbols\FieldSymbol.vb (1)
457Return RefKind.None
Symbols\MethodSymbol.vb (1)
1052Return If(Me.ReturnsByRef, RefKind.Ref, RefKind.None)
Symbols\ParameterSymbol.vb (1)
308Return If(Me.IsByRef, RefKind.Ref, RefKind.None)
Symbols\PropertySymbol.vb (1)
594Return If(Me.ReturnsByRef, RefKind.Ref, RefKind.None)
Symbols\Source\LocalSymbol.vb (1)
300Return RefKind.None
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (5)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\ExpressionSyntaxExtensions.vb (3)
287Return parameter IsNot Nothing AndAlso parameter.RefKind <> RefKind.None 302Return method.Parameters(index).RefKind <> RefKind.None 307Return prop.Parameters(index).RefKind <> RefKind.None
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\ParenthesizedExpressionSyntaxExtensions.vb (1)
288parameter.RefKind <> RefKind.None Then
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Services\SyntaxFacts\VisualBasicSyntaxFacts.vb (1)
601Return RefKind.None
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (5)
src\Analyzers\VisualBasic\CodeFixes\GenerateConstructor\VisualBasicGenerateConstructorService.vb (1)
162Return arguments.SelectAsArray(Function(a) New Argument(RefKind.None, TryCast(a, SimpleArgumentSyntax)?.NameColonEquals?.Name.Identifier.ValueText, a.GetArgumentExpression()))
src\Analyzers\VisualBasic\CodeFixes\GenerateParameterizedMember\VisualBasicGenerateConversionService.vb (1)
155refKind:=RefKind.None,
src\Analyzers\VisualBasic\CodeFixes\GenerateParameterizedMember\VisualBasicGenerateParameterizedMemberService.vb (2)
38Return RefKind.None 133Me.InvocationExpression.ArgumentList.Arguments.Select(Function(a) RefKind.None).ToImmutableArray(),
src\Analyzers\VisualBasic\CodeFixes\ImplementInterface\VisualBasicImplementInterfaceService.vb (1)
118g.Argument(DisposingName, RefKind.None, g.FalseLiteralExpression()))))
Microsoft.CodeAnalysis.VisualBasic.EditorFeatures (1)
NavigationBar\VisualBasicEditorNavigationBarItemService_CodeGeneration.vb (1)
233refKind:=RefKind.None,
Microsoft.CodeAnalysis.VisualBasic.Features (12)
CodeFixes\GenerateEvent\GenerateEventCodeFixProvider.vb (3)
144refKind:=RefKind.None, name:=eventHandlerName, 293modifiers:=Nothing, returnType:=returnType, refKind:=RefKind.None, 393refKind:=RefKind.None, name:=actualEventName + "Handler",
CodeRefactorings\InlineTemporary\VisualBasicInlineTemporaryCodeRefactoringProvider.vb (1)
108Return parameter.RefKind <> RefKind.None
ExtractMethod\Extensions.vb (1)
149If parameter.RefKind <> RefKind.None Then
ExtractMethod\VisualBasicMethodExtractor.VisualBasicCodeGenerator.vb (1)
68refKind:=RefKind.None,
GenerateType\VisualBasicGenerateTypeService.vb (1)
698refKind:=RefKind.None,
src\Analyzers\VisualBasic\CodeFixes\GenerateConstructor\VisualBasicGenerateConstructorService.vb (1)
162Return arguments.SelectAsArray(Function(a) New Argument(RefKind.None, TryCast(a, SimpleArgumentSyntax)?.NameColonEquals?.Name.Identifier.ValueText, a.GetArgumentExpression()))
src\Analyzers\VisualBasic\CodeFixes\GenerateParameterizedMember\VisualBasicGenerateConversionService.vb (1)
155refKind:=RefKind.None,
src\Analyzers\VisualBasic\CodeFixes\GenerateParameterizedMember\VisualBasicGenerateParameterizedMemberService.vb (2)
38Return RefKind.None 133Me.InvocationExpression.ArgumentList.Arguments.Select(Function(a) RefKind.None).ToImmutableArray(),
src\Analyzers\VisualBasic\CodeFixes\ImplementInterface\VisualBasicImplementInterfaceService.vb (1)
118g.Argument(DisposingName, RefKind.None, g.FalseLiteralExpression()))))
Microsoft.CodeAnalysis.VisualBasic.Workspaces (8)
CodeGeneration\VisualBasicSyntaxGenerator.vb (2)
845If refKind <> RefKind.None Then 1498Return Argument(name, RefKind.None, expression)
Simplification\VisualBasicSimplificationService.Expander.vb (1)
325parameter.RefKind <> RefKind.None Then
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\ExpressionSyntaxExtensions.vb (3)
287Return parameter IsNot Nothing AndAlso parameter.RefKind <> RefKind.None 302Return method.Parameters(index).RefKind <> RefKind.None 307Return prop.Parameters(index).RefKind <> RefKind.None
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\ParenthesizedExpressionSyntaxExtensions.vb (1)
288parameter.RefKind <> RefKind.None Then
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Services\SyntaxFacts\VisualBasicSyntaxFacts.vb (1)
601Return RefKind.None
Microsoft.CodeAnalysis.VisualBasic.Workspaces.UnitTests (2)
CodeGeneration\SyntaxGeneratorTests.vb (2)
472{Generator.Argument("goo", RefKind.None, Generator.IdentifierName("x")), 473Generator.Argument("bar", RefKind.None, Generator.IdentifierName("y"))}), "(goo:=x, bar:=y)")
Microsoft.CodeAnalysis.Workspaces (13)
Editing\SyntaxGenerator.cs (4)
303RefKind refKind = RefKind.None) 332or { RefKind: RefKind.None, Type.IsRefLikeType: true, ScopedKind: ScopedKind.ScopedValue }); 1931=> TypeExpression(typeSymbol, RefKind.None); 2246=> Argument(name: null, RefKind.None, expression);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.cs (1)
486if (symbol is IMethodSymbol method && method.Parameters.All(p => p.RefKind == RefKind.None))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\OperationExtensions.cs (1)
233return containingMethod?.RefKind ?? RefKind.None;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.ParameterSymbolEqualityComparer.cs (2)
76: (rk1 == RefKind.None) == (rk2 == RefKind.None);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationSymbolFactory.cs (2)
269=> CreateParameterSymbol(RefKind.None, type, name); 396refKind: RefKind.None,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationFieldSymbol.cs (1)
84public RefKind RefKind => RefKind.None;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions.cs (1)
300refKind: RefKind.None,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (1)
56refKind: RefKind.None,
Microsoft.Gen.Logging (3)
Parsing\Parser.cs (1)
548else if (paramSymbol.RefKind != RefKind.None)
Parsing\Parser.TagProvider.cs (2)
99&& method.Parameters[0].RefKind == RefKind.None 100&& method.Parameters[1].RefKind == RefKind.None
Microsoft.Interop.SourceGeneration (5)
Marshalling\AttributedMarshallingModelGeneratorResolver.cs (1)
455if (refKind == RefKind.None)
Marshalling\MarshallerHelpers.cs (2)
22ByValueContentsMarshalKind.Default => RefKind.None, 457RefKind.None => default,
TypePositionInfo.cs (2)
65public RefKind RefKind { get; init; } = RefKind.None; 67public bool IsByRef => RefKind != RefKind.None;
Microsoft.VisualStudio.LanguageServices (1)
Venus\ContainedLanguageCodeSupport.cs (1)
195refKind: RefKind.None,
Microsoft.VisualStudio.LanguageServices.UnitTests (1)
ChangeSignature\ChangeSignatureViewModelTests.vb (1)
298Dim includedInTest = {RefKind.None, RefKind.Ref, RefKind.Out, RefKind.In, RefKind.RefReadOnly, RefKind.RefReadOnlyParameter}