152 references to RefReadOnly
ILLink.RoslynAnalyzer (3)
IOperationExtensions.cs (3)
126
case RefKind.
RefReadOnly
:
140
RefKind.
RefReadOnly
=> ValueUsageInfo.ReadableReference,
166
case RefKind.
RefReadOnly
:
Microsoft.CodeAnalysis.CodeStyle (4)
src\Workspaces\Core\Portable\Editing\DeclarationModifiers.cs (1)
88
isRef: field?.RefKind is RefKind.Ref or RefKind.
RefReadOnly
|| type?.IsRefLikeType == true,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\OperationExtensions.cs (3)
163
case RefKind.
RefReadOnly
:
180
RefKind.
RefReadOnly
=> ValueUsageInfo.ReadableReference,
221
case RefKind.
RefReadOnly
:
Microsoft.CodeAnalysis.CodeStyle.Fixes (3)
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.cs (1)
262
return RefKind.
RefReadOnly
;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationMethodSymbol.cs (1)
94
return RefKind == RefKind.
RefReadOnly
;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationPropertySymbol.cs (1)
79
public bool ReturnsByRefReadonly => refKind == RefKind.
RefReadOnly
;
Microsoft.CodeAnalysis.CSharp (56)
Binder\Binder.ValueChecks.cs (11)
1060
if (localSymbol.RefKind == RefKind.
RefReadOnly
||
1369
case RefKind.
RefReadOnly
:
1394
case RefKind.
RefReadOnly
:
1408
case RefKind.
RefReadOnly
:
1683
if (RequiresAssignableVariable(valueKind) && methodSymbol.RefKind == RefKind.
RefReadOnly
)
1738
if (RequiresAssignableVariable(valueKind) && propertySymbol.RefKind == RefKind.
RefReadOnly
)
5769
(!IsAnyReadOnly(addressKind) && local.RefKind == RefKind.
RefReadOnly
));
5774
(IsAnyReadOnly(addressKind) && methodRefKind == RefKind.
RefReadOnly
);
5780
(IsAnyReadOnly(addressKind) && dupRefKind == RefKind.
RefReadOnly
);
5796
(IsAnyReadOnly(addressKind) && lhsRefKind is RefKind.
RefReadOnly
or RefKind.RefReadOnlyParameter);
5885
if (field.RefKind == RefKind.
RefReadOnly
)
Binder\Binder_Statements.cs (1)
928
valueKind = variableRefKind == RefKind.
RefReadOnly
Binder\ForEachLoopBinder.cs (3)
342
case RefKind.
RefReadOnly
:
471
if (elementConversionClassification.Kind != ConversionKind.Identity && IterationVariable.RefKind is RefKind.Ref or RefKind.
RefReadOnly
)
866
builder.CurrentPropertyGetter?.RefKind == (wellKnownSpan == WellKnownType.System_ReadOnlySpan_T ? RefKind.
RefReadOnly
: RefKind.Ref)) ||
BoundTree\BoundExpressionExtensions.cs (1)
56
return RefKind.
RefReadOnly
;
BoundTree\UnboundLambda.cs (1)
818
if (lambdaSymbol.RefKind == CodeAnalysis.RefKind.
RefReadOnly
)
CodeGen\EmitAddress.cs (2)
127
(IsAnyReadOnly(addressKind) && funcPtrRefKind == RefKind.
RefReadOnly
))
183
(IsAnyReadOnly(addressKind) && methodRefKind == RefKind.
RefReadOnly
);
CodeGen\EmitExpression.cs (1)
2994
LocalDefinition temp = EmitAddress(assignmentOperator.Right, lhs.GetRefKind() is RefKind.
RefReadOnly
or RefKindExtensions.StrictIn or RefKind.RefReadOnlyParameter ? AddressKind.ReadOnlyStrict : AddressKind.Writeable);
CodeGen\EmitStatement.cs (1)
873
var unexpectedTemp = this.EmitAddress(expressionOpt, this._method.RefKind == RefKind.
RefReadOnly
? AddressKind.ReadOnlyStrict : AddressKind.Writeable);
CodeGen\Optimizer.cs (1)
986
if (localSymbol.RefKind is RefKind.
RefReadOnly
or RefKindExtensions.StrictIn &&
Emitter\EditAndContinue\CSharpSymbolMatcher.cs (2)
701
Debug.Assert(RefKind.
RefReadOnly
== RefKind.In);
704
case RefKind.
RefReadOnly
:
Lowering\ClosureConversion\SynthesizedClosureMethod.cs (1)
121
if (RefKind == RefKind.
RefReadOnly
)
Lowering\LocalRewriter\LocalRewriter_FixedStatement.cs (2)
264
refKind: RefKind.
RefReadOnly
,
326
refKind: RefKind.
RefReadOnly
,
Lowering\StateMachineRewriter\MethodToStateMachineRewriter.cs (1)
640
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)
326
moduleSymbol.Module.HasIsReadOnlyAttribute(_handle) ? RefKind.
RefReadOnly
: RefKind.Ref :
Symbols\Metadata\PE\PEParameterSymbol.cs (1)
402
isBad |= (parameter.RefKind == RefKind.
RefReadOnly
) != hasInAttributeModifier;
Symbols\Metadata\PE\PEPropertySymbol.cs (2)
281
_refKind = RefKind.
RefReadOnly
;
739
this.RefKind == RefKind.
RefReadOnly
? AttributeDescription.IsReadOnlyAttribute : default,
Symbols\MethodSymbol.cs (1)
230
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)
392
if (this.RefKind == RefKind.
RefReadOnly
)
Symbols\Source\LocalFunctionSymbol.cs (1)
261
if (_refKind == RefKind.
RefReadOnly
)
Symbols\Source\SourceDelegateMethodSymbol.cs (2)
280
if (this.RefKind == RefKind.
RefReadOnly
)
319
if (this.RefKind == RefKind.
RefReadOnly
)
Symbols\Source\SourceFieldSymbol.cs (1)
139
if (RefKind == RefKind.
RefReadOnly
)
Symbols\Source\SourceMemberContainerSymbol_ImplementationChecks.cs (1)
1391
(method.RefKind is RefKind.Ref or RefKind.
RefReadOnly
))
Symbols\Source\SourceMemberFieldSymbol.cs (1)
489
Debug.Assert(refKind is RefKind.None or RefKind.Ref or RefKind.
RefReadOnly
);
Symbols\Source\SourceOrdinaryMethodOrUserDefinedOperatorSymbol.cs (2)
118
else if (RefKind == RefKind.
RefReadOnly
)
242
if (RefKind == RefKind.
RefReadOnly
)
Symbols\Source\SourcePropertySymbolBase.cs (2)
268
else if (_refKind == RefKind.
RefReadOnly
)
1025
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)
92
Debug.Assert(property.RefKind is RefKind.None or RefKind.Ref or 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 (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpSyntaxGeneratorInternal.cs (1)
145
RefKind.
RefReadOnly
when forFunctionPointerReturnParameter => [RefKeyword, ReadOnlyKeyword],
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (20)
CodeGen\CodeGenFunctionPointersTests.cs (5)
229
(RefKind.
RefReadOnly
, IsSpecialType(SpecialType.System_Boolean)),
565
(RefKind.
RefReadOnly
, IsSpecialType(SpecialType.System_Int32)));
569
(RefKind.
RefReadOnly
, IsSpecialType(SpecialType.System_Int32)));
652
(RefKind.
RefReadOnly
, IsSpecialType(SpecialType.System_String)))));
690
(RefKind.
RefReadOnly
, IsSpecialType(SpecialType.System_Boolean)),
CodeGen\CodeGenReadonlyStructTests.cs (13)
1572
verifyReadOnly(s1.GetMethod("M2"), true, RefKind.
RefReadOnly
);
1574
verifyReadOnly(s1.GetProperty("P1").GetMethod, true, RefKind.
RefReadOnly
);
1577
verifyReadOnly(s1.GetProperty("P2").GetMethod, true, RefKind.
RefReadOnly
);
1579
verifyReadOnly(s1.GetProperty("P3").GetMethod, true, RefKind.
RefReadOnly
);
1583
verifyReadOnly(s1.GetProperty("P4").SetMethod, true, RefKind.
RefReadOnly
);
1588
verifyReadOnly(s1.GetEvent("E").AddMethod, true, RefKind.
RefReadOnly
);
1589
verifyReadOnly(s1.GetEvent("E").RemoveMethod, true, RefKind.
RefReadOnly
);
1593
verifyReadOnly(s2.GetMethod("M1"), true, RefKind.
RefReadOnly
);
1595
verifyReadOnly(s2.GetProperty("P1").GetMethod, true, RefKind.
RefReadOnly
);
1596
verifyReadOnly(s2.GetProperty("P2").GetMethod, true, RefKind.
RefReadOnly
);
1597
verifyReadOnly(s2.GetProperty("P3").SetMethod, true, RefKind.
RefReadOnly
);
1602
verifyReadOnly(s2.GetEvent("E").AddMethod, true, RefKind.
RefReadOnly
);
1603
verifyReadOnly(s2.GetEvent("E").RemoveMethod, true, RefKind.
RefReadOnly
);
Emit\InAttributeModifierTests.cs (2)
3834
Assert.Equal(RefKind.
RefReadOnly
, interfaceMethod.RefKind);
3863
Assert.Equal(RefKind.
RefReadOnly
, parentMethod.RefKind);
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (22)
Attributes\AttributeTests_RefReadOnly.cs (22)
38
Assert.Equal(RefKind.
RefReadOnly
, method.RefKind);
92
Assert.Equal(RefKind.
RefReadOnly
, method.RefKind);
120
Assert.Equal(RefKind.
RefReadOnly
, method.RefKind);
310
Assert.Equal(RefKind.
RefReadOnly
, property.RefKind);
339
Assert.Equal(RefKind.
RefReadOnly
, property.RefKind);
376
Assert.Equal(RefKind.
RefReadOnly
, property.RefKind);
402
Assert.Equal(RefKind.
RefReadOnly
, indexer.RefKind);
446
Assert.Equal(RefKind.
RefReadOnly
, indexer.RefKind);
474
Assert.Equal(RefKind.
RefReadOnly
, indexer.RefKind);
501
Assert.Equal(RefKind.
RefReadOnly
, method.RefKind);
537
Assert.Equal(RefKind.
RefReadOnly
, method.RefKind);
561
Assert.Equal(RefKind.
RefReadOnly
, method.RefKind);
598
Assert.Equal(RefKind.
RefReadOnly
, method.RefKind);
652
Assert.Equal(RefKind.
RefReadOnly
, method.RefKind);
686
Assert.Equal(RefKind.
RefReadOnly
, method.RefKind);
725
Assert.Equal(RefKind.
RefReadOnly
, method.RefKind);
784
Assert.Equal(RefKind.
RefReadOnly
, method.RefKind);
819
Assert.Equal(RefKind.
RefReadOnly
, method.RefKind);
2346
Assert.Equal(RefKind.
RefReadOnly
, method.RefKind);
2370
Assert.Equal(RefKind.
RefReadOnly
, method.Parameters[0].RefKind);
2393
Assert.Equal(RefKind.
RefReadOnly
, method.RefKind);
2418
Assert.Equal(RefKind.
RefReadOnly
, method.Parameters[1].RefKind);
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (2)
IOperation\IOperationTests.cs (2)
312
Assert.Equal(RefKind.
RefReadOnly
, op.Locals.Single().RefKind);
380
Assert.Equal(RefKind.
RefReadOnly
, op.Locals.Single().RefKind);
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (13)
Semantics\RefFieldTests.cs (13)
148
VerifyFieldSymbol(comp.GetMember<FieldSymbol>("S.F2"), "ref readonly T S<T>.F2", RefKind.
RefReadOnly
, new string[0]);
154
VerifyFieldSymbol(comp.GetMember<FieldSymbol>("S.F2"), "ref readonly T S<T>.F2", RefKind.
RefReadOnly
, new string[0]);
242
VerifyFieldSymbol(comp.GetMember<FieldSymbol>("S.F"), "ref readonly T S<T>.F", RefKind.
RefReadOnly
, new string[0]);
247
VerifyFieldSymbol(comp.GetMember<FieldSymbol>("S.F"), "ref readonly T S<T>.F", RefKind.
RefReadOnly
, new string[0]);
283
VerifyFieldSymbol(comp.GetMember<FieldSymbol>("S.F"), "ref readonly T S<T>.F", RefKind.
RefReadOnly
, new string[0]);
293
VerifyFieldSymbol(comp.GetMember<FieldSymbol>("S.F"), "ref readonly T S<T>.F", RefKind.
RefReadOnly
, new string[0]);
345
VerifyFieldSymbol(field, "ref readonly System.Int32 A.F", RefKind.
RefReadOnly
, new string[0]);
12066
VerifyLocalSymbol(locals[2], "scoped ref readonly R r5", RefKind.
RefReadOnly
, ScopedKind.ScopedRef);
12069
VerifyLocalSymbol(locals[5], "scoped ref readonly R r51", RefKind.
RefReadOnly
, ScopedKind.ScopedRef);
12203
VerifyLocalSymbol(locals[2], "scoped ref readonly R r5", RefKind.
RefReadOnly
, ScopedKind.ScopedRef);
14603
VerifyLocalSymbol(locals[2], "scoped ref readonly R r5", RefKind.
RefReadOnly
, ScopedKind.ScopedRef);
27052
VerifyLocalSymbol(locals[2], "scoped ref readonly R r5", RefKind.
RefReadOnly
, ScopedKind.ScopedRef);
27142
VerifyLocalSymbol(locals[2], "scoped ref readonly R r5", RefKind.
RefReadOnly
, ScopedKind.ScopedRef);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (17)
Compilation\SemanticModelAPITests.cs (2)
208
Assert.Equal(RefKind.
RefReadOnly
, rxSymbol.RefKind);
240
Assert.Equal(RefKind.
RefReadOnly
, rxSymbol.RefKind);
Compilation\SemanticModelGetDeclaredSymbolAPITests.cs (2)
43
Assert.Equal(RefKind.
RefReadOnly
, rx.RefKind);
66
Assert.Equal(RefKind.
RefReadOnly
, rxLocal.RefKind);
SymbolDisplay\SymbolDisplayTests.cs (1)
6776
Assert.Equal(RefKind.
RefReadOnly
, local.RefKind);
Symbols\FunctionPointerTypeSymbolTests.cs (7)
28
[InlineData("ref readonly", RefKind.
RefReadOnly
,
116
verifyRefKind(RefKind.
RefReadOnly
, mParams[3]);
200
Assert.Equal(RefKind.
RefReadOnly
, secondSignature.RefKind);
1584
RefKind.
RefReadOnly
,
1619
RefKind.
RefReadOnly
,
1640
ptr = comp.CreateFunctionPointerTypeSymbol(@string, returnRefKind: RefKind.
RefReadOnly
, parameterTypes: ImmutableArray<ITypeSymbol>.Empty, parameterRefKinds: ImmutableArray<RefKind>.Empty, convention);
1655
ptr = comp.CreateFunctionPointerTypeSymbol(@string, returnRefKind: RefKind.
RefReadOnly
, parameterTypes: ImmutableArray<ITypeSymbol>.Empty, parameterRefKinds: ImmutableArray<RefKind>.Empty, SignatureCallingConvention.Unmanaged, ImmutableArray.Create(cdeclType, stdcallType)!);
Symbols\Source\DelegateTests.cs (2)
800
Assert.Equal(RefKind.
RefReadOnly
, d.DelegateInvokeMethod.RefKind);
801
Assert.Equal(RefKind.
RefReadOnly
, ((MethodSymbol)d.GetMembers("EndInvoke").Single()).RefKind);
Symbols\Source\ExpressionBodiedPropertyTests.cs (3)
534
Assert.Equal(RefKind.
RefReadOnly
, p.GetMethod.RefKind);
561
Assert.Equal(RefKind.
RefReadOnly
, p.GetMethod.RefKind);
589
Assert.Equal(RefKind.
RefReadOnly
, p.GetMethod.RefKind);
Microsoft.CodeAnalysis.CSharp.Test.Utilities (1)
FunctionPointerUtilities.cs (1)
283
case RefKind.
RefReadOnly
:
Microsoft.CodeAnalysis.CSharp.Workspaces (2)
CodeGeneration\CSharpSyntaxGenerator.cs (1)
3439
RefKind.
RefReadOnly
=> SyntaxFactory.RefType(RefKeyword, ReadOnlyKeyword, type),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpSyntaxGeneratorInternal.cs (1)
145
RefKind.
RefReadOnly
when forFunctionPointerReturnParameter => [RefKeyword, ReadOnlyKeyword],
Microsoft.CodeAnalysis.Features (1)
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.cs (1)
262
return RefKind.
RefReadOnly
;
Microsoft.CodeAnalysis.Workspaces (6)
Editing\DeclarationModifiers.cs (1)
88
isRef: field?.RefKind is RefKind.Ref or RefKind.
RefReadOnly
|| type?.IsRefLikeType == true,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\OperationExtensions.cs (3)
163
case RefKind.
RefReadOnly
:
180
RefKind.
RefReadOnly
=> ValueUsageInfo.ReadableReference,
221
case RefKind.
RefReadOnly
:
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationMethodSymbol.cs (1)
94
return RefKind == RefKind.
RefReadOnly
;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationPropertySymbol.cs (1)
79
public bool ReturnsByRefReadonly => refKind == RefKind.
RefReadOnly
;
Microsoft.VisualStudio.LanguageServices.UnitTests (1)
ChangeSignature\ChangeSignatureViewModelTests.vb (1)
298
Dim includedInTest = {RefKind.None, RefKind.Ref, RefKind.Out, RefKind.In, RefKind.
RefReadOnly
, RefKind.RefReadOnlyParameter}