143 references to RefReadOnly
Microsoft.CodeAnalysis.CodeStyle (3)
OperationExtensions.cs (3)
157case RefKind.RefReadOnly: 174RefKind.RefReadOnly => ValueUsageInfo.ReadableReference, 215case RefKind.RefReadOnly:
Microsoft.CodeAnalysis.CodeStyle.Fixes (2)
CodeGenerationMethodSymbol.cs (1)
94return RefKind == RefKind.RefReadOnly;
CodeGenerationPropertySymbol.cs (1)
92public bool ReturnsByRefReadonly => _refKind == RefKind.RefReadOnly;
Microsoft.CodeAnalysis.CSharp (53)
Binder\Binder.ValueChecks.cs (10)
839if (localSymbol.RefKind == RefKind.RefReadOnly || 1151case RefKind.RefReadOnly: 1176case RefKind.RefReadOnly: 1450if (RequiresAssignableVariable(valueKind) && methodSymbol.RefKind == RefKind.RefReadOnly) 1505if (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); 4753if (field.RefKind == RefKind.RefReadOnly)
Binder\Binder_Statements.cs (1)
931valueKind = variableRefKind == RefKind.RefReadOnly
Binder\ForEachLoopBinder.cs (2)
327case RefKind.RefReadOnly: 449if (elementConversionClassification.Kind != ConversionKind.Identity && IterationVariable.RefKind is RefKind.Ref or RefKind.RefReadOnly)
BoundTree\UnboundLambda.cs (1)
779if (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)
2776LocalDefinition temp = EmitAddress(assignmentOperator.Right, lhs.GetRefKind() == RefKind.RefReadOnly ? AddressKind.ReadOnlyStrict : AddressKind.Writeable);
CodeGen\EmitStatement.cs (1)
848var unexpectedTemp = this.EmitAddress(expressionOpt, this._method.RefKind == RefKind.RefReadOnly ? AddressKind.ReadOnlyStrict : AddressKind.Writeable);
CodeGen\Optimizer.cs (1)
985if (localSymbol.RefKind == RefKind.RefReadOnly &&
Emitter\EditAndContinue\CSharpSymbolMatcher.cs (2)
905Debug.Assert(RefKind.RefReadOnly == RefKind.In); 908case RefKind.RefReadOnly:
Lowering\ClosureConversion\SynthesizedClosureMethod.cs (1)
121if (RefKind == RefKind.RefReadOnly)
Lowering\LocalRewriter\LocalRewriter_FixedStatement.cs (2)
264refKind: RefKind.RefReadOnly, 326refKind: RefKind.RefReadOnly,
Lowering\StateMachineRewriter\MethodToStateMachineRewriter.cs (1)
623if (refKind != RefKind.None && refKind != RefKind.RefReadOnly)
SymbolDisplay\SymbolDisplayVisitor.cs (1)
203if (symbol.RefKind == RefKind.RefReadOnly)
SymbolDisplay\SymbolDisplayVisitor.Members.cs (1)
43case RefKind.RefReadOnly:
Symbols\FunctionPointers\FunctionPointerMethodSymbol.cs (2)
48refKind = RefKind.RefReadOnly; 551RefKind = getRefKind(retInfo, RefCustomModifiers, RefKind.RefReadOnly, RefKind.Ref);
Symbols\Metadata\PE\PEFieldSymbol.cs (1)
324moduleSymbol.Module.HasIsReadOnlyAttribute(_handle) ? RefKind.RefReadOnly : RefKind.Ref :
Symbols\Metadata\PE\PEParameterSymbol.cs (1)
386isBad |= (parameter.RefKind == RefKind.RefReadOnly) != hasInAttributeModifier;
Symbols\Metadata\PE\PEPropertySymbol.cs (2)
214_refKind = RefKind.RefReadOnly; 645this.RefKind == RefKind.RefReadOnly ? AttributeDescription.IsReadOnlyAttribute : default,
Symbols\MethodSymbol.cs (1)
226return this.RefKind == RefKind.RefReadOnly;
Symbols\PropertySymbol.cs (1)
75public bool ReturnsByRefReadonly { get { return this.RefKind == RefKind.RefReadOnly; } }
Symbols\RefKindExtensions.cs (1)
16Debug.Assert(refKind <= RefKind.RefReadOnly);
Symbols\Source\FieldSymbolWithAttributesAndModifiers.cs (1)
392if (this.RefKind == RefKind.RefReadOnly)
Symbols\Source\LocalFunctionSymbol.cs (1)
231if (_refKind == RefKind.RefReadOnly)
Symbols\Source\SourceDelegateMethodSymbol.cs (2)
291if (_refKind == RefKind.RefReadOnly) 335if (_refKind == RefKind.RefReadOnly)
Symbols\Source\SourceFieldSymbol.cs (1)
138if (RefKind == RefKind.RefReadOnly)
Symbols\Source\SourceMemberContainerSymbol_ImplementationChecks.cs (1)
1392(method.RefKind is RefKind.Ref or RefKind.RefReadOnly))
Symbols\Source\SourceMemberFieldSymbol.cs (1)
485Debug.Assert(refKind is RefKind.None or RefKind.Ref or RefKind.RefReadOnly);
Symbols\Source\SourceOrdinaryMethodOrUserDefinedOperatorSymbol.cs (2)
125else if (RefKind == RefKind.RefReadOnly) 250if (RefKind == RefKind.RefReadOnly)
Symbols\Source\SourceParameterSymbolBase.cs (1)
112if (this.RefKind == RefKind.RefReadOnly)
Symbols\Source\SourcePropertySymbolBase.cs (2)
235else if (_refKind == RefKind.RefReadOnly) 814if (_refKind == RefKind.RefReadOnly)
Symbols\Synthesized\RefKindVector.cs (2)
48(true, true) => RefKind.RefReadOnly, 59RefKind.RefReadOnly => (true, true),
Symbols\Synthesized\SynthesizedBackingFieldSymbol.cs (1)
92Debug.Assert(property.RefKind is RefKind.None or RefKind.Ref or RefKind.RefReadOnly);
Symbols\Synthesized\SynthesizedParameterSymbol.cs (1)
179if (this.RefKind == RefKind.RefReadOnly)
Syntax\SyntaxNodeExtensions.cs (1)
254? RefKind.RefReadOnly
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (1)
CSharpSyntaxGeneratorInternal.cs (1)
130RefKind.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)
1572verifyReadOnly(s1.GetMethod("M2"), true, RefKind.RefReadOnly); 1574verifyReadOnly(s1.GetProperty("P1").GetMethod, true, RefKind.RefReadOnly); 1577verifyReadOnly(s1.GetProperty("P2").GetMethod, true, RefKind.RefReadOnly); 1579verifyReadOnly(s1.GetProperty("P3").GetMethod, true, RefKind.RefReadOnly); 1583verifyReadOnly(s1.GetProperty("P4").SetMethod, true, RefKind.RefReadOnly); 1588verifyReadOnly(s1.GetEvent("E").AddMethod, true, RefKind.RefReadOnly); 1589verifyReadOnly(s1.GetEvent("E").RemoveMethod, true, RefKind.RefReadOnly); 1593verifyReadOnly(s2.GetMethod("M1"), true, RefKind.RefReadOnly); 1595verifyReadOnly(s2.GetProperty("P1").GetMethod, true, RefKind.RefReadOnly); 1596verifyReadOnly(s2.GetProperty("P2").GetMethod, true, RefKind.RefReadOnly); 1597verifyReadOnly(s2.GetProperty("P3").SetMethod, true, RefKind.RefReadOnly); 1602verifyReadOnly(s2.GetEvent("E").AddMethod, true, RefKind.RefReadOnly); 1603verifyReadOnly(s2.GetEvent("E").RemoveMethod, true, RefKind.RefReadOnly);
Emit\InAttributeModifierTests.cs (2)
3827Assert.Equal(RefKind.RefReadOnly, interfaceMethod.RefKind); 3856Assert.Equal(RefKind.RefReadOnly, parentMethod.RefKind);
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (22)
Attributes\AttributeTests_RefReadOnly.cs (22)
38Assert.Equal(RefKind.RefReadOnly, method.RefKind); 92Assert.Equal(RefKind.RefReadOnly, method.RefKind); 120Assert.Equal(RefKind.RefReadOnly, method.RefKind); 310Assert.Equal(RefKind.RefReadOnly, property.RefKind); 339Assert.Equal(RefKind.RefReadOnly, property.RefKind); 376Assert.Equal(RefKind.RefReadOnly, property.RefKind); 402Assert.Equal(RefKind.RefReadOnly, indexer.RefKind); 446Assert.Equal(RefKind.RefReadOnly, indexer.RefKind); 474Assert.Equal(RefKind.RefReadOnly, indexer.RefKind); 501Assert.Equal(RefKind.RefReadOnly, method.RefKind); 537Assert.Equal(RefKind.RefReadOnly, method.RefKind); 561Assert.Equal(RefKind.RefReadOnly, method.RefKind); 598Assert.Equal(RefKind.RefReadOnly, method.RefKind); 652Assert.Equal(RefKind.RefReadOnly, method.RefKind); 686Assert.Equal(RefKind.RefReadOnly, method.RefKind); 725Assert.Equal(RefKind.RefReadOnly, method.RefKind); 784Assert.Equal(RefKind.RefReadOnly, method.RefKind); 819Assert.Equal(RefKind.RefReadOnly, method.RefKind); 2346Assert.Equal(RefKind.RefReadOnly, method.RefKind); 2370Assert.Equal(RefKind.RefReadOnly, method.Parameters[0].RefKind); 2393Assert.Equal(RefKind.RefReadOnly, method.RefKind); 2418Assert.Equal(RefKind.RefReadOnly, method.Parameters[1].RefKind);
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (2)
IOperation\IOperationTests.cs (2)
312Assert.Equal(RefKind.RefReadOnly, op.Locals.Single().RefKind); 380Assert.Equal(RefKind.RefReadOnly, op.Locals.Single().RefKind);
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (13)
Semantics\RefFieldTests.cs (13)
147VerifyFieldSymbol(comp.GetMember<FieldSymbol>("S.F2"), "ref readonly T S<T>.F2", RefKind.RefReadOnly, new string[0]); 153VerifyFieldSymbol(comp.GetMember<FieldSymbol>("S.F2"), "ref readonly T S<T>.F2", RefKind.RefReadOnly, new string[0]); 241VerifyFieldSymbol(comp.GetMember<FieldSymbol>("S.F"), "ref readonly T S<T>.F", RefKind.RefReadOnly, new string[0]); 246VerifyFieldSymbol(comp.GetMember<FieldSymbol>("S.F"), "ref readonly T S<T>.F", RefKind.RefReadOnly, new string[0]); 282VerifyFieldSymbol(comp.GetMember<FieldSymbol>("S.F"), "ref readonly T S<T>.F", RefKind.RefReadOnly, new string[0]); 292VerifyFieldSymbol(comp.GetMember<FieldSymbol>("S.F"), "ref readonly T S<T>.F", RefKind.RefReadOnly, new string[0]); 344VerifyFieldSymbol(field, "ref readonly System.Int32 A.F", RefKind.RefReadOnly, new string[0]); 11573VerifyLocalSymbol(locals[2], "scoped ref readonly R r5", RefKind.RefReadOnly, ScopedKind.ScopedRef); 11576VerifyLocalSymbol(locals[5], "scoped ref readonly R r51", RefKind.RefReadOnly, ScopedKind.ScopedRef); 11710VerifyLocalSymbol(locals[2], "scoped ref readonly R r5", RefKind.RefReadOnly, ScopedKind.ScopedRef); 14110VerifyLocalSymbol(locals[2], "scoped ref readonly R r5", RefKind.RefReadOnly, ScopedKind.ScopedRef); 26297VerifyLocalSymbol(locals[2], "scoped ref readonly R r5", RefKind.RefReadOnly, ScopedKind.ScopedRef); 26387VerifyLocalSymbol(locals[2], "scoped ref readonly R r5", RefKind.RefReadOnly, ScopedKind.ScopedRef);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (17)
Compilation\SemanticModelAPITests.cs (2)
208Assert.Equal(RefKind.RefReadOnly, rxSymbol.RefKind); 240Assert.Equal(RefKind.RefReadOnly, rxSymbol.RefKind);
Compilation\SemanticModelGetDeclaredSymbolAPITests.cs (2)
43Assert.Equal(RefKind.RefReadOnly, rx.RefKind); 66Assert.Equal(RefKind.RefReadOnly, rxLocal.RefKind);
SymbolDisplay\SymbolDisplayTests.cs (1)
6640Assert.Equal(RefKind.RefReadOnly, local.RefKind);
Symbols\FunctionPointerTypeSymbolTests.cs (7)
28[InlineData("ref readonly", RefKind.RefReadOnly, 116verifyRefKind(RefKind.RefReadOnly, mParams[3]); 200Assert.Equal(RefKind.RefReadOnly, secondSignature.RefKind); 1590RefKind.RefReadOnly, 1625RefKind.RefReadOnly, 1646ptr = comp.CreateFunctionPointerTypeSymbol(@string, returnRefKind: RefKind.RefReadOnly, parameterTypes: ImmutableArray<ITypeSymbol>.Empty, parameterRefKinds: ImmutableArray<RefKind>.Empty, convention); 1661ptr = 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)
801Assert.Equal(RefKind.RefReadOnly, d.DelegateInvokeMethod.RefKind); 802Assert.Equal(RefKind.RefReadOnly, ((MethodSymbol)d.GetMembers("EndInvoke").Single()).RefKind);
Symbols\Source\ExpressionBodiedPropertyTests.cs (3)
534Assert.Equal(RefKind.RefReadOnly, p.GetMethod.RefKind); 561Assert.Equal(RefKind.RefReadOnly, p.GetMethod.RefKind); 589Assert.Equal(RefKind.RefReadOnly, p.GetMethod.RefKind);
Microsoft.CodeAnalysis.CSharp.Test.Utilities (1)
FunctionPointerUtilities.cs (1)
281case RefKind.RefReadOnly:
Microsoft.CodeAnalysis.CSharp.Workspaces (2)
CodeGeneration\CSharpSyntaxGenerator.cs (1)
3438RefKind.RefReadOnly => SyntaxFactory.RefType(SyntaxFactory.Token(SyntaxKind.RefKeyword), SyntaxFactory.Token(SyntaxKind.ReadOnlyKeyword), type),
CSharpSyntaxGeneratorInternal.cs (1)
130RefKind.RefReadOnly when forFunctionPointerReturnParameter => SyntaxFactory.TokenList(SyntaxFactory.Token(SyntaxKind.RefKeyword), SyntaxFactory.Token(SyntaxKind.ReadOnlyKeyword)),
Microsoft.CodeAnalysis.Features (1)
GenerateMember\GenerateVariable\AbstractGenerateVariableService.cs (1)
264return RefKind.RefReadOnly;
Microsoft.CodeAnalysis.Workspaces (5)
CodeGenerationMethodSymbol.cs (1)
94return RefKind == RefKind.RefReadOnly;
CodeGenerationPropertySymbol.cs (1)
92public bool ReturnsByRefReadonly => _refKind == RefKind.RefReadOnly;
OperationExtensions.cs (3)
157case RefKind.RefReadOnly: 174RefKind.RefReadOnly => ValueUsageInfo.ReadableReference, 215case RefKind.RefReadOnly:
Microsoft.VisualStudio.LanguageServices.UnitTests (1)
ChangeSignature\ChangeSignatureViewModelTests.vb (1)
298Dim includedInTest = {RefKind.None, RefKind.Ref, RefKind.Out, RefKind.In, RefKind.RefReadOnly}