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