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.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\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions.cs (1)
300refKind: RefKind.None,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (1)
56refKind: RefKind.None,
Binder\Binder.ValueChecks.cs (67)
53Method is { RefKind: not RefKind.None, ReturnType: { } returnType } &&
386if (indexerAccess.Indexer.RefKind != RefKind.None)
1061(localSymbol.RefKind == RefKind.None && !localSymbol.IsWritableVariable))
1069if (localSymbol.RefKind == RefKind.None)
1101if (localSymbol.RefKind == RefKind.None)
1147else if (parameterSymbol.RefKind == RefKind.None && RequiresRefAssignableVariable(valueKind))
1153Debug.Assert(parameterSymbol.RefKind != RefKind.None || !RequiresRefAssignableVariable(valueKind));
1157if (parameterSymbol.RefKind == RefKind.None &&
1161Debug.Assert(backingField.RefKind == RefKind.None);
1166Debug.Assert(backingField.RefKind == RefKind.None);
1268{ RefKind: RefKind.None } => CurrentMethodScope,
1303Debug.Assert(parameterSymbol.RefKind == RefKind.None || isRefScoped || refSafeToEscape == ReturnOnlyScope);
1353if ((fieldSymbol.RefKind == RefKind.None ? RequiresAssignableVariable(valueKind) : RequiresRefAssignableVariable(valueKind)) &&
1365case RefKind.None:
1390case RefKind.None:
1405case RefKind.None:
1508if (fieldSymbol.RefKind != RefKind.None)
1532if (fieldSymbol.RefKind != RefKind.None)
1668if (RequiresVariable(valueKind) && methodSymbol.RefKind == RefKind.None)
1714propertySymbol.RefKind == RefKind.None)
1744var requiresSet = RequiresAssignableVariable(valueKind) && propertySymbol.RefKind == RefKind.None;
1813var requiresGet = !RequiresAssignmentOnly(valueKind) || propertySymbol.RefKind != RefKind.None;
2105(param is { RefKind: not RefKind.None, Type: { } type } && type.IsRefLikeOrAllowsRefLikeType())) &&
2197var valid = effectiveRefKind != RefKind.None && isRefEscape ?
2266(param is { RefKind: not RefKind.None, Type: { } type } && type.IsRefLikeOrAllowsRefLikeType())) &&
2367var refKind = parameter?.RefKind ?? RefKind.None;
2372if (refKind == RefKind.None &&
2430return new EscapeArgument(parameter: null, receiver, RefKind.None);
2433var refKind = RefKind.None;
2460var refKind = argRefKindsOpt.IsDefault ? RefKind.None : argRefKindsOpt[argIndex];
2638if (refKind != RefKind.None)
2658if (parameter.RefKind != RefKind.None && GetParameterRefEscapeLevel(parameter) is { } refEscapeLevel)
2727if (parameter.RefKind != RefKind.None)
3029if (_underlyingParameter.RefKind is not RefKind.None and var underlyingRefKind)
3036return RefKind.None;
3249Debug.Assert(field.RefKind == RefKind.None ? RequiresAssignableVariable(kind) : RequiresRefAssignableVariable(kind));
3446if (methodSymbol.RefKind == RefKind.None)
3468if (methodSymbol.RefKind == RefKind.None)
3529if (methodSymbol.RefKind == RefKind.None)
3556Debug.Assert(GetInlineArrayAccessEquivalentSignatureMethod(elementAccess, out _, out _).RefKind == RefKind.None);
3564Debug.Assert(equivalentSignatureMethod.RefKind != RefKind.None);
3608conversion.Conversion.Method.RefKind == RefKind.None));
3615unaryMethod.RefKind == RefKind.None));
3622binaryMethod.RefKind == RefKind.None));
3628logicalOperator.LogicalOperator.RefKind == RefKind.None));
3635compoundMethod.RefKind == RefKind.None));
3763if (methodSymbol.RefKind == RefKind.None)
3789if (indexerSymbol.RefKind == RefKind.None)
3820if (indexerSymbol.RefKind == RefKind.None)
3846if (methodSymbol.RefKind == RefKind.None)
3877Debug.Assert(GetInlineArrayAccessEquivalentSignatureMethod(elementAccess, out _, out _).RefKind == RefKind.None);
3885Debug.Assert(equivalentSignatureMethod.RefKind != RefKind.None);
3907if (signature.RefKind == RefKind.None)
3931if (propertySymbol.RefKind == RefKind.None)
3978conversion.Conversion.Method.RefKind == RefKind.None);
3985unaryMethod.RefKind == RefKind.None));
3992binaryMethod.RefKind == RefKind.None));
3998logicalOperator.LogicalOperator.RefKind == RefKind.None));
4005compoundMethod.RefKind == RefKind.None));
4563if (constructMethod is not { Parameters: [{ RefKind: RefKind.None } parameter] })
4698var accessorKind = property.RefKind == RefKind.None ? AccessorKind.Set : AccessorKind.Get;
5471resultRefKind = RefKind.None;
5472parameterRefKind = RefKind.None;
5485resultRefKind = RefKind.None;
5546RefKind.None,
5768return !((CodeGenerator.IsStackLocal(local, stackLocalsOpt) && local.RefKind == RefKind.None) ||
5890Debug.Assert(field.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);
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\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\MethodToStateMachineRewriter.cs (12)
308if (local.RefKind != RefKind.None)
571BoundExpression expression = HoistExpression(array.Expression, awaitSyntaxOpt, syntaxOffset, RefKind.None, sideEffects, hoistedFields, ref needsSacrificialEvaluation);
575indices.Add(HoistExpression(index, awaitSyntaxOpt, syntaxOffset, RefKind.None, sideEffects, hoistedFields, ref needsSacrificialEvaluation));
588if (refKind != RefKind.None || field.FieldSymbol.IsReadOnly) return expr;
592if (refKind == RefKind.None)
600isFieldOfStruct ? refKind : RefKind.None, sideEffects, hoistedFields, ref needsSacrificialEvaluation);
622if (refKind != RefKind.None && refKind != RefKind.In)
625Debug.Assert(call.Method.RefKind != RefKind.None);
629refKind = RefKind.None;
640if (refKind != RefKind.None && refKind != RefKind.RefReadOnly)
647refKind = RefKind.None;
656if (refKind != RefKind.None)
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\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\Synthesized\Records\SynthesizedPrimaryConstructor.cs (1)
43RefKind.None,
Symbols\Synthesized\Records\SynthesizedRecordEqualityContractProperty.cs (1)
41RefKind.None,
Symbols\Synthesized\Records\SynthesizedRecordPropertySymbol.cs (1)
39RefKind.None,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpSyntaxGeneratorInternal.cs (1)
138RefKind.None => [],
InitializeParameter\CSharpInitializeMemberFromPrimaryConstructorParameterCodeRefactoringProvider.cs (1)
254RefKind.None,
ConvertTupleToStruct\AbstractConvertTupleToStructCodeRefactoringProvider.cs (1)
870RefKind.None,
GenerateType\AbstractGenerateTypeService.GenerateNamedType.cs (1)
50RefKind.None,
InitializeParameter\AbstractInitializeMemberFromParameterCodeRefactoringProviderMemberCreation.cs (1)
346RefKind.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.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,