Skip to content

Conversation

@Dreamescaper
Copy link
Owner

Fixes #46 .

@Dreamescaper Dreamescaper requested a review from Copilot October 20, 2025 13:12
Copy link
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 PR adds support for filtering types based on generic constraints defined on CustomHandler methods. When a CustomHandler method is generic, types are now automatically validated against the constraints (such as class, struct, new(), and interface constraints) before being passed to the handler.

Key changes:

  • Version bumped from 2.3 to 2.4
  • Added constraint validation logic in the source generator
  • Added comprehensive test coverage for various constraint scenarios

Reviewed Changes

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

File Description
version.json Bumped version from 2.3 to 2.4
ServiceScan.SourceGenerator/DependencyInjectionGenerator.FilterTypes.cs Implemented generic constraint validation logic with support for reference/value type constraints, constructor constraints, and nested type parameter constraints
ServiceScan.SourceGenerator.Tests/CustomHandlerTests.cs Added six test cases covering different constraint scenarios (new(), class, nested type parameters, multiple interfaces, struct, and combined constraints)
README.md Updated documentation to clarify that CustomHandler methods with generic constraints automatically filter types

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@Dreamescaper Dreamescaper requested a review from Copilot October 22, 2025 14:47
Copy link
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

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


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@Dreamescaper Dreamescaper merged commit 5979aa9 into main Oct 22, 2025
1 check passed
@Dreamescaper Dreamescaper deleted the custom-handler-generic-constraints branch October 22, 2025 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Filter types based on CustomHandler generic constraints

2 participants