bugfix - #22
bugfix#22
Conversation
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #22 +/- ##
=======================================
Coverage 77.95% 77.95%
=======================================
Files 2 2
Lines 186 186
Branches 28 28
=======================================
Hits 145 145
Misses 21 21
Partials 20 20
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR fixes a bug in the source generator where generic type signatures with multiple type parameters were not matching correctly between compile-time and runtime. The issue occurred because Roslyn's SymbolDisplayFormat.FullyQualifiedFormat includes spaces after commas in generic type arguments (e.g., IConsumer<string, string>), while the runtime's FormatTypeName method produces signatures without spaces (e.g., IConsumer<string,string>). The fix normalizes the spacing by removing spaces after commas in the generated signatures.
Changes:
- Fixed signature matching in WorkerEmitter.cs by normalizing generic type parameter spacing
- Added comprehensive test coverage with two new test cases for multi-type generic parameters
- Added test helper interfaces and implementations to support the new tests
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| src/MinimalWorker.Generators/WorkerEmitter.cs | Fixed signature generation to strip spaces after commas in generic type arguments, ensuring alignment with runtime signature format |
| test/MinimalWorker.Test/Fakes/FakeRepositories.cs | Added IConsumer and IMultipleConsumer interfaces with implementations to test multi-type generic parameter resolution |
| test/MinimalWorker.Test/ServiceResolutionTests.cs | Added two test cases verifying that background workers can resolve services with multiple generic type arguments |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
No description provided.