Cannot define model consisting of only a `LinkingObjects` property

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

XMLWordPrintableJSON

      How frequently does the bug occur?

      Always

      Description

      Consider the following model:

      class Note: Object {
          @objc dynamic var user: User?
      }
      class User: Object {
          let notes = LinkingObjects(fromType: Note.self, property: #keyPath(Note.user))
      }
      

      Calling -[User init] fails with the following exception: "No properties are defined for 'User'. Did you remember to mark them with '@objc' in your model?".

      This happens both when using the legacy @objc syntax, as well as with the new @Persisted property wrappers.

      IMO this should work, since there is a property here (the LinkingObjects, which apparently gets ignored by the "are there properties" check?)

      Stacktrace & log output

      No response

      Can you reproduce the bug?

      Always

      Reproduction Steps

      No response

      Version

      10.44.0

      What Atlas Services are you using?

      Local Database only

      Are you using encryption?

      No

      Platform OS and version(s)

      macOS 13.4.1 (22F82)

      Build environment

      Xcode version: 15.0.1
      Dependency manager and version: SPM, shipped w/ Xcode

              Assignee:
              Nikola Irinchev
              Reporter:
              Unito Sync Bot
              Archiver:
              Marc Greenfield

                Created:
                Updated:
                Archived: