5 implementations of IsInitOnly
Microsoft.CodeAnalysis.CodeStyle.Fixes (1)
CodeGenerationAbstractMethodSymbol.cs (1)
52public abstract bool IsInitOnly { get; }
Microsoft.CodeAnalysis.CSharp (1)
Symbols\PublicModel\MethodSymbol.cs (1)
148bool IMethodSymbol.IsInitOnly
Microsoft.CodeAnalysis.Features (1)
MetadataAsSource\AbstractMetadataAsSourceService.WrappedMethodSymbol.cs (1)
34public bool IsInitOnly => _symbol.IsInitOnly;
Microsoft.CodeAnalysis.VisualBasic (1)
Symbols\MethodSymbol.vb (1)
114Private ReadOnly Property IMethodSymbol_IsInitOnly As Boolean Implements IMethodSymbol.IsInitOnly
Microsoft.CodeAnalysis.Workspaces (1)
CodeGenerationAbstractMethodSymbol.cs (1)
52public abstract bool IsInitOnly { get; }
62 references to IsInitOnly
Microsoft.CodeAnalysis.CodeStyle.Fixes (2)
CodeGenerationSymbolFactory.cs (2)
378isInitOnly: accessor.IsInitOnly); 539isInitOnly: method.IsInitOnly);
Microsoft.CodeAnalysis.CSharp (1)
SymbolDisplay\SymbolDisplayVisitor.Members.cs (1)
189return symbol?.IsInitOnly == true;
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (4)
PositionalParameterInfo.cs (3)
57.Any(symbol => symbol.SetMethod is IMethodSymbol { IsInitOnly: true }); 198if (setAccessor.IsInitOnly) 214if (!setAccessor.IsInitOnly)
PropertyGenerator.cs (1)
260var setAccessorKind = property.SetMethod?.IsInitOnly == true ? SyntaxKind.InitAccessorDeclaration : SyntaxKind.SetAccessorDeclaration;
Microsoft.CodeAnalysis.CSharp.Features (3)
PositionalParameterInfo.cs (3)
57.Any(symbol => symbol.SetMethod is IMethodSymbol { IsInitOnly: true }); 198if (setAccessor.IsInitOnly) 214if (!setAccessor.IsInitOnly)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (35)
Semantics\InitOnlyMemberTests.cs (32)
49Assert.False(publicProperty.GetMethod.IsInitOnly); 50Assert.True(publicProperty.SetMethod.IsInitOnly); 414Assert.False(property.GetPublicSymbol().SetMethod.IsInitOnly); 418Assert.True(property2.GetPublicSymbol().SetMethod.IsInitOnly); 422Assert.True(property3.GetPublicSymbol().SetMethod.IsInitOnly); 611Assert.False(property.GetPublicSymbol().GetMethod.IsInitOnly); 613Assert.True(property.GetPublicSymbol().SetMethod.IsInitOnly); 642Assert.False(property.GetPublicSymbol().GetMethod.IsInitOnly); 644Assert.True(property.GetPublicSymbol().SetMethod.IsInitOnly); 901Assert.False(property.GetPublicSymbol().GetMethod.IsInitOnly); 903Assert.True(property.GetPublicSymbol().SetMethod.IsInitOnly); 1156Assert.False(property.GetPublicSymbol().GetMethod.IsInitOnly); 1158Assert.False(property.GetPublicSymbol().SetMethod.IsInitOnly); 1459Assert.False(getter.GetPublicSymbol().IsInitOnly); 1472Assert.True(setter.GetPublicSymbol().IsInitOnly); 2448Assert.False(eventSymbol.GetPublicSymbol().AddMethod.IsInitOnly); 2450Assert.False(eventSymbol.GetPublicSymbol().RemoveMethod.IsInitOnly); 2468Assert.False(constructor.GetPublicSymbol().IsInitOnly); 2472Assert.False(destructor.GetPublicSymbol().IsInitOnly); 2490Assert.False(conversion.GetPublicSymbol().IsInitOnly); 2494Assert.False(addition.GetPublicSymbol().IsInitOnly); 2519Assert.False(method.IsInitOnly); 2562Assert.Equal(isSetter, method.GetPublicSymbol().IsInitOnly); 3627Assert.False(method.GetPublicSymbol().IsInitOnly); 3686Assert.False(method.GetPublicSymbol().IsInitOnly); 3815Assert.False(property0.GetPublicSymbol().SetMethod.IsInitOnly); 3903Assert.False(property0.GetPublicSymbol().SetMethod.IsInitOnly); 3992Assert.False(property0.GetPublicSymbol().SetMethod.IsInitOnly); 4053Assert.False(property.GetPublicSymbol().GetMethod.IsInitOnly); 4057Assert.False(property.GetPublicSymbol().SetMethod.IsInitOnly); 4135Assert.False(localFunctionSymbol.GetPublicSymbol().IsInitOnly); 4145Assert.False(method.GetPublicSymbol().IsInitOnly);
Semantics\RecordStructTests.cs (2)
1767Assert.False(x.SetMethod!.IsInitOnly); 1814Assert.True(x.SetMethod!.IsInitOnly);
Semantics\RecordTests.cs (1)
904Assert.True(x.SetMethod!.IsInitOnly);
Microsoft.CodeAnalysis.CSharp.Workspaces (1)
PropertyGenerator.cs (1)
260var setAccessorKind = property.SetMethod?.IsInitOnly == true ? SyntaxKind.InitAccessorDeclaration : SyntaxKind.SetAccessorDeclaration;
Microsoft.CodeAnalysis.Features (4)
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (2)
3836if (oldMethod.IsInitOnly != newMethod.IsInitOnly)
ExtractInterface\AbstractExtractInterfaceService.cs (1)
410isInitOnly: method.IsInitOnly));
MetadataAsSource\AbstractMetadataAsSourceService.WrappedMethodSymbol.cs (1)
34public bool IsInitOnly => _symbol.IsInitOnly;
Microsoft.CodeAnalysis.VisualBasic (1)
Symbols\MethodSymbol.vb (1)
114Private ReadOnly Property IMethodSymbol_IsInitOnly As Boolean Implements IMethodSymbol.IsInitOnly
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (9)
Semantics\InitOnlyMemberTests.vb (9)
75Assert.True(DirectCast(comp1.GetMember(Of PropertySymbol)("C.Property0").SetMethod, IMethodSymbol).IsInitOnly) 348Assert.True(DirectCast(comp1.GetMember(Of PropertySymbol)("C.Property0").SetMethod, IMethodSymbol).IsInitOnly) 569Assert.True(DirectCast(comp1.GetMember(Of PropertySymbol)("C.Item").SetMethod, IMethodSymbol).IsInitOnly) 861Assert.True(DirectCast(comp1.GetMember(Of PropertySymbol)("C.Item").SetMethod, IMethodSymbol).IsInitOnly) 1118Assert.True(DirectCast(comp1.GetMember(Of PropertySymbol)("C.Property0").SetMethod, IMethodSymbol).IsInitOnly) 1306Assert.True(DirectCast(comp1.GetMember(Of PropertySymbol)("C.Item").SetMethod, IMethodSymbol).IsInitOnly) 1959Assert.True(DirectCast(p0Set.OverriddenMethod, IMethodSymbol).IsInitOnly) 3454Assert.True(DirectCast(comp1.GetMember(Of PropertySymbol)("C.Item").SetMethod, IMethodSymbol).IsInitOnly) 3863Assert.True(DirectCast(comp1.GetMember(Of PropertySymbol)("C.Item").SetMethod, IMethodSymbol).IsInitOnly)
Microsoft.CodeAnalysis.Workspaces (2)
CodeGenerationSymbolFactory.cs (2)
378isInitOnly: accessor.IsInitOnly); 539isInitOnly: method.IsInitOnly);