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