16 overrides of IsInitOnly
Microsoft.CodeAnalysis.CSharp (14)
Symbols\ErrorMethodSymbol.cs (1)
136internal override bool IsInitOnly => false;
Symbols\FunctionPointers\FunctionPointerMethodSymbol.cs (1)
827internal override bool IsInitOnly => false;
Symbols\Metadata\PE\PEMethodSymbol.cs (1)
1361internal override bool IsInitOnly
Symbols\ReducedExtensionMethodSymbol.cs (1)
529internal override bool IsInitOnly => false;
Symbols\SignatureOnlyMethodSymbol.cs (1)
171internal override bool IsInitOnly => _isInitOnly;
Symbols\Source\LambdaSymbol.cs (1)
404internal override bool IsInitOnly => false;
Symbols\Source\LocalFunctionSymbol.cs (1)
343internal override bool IsInitOnly => false;
Symbols\Source\SourceMemberMethodSymbol.cs (1)
576internal override bool IsInitOnly => false;
Symbols\Synthesized\SynthesizedEntryPointSymbol.cs (1)
225internal sealed override bool IsInitOnly => false;
Symbols\Synthesized\SynthesizedGlobalMethodSymbol.cs (1)
323internal sealed override bool IsInitOnly => false;
Symbols\Synthesized\SynthesizedInstanceMethodSymbol.cs (1)
76internal override bool IsInitOnly => false;
Symbols\Synthesized\SynthesizedIntrinsicOperatorSymbol.cs (1)
273internal 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;
Microsoft.CodeAnalysis.CSharp.ExpressionEvaluator.ExpressionCompiler (2)
Symbols\EEMethodSymbol.cs (1)
452internal override bool IsInitOnly => false;
Symbols\PlaceholderMethodSymbol.cs (1)
127internal override bool IsInitOnly => false;
43 references to IsInitOnly
Microsoft.CodeAnalysis.CSharp (17)
Binder\Binder.ValueChecks.cs (4)
1243return method.IsInitOnly; 1528if (setMethod.IsInitOnly) 1679if (method.MethodKind == MethodKind.Constructor || method.IsInitOnly) 4798return (containingSymbol is MethodSymbol { MethodKind: MethodKind.Constructor } or FieldSymbol { IsStatic: false } or MethodSymbol { IsInitOnly: true }) &&
Binder\Binder_Attributes.cs (1)
519if (setMethod.IsInitOnly && setMethod.DeclaringCompilation != this.Compilation)
Symbols\MethodSymbol.cs (2)
365protected bool IsValidReadOnlyTarget => !IsStatic && ContainingType.IsStructType() && MethodKind != MethodKind.Constructor && !IsInitOnly; 947IsInitOnly ?
Symbols\MethodSymbolExtensions.cs (1)
221!method.IsInitOnly;
Symbols\PublicModel\MethodSymbol.cs (1)
152return _underlying.IsInitOnly;
Symbols\Retargeting\RetargetingSymbolTranslator.cs (1)
1046method.IsInitOnly,
Symbols\Source\SourceMemberContainerSymbol_ImplementationChecks.cs (2)
1125overridingProperty.SetMethod.IsInitOnly != ownOrInheritedOverriddenSetMethod.IsInitOnly)
Symbols\Source\SourcePropertySymbolBase.cs (1)
680if (!IsStatic && SetMethod is { IsInitOnly: false })
Symbols\TypeSymbol.cs (3)
1605interfaceMethod.IsInitOnly, 2023return 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)
46Assert.False(property.GetMethod.IsInitOnly); 47Assert.True(property.SetMethod.IsInitOnly); 413Assert.False(property.SetMethod.IsInitOnly); 417Assert.True(property2.SetMethod.IsInitOnly); 421Assert.True(property3.SetMethod.IsInitOnly); 610Assert.False(property.GetMethod.IsInitOnly); 612Assert.True(property.SetMethod.IsInitOnly); 641Assert.False(property.GetMethod.IsInitOnly); 643Assert.True(property.SetMethod.IsInitOnly); 900Assert.False(property.GetMethod.IsInitOnly); 902Assert.True(property.SetMethod.IsInitOnly); 1155Assert.False(property.GetMethod.IsInitOnly); 1157Assert.False(property.SetMethod.IsInitOnly); 1458Assert.False(getter.IsInitOnly); 1471Assert.True(setter.IsInitOnly); 2447Assert.False(eventSymbol.AddMethod.IsInitOnly); 2449Assert.False(eventSymbol.RemoveMethod.IsInitOnly); 2561Assert.Equal(isSetter, method.IsInitOnly); 3814Assert.False(property0.SetMethod.IsInitOnly); 3902Assert.False(property0.SetMethod.IsInitOnly); 3991Assert.False(property0.SetMethod.IsInitOnly); 4052Assert.False(property.GetMethod.IsInitOnly); 4056Assert.False(property.SetMethod.IsInitOnly); 4144Assert.False(method.IsInitOnly);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (2)
Symbols\Source\RecordTests.cs (2)
183Assert.True(setAccessor.IsInitOnly); 216Assert.True(setAccessor.IsInitOnly);