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 (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_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)
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)
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,