-
-
Notifications
You must be signed in to change notification settings - Fork 155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: generate generic mapping only with LSP compatible methods #1000
feat: generate generic mapping only with LSP compatible methods #1000
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1000 +/- ##
=======================================
Coverage 91.40% 91.40%
=======================================
Files 223 223
Lines 7256 7259 +3
Branches 911 913 +2
=======================================
+ Hits 6632 6635 +3
Misses 412 412
Partials 212 212 ☔ View full report in Codecov by Sentry. |
c37aea2
to
cec5e00
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this contribution 😊
src/Riok.Mapperly/Descriptors/Mappings/UserMappings/UserDefinedNewInstanceGenericTypeMapping.cs
Outdated
Show resolved
Hide resolved
3a77938
to
e18f6d8
Compare
🎉 This PR is included in version 3.3.1-next.1 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
🎉 This PR is included in version 3.4.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Generate generic mapping only with LSP compatible methods
Description
Generic mapping is selecting target methods only by type argument constraint. This PR filters them also by LSP type compatibility.
Right now, the mapping does not produce valid code when e.g. source is a specific abstract type (not the
object
). And your mapper has e.g. enum mapping. The compiler then complains:Error CS8121 : An expression of type 'TheClass' cannot be handled by a pattern of type 'TheEnum'.
on generated code that looks like this:Checklist