fix(dispatcher): resolve handlers in registration order across closed and open generics

Handler/behavior resolution previously forced closed generics before open
generics regardless of registration order, which was surprising and fragile.
TypeIndex now tracks each registered type's index and orders matching
candidates by registration order, so closed/open ordering is deterministic
and follows registration.
This commit is contained in:
Louis Seubert 2026-07-12 19:22:50 +02:00
commit 595ba01ea6
Signed by: louis9902
GPG key ID: 4B9DB28F826553BD
3 changed files with 45 additions and 10 deletions

View file

@ -55,6 +55,7 @@ To have a consistent experience across all packages, some public interfaces have
- **request.validation:** Return no problems when validating a `null` instance of a reference type instead of dereferencing it (`NullReferenceException`)
- **request.validation:** Make `Severity` meaningful — `Validation.IsValid` now only fails on `Error` problems; `Warning`/`Info` no longer invalidate. Added `Validation.IsValidFor(Severity)` to set the failing-severity threshold (see PLAN.md Inconsistencies#B)
- **request.dispatcher:** Throw `InvalidOperationException` listing candidates when multiple handlers match a request instead of silently resolving via `.First()` (matches MediatR). Also throws when no handler is registered (see PLAN.md Inconsistencies#C)
- **request.dispatcher:** Resolve handlers/behaviors in registration order across closed and open generics instead of the fixed closed-before-open reflection order (see PLAN.md Inconsistencies#D)
### Removed