From 379585196b3e3b70b10ca8e01a28bb56657c236b Mon Sep 17 00:00:00 2001 From: sveinungf Date: Sun, 12 May 2024 22:44:50 +0200 Subject: [PATCH] Use concrete type in WorksheetRowGenerator to resolve CA1859 --- SpreadCheetah.SourceGenerator/WorksheetRowGenerator.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/SpreadCheetah.SourceGenerator/WorksheetRowGenerator.cs b/SpreadCheetah.SourceGenerator/WorksheetRowGenerator.cs index 9b53c7cb..4cfa312e 100644 --- a/SpreadCheetah.SourceGenerator/WorksheetRowGenerator.cs +++ b/SpreadCheetah.SourceGenerator/WorksheetRowGenerator.cs @@ -86,7 +86,7 @@ private static RowType AnalyzeTypeProperties(ITypeSymbol classType, LocationInfo var explicitOrderProperties = new SortedDictionary(); var unsupportedPropertyTypeNames = new HashSet(StringComparer.Ordinal); var diagnosticInfos = new List(); - + foreach (var property in GetClassAndBaseClassProperties(classType)) { if (property.IsWriteOnly || property.IsStatic || property.DeclaredAccessibility != Accessibility.Public) @@ -135,7 +135,7 @@ private static IEnumerable GetClassAndBaseClassProperties(IType { return []; } - + var inheritedColumnOrderStrategy = classType.GetAttributes() .Where(data => data.TryGetInheritedColumnOrderingAttribute().HasValue) .Select(data => data.TryGetInheritedColumnOrderingAttribute()) @@ -147,7 +147,7 @@ private static IEnumerable GetClassAndBaseClassProperties(IType { return classProperties; } - + var inheritedProperties = GetClassAndBaseClassProperties(classType.BaseType); return inheritedColumnOrderStrategy switch @@ -285,7 +285,7 @@ private static void ReportDiagnostics(RowType rowType, LocationInfo? locationInf context.ReportDiagnostic(Diagnostic.Create(Diagnostics.UnsupportedTypeForCellValue, location, rowType.Name, unsupportedPropertyTypeName)); } - private static void GenerateAddHeaderRow(StringBuilder sb, int typeIndex, IReadOnlyCollection properties) + private static void GenerateAddHeaderRow(StringBuilder sb, int typeIndex, EquatableArray properties) { Debug.Assert(properties.Count > 0);