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