Private fields cannot be combined with default values

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Critical - P2
    • None
    • Affects Version/s: None
    • Component/s: None

      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

      Unable to find source-code formatter for language: dart. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
      @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

              Assignee:
              Kasper Nielsen (Inactive)
              Reporter:
              Unito Sync Bot
              Archiver:
              Marc Greenfield

                Created:
                Updated:
                Archived: