127 references to RefReadOnly
GenerateDocumentationAndConfigFiles (5)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\OperationExtensions.cs (3)
166case RefKind.RefReadOnly: 183RefKind.RefReadOnly => ValueUsageInfo.ReadableReference, 224case RefKind.RefReadOnly:
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationMethodSymbol.cs (1)
89return RefKind == RefKind.RefReadOnly;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationPropertySymbol.cs (1)
74public bool ReturnsByRefReadonly => refKind == RefKind.RefReadOnly;
ILLink.RoslynAnalyzer (3)
IOperationExtensions.cs (3)
140case RefKind.RefReadOnly: 157RefKind.RefReadOnly => ValueUsageInfo.ReadableReference, 198case RefKind.RefReadOnly:
Microsoft.CodeAnalysis.Analyzers (5)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\OperationExtensions.cs (3)
166case RefKind.RefReadOnly: 183RefKind.RefReadOnly => ValueUsageInfo.ReadableReference, 224case RefKind.RefReadOnly:
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationMethodSymbol.cs (1)
89return RefKind == RefKind.RefReadOnly;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationPropertySymbol.cs (1)
74public bool ReturnsByRefReadonly => refKind == RefKind.RefReadOnly;
Microsoft.CodeAnalysis.AnalyzerUtilities (3)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\OperationExtensions.cs (3)
166case RefKind.RefReadOnly: 183RefKind.RefReadOnly => ValueUsageInfo.ReadableReference, 224case RefKind.RefReadOnly:
Microsoft.CodeAnalysis.CodeStyle (3)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\OperationExtensions.cs (3)
166case RefKind.RefReadOnly: 183RefKind.RefReadOnly => ValueUsageInfo.ReadableReference, 224case RefKind.RefReadOnly:
Microsoft.CodeAnalysis.CodeStyle.Fixes (3)
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.cs (1)
256return RefKind.RefReadOnly;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationMethodSymbol.cs (1)
89return RefKind == RefKind.RefReadOnly;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationPropertySymbol.cs (1)
74public bool ReturnsByRefReadonly => refKind == RefKind.RefReadOnly;
Microsoft.CodeAnalysis.CSharp (65)
Binder\Binder.ValueChecks.cs (6)
1334if (localSymbol.RefKind == RefKind.RefReadOnly || 1643case RefKind.RefReadOnly: 1667case RefKind.RefReadOnly: 1690case RefKind.RefReadOnly: 1973if (RequiresAssignableVariable(valueKind) && methodSymbol.RefKind == RefKind.RefReadOnly) 2028if (RequiresAssignableVariable(valueKind) && propertySymbol.RefKind == RefKind.RefReadOnly)
Binder\Binder_Lambda.cs (1)
316if (refKind == RefKind.RefReadOnly)
Binder\Binder_Statements.cs (1)
935valueKind = variableRefKind == RefKind.RefReadOnly
Binder\ForEachLoopBinder.cs (3)
352case RefKind.RefReadOnly: 486if (elementConversionClassification.Kind != ConversionKind.Identity && IterationVariable.RefKind is RefKind.Ref or RefKind.RefReadOnly) 889builder.CurrentPropertyGetter?.RefKind == (wellKnownSpan == WellKnownType.System_ReadOnlySpan_T ? RefKind.RefReadOnly : RefKind.Ref)) ||
BoundTree\BoundExpressionExtensions.cs (2)
56return RefKind.RefReadOnly; 146delegateType is { DelegateInvokeMethod.OriginalDefinition: SynthesizedDelegateInvokeMethod { RefKind: RefKind.RefReadOnly } })
BoundTree\UnboundLambda.cs (4)
244Debug.Assert(refKind != RefKind.RefReadOnly); 867if (lambdaSymbol.RefKind == CodeAnalysis.RefKind.RefReadOnly) 1014Debug.Assert(refKind != CodeAnalysis.RefKind.RefReadOnly); 1040Debug.Assert(refKind != CodeAnalysis.RefKind.RefReadOnly);
CodeGen\CodeGenerator_HasHome.cs (5)
95(!IsAnyReadOnly(addressKind) && local.RefKind == RefKind.RefReadOnly)); 100(IsAnyReadOnly(addressKind) && methodRefKind == RefKind.RefReadOnly); 106(IsAnyReadOnly(addressKind) && dupRefKind == RefKind.RefReadOnly); 122(IsAnyReadOnly(addressKind) && lhsRefKind is RefKind.RefReadOnly or RefKind.RefReadOnlyParameter); 211if (field.RefKind == RefKind.RefReadOnly)
CodeGen\EmitAddress.cs (2)
125(IsAnyReadOnly(addressKind) && funcPtrRefKind == RefKind.RefReadOnly)) 181(IsAnyReadOnly(addressKind) && methodRefKind == RefKind.RefReadOnly);
CodeGen\EmitExpression.cs (1)
3038LocalDefinition temp = EmitAddress(assignmentOperator.Right, lhs.GetRefKind() is RefKind.RefReadOnly or RefKindExtensions.StrictIn or RefKind.RefReadOnlyParameter ? AddressKind.ReadOnlyStrict : AddressKind.Writeable);
CodeGen\EmitStatement.cs (1)
883var unexpectedTemp = this.EmitAddress(expressionOpt, this._method.RefKind == RefKind.RefReadOnly ? AddressKind.ReadOnlyStrict : AddressKind.Writeable);
CodeGen\Optimizer.cs (1)
985if (localSymbol.RefKind is RefKind.RefReadOnly or RefKindExtensions.StrictIn &&
Emitter\EditAndContinue\CSharpSymbolMatcher.cs (2)
715Debug.Assert(RefKind.RefReadOnly == RefKind.In); 718case RefKind.RefReadOnly:
Lowering\ClosureConversion\SynthesizedClosureMethod.cs (1)
119if (RefKind == RefKind.RefReadOnly)
Lowering\LocalRewriter\LocalRewriter_FixedStatement.cs (2)
264refKind: RefKind.RefReadOnly, 326refKind: RefKind.RefReadOnly,
Lowering\StateMachineRewriter\RefInitializationHoister.cs (1)
259if (refKind != RefKind.None && refKind != RefKind.RefReadOnly)
SymbolDisplay\SymbolDisplayVisitor.cs (1)
254if (symbol.RefKind == RefKind.RefReadOnly)
SymbolDisplay\SymbolDisplayVisitor.Members.cs (1)
42case RefKind.RefReadOnly:
Symbols\FunctionPointers\FunctionPointerMethodSymbol.cs (2)
48refKind = RefKind.RefReadOnly; 553RefKind = getRefKind(retInfo, RefCustomModifiers, RefKind.RefReadOnly, RefKind.Ref, requiresLocationAllowed: false);
Symbols\Metadata\PE\PEFieldSymbol.cs (1)
327moduleSymbol.Module.HasIsReadOnlyAttribute(_handle) ? RefKind.RefReadOnly : RefKind.Ref :
Symbols\Metadata\PE\PEParameterSymbol.cs (1)
421isBad |= (parameter.RefKind == RefKind.RefReadOnly) != hasInAttributeModifier;
Symbols\Metadata\PE\PEPropertySymbol.cs (2)
304_refKind = RefKind.RefReadOnly; 835var filterIsReadOnlyAttribute = this.RefKind == RefKind.RefReadOnly;
Symbols\MethodSymbol.cs (1)
239return this.RefKind == RefKind.RefReadOnly;
Symbols\PropertySymbol.cs (1)
76public bool ReturnsByRefReadonly { get { return this.RefKind == RefKind.RefReadOnly; } }
Symbols\RefKindExtensions.cs (1)
16Debug.Assert(refKind <= RefKind.RefReadOnly);
Symbols\Source\FieldSymbolWithAttributesAndModifiers.cs (1)
394if (this.RefKind == RefKind.RefReadOnly)
Symbols\Source\LambdaSymbol.cs (1)
173Debug.Assert(refKind != RefKind.RefReadOnly);
Symbols\Source\LocalFunctionSymbol.cs (2)
275if (_refKind == RefKind.RefReadOnly) 365(_refKind == RefKind.RefReadOnly && DeclaringCompilation is { } compilation) ?
Symbols\Source\SourceDelegateMethodSymbol.cs (2)
286if (this.RefKind == RefKind.RefReadOnly) 325if (this.RefKind == RefKind.RefReadOnly)
Symbols\Source\SourceFieldSymbol.cs (1)
139if (RefKind == RefKind.RefReadOnly)
Symbols\Source\SourceMemberContainerSymbol_ImplementationChecks.cs (1)
1440(method.RefKind is RefKind.Ref or RefKind.RefReadOnly))
Symbols\Source\SourceMemberFieldSymbol.cs (1)
500Debug.Assert(refKind is RefKind.None or RefKind.Ref or RefKind.RefReadOnly);
Symbols\Source\SourceNamedTypeSymbol_Extension.cs (1)
756RefKind.RefReadOnly => "ref readonly ",
Symbols\Source\SourceOrdinaryMethodOrUserDefinedOperatorSymbol.cs (2)
118else if (RefKind == RefKind.RefReadOnly) 245if (RefKind == RefKind.RefReadOnly)
Symbols\Source\SourcePropertySymbolBase.cs (2)
270else if (_refKind == RefKind.RefReadOnly) 1044if (_refKind == RefKind.RefReadOnly)
Symbols\Synthesized\RefKindVector.cs (2)
49(false, true, true) => RefKind.RefReadOnly, 62RefKind.RefReadOnly => (false, true, true),
Symbols\Synthesized\SynthesizedBackingFieldSymbol.cs (1)
96Debug.Assert(property.RefKind is RefKind.None or RefKind.Ref or RefKind.RefReadOnly);
Symbols\Synthesized\SynthesizedDelegateSymbol.cs (1)
68RefCustomModifiers = refKind == RefKind.RefReadOnly ?
Symbols\Synthesized\SynthesizedInlineArrayElementRefReadOnlyMethod.cs (1)
21public override RefKind RefKind => RefKind.RefReadOnly;
Symbols\Synthesized\SynthesizedInlineArrayFirstElementRefReadOnlyMethod.cs (1)
20public override RefKind RefKind => RefKind.RefReadOnly;
Syntax\SyntaxNodeExtensions.cs (1)
254? RefKind.RefReadOnly
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (2)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpSyntaxGeneratorInternal.cs (2)
176case RefKind.RefReadOnly when forFunctionPointerReturnParameter: 302RefKind.RefReadOnly => SyntaxFactory.RefType(RefKeyword, ReadOnlyKeyword, type),
Microsoft.CodeAnalysis.CSharp.Workspaces (2)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpSyntaxGeneratorInternal.cs (2)
176case RefKind.RefReadOnly when forFunctionPointerReturnParameter: 302RefKind.RefReadOnly => SyntaxFactory.RefType(RefKeyword, ReadOnlyKeyword, type),
Microsoft.CodeAnalysis.Features (1)
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.cs (1)
256return RefKind.RefReadOnly;
Microsoft.CodeAnalysis.ResxSourceGenerator (3)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\OperationExtensions.cs (3)
166case RefKind.RefReadOnly: 183RefKind.RefReadOnly => ValueUsageInfo.ReadableReference, 224case RefKind.RefReadOnly:
Microsoft.CodeAnalysis.Workspaces (6)
Editing\DeclarationModifiers.cs (1)
85isRef: field?.RefKind is RefKind.Ref or RefKind.RefReadOnly || type?.IsRefLikeType == true,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\OperationExtensions.cs (3)
166case RefKind.RefReadOnly: 183RefKind.RefReadOnly => ValueUsageInfo.ReadableReference, 224case RefKind.RefReadOnly:
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationMethodSymbol.cs (1)
89return RefKind == RefKind.RefReadOnly;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationPropertySymbol.cs (1)
74public bool ReturnsByRefReadonly => refKind == RefKind.RefReadOnly;
Roslyn.Diagnostics.Analyzers (23)
AbstractDoNotCopyValue.cs (17)
576case RefKind.Ref or RefKind.RefReadOnly or RefKindEx.RefReadOnlyParameter when operation.Conversion.IsIdentity: 1355(RefKind.Ref, RefKind.Ref or RefKind.RefReadOnly or RefKindEx.RefReadOnlyParameter) => true, 1356(RefKind.RefReadOnly or RefKindEx.RefReadOnlyParameter, RefKind.RefReadOnly or RefKindEx.RefReadOnlyParameter) => true, 1364return RefKind.RefReadOnly; 1389{ ReturnsByRefReadonly: true } => RefKind.RefReadOnly, 1399return field.IsReadOnly ? RefKind.RefReadOnly : RefKind.Ref; 1402return _context.OwningSymbol.IsReadOnly() ? RefKind.RefReadOnly : RefKind.Ref; 1407{ ReturnsByRefReadonly: true } => RefKind.RefReadOnly, 1417return local.RefKind == RefKind.RefReadOnly ? RefKind.RefReadOnly : RefKind.Ref; 1433{ ReturnsByRefReadonly: true } => RefKind.RefReadOnly, 1445return RefKind.RefReadOnly; 1453(RefKind.RefReadOnly or RefKindEx.RefReadOnlyParameter, _) => RefKind.RefReadOnly, 1454(_, RefKind.RefReadOnly or RefKindEx.RefReadOnlyParameter) => RefKind.RefReadOnly,
AbstractExposeMemberForTesting`1.cs (1)
191GetByRefType(syntaxGenerator.TypeExpression(fieldSymbol.Type), fieldSymbol.IsReadOnly ? RefKind.RefReadOnly : RefKind.Ref),
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\OperationExtensions.cs (3)
166case RefKind.RefReadOnly: 183RefKind.RefReadOnly => ValueUsageInfo.ReadableReference, 224case RefKind.RefReadOnly:
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationMethodSymbol.cs (1)
89return RefKind == RefKind.RefReadOnly;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationPropertySymbol.cs (1)
74public bool ReturnsByRefReadonly => refKind == RefKind.RefReadOnly;
Roslyn.Diagnostics.CSharp.Analyzers (3)
CSharpExposeMemberForTesting.cs (1)
44RefKind.RefReadOnly => SyntaxFactory.Token(SyntaxKind.ReadOnlyKeyword),
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpSyntaxGeneratorInternal.cs (2)
176case RefKind.RefReadOnly when forFunctionPointerReturnParameter: 302RefKind.RefReadOnly => SyntaxFactory.RefType(RefKeyword, ReadOnlyKeyword, type),