143 references to RefReadOnly
Microsoft.CodeAnalysis.CodeStyle (3)
OperationExtensions.cs (3)
157
case RefKind.
RefReadOnly
:
174
RefKind.
RefReadOnly
=> ValueUsageInfo.ReadableReference,
215
case RefKind.
RefReadOnly
:
Microsoft.CodeAnalysis.CodeStyle.Fixes (2)
CodeGenerationMethodSymbol.cs (1)
94
return RefKind == RefKind.
RefReadOnly
;
CodeGenerationPropertySymbol.cs (1)
92
public bool ReturnsByRefReadonly => _refKind == RefKind.
RefReadOnly
;
Microsoft.CodeAnalysis.CSharp (53)
Binder\Binder.ValueChecks.cs (10)
839
if (localSymbol.RefKind == RefKind.
RefReadOnly
||
1151
case RefKind.
RefReadOnly
:
1176
case RefKind.
RefReadOnly
:
1450
if (RequiresAssignableVariable(valueKind) && methodSymbol.RefKind == RefKind.
RefReadOnly
)
1505
if (RequiresAssignableVariable(valueKind) && propertySymbol.RefKind == RefKind.
RefReadOnly
)
4637
(!IsAnyReadOnly(addressKind) && local.RefKind == RefKind.
RefReadOnly
));
4642
(IsAnyReadOnly(addressKind) && methodRefKind == RefKind.
RefReadOnly
);
4648
(IsAnyReadOnly(addressKind) && dupRefKind == RefKind.
RefReadOnly
);
4664
(IsAnyReadOnly(addressKind) && lhsRefKind == RefKind.
RefReadOnly
);
4753
if (field.RefKind == RefKind.
RefReadOnly
)
Binder\Binder_Statements.cs (1)
931
valueKind = variableRefKind == RefKind.
RefReadOnly
Binder\ForEachLoopBinder.cs (2)
327
case RefKind.
RefReadOnly
:
449
if (elementConversionClassification.Kind != ConversionKind.Identity && IterationVariable.RefKind is RefKind.Ref or RefKind.
RefReadOnly
)
BoundTree\UnboundLambda.cs (1)
779
if (lambdaSymbol.RefKind == CodeAnalysis.RefKind.
RefReadOnly
)
CodeGen\EmitAddress.cs (2)
117
(IsAnyReadOnly(addressKind) && methodRefKind == RefKind.
RefReadOnly
))
129
(IsAnyReadOnly(addressKind) && funcPtrRefKind == RefKind.
RefReadOnly
))
CodeGen\EmitExpression.cs (1)
2776
LocalDefinition temp = EmitAddress(assignmentOperator.Right, lhs.GetRefKind() == RefKind.
RefReadOnly
? AddressKind.ReadOnlyStrict : AddressKind.Writeable);
CodeGen\EmitStatement.cs (1)
848
var unexpectedTemp = this.EmitAddress(expressionOpt, this._method.RefKind == RefKind.
RefReadOnly
? AddressKind.ReadOnlyStrict : AddressKind.Writeable);
CodeGen\Optimizer.cs (1)
985
if (localSymbol.RefKind == RefKind.
RefReadOnly
&&
Emitter\EditAndContinue\CSharpSymbolMatcher.cs (2)
905
Debug.Assert(RefKind.
RefReadOnly
== RefKind.In);
908
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)
623
if (refKind != RefKind.None && refKind != RefKind.
RefReadOnly
)
SymbolDisplay\SymbolDisplayVisitor.cs (1)
203
if (symbol.RefKind == RefKind.
RefReadOnly
)
SymbolDisplay\SymbolDisplayVisitor.Members.cs (1)
43
case RefKind.
RefReadOnly
:
Symbols\FunctionPointers\FunctionPointerMethodSymbol.cs (2)
48
refKind = RefKind.
RefReadOnly
;
551
RefKind = getRefKind(retInfo, RefCustomModifiers, RefKind.
RefReadOnly
, RefKind.Ref);
Symbols\Metadata\PE\PEFieldSymbol.cs (1)
324
moduleSymbol.Module.HasIsReadOnlyAttribute(_handle) ? RefKind.
RefReadOnly
: RefKind.Ref :
Symbols\Metadata\PE\PEParameterSymbol.cs (1)
386
isBad |= (parameter.RefKind == RefKind.
RefReadOnly
) != hasInAttributeModifier;
Symbols\Metadata\PE\PEPropertySymbol.cs (2)
214
_refKind = RefKind.
RefReadOnly
;
645
this.RefKind == RefKind.
RefReadOnly
? AttributeDescription.IsReadOnlyAttribute : default,
Symbols\MethodSymbol.cs (1)
226
return this.RefKind == RefKind.
RefReadOnly
;
Symbols\PropertySymbol.cs (1)
75
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)
231
if (_refKind == RefKind.
RefReadOnly
)
Symbols\Source\SourceDelegateMethodSymbol.cs (2)
291
if (_refKind == RefKind.
RefReadOnly
)
335
if (_refKind == RefKind.
RefReadOnly
)
Symbols\Source\SourceFieldSymbol.cs (1)
138
if (RefKind == RefKind.
RefReadOnly
)
Symbols\Source\SourceMemberContainerSymbol_ImplementationChecks.cs (1)
1392
(method.RefKind is RefKind.Ref or RefKind.
RefReadOnly
))
Symbols\Source\SourceMemberFieldSymbol.cs (1)
485
Debug.Assert(refKind is RefKind.None or RefKind.Ref or RefKind.
RefReadOnly
);
Symbols\Source\SourceOrdinaryMethodOrUserDefinedOperatorSymbol.cs (2)
125
else if (RefKind == RefKind.
RefReadOnly
)
250
if (RefKind == RefKind.
RefReadOnly
)
Symbols\Source\SourceParameterSymbolBase.cs (1)
112
if (this.RefKind == RefKind.
RefReadOnly
)
Symbols\Source\SourcePropertySymbolBase.cs (2)
235
else if (_refKind == RefKind.
RefReadOnly
)
814
if (_refKind == RefKind.
RefReadOnly
)
Symbols\Synthesized\RefKindVector.cs (2)
48
(true, true) => RefKind.
RefReadOnly
,
59
RefKind.
RefReadOnly
=> (true, true),
Symbols\Synthesized\SynthesizedBackingFieldSymbol.cs (1)
92
Debug.Assert(property.RefKind is RefKind.None or RefKind.Ref or RefKind.
RefReadOnly
);
Symbols\Synthesized\SynthesizedParameterSymbol.cs (1)
179
if (this.RefKind == RefKind.
RefReadOnly
)
Syntax\SyntaxNodeExtensions.cs (1)
254
? RefKind.
RefReadOnly
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (1)
CSharpSyntaxGeneratorInternal.cs (1)
130
RefKind.
RefReadOnly
when forFunctionPointerReturnParameter => SyntaxFactory.TokenList(SyntaxFactory.Token(SyntaxKind.RefKeyword), SyntaxFactory.Token(SyntaxKind.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)
3827
Assert.Equal(RefKind.
RefReadOnly
, interfaceMethod.RefKind);
3856
Assert.Equal(RefKind.
RefReadOnly
, parentMethod.RefKind);
Microsoft.CodeAnalysis.CSharp.Emit2.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)
147
VerifyFieldSymbol(comp.GetMember<FieldSymbol>("S.F2"), "ref readonly T S<T>.F2", RefKind.
RefReadOnly
, new string[0]);
153
VerifyFieldSymbol(comp.GetMember<FieldSymbol>("S.F2"), "ref readonly T S<T>.F2", RefKind.
RefReadOnly
, new string[0]);
241
VerifyFieldSymbol(comp.GetMember<FieldSymbol>("S.F"), "ref readonly T S<T>.F", RefKind.
RefReadOnly
, new string[0]);
246
VerifyFieldSymbol(comp.GetMember<FieldSymbol>("S.F"), "ref readonly T S<T>.F", RefKind.
RefReadOnly
, new string[0]);
282
VerifyFieldSymbol(comp.GetMember<FieldSymbol>("S.F"), "ref readonly T S<T>.F", RefKind.
RefReadOnly
, new string[0]);
292
VerifyFieldSymbol(comp.GetMember<FieldSymbol>("S.F"), "ref readonly T S<T>.F", RefKind.
RefReadOnly
, new string[0]);
344
VerifyFieldSymbol(field, "ref readonly System.Int32 A.F", RefKind.
RefReadOnly
, new string[0]);
11573
VerifyLocalSymbol(locals[2], "scoped ref readonly R r5", RefKind.
RefReadOnly
, ScopedKind.ScopedRef);
11576
VerifyLocalSymbol(locals[5], "scoped ref readonly R r51", RefKind.
RefReadOnly
, ScopedKind.ScopedRef);
11710
VerifyLocalSymbol(locals[2], "scoped ref readonly R r5", RefKind.
RefReadOnly
, ScopedKind.ScopedRef);
14110
VerifyLocalSymbol(locals[2], "scoped ref readonly R r5", RefKind.
RefReadOnly
, ScopedKind.ScopedRef);
26297
VerifyLocalSymbol(locals[2], "scoped ref readonly R r5", RefKind.
RefReadOnly
, ScopedKind.ScopedRef);
26387
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)
6640
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);
1590
RefKind.
RefReadOnly
,
1625
RefKind.
RefReadOnly
,
1646
ptr = comp.CreateFunctionPointerTypeSymbol(@string, returnRefKind: RefKind.
RefReadOnly
, parameterTypes: ImmutableArray<ITypeSymbol>.Empty, parameterRefKinds: ImmutableArray<RefKind>.Empty, convention);
1661
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)
801
Assert.Equal(RefKind.
RefReadOnly
, d.DelegateInvokeMethod.RefKind);
802
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)
281
case RefKind.
RefReadOnly
:
Microsoft.CodeAnalysis.CSharp.Workspaces (2)
CodeGeneration\CSharpSyntaxGenerator.cs (1)
3438
RefKind.
RefReadOnly
=> SyntaxFactory.RefType(SyntaxFactory.Token(SyntaxKind.RefKeyword), SyntaxFactory.Token(SyntaxKind.ReadOnlyKeyword), type),
CSharpSyntaxGeneratorInternal.cs (1)
130
RefKind.
RefReadOnly
when forFunctionPointerReturnParameter => SyntaxFactory.TokenList(SyntaxFactory.Token(SyntaxKind.RefKeyword), SyntaxFactory.Token(SyntaxKind.ReadOnlyKeyword)),
Microsoft.CodeAnalysis.Features (1)
GenerateMember\GenerateVariable\AbstractGenerateVariableService.cs (1)
264
return RefKind.
RefReadOnly
;
Microsoft.CodeAnalysis.Workspaces (5)
CodeGenerationMethodSymbol.cs (1)
94
return RefKind == RefKind.
RefReadOnly
;
CodeGenerationPropertySymbol.cs (1)
92
public bool ReturnsByRefReadonly => _refKind == RefKind.
RefReadOnly
;
OperationExtensions.cs (3)
157
case RefKind.
RefReadOnly
:
174
RefKind.
RefReadOnly
=> ValueUsageInfo.ReadableReference,
215
case RefKind.
RefReadOnly
:
Microsoft.VisualStudio.LanguageServices.UnitTests (1)
ChangeSignature\ChangeSignatureViewModelTests.vb (1)
298
Dim includedInTest = {RefKind.None, RefKind.Ref, RefKind.Out, RefKind.In, RefKind.
RefReadOnly
}