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

Private fields cannot be combined with default values #1663

Closed
nielsenko opened this issue May 5, 2024 · 2 comments · Fixed by #1664
Closed

Private fields cannot be combined with default values #1663

nielsenko opened this issue May 5, 2024 · 2 comments · Fixed by #1664
Assignees

Comments

@nielsenko
Copy link
Contributor

What happened?

When combining private fields with default values, realm_generator it will generate invalid code.

Repro steps

Try to run generator on the code snippet below

Version

2.2.1

What Atlas Services are you using?

Atlas Device Sync

What type of application is this?

Flutter Application

Client OS and version

Any

Code snippets

@RealmModel()
class _Car {
  @MapTo("type")
  late int _type = 0;
  CustomType get type => CustomType.values[_type];
  set type(final CustomType value) => _type = value.index;
}

Stacktrace of the exception/crash you're getting

No response

Relevant log output

No response

@nielsenko nielsenko added the T-Bug label May 5, 2024
@nielsenko nielsenko self-assigned this May 5, 2024
Copy link

sync-by-unito bot commented May 5, 2024

➤ PM Bot commented:

Jira ticket: RDART-1018

@nielsenko
Copy link
Contributor Author

Related to #681

@dotjon0 dotjon0 mentioned this issue May 5, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant