14 overrides of IsInitOnly
Microsoft.CodeAnalysis.CSharp (14)
Symbols\ErrorMethodSymbol.cs (1)
138internal override bool IsInitOnly => false;
Symbols\FunctionPointers\FunctionPointerMethodSymbol.cs (1)
843internal override bool IsInitOnly => false;
Symbols\Metadata\PE\PEMethodSymbol.cs (1)
1453internal override bool IsInitOnly
Symbols\ReducedExtensionMethodSymbol.cs (1)
539internal override bool IsInitOnly => false;
Symbols\SignatureOnlyMethodSymbol.cs (1)
179internal override bool IsInitOnly => _isInitOnly;
Symbols\Source\LambdaSymbol.cs (1)
411internal override bool IsInitOnly => false;
Symbols\Source\LocalFunctionSymbol.cs (1)
383internal override bool IsInitOnly => false;
Symbols\Source\SourceMemberMethodSymbol.cs (1)
711internal override bool IsInitOnly => false;
Symbols\Synthesized\SynthesizedEntryPointSymbol.cs (1)
227internal sealed override bool IsInitOnly => false;
Symbols\Synthesized\SynthesizedGlobalMethodSymbol.cs (1)
339internal sealed override bool IsInitOnly => false;
Symbols\Synthesized\SynthesizedIntrinsicOperatorSymbol.cs (1)
274internal override bool IsInitOnly => false;
Symbols\Synthesized\SynthesizedMethodSymbol.cs (1)
84internal override bool IsInitOnly => false;
Symbols\Synthesized\SynthesizedStaticConstructor.cs (1)
293internal override bool IsInitOnly => false;
Symbols\Wrapped\WrappedMethodSymbol.cs (1)
360internal override bool IsInitOnly => UnderlyingMethod.IsInitOnly;
43 references to IsInitOnly
Microsoft.CodeAnalysis.CSharp (17)
Binder\Binder.ValueChecks.cs (3)
1487return method.IsInitOnly; 1772if (setMethod.IsInitOnly) 1923if (method.MethodKind == MethodKind.Constructor || method.IsInitOnly)
Binder\Binder_Attributes.cs (1)
539if (setMethod.IsInitOnly && setMethod.DeclaringCompilation != this.Compilation)
CodeGen\CodeGenerator_HasHome.cs (1)
256return (containingSymbol is MethodSymbol { MethodKind: MethodKind.Constructor } or FieldSymbol { IsStatic: false } or MethodSymbol { IsInitOnly: true }) &&
Symbols\MethodSymbol.cs (2)
371protected bool IsValidReadOnlyTarget => !IsStatic && ContainingType.IsStructType() && MethodKind != MethodKind.Constructor && !IsInitOnly; 961IsInitOnly ?
Symbols\MethodSymbolExtensions.cs (1)
224!method.IsInitOnly;
Symbols\PublicModel\MethodSymbol.cs (1)
153return _underlying.IsInitOnly;
Symbols\Retargeting\RetargetingSymbolTranslator.cs (1)
1023method.IsInitOnly,
Symbols\Source\SourceMemberContainerSymbol_ImplementationChecks.cs (2)
1120overridingProperty.SetMethod.IsInitOnly != ownOrInheritedOverriddenSetMethod.IsInitOnly)
Symbols\Source\SourcePropertySymbolBase.cs (1)
889if (!IsStatic && ((_propertyFlags & Flags.HasAutoPropertySet) != 0) && SetMethod is { IsInitOnly: false })
Symbols\TypeSymbol.cs (3)
1625interfaceMethod.IsInitOnly, 2088return oneMethod.IsInitOnly != otherMethod.IsInitOnly;
Symbols\Wrapped\WrappedMethodSymbol.cs (1)
360internal override bool IsInitOnly => UnderlyingMethod.IsInitOnly;
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (24)
Semantics\InitOnlyMemberTests.cs (24)
48Assert.False(property.GetMethod.IsInitOnly); 49Assert.True(property.SetMethod.IsInitOnly); 415Assert.False(property.SetMethod.IsInitOnly); 419Assert.True(property2.SetMethod.IsInitOnly); 423Assert.True(property3.SetMethod.IsInitOnly); 612Assert.False(property.GetMethod.IsInitOnly); 614Assert.True(property.SetMethod.IsInitOnly); 643Assert.False(property.GetMethod.IsInitOnly); 645Assert.True(property.SetMethod.IsInitOnly); 902Assert.False(property.GetMethod.IsInitOnly); 904Assert.True(property.SetMethod.IsInitOnly); 1157Assert.False(property.GetMethod.IsInitOnly); 1159Assert.False(property.SetMethod.IsInitOnly); 1463Assert.False(getter.IsInitOnly); 1476Assert.True(setter.IsInitOnly); 2452Assert.False(eventSymbol.AddMethod.IsInitOnly); 2454Assert.False(eventSymbol.RemoveMethod.IsInitOnly); 2566Assert.Equal(isSetter, method.IsInitOnly); 3825Assert.False(property0.SetMethod.IsInitOnly); 3913Assert.False(property0.SetMethod.IsInitOnly); 4002Assert.False(property0.SetMethod.IsInitOnly); 4063Assert.False(property.GetMethod.IsInitOnly); 4067Assert.False(property.SetMethod.IsInitOnly); 4155Assert.False(method.IsInitOnly);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (2)
Symbols\Source\RecordTests.cs (2)
183Assert.True(setAccessor.IsInitOnly); 216Assert.True(setAccessor.IsInitOnly);