diff --git a/src/D2L.CodeStyle.Analyzers/AnnotationsContext.cs b/src/D2L.CodeStyle.Analyzers/AnnotationsContext.cs index b4412e7d9..b9a4a144c 100644 --- a/src/D2L.CodeStyle.Analyzers/AnnotationsContext.cs +++ b/src/D2L.CodeStyle.Analyzers/AnnotationsContext.cs @@ -1,7 +1,6 @@ #nullable disable using System.Collections.Immutable; -using System.Linq; using Microsoft.CodeAnalysis; namespace D2L.CodeStyle.Analyzers { @@ -20,25 +19,19 @@ public static bool TryCreate( Compilation compilation, out AnnotationsContext ct } private AnnotationsContext( Compilation compilation ) { - Statics = ( - Audited: GetAttr( compilation, "D2L.CodeStyle.Annotations.Statics+Audited" ), - Unaudited: GetAttr( compilation, "D2L.CodeStyle.Annotations.Statics+Unaudited" ) - ); + Statics_Audited = GetAttr( compilation, "D2L.CodeStyle.Annotations.Statics+Audited" ); + Mutability_Audited = GetAttr( compilation, "D2L.CodeStyle.Annotations.Mutability+AuditedAttribute" ); Objects = ( Immutable: GetAttr( compilation, "D2L.CodeStyle.Annotations.Objects+Immutable" ), ImmutableBaseClass: GetAttr( compilation, "D2L.CodeStyle.Annotations.Objects+ImmutableBaseClassAttribute" ), ConditionallyImmutable: GetAttr( compilation, "D2L.CodeStyle.Annotations.Objects+ConditionallyImmutable" ), OnlyIf: GetAttr( compilation, "D2L.CodeStyle.Annotations.Objects+ConditionallyImmutable+OnlyIf" ) ); - Mutability = ( - Audited: GetAttr( compilation, "D2L.CodeStyle.Annotations.Mutability+AuditedAttribute" ), - Unaudited: GetAttr( compilation, "D2L.CodeStyle.Annotations.Mutability+UnauditedAttribute" ) - ); } - internal (Attr Audited, Attr Unaudited) Statics { get; } + internal Attr Statics_Audited { get; } + internal Attr Mutability_Audited { get; } internal (Attr Immutable, Attr ImmutableBaseClass, Attr ConditionallyImmutable, Attr OnlyIf) Objects { get; } - internal (Attr Audited, Attr Unaudited) Mutability { get; } private static Attr GetAttr( Compilation compilation, string metadataName ) => new( compilation.GetTypeByMetadataName( metadataName ) ); diff --git a/src/D2L.CodeStyle.Analyzers/Diagnostics.cs b/src/D2L.CodeStyle.Analyzers/Diagnostics.cs index 30fbe3d13..83e291ebd 100644 --- a/src/D2L.CodeStyle.Analyzers/Diagnostics.cs +++ b/src/D2L.CodeStyle.Analyzers/Diagnostics.cs @@ -117,8 +117,8 @@ public static class Diagnostics { public static readonly DiagnosticDescriptor UnnecessaryMutabilityAnnotation = new DiagnosticDescriptor( id: "D2L0030", - title: "Unnecessary Mutability.(Un)Audited Attribute", - messageFormat: "There is a Mutability.Audited or Mutability.Unaudited attribute on an immutable member. Remove the unnecessary attribute.", + title: "Unnecessary Mutability.Audited Attribute", + messageFormat: "There is a Mutability.Audited attribute on an immutable member. Remove the unnecessary attribute.", category: "Cleanliness", defaultSeverity: DiagnosticSeverity.Error, isEnabledByDefault: true diff --git a/src/D2L.CodeStyle.Analyzers/Immutability/MutabilityAuditor.cs b/src/D2L.CodeStyle.Analyzers/Immutability/MutabilityAuditor.cs index eaa597859..24d72c56f 100644 --- a/src/D2L.CodeStyle.Analyzers/Immutability/MutabilityAuditor.cs +++ b/src/D2L.CodeStyle.Analyzers/Immutability/MutabilityAuditor.cs @@ -1,6 +1,5 @@ #nullable disable -using System.Linq; using Microsoft.CodeAnalysis; using static D2L.CodeStyle.Analyzers.Immutability.ImmutableDefinitionChecker; @@ -15,17 +14,11 @@ out Location location ) { // Collect audit information - var hasStaticAudited = annotationsContext.Statics.Audited.IsDefined( symbol ); - var hasStaticUnaudited = annotationsContext.Statics.Unaudited.IsDefined( symbol ); - var hasMutabilityAudited = annotationsContext.Mutability.Audited.IsDefined( symbol ); - var hasMutabilityUnaudited = annotationsContext.Mutability.Unaudited.IsDefined( symbol ); - var hasBothStaticsAttributes = hasStaticAudited && hasStaticUnaudited; - var hasBothMutabilityAttributes = hasMutabilityAudited && hasMutabilityUnaudited; - var hasEitherStaticsAttributes = hasStaticAudited || hasStaticUnaudited; - var hasEitherMutabilityAttributes = hasMutabilityAudited || hasMutabilityUnaudited; + var hasStaticAudited = annotationsContext.Statics_Audited.IsDefined( symbol ); + var hasMutabilityAudited = annotationsContext.Mutability_Audited.IsDefined( symbol ); // If there are no audits, don't do anything - if( !hasEitherStaticsAttributes && !hasEitherMutabilityAttributes ) { + if( !hasStaticAudited && !hasMutabilityAudited ) { location = null; return false; } @@ -36,33 +29,11 @@ out Location location .GetLastToken() .GetLocation(); - // Check if both static audits are applied - if( hasBothStaticsAttributes ) { - var diagnostic = Diagnostic.Create( - Diagnostics.ConflictingImmutability, - syntaxLocation, - "Statics.Audited", - "Statics.Unaudited", - symbol.Kind.ToString().ToLower() ); - diagnosticSink( diagnostic ); - } - - // Check if both mutability audits are applied - if( hasBothMutabilityAttributes ) { - var diagnostic = Diagnostic.Create( - Diagnostics.ConflictingImmutability, - syntaxLocation, - "Mutability.Audited", - "Mutability.Unaudited", - symbol.Kind.ToString().ToLower() ); - diagnosticSink( diagnostic ); - } - AttributeData attr = null; if( symbol.IsStatic ) { // Check if a static member is using mutability audits - if( hasEitherMutabilityAttributes ) { + if( hasMutabilityAudited ) { var diagnostic = Diagnostic.Create( Diagnostics.InvalidAuditType, syntaxLocation, @@ -72,11 +43,10 @@ out Location location diagnosticSink( diagnostic ); } - attr = annotationsContext.Statics.Audited.GetAll( symbol ).FirstOrDefault() - ?? annotationsContext.Statics.Unaudited.GetAll( symbol ).FirstOrDefault(); + attr = annotationsContext.Statics_Audited.GetAll( symbol ).FirstOrDefault(); } else { // Check if a non-static member is using static audits - if( hasEitherStaticsAttributes ) { + if( hasStaticAudited ) { var diagnostic = Diagnostic.Create( Diagnostics.InvalidAuditType, syntaxLocation, @@ -86,8 +56,7 @@ out Location location diagnosticSink( diagnostic ); } - attr = annotationsContext.Mutability.Audited.GetAll( symbol ).FirstOrDefault() - ?? annotationsContext.Mutability.Unaudited.GetAll( symbol ).FirstOrDefault(); + attr = annotationsContext.Mutability_Audited.GetAll( symbol ).FirstOrDefault(); } if( attr != null ) { diff --git a/src/D2L.CodeStyle.Annotations/Mutability/UnauditedAttribute.cs b/src/D2L.CodeStyle.Annotations/Mutability/UnauditedAttribute.cs deleted file mode 100644 index cdcedf230..000000000 --- a/src/D2L.CodeStyle.Annotations/Mutability/UnauditedAttribute.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; - -// ReSharper disable once CheckNamespace -namespace D2L.CodeStyle.Annotations { - public static partial class Mutability { - [AttributeUsage( validOn: AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Event )] - public sealed class UnauditedAttribute : Attribute { - public readonly Because m_cuz; - public readonly UndiffBucket m_bucket; - - public UnauditedAttribute( Because why ) { - m_cuz = why; - } - - public UnauditedAttribute( Because why, UndiffBucket bucket ) { - if( why != Because.ItsStickyDataOhNooo ) { - throw new ArgumentException( "UndiffBucket is only meaningful for Because.ItsStickyDataOhNooo", nameof( bucket ) ); - } - m_cuz = why; - m_bucket = bucket; - } - } - } -} diff --git a/src/D2L.CodeStyle.Annotations/Statics/Unaudited.cs b/src/D2L.CodeStyle.Annotations/Statics/Unaudited.cs deleted file mode 100644 index a218e9e63..000000000 --- a/src/D2L.CodeStyle.Annotations/Statics/Unaudited.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; - -// ReSharper disable once CheckNamespace -namespace D2L.CodeStyle.Annotations { - public static partial class Statics { - [AttributeUsage( validOn: AttributeTargets.Field | AttributeTargets.Property )] - public sealed class Unaudited : Attribute { - public readonly Because m_cuz; - public readonly UndiffBucket m_bucket; - - public Unaudited( Because why ) { - m_cuz = why; - } - - public Unaudited( Because why, UndiffBucket bucket ) { - if ( why != Because.ItsStickyDataOhNooo ) { - throw new ArgumentException( "UndiffBucket is only meaningful for Because.ItsStickyDataOhNooo", nameof( bucket ) ); - } - m_cuz = why; - m_bucket = bucket; - } - } - } -} diff --git a/tests/D2L.CodeStyle.Analyzers.Test/Specs/ImmutabilityAnalyzer.cs b/tests/D2L.CodeStyle.Analyzers.Test/Specs/ImmutabilityAnalyzer.cs index fbecd89a8..c5b0089ae 100644 --- a/tests/D2L.CodeStyle.Analyzers.Test/Specs/ImmutabilityAnalyzer.cs +++ b/tests/D2L.CodeStyle.Analyzers.Test/Specs/ImmutabilityAnalyzer.cs @@ -352,13 +352,9 @@ object this[ int index ] { static readonly int m_field2 = 0; int /* MemberIsNotReadOnly(Field, m_field3, AnalyzedClassMarkedImmutable) */ m_field3 /**/ = 0; int /* MemberIsNotReadOnly(Field, m_field4, AnalyzedClassMarkedImmutable) */ m_field4 /**/; - [Mutability.Unaudited( Because.ItHasntBeenLookedAt )] - int m_field5 = 0; [Mutability.Audited( "John Doe", "1970-01-01", "Rationale" )] int m_field6 = 0; readonly int m_field7 = 0; - [/* UnnecessaryMutabilityAnnotation() */ Mutability.Unaudited( Because.ItHasntBeenLookedAt ) /**/] - readonly int m_field8 = 0; [/* UnnecessaryMutabilityAnnotation() */ Mutability.Audited( "John Doe", "1970-01-01", "Rationale" ) /**/] readonly int m_field9 = 0; readonly int m_field10; @@ -374,8 +370,6 @@ object this[ int index ] { static readonly Types.SomeEnum m_field12 = Types.SomeEnum.Foo; Types.SomeEnum /* MemberIsNotReadOnly(Field, m_field13, AnalyzedClassMarkedImmutable) */ m_field13 /**/ = Types.SomeEnum.Foo; Types.SomeEnum /* MemberIsNotReadOnly(Field, m_field14, AnalyzedClassMarkedImmutable) */ m_field14 /**/; - [Mutability.Unaudited( Because.ItHasntBeenLookedAt )] - Types.SomeEnum m_field15 = Types.SomeEnum.Foo; [Mutability.Audited( "John Doe", "1970-01-01", "Rationale" )] Types.SomeEnum m_field16 = Types.SomeEnum.Foo; readonly Types.SomeEnum m_field17 = Types.SomeEnum.Foo; @@ -390,8 +384,6 @@ object this[ int index ] { static readonly int[] m_field20 = /* ArraysAreMutable(Int32) */ new[] { 0 } /**/; int[] /* MemberIsNotReadOnly(Field, m_field21, AnalyzedClassMarkedImmutable) */ m_field21 /**/ = /* ArraysAreMutable(Int32) */ new[] { 0 } /**/; /* ArraysAreMutable(Int32) */ int[] /**/ /* MemberIsNotReadOnly(Field, m_field22, AnalyzedClassMarkedImmutable) */ m_field22 /**/; - [Mutability.Unaudited( Because.ItHasntBeenLookedAt )] - int[] m_field23 = new[] { 0 }; [Mutability.Audited( "John Doe", "1970-01-01", "Rationale" )] int[] m_field24 = new[] { 0 }; readonly int[] m_field25 = /* ArraysAreMutable(Int32) */ new[] { 0 } /**/; @@ -404,8 +396,6 @@ object this[ int index ] { static readonly /* UnexpectedTypeKind(PointerType) */ int* /**/ m_field27; /* UnexpectedTypeKind(PointerType) */ int* /**/ /* MemberIsNotReadOnly(Field, m_field28, AnalyzedClassMarkedImmutable) */ m_field28 /**/; - [Mutability.Unaudited( Because.ItHasntBeenLookedAt )] - int* m_field29; [Mutability.Audited( "John Doe", "1970-01-01", "Rationale" )] int* m_field30; readonly /* UnexpectedTypeKind(PointerType) */ int* /**/ m_field31; @@ -439,13 +429,9 @@ object this[ int index ] { static readonly /* DynamicObjectsAreMutable */ dynamic /**/ m_field42; /* DynamicObjectsAreMutable */ dynamic /**/ /* MemberIsNotReadOnly(Field, m_field44, AnalyzedClassMarkedImmutable) */ m_field44 /**/; readonly /* DynamicObjectsAreMutable */ dynamic /**/ m_field45; - [Mutability.Unaudited( Because.ItHasntBeenLookedAt )] - readonly dynamic m_field46; [Mutability.Audited( "John Doe", "1970-01-01", "Rationale" )] readonly dynamic m_field47; /* DynamicObjectsAreMutable */ dynamic /**/ Property16 { get; } - [Mutability.Unaudited( Because.ItHasntBeenLookedAt )] - dynamic Property17 { get; } [Mutability.Audited( "John Doe", "1970-01-01", "Rationale" )] dynamic Property18 { get; } dynamic Property19 { get { return new ExpandoObject(); } } @@ -501,13 +487,9 @@ object this[ int index ] { static readonly Types.RegularClass m_field71 = /* NonImmutableTypeHeldByImmutable(class, SpecTests.Types.RegularClass, (or [ImmutableBaseClass])) */ new Types.RegularClass() /**/; Types.RegularClass /* MemberIsNotReadOnly(Field, m_field72, AnalyzedClassMarkedImmutable) */ m_field72 /**/ = /* NonImmutableTypeHeldByImmutable(class, SpecTests.Types.RegularClass, (or [ImmutableBaseClass])) */ new Types.RegularClass() /**/; readonly Types.RegularClass m_field73 = /* NonImmutableTypeHeldByImmutable(class, SpecTests.Types.RegularClass, (or [ImmutableBaseClass])) */ new Types.RegularClass() /**/; - [Mutability.Unaudited( Because.ItHasntBeenLookedAt )] - readonly Types.RegularClass m_field74 = new Types.RegularClass (); [Mutability.Audited( "John Doe", "1970-01-01", "Rationale" )] readonly Types.RegularClass m_field75 = new Types.RegularClass(); Types.RegularClass Property29 { get; } = /* NonImmutableTypeHeldByImmutable(class, SpecTests.Types.RegularClass, (or [ImmutableBaseClass])) */ new Types.RegularClass() /**/; - [Mutability.Unaudited( Because.ItHasntBeenLookedAt )] - Types.RegularClass Property30 { get; } = new Types.RegularClass (); [Mutability.Audited( "John Doe", "1970-01-01", "Rationale" )] Types.RegularClass Property31 { get; } = new Types.RegularClass(); Types.RegularClass Property32 { get { return new Types.RegularClass(); } } @@ -564,13 +546,9 @@ object this[ int index ] { static readonly /* NonImmutableTypeHeldByImmutable(interface, SpecTests.Types.RegularInterface, ) */ Types.RegularInterface /**/ m_field93; /* NonImmutableTypeHeldByImmutable(interface, SpecTests.Types.RegularInterface, ) */ Types.RegularInterface /**/ /* MemberIsNotReadOnly(Field, m_field94, AnalyzedClassMarkedImmutable) */ m_field94 /**/; readonly /* NonImmutableTypeHeldByImmutable(interface, SpecTests.Types.RegularInterface, ) */ Types.RegularInterface /**/ m_field95; - [Mutability.Unaudited( Because.ItHasntBeenLookedAt )] - readonly Types.RegularInterface m_field96; [Mutability.Audited( "John Doe", "1970-01-01", "Rationale" )] readonly Types.RegularInterface m_field97; /* NonImmutableTypeHeldByImmutable(interface, SpecTests.Types.RegularInterface, ) */ Types.RegularInterface /**/ Property42 { get; } - [Mutability.Unaudited( Because.ItHasntBeenLookedAt )] - Types.RegularInterface Property43 { get; } [Mutability.Audited( "John Doe", "1970-01-01", "Rationale" )] Types.RegularInterface Property44 { get; } @@ -598,14 +576,10 @@ object this[ int index ] { Types.SomeStruct /* MemberIsNotReadOnly(Field, m_field109, AnalyzedClassMarkedImmutable) */ m_field109 /**/ = /* NonImmutableTypeHeldByImmutable(structure, SpecTests.Types.SomeStruct, ) */ new Types.SomeStruct() /**/; readonly /* NonImmutableTypeHeldByImmutable(structure, SpecTests.Types.SomeStruct, ) */ Types.SomeStruct /**/ m_field110; readonly Types.SomeStruct m_field111 = /* NonImmutableTypeHeldByImmutable(structure, SpecTests.Types.SomeStruct, ) */ new Types.SomeStruct() /**/; - [Mutability.Unaudited( Because.ItHasntBeenLookedAt )] - readonly Types.SomeStruct m_field112; [Mutability.Audited( "John Doe", "1970-01-01", "Rationale" )] readonly Types.SomeStruct m_field113; /* NonImmutableTypeHeldByImmutable(structure, SpecTests.Types.SomeStruct, ) */ Types.SomeStruct /**/ Property47 { get; } Types.SomeStruct Property48 { get; } = /* NonImmutableTypeHeldByImmutable(structure, SpecTests.Types.SomeStruct, ) */ new Types.SomeStruct() /**/; - [Mutability.Unaudited( Because.ItHasntBeenLookedAt )] - Types.SomeStruct Property49 { get; } [Mutability.Audited( "John Doe", "1970-01-01", "Rationale" )] Types.SomeStruct Property50 { get; } @@ -781,18 +755,12 @@ public sealed class AnalyzedImmutableGenericClassRestrictingT<[Immutable] T, U> static /* TypeParameterIsNotKnownToBeImmutable(U) */ U /**/ /* MemberIsNotReadOnly(Field, m_field185, AnalyzedImmutableGenericClassRestrictingT) */ m_field185 /**/; static readonly /* TypeParameterIsNotKnownToBeImmutable(U) */ U /**/ m_field186; /* TypeParameterIsNotKnownToBeImmutable(U) */ U /**/ /* MemberIsNotReadOnly(Field, m_field187, AnalyzedImmutableGenericClassRestrictingT) */ m_field187 /**/; - [Mutability.Unaudited( Because.ItHasntBeenLookedAt )] - U m_field188; [Mutability.Audited( "John Doe", "1970-01-01", "Rationale" )] U m_field189; readonly /* TypeParameterIsNotKnownToBeImmutable(U) */ U /**/ m_field190; - [Mutability.Unaudited( Because.ItHasntBeenLookedAt )] - readonly U m_field191; [Mutability.Audited( "John Doe", "1970-01-01", "Rationale" )] readonly U m_field192; /* TypeParameterIsNotKnownToBeImmutable(U) */ U /**/ Property86 { get; } - [Mutability.Unaudited( Because.ItHasntBeenLookedAt )] - U Property87 { get; } [Mutability.Audited( "John Doe", "1970-01-01", "Rationale" )] U Property88 { get; } U Property89 { get { return default; } } @@ -802,18 +770,12 @@ public sealed class AnalyzedImmutableGenericClassRestrictingT<[Immutable] T, U> static U /* MemberIsNotReadOnly(Field, m_field193, AnalyzedImmutableGenericClassRestrictingT) */ m_field193 /**/ = /* TypeParameterIsNotKnownToBeImmutable(U) */ new U() /**/; static readonly U m_field194 = /* TypeParameterIsNotKnownToBeImmutable(U) */ new U() /**/; U /* MemberIsNotReadOnly(Field, m_field195, AnalyzedImmutableGenericClassRestrictingT) */ m_field195 /**/ = /* TypeParameterIsNotKnownToBeImmutable(U) */ new U() /**/; - [Mutability.Unaudited( Because.ItHasntBeenLookedAt )] - U m_field196 = new U(); [Mutability.Audited( "John Doe", "1970-01-01", "Rationale" )] U m_field197 = new U(); readonly U m_field198 = /* TypeParameterIsNotKnownToBeImmutable(U) */ new U() /**/; - [Mutability.Unaudited( Because.ItHasntBeenLookedAt )] - readonly U m_field199 = new U(); [Mutability.Audited( "John Doe", "1970-01-01", "Rationale" )] readonly U m_field200 = new U(); U Property90 { get; } = /* TypeParameterIsNotKnownToBeImmutable(U) */ new U() /**/; - [Mutability.Unaudited( Because.ItHasntBeenLookedAt )] - U Property91 { get; } = new U(); [Mutability.Audited( "John Doe", "1970-01-01", "Rationale" )] U Property92 { get; } = new U(); @@ -939,27 +901,18 @@ public sealed class AnalyzedImmutableGenericClassRestrictingT<[Immutable] T, U> Types.SomeImmutableGenericInterfaceRestrictingTU Property119 { get; } Types.SomeImmutableGenericInterfaceRestrictingTU Property120 { get { return default; } } - [Mutability.Audited( "John Doe", "1970-01-01", "Rationale" )] - [Mutability.Unaudited(Because.ItsSketchy)] - object /* ConflictingImmutability(Mutability.Audited, Mutability.Unaudited, field) */ someMutabilityAuditedAndUnauditedObject /**/; - - [Statics.Audited] - [Statics.Unaudited(Because.ItsSketchy)] - static object /* ConflictingImmutability(Statics.Audited, Statics.Unaudited, field) */ someStaticsAuditedAndUnauditedObject /**/; - [Mutability.Audited( "John Doe", "1970-01-01", "Rationale" )] static /* NonImmutableTypeHeldByImmutable(class, object, ) */ object /**/ /* InvalidAuditType(static, field, Statics.*) | MemberIsNotReadOnly(Field, someStaticsMutabilityAuditedObject, AnalyzedImmutableGenericClassRestrictingT) */ someStaticsMutabilityAuditedObject /**/; [Statics.Audited] /* NonImmutableTypeHeldByImmutable(class, object, ) */ object /**/ /* InvalidAuditType(non-static, field, Mutability.*) | MemberIsNotReadOnly(Field, someNonstaticStaticsAuditedObject, AnalyzedImmutableGenericClassRestrictingT) */ someNonstaticStaticsAuditedObject /**/; - [Statics.Unaudited(Because.ItsSketchy)] + [Statics.Audited( "John Doe", "1970-01-01", "Rationale" )] [Mutability.Audited( "John Doe", "1970-01-01", "Rationale" )] - [Mutability.Unaudited(Because.ItsSketchy)] - object /* InvalidAuditType(non-static, field, Mutability.*) | ConflictingImmutability(Mutability.Audited, Mutability.Unaudited, field) */ someNonstaticDoublyAuditedObject /**/; + object /* InvalidAuditType(non-static, field, Mutability.*) */ someNonstaticDoublyAuditedObject /**/; [Mutability.Audited( "John Doe", "1970-01-01", "Rationale" )] - [Statics.Unaudited(Because.ItsSketchy)] + [Statics.Audited( "John Doe", "1970-01-01", "Rationale" )] static object /* InvalidAuditType(static, field, Statics.*) */ someStaticSortOfDoublyAuditedObject /**/; void Method() { @@ -1017,18 +970,12 @@ public sealed class AnalyzedImmutableGenericClassGivenT<[ConditionallyImmutable. static /* TypeParameterIsNotKnownToBeImmutable(U) */ U /**/ /* MemberIsNotReadOnly(Field, m_field267, AnalyzedImmutableGenericClassGivenT) */ m_field267 /**/; static readonly /* TypeParameterIsNotKnownToBeImmutable(U) */ U /**/ m_field268; /* TypeParameterIsNotKnownToBeImmutable(U) */ U /**/ /* MemberIsNotReadOnly(Field, m_field269, AnalyzedImmutableGenericClassGivenT) */ m_field269 /**/; - [Mutability.Unaudited( Because.ItHasntBeenLookedAt )] - U m_field270; [Mutability.Audited( "John Doe", "1970-01-01", "Rationale" )] U m_field271; readonly /* TypeParameterIsNotKnownToBeImmutable(U) */ U /**/ m_field272; - [Mutability.Unaudited( Because.ItHasntBeenLookedAt )] - readonly U m_field273; [Mutability.Audited( "John Doe", "1970-01-01", "Rationale" )] readonly U m_field274; /* TypeParameterIsNotKnownToBeImmutable(U) */ U /**/ Property125 { get; } - [Mutability.Unaudited( Because.ItHasntBeenLookedAt )] - U Property126 { get; } [Mutability.Audited( "John Doe", "1970-01-01", "Rationale" )] U Property127 { get; } U Property128 { get { return default; } } @@ -1038,18 +985,12 @@ public sealed class AnalyzedImmutableGenericClassGivenT<[ConditionallyImmutable. static U /* MemberIsNotReadOnly(Field, m_field275, AnalyzedImmutableGenericClassGivenT) */ m_field275 /**/ = /* TypeParameterIsNotKnownToBeImmutable(U) */ new U() /**/; static readonly U m_field276 = /* TypeParameterIsNotKnownToBeImmutable(U) */ new U() /**/; U /* MemberIsNotReadOnly(Field, m_field278, AnalyzedImmutableGenericClassGivenT) */ m_field278 /**/ = /* TypeParameterIsNotKnownToBeImmutable(U) */ new U() /**/; - [Mutability.Unaudited( Because.ItHasntBeenLookedAt )] - U m_field279 = new U(); [Mutability.Audited( "John Doe", "1970-01-01", "Rationale" )] U m_field280 = new U(); readonly U m_field281 = /* TypeParameterIsNotKnownToBeImmutable(U) */ new U() /**/; - [Mutability.Unaudited( Because.ItHasntBeenLookedAt )] - readonly U m_field282 = new U(); [Mutability.Audited( "John Doe", "1970-01-01", "Rationale" )] readonly U m_field283 = new U(); U Property129 { get; } = /* TypeParameterIsNotKnownToBeImmutable(U) */ new U() /**/; - [Mutability.Unaudited( Because.ItHasntBeenLookedAt )] - U Property130 { get; } = new U(); [Mutability.Audited( "John Doe", "1970-01-01", "Rationale" )] U Property131 { get; } = new U(); @@ -1226,15 +1167,6 @@ public static class StaticAudits { [/* UnnecessaryMutabilityAnnotation */ Statics.Audited /**/] static readonly object m_lock1 = new object(); - - [Statics.Unaudited( Because.ItHasntBeenLookedAt )] - static int staticint2; - - [Statics.Unaudited( Because.ItHasntBeenLookedAt )] - static readonly object staticreadonlyobject2; - - [/* UnnecessaryMutabilityAnnotation */ Statics.Unaudited( Because.ItHasntBeenLookedAt ) /**/] - static readonly object m_lock = new object(); } [Immutable]