realm-kotlin
realm-kotlin copied to clipboard
Verify that inline classes work as types
Inline classes are a great way to allow greater type-safety in API's, e.g. something like:
inline class WorkTypeId(val id: Long)
class WorkType() : RealmObject {
var _id: WorkTypeId = WorkTypeId(0)
}
But this throws an exception during compile time right now:
e: [Realm Compiler Plugin] 2021-11-21T14:17:50.921229Z Primary key _id is of type WorkEntryId but must be of type [Byte, Char, Short, Int, Long, String]
IMO we should allow properties with inline class types that map to supported Realm types.
Is it still valid? I have such case and it works.