Skip to content

Commit

Permalink
Generator: exclude static members
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreamescaper committed Nov 6, 2024
1 parent d1a26a1 commit 97e0613
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,8 @@ private static IEnumerable<T> GetMembers<T>(ITypeSymbol typeSymbol, IEnumerable<
.Select(member => typeSymbol.GetMember(member, true))
.Where(member => member != null);

return typeSymbol.GetMembers().Union(baseMembers, SymbolEqualityComparer.Default).OfType<T>();
return typeSymbol.GetMembers().Union(baseMembers, SymbolEqualityComparer.Default)
.Where(m => !m.IsStatic && m.DeclaredAccessibility == Accessibility.Public)
.OfType<T>();
}
}

0 comments on commit 97e0613

Please sign in to comment.