Code Analysis ReferenceAnalyzersRCS1180On this pageRCS1180: Inline lazy initializationPropertiesPropertyValueDefault SeverityInfoMinimum language version-ExamplesExample #1diagnostic.csList<object> items = null;// ...if (items == null){ items = new List<object>();}items.Add(x);fix.cs(items ?? (items = new List<object>())).Add(x);Applies toExtension for VS 2022Extension for VS CodeExtension for Open VSXPackage Roslynator.Analyzers