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