1 override of IsEffectivelyReadOnly
Microsoft.CodeAnalysis.CSharp (1)
Symbols\ReducedExtensionMethodSymbol.cs (1)
531internal override bool IsEffectivelyReadOnly => _reducedFrom.Parameters[0].RefKind == RefKind.In;
32 references to IsEffectivelyReadOnly
Microsoft.CodeAnalysis.CSharp (20)
Binder\Binder.ValueChecks.cs (8)
690if (!isValueType || (RequiresAssignableVariable(valueKind) && (this.ContainingMemberOrLambda as MethodSymbol)?.IsEffectivelyReadOnly == true)) 957if (RequiresAssignableVariable(valueKind) && !backingField.ContainingType.IsReferenceType && (this.ContainingMemberOrLambda as MethodSymbol)?.IsEffectivelyReadOnly == true) 1564var setValueKind = setMethod.IsEffectivelyReadOnly ? BindValueKind.RValue : BindValueKind.Assignable; 2080var receiverAddressKind = method.IsEffectivelyReadOnly ? Binder.AddressKind.ReadOnly : Binder.AddressKind.Writeable; 2609MethodSymbol m => m.IsEffectivelyReadOnly, 2614PropertySymbol p => p.GetMethod?.IsEffectivelyReadOnly != false && p.SetMethod?.IsEffectivelyReadOnly != false, 4617if (!IsAnyReadOnly(addressKind) && containingSymbol is MethodSymbol { ContainingSymbol: NamedTypeSymbol, IsEffectivelyReadOnly: true })
Binder\Binder_Invocation.cs (2)
1478containingMethod.IsEffectivelyReadOnly && 1481!method.IsEffectivelyReadOnly &&
CodeGen\EmitExpression.cs (1)
1966if (method.IsEffectivelyReadOnly && method.MethodKind != MethodKind.Constructor)
Lowering\LocalRewriter\LocalRewriter.DecisionDagRewriter.cs (1)
173!method.IsEffectivelyReadOnly &&
Lowering\LocalRewriter\LocalRewriter_StringConcat.cs (1)
450structToStringMethod?.IsEffectivelyReadOnly == true;
Symbols\MethodSymbol.cs (1)
350/// See also <see cref="IsEffectivelyReadOnly"/>
Symbols\PublicModel\MethodSymbol.cs (1)
144return _underlying.IsEffectivelyReadOnly;
Symbols\Source\SourceMemberContainerSymbol.cs (2)
4008Debug.Assert(isRecordClass || !members.Any(m => m is PropertySymbol { GetMethod.IsEffectivelyReadOnly: false })); 4211isReadOnly: printMethod.IsEffectivelyReadOnly,
Symbols\Source\ThisParameterSymbol.cs (1)
49if (_containingMethod?.IsEffectivelyReadOnly == true)
Symbols\Synthesized\Records\SynthesizedRecordDeconstruct.cs (1)
118return property.GetMethod is not null && !getterMethod.IsEffectivelyReadOnly;
Symbols\Synthesized\Records\SynthesizedRecordPrintMembers.cs (1)
315if (property.GetMethod is not null && !getterMethod.IsEffectivelyReadOnly)
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (4)
CodeGen\CodeGenReadonlyStructTests.cs (4)
1607Assert.Equal(isReadOnly, method.IsEffectivelyReadOnly); 1678Assert.True(m1.IsEffectivelyReadOnly); 1684Assert.False(m2.IsEffectivelyReadOnly); 2583Assert.Equal(isReadOnly, type.GetProperty("P").GetMethod.IsEffectivelyReadOnly);
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (8)
Semantics\ReadOnlyStructsTests.cs (8)
390Assert.True(method.IsEffectivelyReadOnly); 423Assert.False(method.IsEffectivelyReadOnly); 453Assert.True(method.IsEffectivelyReadOnly); 1155Assert.True(method.IsEffectivelyReadOnly); 1286Assert.Equal(isEffectivelyReadOnly, symbol.GetSymbol().IsEffectivelyReadOnly); 1291Assert.False(reducedFrom.GetSymbol().IsEffectivelyReadOnly); 1326Assert.Equal(isReadOnly, property.GetMethod.IsEffectivelyReadOnly); 1460Assert.False(method.IsEffectivelyReadOnly);