Skip to content
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

fix: resolve user mappings correctly when reference handling is enabled #1162

Merged

Conversation

latonz
Copy link
Contributor

@latonz latonz commented Mar 11, 2024

Resolves user mappings correctly (especially with new [UserMapping]s) when reference handling is enabled without explicit reference handling parameters on the user mappings.

  • Removes the BuildPriority of a Mapping, all mappings are built with the same priority. This is not needed anymore as user defined mappings with reference handling enabled but no reference handler parameter just delegate to the a generated version of the mapping with a reference handler parameter.
  • Removes CallableByOthers of a Mapping, all mappings are now considered callable by others For runtime target type mappings there is no type match anyway. And user defined mappings with reference handling enabled but no reference handler parameter just delegate to the version with a reference handler parameter now.

Fixes #1154

@latonz latonz self-assigned this Mar 11, 2024
Copy link

codecov bot commented Mar 11, 2024

Codecov Report

Attention: Patch coverage is 63.63636% with 12 lines in your changes are missing coverage. Please review.

Project coverage is 91.31%. Comparing base (b4d5e74) to head (0ad1699).

Files Patch % Lines
...Mappings/UserDefinedExistingTargetMethodMapping.cs 23.07% 10 Missing ⚠️
...iok.Mapperly/Descriptors/Mappings/MethodMapping.cs 0.00% 0 Missing and 1 partial ⚠️
...serMappings/UserDefinedNewInstanceMethodMapping.cs 85.71% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1162      +/-   ##
==========================================
- Coverage   91.43%   91.31%   -0.12%     
==========================================
  Files         230      230              
  Lines        7799     7788      -11     
  Branches      989      987       -2     
==========================================
- Hits         7131     7112      -19     
- Misses        433      441       +8     
  Partials      235      235              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@latonz latonz force-pushed the 1154-reference-handling-default-user-mappings branch from 8cf686f to 8e55706 Compare March 11, 2024 03:47
* Removes the BuildPriority of a Mapping, all mappings are built with the same priority.
  This is not needed anymore as user defined mappings with reference handling enabled but no reference handler parameter
  just delegate to the a generated version of the mapping with a reference handler parameter.
* Removes CallableByOthers of a Mapping, all mappings are now considered callable by others
  For runtime target type mappings there is no type match anyway.
  And user defined mappings with reference handling enabled but no reference handler parameter
  just delegate to the version with a reference handler parameter now.
@latonz latonz force-pushed the 1154-reference-handling-default-user-mappings branch from 8e55706 to 0ad1699 Compare March 11, 2024 03:48
@latonz latonz marked this pull request as ready for review March 11, 2024 03:51
@latonz latonz requested a review from CommonGuy March 11, 2024 03:51
@latonz latonz enabled auto-merge (squash) March 11, 2024 04:28
@latonz latonz merged commit d303198 into riok:main Mar 11, 2024
17 of 19 checks passed
@latonz latonz deleted the 1154-reference-handling-default-user-mappings branch March 11, 2024 10:38
Copy link

🎉 This PR is included in version 3.5.0-next.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enabled reference handling does not resolve user-defined mapping methods correctly
2 participants