Skip to content

Commit

Permalink
Use concrete type in WorksheetRowGenerator to resolve CA1859
Browse files Browse the repository at this point in the history
  • Loading branch information
sveinungf committed May 12, 2024
1 parent a376f48 commit 3795851
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions SpreadCheetah.SourceGenerator/WorksheetRowGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ private static RowType AnalyzeTypeProperties(ITypeSymbol classType, LocationInfo
var explicitOrderProperties = new SortedDictionary<int, RowTypeProperty>();
var unsupportedPropertyTypeNames = new HashSet<string>(StringComparer.Ordinal);
var diagnosticInfos = new List<DiagnosticInfo>();

foreach (var property in GetClassAndBaseClassProperties(classType))
{
if (property.IsWriteOnly || property.IsStatic || property.DeclaredAccessibility != Accessibility.Public)
Expand Down Expand Up @@ -135,7 +135,7 @@ private static IEnumerable<IPropertySymbol> GetClassAndBaseClassProperties(IType
{
return [];
}

var inheritedColumnOrderStrategy = classType.GetAttributes()
.Where(data => data.TryGetInheritedColumnOrderingAttribute().HasValue)
.Select(data => data.TryGetInheritedColumnOrderingAttribute())
Expand All @@ -147,7 +147,7 @@ private static IEnumerable<IPropertySymbol> GetClassAndBaseClassProperties(IType
{
return classProperties;
}

var inheritedProperties = GetClassAndBaseClassProperties(classType.BaseType);

return inheritedColumnOrderStrategy switch
Expand Down Expand Up @@ -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<RowTypeProperty> properties)
private static void GenerateAddHeaderRow(StringBuilder sb, int typeIndex, EquatableArray<RowTypeProperty> properties)
{
Debug.Assert(properties.Count > 0);

Expand Down

0 comments on commit 3795851

Please sign in to comment.