4 implementations of IMethodSymbol_IsReadOnly
Microsoft.CodeAnalysis.CodeStyle.Fixes (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAbstractMethodSymbol.cs (1)
51public abstract bool IsReadOnly { get; }
Microsoft.CodeAnalysis.CSharp (1)
Symbols\PublicModel\MethodSymbol.cs (1)
141bool IMethodSymbol.IsReadOnly
Microsoft.CodeAnalysis.VisualBasic (1)
Symbols\MethodSymbol.vb (1)
109Private ReadOnly Property IMethodSymbol_IsReadOnly As Boolean Implements IMethodSymbol.IsReadOnly
Microsoft.CodeAnalysis.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAbstractMethodSymbol.cs (1)
51public abstract bool IsReadOnly { get; }
51 references to IMethodSymbol_IsReadOnly
Microsoft.CodeAnalysis.CodeStyle (1)
src\Workspaces\Core\Portable\Editing\DeclarationModifiers.cs (1)
82isReadOnly: field?.IsReadOnly == true || property?.IsReadOnly == true || type?.IsReadOnly == true || method?.IsReadOnly == true,
Microsoft.CodeAnalysis.CSharp.CodeStyle (5)
src\Analyzers\CSharp\Analyzers\MakeStructMemberReadOnly\CSharpMakeStructMemberReadOnlyAnalyzer.cs (4)
116owningProperty.GetMethod.IsReadOnly || 177|| owningMethod.IsReadOnly 311!propertyReference.Property.GetMethod.IsReadOnly) 384if (methodReference.IsReadOnly)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (1)
683if (methodSymbol.IsReadOnly)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (7)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\EventGenerator.cs (1)
229if (@event.AddMethod?.IsReadOnly == true && !@event.ContainingType.IsReadOnly)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\MethodGenerator.cs (1)
298if (method.IsReadOnly && (method.ContainingSymbol as INamedTypeSymbol)?.IsReadOnly != true)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\PropertyGenerator.cs (5)
338var hasNonReadOnlyAccessor = property.GetMethod?.IsReadOnly == false || property.SetMethod?.IsReadOnly == false; 339if (hasNonReadOnlyAccessor && accessor.IsReadOnly) 379var hasAllReadOnlyAccessors = property.GetMethod?.IsReadOnly != false && property.SetMethod?.IsReadOnly != false;
Microsoft.CodeAnalysis.CSharp.Features (6)
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (2)
1268=> oldMethod != null && newMethod != null && oldMethod.IsReadOnly != newMethod.IsReadOnly;
src\Analyzers\CSharp\Analyzers\MakeStructMemberReadOnly\CSharpMakeStructMemberReadOnlyAnalyzer.cs (4)
116owningProperty.GetMethod.IsReadOnly || 177|| owningMethod.IsReadOnly 311!propertyReference.Property.GetMethod.IsReadOnly) 384if (methodReference.IsReadOnly)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (22)
Semantics\ReadOnlyStructsTests.cs (22)
1192Assert.False(getMethod(s1, "M1").IsReadOnly); 1194Assert.True(getMethod(s1, "M2").IsReadOnly); 1196Assert.True(getProperty(s1, "P1").GetMethod.IsReadOnly); 1197Assert.False(getProperty(s1, "P1").SetMethod.IsReadOnly); 1199Assert.True(getProperty(s1, "P2").GetMethod.IsReadOnly); 1201Assert.True(getProperty(s1, "P3").GetMethod.IsReadOnly); 1203Assert.True(getProperty(s1, "P4").SetMethod.IsReadOnly); 1205Assert.False(getProperty(s1, "P5").GetMethod.IsReadOnly); 1206Assert.False(getProperty(s1, "P5").SetMethod.IsReadOnly); 1208Assert.True(getEvent(s1, "E").AddMethod.IsReadOnly); 1209Assert.True(getEvent(s1, "E").RemoveMethod.IsReadOnly); 1212Assert.True(getMethod(s2, "M1").IsReadOnly); 1213Assert.False(getMethod(s2, "M2").IsReadOnly); 1215Assert.True(getProperty(s2, "P1").GetMethod.IsReadOnly); 1217Assert.True(getProperty(s2, "P2").GetMethod.IsReadOnly); 1219Assert.True(getProperty(s2, "P3").SetMethod.IsReadOnly); 1221Assert.False(getProperty(s2, "P4").GetMethod.IsReadOnly); 1222Assert.False(getProperty(s2, "P4").SetMethod.IsReadOnly); 1224Assert.True(getEvent(s2, "E").AddMethod.IsReadOnly); 1225Assert.True(getEvent(s2, "E").RemoveMethod.IsReadOnly); 1287Assert.Equal(isEffectivelyReadOnly, symbol.IsReadOnly); 1292Assert.False(((IMethodSymbol)reducedFrom).IsReadOnly);
Microsoft.CodeAnalysis.CSharp.Workspaces (8)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (1)
683if (methodSymbol.IsReadOnly)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\EventGenerator.cs (1)
229if (@event.AddMethod?.IsReadOnly == true && !@event.ContainingType.IsReadOnly)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\MethodGenerator.cs (1)
298if (method.IsReadOnly && (method.ContainingSymbol as INamedTypeSymbol)?.IsReadOnly != true)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\PropertyGenerator.cs (5)
338var hasNonReadOnlyAccessor = property.GetMethod?.IsReadOnly == false || property.SetMethod?.IsReadOnly == false; 339if (hasNonReadOnlyAccessor && accessor.IsReadOnly) 379var hasAllReadOnlyAccessors = property.GetMethod?.IsReadOnly != false && property.SetMethod?.IsReadOnly != false;
Microsoft.CodeAnalysis.VisualBasic (1)
Symbols\MethodSymbol.vb (1)
109Private ReadOnly Property IMethodSymbol_IsReadOnly As Boolean Implements IMethodSymbol.IsReadOnly
Microsoft.CodeAnalysis.Workspaces (1)
Editing\DeclarationModifiers.cs (1)
82isReadOnly: field?.IsReadOnly == true || property?.IsReadOnly == true || type?.IsReadOnly == true || method?.IsReadOnly == true,