Uploaded image for project: 'Realm Kotlin'
  1. Realm Kotlin
  2. RKOTLIN-1109

custom setter function is not called

      How frequently does the bug occur?

      Always

      Description

      class Human: RealmObject {
          var name: String = ""
              set(value) {
                 println("Example Setter called with value: $value")
                 field = value
              }
      }
      

      When I set the name with: person.name = "John", the setter function is not called.

      I googled hard to understand about the issue, it appears this 7 years old post explained it, but obviously is regarding the Java API, seems still valid with the current Kotlin API? https://stackoverflow.com/questions/43066612/realm-call-setter

      Is it possible to get the setters to work in Kotlin as that's a neat feature of the language?

      Stacktrace & log output

      No response

      Can you reproduce the bug?

      Always

      Reproduction Steps

      No response

      Version

      2.0.0

      What Atlas App Services are you using?

      Local Database only

      Are you using encryption?

      No

      Platform OS and version(s)

      Android 9, Android 14

      Build environment

      Android Studio version: ...
      Android Build Tools version: ...
      Gradle version: ...

            Assignee:
            Unassigned Unassigned
            Reporter:
            unitosyncbot Unito Sync Bot
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: