2 implementations of IsReadOnly
Microsoft.CodeAnalysis.CSharp (1)
Symbols\PublicModel\FieldSymbol.cs (1)
84bool IFieldSymbol.IsReadOnly => _underlying.IsReadOnly;
Microsoft.CodeAnalysis.VisualBasic (1)
Symbols\FieldSymbol.vb (1)
87Public MustOverride ReadOnly Property IsReadOnly As Boolean Implements IFieldSymbol.IsReadOnly
46 references to IsReadOnly
Microsoft.AspNetCore.Http.RequestDelegateGenerator (1)
StaticRouteHandlerModel\InvocationOperationExtensions.cs (1)
88IFieldReferenceOperation { Field.IsReadOnly: true } f when ResolveDeclarationOperation(f.Field, semanticModel) is IOperation op =>
Microsoft.CodeAnalysis.CodeStyle (8)
src\Analyzers\Core\Analyzers\MakeFieldReadonly\AbstractMakeFieldReadonlyDiagnosticAnalyzer.cs (1)
162IsReadOnly: false,
src\Analyzers\Core\Analyzers\UseAutoProperty\AbstractUseAutoPropertyAnalyzer.cs (2)
408if (getterField.IsReadOnly && !@this.SupportsReadOnlyProperties(compilation)) 412if (!getterField.IsReadOnly && getterField.Type.IsMutableValueType() != false)
src\Workspaces\Core\Portable\Editing\DeclarationModifiers.cs (1)
82isReadOnly: field?.IsReadOnly == true || property?.IsReadOnly == true || type?.IsReadOnly == true || method?.IsReadOnly == true,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\INamedTypeSymbolExtensions.cs (1)
487!fieldSymbol.IsReadOnly &&
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.cs (1)
317IFieldSymbol fieldSymbol => !fieldSymbol.IsReadOnly && !fieldSymbol.IsConst,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.cs (1)
701if (!fieldSymbol.IsConst && !fieldSymbol.IsReadOnly && !fieldSymbol.IsStatic)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SymbolSpecification.cs (1)
510if (kind == SymbolKind.Field && ((IFieldSymbol)symbol).IsReadOnly)
Microsoft.CodeAnalysis.CodeStyle.Fixes (1)
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.State.cs (1)
414=> symbol is IFieldSymbol field && field.IsReadOnly;
Microsoft.CodeAnalysis.CSharp (1)
SymbolDisplay\SymbolDisplayVisitor.Members.cs (1)
905if (symbol.IsReadOnly)
Microsoft.CodeAnalysis.CSharp.CodeStyle (3)
src\Analyzers\CSharp\Analyzers\MakeStructFieldsWritable\CSharpMakeStructFieldsWritableDiagnosticAnalyzer.cs (1)
81.Any(field => field is { AssociatedSymbol: null, IsStatic: false, IsReadOnly: true });
src\Analyzers\CSharp\Analyzers\MakeStructMemberReadOnly\CSharpMakeStructMemberReadOnlyAnalyzer.cs (1)
290if (operation is IFieldReferenceOperation { Field.IsReadOnly: false } fieldReference &&
src\Analyzers\CSharp\Analyzers\MakeStructReadOnly\CSharpMakeStructReadOnlyDiagnosticAnalyzer.cs (1)
107if (!field.IsReadOnly)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\FieldGenerator.cs (1)
136if (field.IsReadOnly)
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (1)
Semantics\RecordTests.cs (1)
908Assert.True(xBackingField.IsReadOnly);
Microsoft.CodeAnalysis.CSharp.Features (4)
EncapsulateField\CSharpEncapsulateFieldService.cs (1)
98new DeclarationModifiers(isStatic: field.IsStatic, isReadOnly: field.IsReadOnly, isConst: field.IsConst),
src\Analyzers\CSharp\Analyzers\MakeStructFieldsWritable\CSharpMakeStructFieldsWritableDiagnosticAnalyzer.cs (1)
81.Any(field => field is { AssociatedSymbol: null, IsStatic: false, IsReadOnly: true });
src\Analyzers\CSharp\Analyzers\MakeStructMemberReadOnly\CSharpMakeStructMemberReadOnlyAnalyzer.cs (1)
290if (operation is IFieldReferenceOperation { Field.IsReadOnly: false } fieldReference &&
src\Analyzers\CSharp\Analyzers\MakeStructReadOnly\CSharpMakeStructReadOnlyDiagnosticAnalyzer.cs (1)
107if (!field.IsReadOnly)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (2)
Semantics\RecordStructTests.cs (2)
1771Assert.False(xBackingField.IsReadOnly); 1818Assert.True(xBackingField.IsReadOnly);
Microsoft.CodeAnalysis.CSharp.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\FieldGenerator.cs (1)
136if (field.IsReadOnly)
Microsoft.CodeAnalysis.Features (9)
EncapsulateField\AbstractEncapsulateFieldService.cs (3)
240if (field.IsReadOnly) 349modifiers: new DeclarationModifiers(isStatic: field.IsStatic, isReadOnly: field.IsReadOnly, isUnsafe: field.RequiresUnsafeModifier()), 356setMethod: field.IsReadOnly || field.IsConst ? null : CreateSet(fieldName, field, factory)));
ExtractMethod\MethodExtractor.Analyzer.cs (1)
922if (!field.IsReadOnly)
GenerateType\AbstractGenerateTypeService.Editor.cs (1)
624!field.IsReadOnly &&
src\Analyzers\Core\Analyzers\MakeFieldReadonly\AbstractMakeFieldReadonlyDiagnosticAnalyzer.cs (1)
162IsReadOnly: false,
src\Analyzers\Core\Analyzers\UseAutoProperty\AbstractUseAutoPropertyAnalyzer.cs (2)
408if (getterField.IsReadOnly && !@this.SupportsReadOnlyProperties(compilation)) 412if (!getterField.IsReadOnly && getterField.Type.IsMutableValueType() != false)
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.State.cs (1)
414=> symbol is IFieldSymbol field && field.IsReadOnly;
Microsoft.CodeAnalysis.Test.Utilities (1)
Diagnostics\FieldCouldBeReadOnlyAnalyzer.cs (1)
92if (!field.IsConst && !field.IsReadOnly && !assignedToFields.Contains(field))
Microsoft.CodeAnalysis.VisualBasic (2)
SymbolDisplay\SymbolDisplayVisitor.Members.vb (1)
603If symbol.IsReadOnly Then
Symbols\FieldSymbol.vb (1)
87Public MustOverride ReadOnly Property IsReadOnly As Boolean Implements IFieldSymbol.IsReadOnly
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\FieldGenerator.vb (1)
118If field.IsReadOnly Then
Microsoft.CodeAnalysis.VisualBasic.Workspaces (2)
Recommendations\VisualBasicRecommendationServiceRunner.vb (1)
86Return Not field.IsReadOnly AndAlso Not field.IsConst
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\FieldGenerator.vb (1)
118If field.IsReadOnly Then
Microsoft.CodeAnalysis.Workspaces (5)
Editing\DeclarationModifiers.cs (1)
82isReadOnly: field?.IsReadOnly == true || property?.IsReadOnly == true || type?.IsReadOnly == true || method?.IsReadOnly == true,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\INamedTypeSymbolExtensions.cs (1)
487!fieldSymbol.IsReadOnly &&
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.cs (1)
317IFieldSymbol fieldSymbol => !fieldSymbol.IsReadOnly && !fieldSymbol.IsConst,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.cs (1)
701if (!fieldSymbol.IsConst && !fieldSymbol.IsReadOnly && !fieldSymbol.IsStatic)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SymbolSpecification.cs (1)
510if (kind == SymbolKind.Field && ((IFieldSymbol)symbol).IsReadOnly)
Microsoft.VisualStudio.LanguageServices.CSharp (1)
ObjectBrowser\DescriptionBuilder.cs (1)
290if (fieldSymbol != null && fieldSymbol.IsReadOnly)
Microsoft.VisualStudio.LanguageServices.VisualBasic (1)
ObjectBrowser\DescriptionBuilder.vb (1)
347If fieldSymbol IsNot Nothing AndAlso fieldSymbol.IsReadOnly Then
System.Text.Json.SourceGeneration (1)
JsonSourceGenerator.Parser.cs (1)
1406isReadOnly = fieldInfo.IsReadOnly;