Skip to content

feat: Generic type blacklisting and enhance blacklist checks in Reflector#61

Merged
IvanMurzak merged 1 commit into
mainfrom
feature/ignore-system-span
Jan 19, 2026
Merged

feat: Generic type blacklisting and enhance blacklist checks in Reflector#61
IvanMurzak merged 1 commit into
mainfrom
feature/ignore-system-span

Conversation

@IvanMurzak
Copy link
Copy Markdown
Owner

This pull request adds comprehensive tests for generic type blacklisting and extends the blacklisting logic in the Reflector class to support blacklisting generic type definitions. This ensures that when a generic type definition (like List<>) is blacklisted, all its closed constructed types (such as List<int>, List<string>, etc.) are also considered blacklisted. The changes also cover nested generics, arrays of generics, and .NET-specific types like Span<> and ReadOnlySpan<>.

Generic Type Blacklisting Enhancements

  • Updated the internal logic in Reflector.Registry.cs to check if a generic type's definition is blacklisted, ensuring that blacklisting a generic type definition (e.g., List<>) will blacklist all its closed constructed types (e.g., List<int>, List<string>) as well.

Expanded Unit Test Coverage

  • Added a new test region in IsTypeBlacklistedTests.cs for generic type definition blacklisting, including tests for blacklisting closed generic types, generic type definitions, nested generics, custom generic wrappers, arrays of generics, and .NET-specific generic types like Span<> and ReadOnlySpan<>.

@IvanMurzak IvanMurzak self-assigned this Jan 19, 2026
@IvanMurzak IvanMurzak added the enhancement New feature or request label Jan 19, 2026
@IvanMurzak IvanMurzak requested a review from Copilot January 19, 2026 06:39
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request enhances the blacklisting mechanism in the Reflector class to support generic type definition blacklisting. When a generic type definition (e.g., List<>) is blacklisted, all its closed constructed types (e.g., List<int>, List<string>) are automatically considered blacklisted as well.

Changes:

  • Added logic to check if a generic type's definition is blacklisted in the IsTypeBlacklistedInternal method
  • Added comprehensive unit tests covering various scenarios of generic type definition blacklisting

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
ReflectorNet/src/Reflector/Reflector.Registry.cs Added generic type definition check to blacklist all closed constructed types when their generic definition is blacklisted
ReflectorNet.Tests/src/ReflectorTests/IsTypeBlacklistedTests.cs Added 13 new test cases covering generic type definition blacklisting scenarios including closed generics, nested generics, arrays, and .NET-specific generic types

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link
Copy Markdown
Contributor

Test Results

    2 files      2 suites   8m 7s ⏱️
1 166 tests 1 166 ✅ 0 💤 0 ❌
2 332 runs  2 332 ✅ 0 💤 0 ❌

Results for commit 1d38854.

@IvanMurzak IvanMurzak merged commit 7385f4a into main Jan 19, 2026
8 checks passed
@IvanMurzak IvanMurzak deleted the feature/ignore-system-span branch January 19, 2026 06:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants