5 implementations of IsReadOnly
Microsoft.CodeAnalysis.CodeStyle.Fixes (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationTypeSymbol.cs (1)
78bool ITypeSymbol.IsReadOnly => Modifiers.IsReadOnly;
Microsoft.CodeAnalysis.CSharp (1)
Symbols\PublicModel\TypeSymbol.cs (1)
173bool ITypeSymbol.IsReadOnly => UnderlyingTypeSymbol.IsReadOnly;
Microsoft.CodeAnalysis.Features (1)
MetadataAsSource\AbstractMetadataAsSourceService.WrappedNamedTypeSymbol.cs (1)
141public bool IsReadOnly => _symbol.IsReadOnly;
Microsoft.CodeAnalysis.VisualBasic (1)
Symbols\TypeSymbol.vb (1)
600Private ReadOnly Property ITypeSymbol_IsReadOnly As Boolean Implements ITypeSymbol.IsReadOnly
Microsoft.CodeAnalysis.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationTypeSymbol.cs (1)
78bool ITypeSymbol.IsReadOnly => Modifiers.IsReadOnly;
42 references to 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 (4)
SymbolDisplay\SymbolDisplayVisitor.Members.cs (2)
99if (property.ContainingType?.IsReadOnly == true) 123if (method.ContainingType?.IsReadOnly == true)
SymbolDisplay\SymbolDisplayVisitor.Types.cs (2)
707if (symbol.IsReadOnly) 741if (symbol.IsReadOnly)
Microsoft.CodeAnalysis.CSharp.CodeStyle (3)
src\Analyzers\CSharp\Analyzers\MakeStructMemberReadOnly\CSharpMakeStructMemberReadOnlyAnalyzer.cs (1)
61IsReadOnly: false,
src\Analyzers\CSharp\Analyzers\MakeStructReadOnly\CSharpMakeStructReadOnlyDiagnosticAnalyzer.cs (1)
86if (typeSymbol.IsReadOnly)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (1)
681if (castType.IsReadOnly)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (5)
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\PositionalParameterInfo.cs (1)
179if (containingType.TypeKind == TypeKind.Struct && !containingType.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\NamedTypeGenerator.cs (1)
301if (namedType.IsReadOnly)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\PropertyGenerator.cs (1)
382if (hasAllReadOnlyAccessors && !property.ContainingType.IsReadOnly)
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (4)
CodeGen\CodeGenReadonlyStructTests.cs (4)
898Assert.False(iNamedType.IsReadOnly); 906Assert.False(iNamedType.IsReadOnly); 1062Assert.False(iNamedType.IsReadOnly); 1070Assert.False(iNamedType.IsReadOnly);
Microsoft.CodeAnalysis.CSharp.Features (3)
src\Analyzers\CSharp\Analyzers\MakeStructMemberReadOnly\CSharpMakeStructMemberReadOnlyAnalyzer.cs (1)
61IsReadOnly: false,
src\Analyzers\CSharp\Analyzers\MakeStructReadOnly\CSharpMakeStructReadOnlyDiagnosticAnalyzer.cs (1)
86if (typeSymbol.IsReadOnly)
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\PositionalParameterInfo.cs (1)
179if (containingType.TypeKind == TypeKind.Struct && !containingType.IsReadOnly)
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (13)
Parsing\ReadOnlyStructs.cs (13)
46Assert.True(s1.IsReadOnly); 52Assert.True(s2.IsReadOnly); 58Assert.True(s3.IsReadOnly); 120Assert.False(s1.IsReadOnly); 126Assert.False(s2.IsReadOnly); 132Assert.False(s3.IsReadOnly); 155Assert.True(s1.IsReadOnly); 161Assert.True(s2.IsReadOnly); 188Assert.True(s1.IsReadOnly); 192Assert.True(s2.IsReadOnly); 222Assert.True(s1.IsReadOnly); 226Assert.True(s2.IsReadOnly); 230Assert.True(s3.IsReadOnly);
Microsoft.CodeAnalysis.CSharp.Workspaces (5)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (1)
681if (castType.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\NamedTypeGenerator.cs (1)
301if (namedType.IsReadOnly)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\PropertyGenerator.cs (1)
382if (hasAllReadOnlyAccessors && !property.ContainingType.IsReadOnly)
Microsoft.CodeAnalysis.Features (2)
ExtractMethod\MethodExtractor.Analyzer.cs (1)
170&& thisParameterBeingRead.Type is { TypeKind: TypeKind.Struct, IsReadOnly: false };
MetadataAsSource\AbstractMetadataAsSourceService.WrappedNamedTypeSymbol.cs (1)
141public bool IsReadOnly => _symbol.IsReadOnly;
Microsoft.CodeAnalysis.VisualBasic (1)
Symbols\TypeSymbol.vb (1)
600Private ReadOnly Property ITypeSymbol_IsReadOnly As Boolean Implements ITypeSymbol.IsReadOnly
Microsoft.CodeAnalysis.Workspaces (1)
Editing\DeclarationModifiers.cs (1)
82isReadOnly: field?.IsReadOnly == true || property?.IsReadOnly == true || type?.IsReadOnly == true || method?.IsReadOnly == true,