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: prevent property backing field mapping #608

Merged
merged 1 commit into from Aug 1, 2023

Conversation

TimothyMakkison
Copy link
Collaborator

@TimothyMakkison TimothyMakkison commented Jul 30, 2023

Prevent mapperly mapping a properties backing field

Description

When mapping inside another class, the mapper will attempt to map properties' backing fields, leading to invalid or strange code.

  • Added unit test
  • Modified SymbolAccessor to check that field symbols don't have an AssociatedSymbol aka; is not a backing field.

Fixes #599, see comment

Checklist

  • The existing code style is followed
  • The commit message follows our guidelines
  • Performed a self-review of my code
  • Hard-to-understand areas of my code are commented
  • Unit tests are added/updated

@codecov
Copy link

codecov bot commented Jul 30, 2023

Codecov Report

Merging #608 (f6a5c76) into main (e8fc876) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main     #608   +/-   ##
=======================================
  Coverage   90.36%   90.36%           
=======================================
  Files         174      174           
  Lines        5977     5977           
  Branches      758      758           
=======================================
  Hits         5401     5401           
  Misses        410      410           
  Partials      166      166           
Files Changed Coverage Δ
src/Riok.Mapperly/Descriptors/SymbolAccessor.cs 95.74% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Contributor

@latonz latonz left a 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 fix 😊

@latonz latonz merged commit d768dbb into riok:main Aug 1, 2023
14 checks passed
@latonz latonz modified the milestone: v3.1.0 Aug 2, 2023
@github-actions
Copy link

github-actions bot commented Aug 2, 2023

🎉 This PR is included in version 3.0.0-next.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions
Copy link

github-actions bot commented Aug 7, 2023

🎉 This PR is included in version 3.0.0 🎉

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.

Add support for mapping inner class
2 participants