private MutabilityInspectionResult InspectProperty( IPropertySymbol property, HashSet <ITypeSymbol> typeStack ) { if (property.IsIndexer) { // Indexer properties are just glorified method syntax and dont' hold state return(MutabilityInspectionResult.NotMutable()); } var propertySyntax = GetDeclarationSyntax <PropertyDeclarationSyntax>(property); // TODO: can we do this without the syntax; with only the symbol? if (!propertySyntax.IsAutoImplemented()) { // Properties that are auto-implemented have an implicit // backing field that may be mutable. Otherwise, properties are // just sugar for getter/setter methods and don't themselves // contribute to mutability. return(MutabilityInspectionResult.NotMutable()); } if (!property.IsReadOnly) { return(MutabilityInspectionResult.MutableProperty( property, MutabilityCause.IsNotReadonly )); } if (propertySyntax.Initializer != null) { return(InspectInitializer( propertySyntax.Initializer.Value, typeStack ).WithPrefixedMember(property.Name)); } return(InspectType( property.Type, MutabilityInspectionFlags.Default, typeStack ).WithPrefixedMember(property.Name)); }