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: improve handling of read-only and immutable types #1413

Merged
merged 1 commit into from
Aug 9, 2024

Conversation

latonz
Copy link
Contributor

@latonz latonz commented Jul 22, 2024

  • do not copy immutable types when deep cloning is enabled
  • introduce new RMG083 for when trying to map to existing immutable types, replaces RMG009 if the member is read-only and the type is immutable
  • RMG009 is not reported anymore if the read-only member on the target is matched automatically

Fixes #1402

@latonz latonz added the bug Something isn't working label Jul 22, 2024
@latonz latonz self-assigned this Jul 22, 2024
@latonz latonz force-pushed the 1402-no-readonly-diagnostic-if-automatch branch from 2fc1d6b to af05974 Compare July 23, 2024 02:17
@latonz latonz changed the title do not build existing target mappings for immutable targets and do not report RMG009 for auto matched members fix: improve handling of read-only and immutable types Jul 23, 2024
@latonz latonz added enhancement New feature or request breaking-change This issue or pull request will break existing consumers labels Jul 23, 2024
@latonz latonz force-pushed the 1402-no-readonly-diagnostic-if-automatch branch 3 times, most recently from 094f106 to 3631cad Compare July 23, 2024 02:43
@latonz latonz force-pushed the 1402-no-readonly-diagnostic-if-automatch branch from 3631cad to cf1465d Compare August 3, 2024 03:33
@latonz latonz marked this pull request as ready for review August 3, 2024 03:33
@latonz latonz requested a review from ni507 August 3, 2024 03:33
@latonz latonz force-pushed the 1402-no-readonly-diagnostic-if-automatch branch from cf1465d to 34e08bc Compare August 3, 2024 14:50
ni507
ni507 previously approved these changes Aug 9, 2024
* do not copy immutable types when deep cloning is enabled
* introduce new RMG083 for when trying to map to existing immutable types, replaces RMG009 if the member is read-only and the type is immutable
* RMG009 is not reported anymore if the read-only member on the target is matched automatically
@latonz latonz force-pushed the 1402-no-readonly-diagnostic-if-automatch branch from 34e08bc to 151ce69 Compare August 9, 2024 14:09
@latonz latonz merged commit 3109e71 into riok:main Aug 9, 2024
17 checks passed
@latonz latonz deleted the 1402-no-readonly-diagnostic-if-automatch branch August 9, 2024 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change This issue or pull request will break existing consumers bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Computed read-only properties causing RMG066 warning
2 participants