1 override of IsEffectivelyReadOnly
Microsoft.CodeAnalysis.CSharp (1)
Symbols\ReducedExtensionMethodSymbol.cs (1)
541
internal override bool
IsEffectivelyReadOnly
=> _reducedFrom.Parameters[0].RefKind is RefKind.In or RefKind.RefReadOnlyParameter;
75 references to IsEffectivelyReadOnly
Microsoft.CodeAnalysis.CSharp (19)
Binder\Binder.ValueChecks.cs (5)
863
if (!isValueType || (RequiresAssignableVariable(valueKind) && (this.ContainingMemberOrLambda as MethodSymbol)?.
IsEffectivelyReadOnly
== true))
1179
if (RequiresAssignableVariable(valueKind) && !backingField.ContainingType.IsReferenceType && (this.ContainingMemberOrLambda as MethodSymbol)?.
IsEffectivelyReadOnly
== true)
1808
var setValueKind = setMethod.
IsEffectivelyReadOnly
? BindValueKind.RValue : BindValueKind.Assignable;
4792
if (methodInfo.Method.
IsEffectivelyReadOnly
)
4837
if (methodInfo.Method is null || methodInfo.Method.
IsEffectivelyReadOnly
)
Binder\Binder_Invocation.cs (3)
1399
var valueKind = method.
IsEffectivelyReadOnly
1844
containingMethod.
IsEffectivelyReadOnly
&&
1847
!method.
IsEffectivelyReadOnly
&&
CodeGen\CodeGenerator_HasHome.cs (1)
75
if (!IsAnyReadOnly(addressKind) && containingSymbol is MethodSymbol { ContainingSymbol: NamedTypeSymbol,
IsEffectivelyReadOnly
: true })
CodeGen\EmitExpression.cs (1)
2186
if (method.
IsEffectivelyReadOnly
&& method.MethodKind != MethodKind.Constructor)
Lowering\LocalRewriter\LocalRewriter.DecisionDagRewriter.cs (1)
172
!method.
IsEffectivelyReadOnly
&&
Lowering\LocalRewriter\LocalRewriter_StringConcat.cs (1)
662
structToStringMethod?.
IsEffectivelyReadOnly
== true;
Symbols\MethodSymbol.cs (1)
356
/// See also <see cref="
IsEffectivelyReadOnly
"/>
Symbols\PublicModel\MethodSymbol.cs (1)
145
return _underlying.
IsEffectivelyReadOnly
;
Symbols\Source\SourceMemberContainerSymbol.cs (1)
4887
Debug.Assert(isRecordClass || !members.Any(m => m is PropertySymbol { GetMethod.
IsEffectivelyReadOnly
: false }));
Symbols\Source\ThisParameterSymbol.cs (1)
162
if (_containingMethod?.
IsEffectivelyReadOnly
== true)
Symbols\Synthesized\Records\SynthesizedRecordDeconstruct.cs (1)
108
return property.GetMethod is not null && !getterMethod.
IsEffectivelyReadOnly
;
Symbols\Synthesized\Records\SynthesizedRecordPrintMembers.cs (1)
315
if (property.GetMethod is not null && !getterMethod.
IsEffectivelyReadOnly
)
Symbols\Synthesized\Records\SynthesizedRecordToString.cs (1)
30
isReadOnly: printMethod.
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.Emit3.UnitTests (44)
Symbols\UserDefinedCompoundAssignmentOperatorsTests.cs (44)
6898
Assert.False(m.
IsEffectivelyReadOnly
);
6919
Assert.True(m.
IsEffectivelyReadOnly
);
6946
Assert.True(m.
IsEffectivelyReadOnly
);
6952
Assert.True(m.
IsEffectivelyReadOnly
);
6981
Assert.True(m.
IsEffectivelyReadOnly
);
7009
Assert.True(m.
IsEffectivelyReadOnly
);
7043
Assert.False(m.
IsEffectivelyReadOnly
);
7076
Assert.True(m.
IsEffectivelyReadOnly
);
7082
Assert.True(m.
IsEffectivelyReadOnly
);
7109
Assert.True(m.
IsEffectivelyReadOnly
);
7144
Assert.True(m.
IsEffectivelyReadOnly
);
7178
Assert.True(m.
IsEffectivelyReadOnly
);
7252
Assert.False(m.
IsEffectivelyReadOnly
);
7258
Assert.False(m.
IsEffectivelyReadOnly
);
7264
Assert.False(m.
IsEffectivelyReadOnly
);
7270
Assert.False(m.
IsEffectivelyReadOnly
);
18462
Assert.True(m.
IsEffectivelyReadOnly
);
18482
Assert.True(m.
IsEffectivelyReadOnly
);
18509
Assert.True(m.
IsEffectivelyReadOnly
);
18515
Assert.True(m.
IsEffectivelyReadOnly
);
18540
Assert.True(m.
IsEffectivelyReadOnly
);
18546
Assert.True(m.
IsEffectivelyReadOnly
);
18575
Assert.True(m.
IsEffectivelyReadOnly
);
18603
Assert.True(m.
IsEffectivelyReadOnly
);
18631
Assert.True(m.
IsEffectivelyReadOnly
);
18658
Assert.True(m.
IsEffectivelyReadOnly
);
18691
Assert.True(m.
IsEffectivelyReadOnly
);
18697
Assert.True(m.
IsEffectivelyReadOnly
);
18727
Assert.True(m.
IsEffectivelyReadOnly
);
18733
Assert.True(m.
IsEffectivelyReadOnly
);
18760
Assert.True(m.
IsEffectivelyReadOnly
);
18785
Assert.True(m.
IsEffectivelyReadOnly
);
18820
Assert.True(m.
IsEffectivelyReadOnly
);
18853
Assert.True(m.
IsEffectivelyReadOnly
);
18894
Assert.True(m.
IsEffectivelyReadOnly
);
18926
Assert.True(m.
IsEffectivelyReadOnly
);
19000
Assert.False(m.
IsEffectivelyReadOnly
);
19006
Assert.False(m.
IsEffectivelyReadOnly
);
19012
Assert.False(m.
IsEffectivelyReadOnly
);
19018
Assert.False(m.
IsEffectivelyReadOnly
);
19075
Assert.False(m.
IsEffectivelyReadOnly
);
19081
Assert.False(m.
IsEffectivelyReadOnly
);
19087
Assert.False(m.
IsEffectivelyReadOnly
);
19093
Assert.False(m.
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
);