5 overrides of IsReadOnly
Microsoft.CodeAnalysis.CSharp (5)
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.FieldSymbol.cs (1)
80public override bool IsReadOnly
Symbols\Metadata\PE\PEFieldSymbol.cs (1)
457public override bool IsReadOnly
Symbols\Source\FieldSymbolWithAttributesAndModifiers.cs (1)
49public sealed override bool IsReadOnly
Symbols\Synthesized\SynthesizedFieldSymbolBase.cs (1)
105public override bool IsReadOnly
Symbols\Wrapped\WrappedFieldSymbol.cs (1)
139public override bool IsReadOnly
38 references to IsReadOnly
Microsoft.CodeAnalysis.CSharp (12)
Binder\Binder.ValueChecks.cs (2)
1167if (backingField.IsReadOnly) 1347if (fieldSymbol.IsReadOnly)
Binder\Binder_Attributes.cs (1)
631invalidNamedArgument |= fieldSymbol.IsReadOnly;
Binder\Binder_Expressions.cs (1)
5926if (isRhsNestedInitializer && fieldSymbol.IsReadOnly && fieldSymbol.Type.IsValueType)
CodeGen\CodeGenerator_HasHome.cs (1)
218if (!field.IsReadOnly)
Emitter\Model\FieldSymbolAdapter.cs (1)
204return AdaptedFieldSymbol.IsReadOnly || (AdaptedFieldSymbol.IsConst && !AdaptedFieldSymbol.IsMetadataConstant);
Emitter\NoPia\EmbeddedField.cs (1)
64return UnderlyingField.AdaptedFieldSymbol.IsReadOnly;
Lowering\SpillSequenceSpiller.cs (1)
410if (refKind != RefKind.None || fieldSymbol.IsReadOnly)
Lowering\StateMachineRewriter\MethodToStateMachineRewriter.cs (1)
612if (refKind != RefKind.None || field.FieldSymbol.IsReadOnly) return expr;
Symbols\PublicModel\FieldSymbol.cs (1)
84bool IFieldSymbol.IsReadOnly => _underlying.IsReadOnly;
Symbols\Source\SourceNamedTypeSymbol.cs (1)
1884if (elementField.IsRequired || elementField.IsReadOnly || elementField.IsVolatile || elementField.IsFixedSizeBuffer)
Symbols\Wrapped\WrappedFieldSymbol.cs (1)
143return _underlyingField.IsReadOnly;
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (2)
CodeGen\CodeGenDynamicTests.cs (1)
603Assert.False(field.IsReadOnly);
Emit\EmitMetadataTests.cs (1)
1410Assert.False(field.IsReadOnly);
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (12)
FieldKeywordTests.cs (7)
4655var actualMembers = comp.GetMember<NamedTypeSymbol>("S").GetMembers().OfType<FieldSymbol>().Select(f => $"{f.ToTestDisplayString()}: {f.IsReadOnly}"); 4810var actualMembers = comp.GetMember<NamedTypeSymbol>("S").GetMembers().OfType<FieldSymbol>().Select(f => $"{f.ToTestDisplayString()}: {f.IsReadOnly}"); 4878var actualMembers = comp.GetMember<NamedTypeSymbol>("S").GetMembers().OfType<FieldSymbol>().Select(f => $"{f.ToTestDisplayString()}: {f.IsReadOnly}"); 4962var actualMembers = comp.GetMember<NamedTypeSymbol>("S").GetMembers().OfType<FieldSymbol>().Select(f => $"{f.ToTestDisplayString()}: {f.IsReadOnly}"); 5085var actualMembers = comp.GetMember<NamedTypeSymbol>("S").GetMembers().OfType<FieldSymbol>().Select(f => $"{f.ToTestDisplayString()}: {f.IsReadOnly}"); 5148var actualMembers = comp.GetMember<NamedTypeSymbol>("C1").GetMembers().OfType<FieldSymbol>().Select(f => $"{f.ToTestDisplayString()}: {f.IsReadOnly}"); 5157actualMembers = comp.GetMember<NamedTypeSymbol>("C2").GetMembers().OfType<FieldSymbol>().Select(f => $"{f.ToTestDisplayString()}: {f.IsReadOnly}");
Semantics\PrimaryConstructorTests.cs (5)
14620Assert.All(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetBackingFields(), f => Assert.True(f.IsReadOnly)); 14816Assert.All(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetBackingFields(), f => Assert.True(f.IsReadOnly)); 15017Assert.All(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetBackingFields(), f => Assert.True(f.IsReadOnly)); 15243Assert.All(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetBackingFields(), f => Assert.True(f.IsReadOnly)); 15554Assert.All(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetBackingFields(), f => Assert.True(f.IsReadOnly));
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (1)
Semantics\InitOnlyMemberTests.cs (1)
1494Assert.True(backingField.IsReadOnly);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (11)
Symbols\DefaultInterfaceImplementationTests.cs (4)
43937Assert.True(f1.IsReadOnly); 43938Assert.True(f2.IsReadOnly); 43939Assert.True(f3.IsReadOnly); 43940Assert.True(f4.IsReadOnly);
Symbols\Metadata\PE\LoadingFields.cs (6)
52Assert.False(f1.IsReadOnly); 67Assert.True(f2.IsReadOnly); 75Assert.False(f3.IsReadOnly); 83Assert.False(f4.IsReadOnly); 91Assert.False(f5.IsReadOnly); 99Assert.False(f6.IsReadOnly);
Symbols\Retargeting\RetargetCustomModifiers.cs (1)
187Assert.False(volatileFld.IsReadOnly);